fix GEODE_PRETTY_FUNCTION on clang

This commit is contained in:
HJfod 2022-10-06 20:58:05 +03:00
parent 1b40d1a6da
commit 7370f78a6d
4 changed files with 49 additions and 44 deletions
codegen/src
loader
include/Geode/platform
resources
src/hooks

View file

@ -33,9 +33,9 @@ public:
[[deprecated("Use of undefined virtual function - will crash at runtime!!!")]]
{virtual}{return_type} {function_name}({parameters}){const}{{
#ifdef GEODE_NO_UNDEFINED_VIRTUALS
static_assert(false, "Undefined virtual function " GEODE_PRETTY_FUNCTION " - implement in GeometryDash.bro");
static_assert(false, "Undefined virtual function - implement in GeometryDash.bro");
#endif
throw std::runtime_error("Use of undefined virtual function " GEODE_PRETTY_FUNCTION);
throw std::runtime_error("Use of undefined virtual function " + GEODE_PRETTY_FUNCTION);
}}
)GEN";

View file

@ -64,9 +64,9 @@ namespace std {
}
#if !defined(__PRETTY_FUNCTION__) && !defined(__GNUC__)
#define GEODE_PRETTY_FUNCTION __FUNCSIG__
#define GEODE_PRETTY_FUNCTION std::string_view(__FUNCSIG__)
#else
#define GEODE_PRETTY_FUNCTION __PRETTY_FUNCTION__
#define GEODE_PRETTY_FUNCTION std::string_view(__PRETTY_FUNCTION__)
#endif
// Windows

View file

@ -59,6 +59,12 @@
"default": true,
"name": "Check For Updates",
"description": "Automatically check for <cy>updates</c> to Geode on startup"
},
"auto-update-mods": {
"type": "bool",
"default": true,
"name": "Auto-Update Mods",
"description": "Automatically update <cp>mods</c> on startup"
}
},
"issues": {

View file

@ -86,46 +86,45 @@ static void updateIndexProgress(
g_indexUpdateNotif->hide();
g_indexUpdateNotif = nullptr;
if (Index::get()->areUpdatesAvailable()) {
// todo: uncomment and fix crash
// if (Mod::get()->getDataStore()["enable-auto-updates"]) {
// auto ticket = Index::get()->installUpdates(updateModsProgress);
// if (!ticket) {
// NotificationBuilder()
// .title("Unable to auto-update")
// .text("Unable to update mods :(")
// .icon("updates-failed.png"_spr)
// .show();
// } else {
// g_indexUpdateNotif = NotificationBuilder()
// .title("Installing updates")
// .text("Installing updates...")
// .clicked([ticket](auto) -> void {
// createQuickPopup(
// "Cancel Updates",
// "Do you want to <cr>cancel</c> updates?",
// "Don't Cancel", "Cancel Updates",
// [ticket](auto, bool btn2) -> void {
// if (g_indexUpdateNotif && btn2) {
// ticket.value()->cancel();
// }
// }
// );
// }, false)
// .loading()
// .stay()
// .show();
// }
// } else {
// NotificationBuilder()
// .title("Updates available")
// .text("Some mods have updates available!")
// .icon("updates-available.png"_spr)
// .clicked([](auto) -> void {
// ModListLayer::scene();
// })
// .show();
// }
// addUpdateIcon();
if (Mod::get()->getSettingValue<bool>("auto-update-mods")) {
auto ticket = Index::get()->installUpdates(updateModsProgress);
if (!ticket) {
NotificationBuilder()
.title("Unable to auto-update")
.text("Unable to update mods :(")
.icon("updates-failed.png"_spr)
.show();
} else {
g_indexUpdateNotif = NotificationBuilder()
.title("Installing updates")
.text("Installing updates...")
.clicked([ticket](auto) -> void {
createQuickPopup(
"Cancel Updates",
"Do you want to <cr>cancel</c> updates?",
"Don't Cancel", "Cancel Updates",
[ticket](auto, bool btn2) -> void {
if (g_indexUpdateNotif && btn2) {
ticket.value()->cancel();
}
}
);
}, false)
.loading()
.stay()
.show();
}
} else {
NotificationBuilder()
.title("Updates available")
.text("Some mods have updates available!")
.icon("updates-available.png"_spr)
.clicked([](auto) -> void {
ModListLayer::scene();
})
.show();
}
addUpdateIcon();
}
}
}