Merge branch 'main' into new-index-but-better

This commit is contained in:
HJfod 2024-04-22 00:08:49 +03:00
commit 5f8588ea97
11 changed files with 63 additions and 12 deletions

View file

@ -1,5 +1,20 @@
# Geode Changelog
## v2.0.0-beta.24
* CMake error when compiling with Android SDK below 23 (ea34e12)
* Fix rendering of soft line breaks in MDTextArea (c7f8b5f)
* Fix `getChildOfType` entering an infinite loop with negative indices (a795487)
* Don't cache fonts on Windows (e9da55f)
* Add `level:` and `mod:` to MDTextArea (8c61a6f)
* Fix json floating precision errors (318a7f2)
* Fix loading bar going out of bounds (e50c3ab)
* Fix field containers for modified classes that have an inheritance relationship sharing the container (00e971a)
* Error if mod target geode version doesn't match installed SDK version (2c559f8)
* Fix dangling pointer in `disownPatch` (4c492c1)
* Add a way to access internal setting container (798cacc)
* Add the crashed thread to Windows crashlog (f84e866)
* Add Greek, Ukranian, Simplified and Traditional Chinese, French translations for the installer (8002ca0, bd5db26, 33fcd52, c02cc6d)
## v2.0.0-beta.23
* Fix `CCMenuItem::activate` crashes (005d245, 7f9dcc6)
* Fix ProfilePage fix misaligning profiles (b44184c)
@ -736,5 +751,4 @@ Note that from here on, changes to the framework were not tracked by versions as
- Lilac started by Mat, HJfod and Pie
## 2021/01/25
- CacaoSDK started by Camila, based on CappuccinoSDK
- CacaoSDK started by Camila, based on CappuccinoSDK

View file

@ -241,7 +241,7 @@ if (DEFINED GEODE_TULIPHOOK_REPO_PATH)
message(STATUS "Using ${GEODE_TULIPHOOK_REPO_PATH} for TulipHook")
add_subdirectory(${GEODE_TULIPHOOK_REPO_PATH} ${GEODE_TULIPHOOK_REPO_PATH}/build)
else()
CPMAddPackage("gh:geode-sdk/TulipHook#3ec2e6e")
CPMAddPackage("gh:geode-sdk/TulipHook#7fa328b")
endif()
set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE)

View file

