Compare commits

...

4 commits

Author SHA1 Message Date
Cvolton
e363a3e44c
bump version to 3.9.3
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Check CHANGELOG.md / Check CHANGELOG.md (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
2024-11-22 20:05:51 +01:00
Oleksandr Nemesh
e47d5ff9f4 add cutoff constructor for CCRenderTexture (#1171) 2024-11-22 18:04:57 +01:00
Cvolton
2ed18863a7 force update to 4.0.1 on forward compat 2024-11-22 17:41:12 +01:00
dankmeme01
480b12e86c add XInputSetState export in proxy loader, fixing certain steam emus 2024-11-22 16:54:52 +01:00
7 changed files with 51 additions and 13 deletions

View file

@ -1,5 +1,10 @@
# Geode Changelog # Geode Changelog
## v3.9.3
* Add cutoff constructor for CCRenderTexture (#1171)
* Add XInputSetState export in proxy loader, fixing certain steam emus (480b12)
* Force update to 4.0.1 on forward compat (2ed1886)
## v3.9.2 ## v3.9.2
* Fix searching for mods returning unavailable mods (#1149) * Fix searching for mods returning unavailable mods (#1149)

View file

@ -1 +1 @@
3.9.2 3.9.3

View file

@ -61,6 +61,8 @@ class CC_DLL CCRenderTexture : public CCNode
*/ */
CC_PROPERTY(CCSprite*, m_pSprite, Sprite) CC_PROPERTY(CCSprite*, m_pSprite, Sprite)
public: public:
GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCRenderTexture, CCNode)
/** /**
* @js ctor * @js ctor
*/ */

View file

@ -6,6 +6,7 @@
struct XINPUT_STATE; struct XINPUT_STATE;
struct XINPUT_CAPABILITIES; struct XINPUT_CAPABILITIES;
struct XINPUT_VIBRATION;
constexpr static auto MAX_PATH_CHARS = 32768u; constexpr static auto MAX_PATH_CHARS = 32768u;
@ -41,6 +42,17 @@ extern "C" DWORD XInputGetState(DWORD dwUserIndex, XINPUT_STATE *pState) {
return ERROR_DEVICE_NOT_CONNECTED; return ERROR_DEVICE_NOT_CONNECTED;
} }
#pragma comment(linker, "/export:XInputSetState,@3")
extern "C" DWORD XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) {
static auto fp = getFP("XInputSetState");
if (fp) {
using FPType = decltype(&XInputSetState);
return reinterpret_cast<FPType>(fp)(dwUserIndex, pVibration);
}
return ERROR_DEVICE_NOT_CONNECTED;
}
#pragma comment(linker, "/export:XInputGetCapabilities,@4") #pragma comment(linker, "/export:XInputGetCapabilities,@4")
extern "C" DWORD XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES *pCapabilities) { extern "C" DWORD XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES *pCapabilities) {
static auto fp = getFP("XInputGetCapabilities"); static auto fp = getFP("XInputGetCapabilities");

View file

@ -68,14 +68,15 @@ void tryShowForwardCompat() {
LoaderImpl::get()->getGameVersion()) LoaderImpl::get()->getGameVersion())
return; return;
// TODO: change text later /*Loader::get()->queueInMainThread([]{
console::messageBox( console::messageBox(
"Forward Compatibility Warning", "Forward Compatibility Warning",
"Geode is running in a newer version of GD than Geode targets.\n" "This version of Geode is for an older version of GD.\n"
"UI is going to be disabled, platform console is forced on and crashes can be more common.\n" "Please wait a few minutes for Geode to update\n"
"However, if your game crashes, it is probably caused by an outdated mod and not Geode itself.", "and then restart the game.",
Severity::Warning Severity::Warning
); );
});*/
Mod::get()->setSavedValue<std::string>( Mod::get()->setSavedValue<std::string>(
"last-forward-compat-warn-popup-ver", "last-forward-compat-warn-popup-ver",

View file

@ -52,6 +52,11 @@ void updater::fetchLatestGithubRelease(
return then(s_latestGithubRelease.value()); return then(s_latestGithubRelease.value());
} }
//quick hack to make sure it always attempts an update check in forward compat
if(Loader::get()->isForwardCompatMode()) {
force = true;
}
auto version = VersionInfo::parse( auto version = VersionInfo::parse(
Mod::get()->getSavedValue("latest-version-auto-update-check", std::string("0.0.0")) Mod::get()->getSavedValue("latest-version-auto-update-check", std::string("0.0.0"))
); );
@ -68,9 +73,14 @@ void updater::fetchLatestGithubRelease(
auto req = web::WebRequest(); auto req = web::WebRequest();
req.header("If-Modified-Since", modifiedSince); req.header("If-Modified-Since", modifiedSince);
req.userAgent("github_api/1.0"); req.userAgent("github_api/1.0");
//Force fetching v4.0.1 as the latest release for forward compat mode
RUNNING_REQUESTS.emplace( RUNNING_REQUESTS.emplace(
"@loaderAutoUpdateCheck", "@loaderAutoUpdateCheck",
req.get("https://api.github.com/repos/geode-sdk/geode/releases/latest").map( req.get(
Loader::get()->isForwardCompatMode()
? "https://api.github.com/repos/geode-sdk/geode/releases/tags/v4.0.1"
: "https://api.github.com/repos/geode-sdk/geode/releases/latest"
).map(
[expect = std::move(expect), then = std::move(then)](web::WebResponse* response) { [expect = std::move(expect), then = std::move(then)](web::WebResponse* response) {
if (response->ok()) { if (response->ok()) {
if (response->data().empty()) { if (response->data().empty()) {
@ -318,6 +328,10 @@ void updater::downloadLoaderUpdate(std::string const& url) {
if (ok) { if (ok) {
s_isNewUpdateDownloaded = true; s_isNewUpdateDownloaded = true;
LoaderUpdateEvent(UpdateFinished()).post(); LoaderUpdateEvent(UpdateFinished()).post();
if(
Loader::get()->isForwardCompatMode()
&& CCScene::get()->getChildByType<MenuLayer>(0)
) utils::game::restart();
} }
else { else {
LoaderUpdateEvent( LoaderUpdateEvent(
@ -382,8 +396,8 @@ void updater::checkForLoaderUpdates() {
return; return;
} }
// don't auto-update major versions // don't auto-update major versions when not on forward compat
if (ver.getMajor() > Loader::get()->getVersion().getMajor()) { if (!Loader::get()->isForwardCompatMode() && ver.getMajor() > Loader::get()->getVersion().getMajor()) {
return; return;
} }

View file

@ -218,5 +218,9 @@ void console::messageBox(char const* title, std::string const& info, Severity se
icon = MB_ICONERROR; icon = MB_ICONERROR;
break; break;
} }
MessageBoxA(nullptr, info.c_str(), title, icon);
//run in another thread so auto update can run in the background
std::thread([info, title, icon]{
MessageBoxA(nullptr, info.c_str(), title, icon | MB_SETFOREGROUND);
}).detach();
} }