@ -11,8 +11,8 @@ if (GEODE_TARGET_PLATFORM STREQUAL "iOS")
OSX_ARCHITECTURES arm64
)
set(GEODE_OUTPUT_NAME "GeodeIOS")
set(GEODE_PLATFORM_BINARY "GeodeIOS.dylib")
set(GEODE_OUTPUT_NAME "Geode.ios")
set(GEODE_PLATFORM_BINARY "Geode.ios.dylib")
set(GEODE_MOD_BINARY_SUFFIX ".ios.dylib" CACHE STRING "" FORCE)
elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
set_target_properties(${PROJECT_NAME} PROPERTIES

View file

@ -267,7 +267,11 @@ enum class ColorSelectType {};
enum class AudioGuidelinesType {};
enum class SmartBrowseFilter {};
enum class GJUITouchEvent {};
enum class ObjectScaleType {};
enum class ObjectScaleType {
XY = 0,
X = 1,
Y = 2
};
enum class SavedActiveObjectState {};
enum class SavedSpecialObjectState {};
enum class SavedObjectStateRef {};

View file

@ -48,10 +48,9 @@ typedef struct _ccColor3B
typedef struct _ccHSVValue
{
float h, s, v;
GLubyte absoluteSaturation;
GLubyte absoluteBrightness;
bool saturationChecked;
bool brightnessChecked;
bool absoluteSaturation;
bool absoluteBrightness;
private: unsigned char __pad[2];
} ccHSVValue;
static inline ccHSVValue

View file

@ -211,6 +211,7 @@ namespace geode {
}
matjson::Value& getSaveContainer();
matjson::Value& getSavedSettingsData();
template <class T>
T getSettingValue(std::string_view const key) const {

View file

@ -47,6 +47,10 @@ matjson::Value& Mod::getSaveContainer() {
return m_impl->getSaveContainer();
}
matjson::Value& Mod::getSavedSettingsData() {
return m_impl->getSavedSettingsData();
}
bool Mod::isEnabled() const {
return m_impl->isEnabled();
}

View file

@ -130,6 +130,10 @@ matjson::Value& Mod::Impl::getSaveContainer() {
return m_saved;
}
matjson::Value& Mod::Impl::getSavedSettingsData() {
return m_savedSettingsData;
}
bool Mod::Impl::isEnabled() const {
return m_enabled;
}

View file

@ -99,6 +99,7 @@ namespace geode {
ghc::filesystem::path getBinaryPath() const;
matjson::Value& getSaveContainer();
matjson::Value& getSavedSettingsData();
#if defined(GEODE_EXPOSE_SECRET_INTERNALS_IN_HEADERS_DO_NOT_DEFINE_PLEASE)
void setMetadata(ModMetadata const& metadata);

View file

@ -50,12 +50,17 @@ void updater::fetchLatestGithubRelease(
return then(s_latestGithubRelease.value());
}
auto version = VersionInfo::parse(
Mod::get()->getSavedValue("latest-version-auto-update-check", std::string("0.0.0"))
);
log::debug("Last update check result: {}", version.unwrap().toString());
std::string modifiedSince;
if (!force) {
if (!force && version && version.unwrap() <= Mod::get()->getVersion() && version.unwrap() != VersionInfo(0, 0, 0)) {
modifiedSince = Mod::get()->getSavedValue("last-modified-auto-update-check", std::string());
}
// TODO: add header to not get rate limited
web::AsyncWebRequest()
.join("loader-auto-update-check")
.header("If-Modified-Since", modifiedSince)
@ -279,6 +284,8 @@ void updater::downloadLoaderUpdate(std::string const& url) {
LoaderUpdateEvent(
UpdateFailed("Unable to unzip update: " + unzip.unwrapErr())
).post();
Mod::get()->setSavedValue("last-modified-auto-update-check", std::string());
return;
}
s_isNewUpdateDownloaded = true;
@ -289,6 +296,8 @@ void updater::downloadLoaderUpdate(std::string const& url) {
LoaderUpdateEvent(
UpdateFailed("Unable to download update: " + info)
).post();
Mod::get()->setSavedValue("last-modified-auto-update-check", std::string());
})
.progress([](auto&, double now, double total) {
LoaderUpdateEvent(
@ -311,8 +320,16 @@ void updater::checkForLoaderUpdates() {
VersionInfo ver { 0, 0, 0 };
root.needs("tag_name").into(ver);
log::info("Latest version is {}", ver.toString());
Mod::get()->setSavedValue("latest-version-auto-update-check", ver.toString());
// make sure release is newer
if (ver <= Loader::get()->getVersion()) {
if(ver <= VersionInfo(2, 0, 0, VersionTag(VersionTag::Beta, 1))) {
log::warn("Invalid loader version detected, resetting update check time");
Mod::get()->setSavedValue("last-modified-auto-update-check", std::string());
}
return;
}
@ -335,9 +352,12 @@ void updater::checkForLoaderUpdates() {
}
}
log::error("Failed to find release asset for " GEODE_PLATFORM_NAME);
LoaderUpdateEvent(
UpdateFailed("Unable to find release asset for " GEODE_PLATFORM_NAME)
).post();
Mod::get()->setSavedValue("last-modified-auto-update-check", std::string());
},
[](std::string const& info) {
log::error("Failed to fetch updates {}", info);

View file

@ -292,6 +292,10 @@ static std::string getInfo(LPEXCEPTION_POINTERS info, Mod* faultyMod) {
<< "\n"
<< "Number Parameters: " << info->ExceptionRecord->NumberParameters << "\n";
}
// show the thread that crashed
stream << "Crashed thread: " << utils::thread::getName() << "\n";
return stream.str();
}