Fix Issues with mod resetting, make gamemode ids lowercase, update modding.md

This commit is contained in:
jdflyer
2026-07-20 17:18:23 -07:00
parent 449a8408ab
commit 91c6c5c137
3 changed files with 34 additions and 16 deletions
+6 -1
View File
@@ -20,7 +20,12 @@ aurora::Module Log("dusk::mods::gamemode");
std::unordered_map<std::string, std::vector<std::string>> s_gamemodesRegisteredToMods;
std::string get_mod_gamemode_id(ModContext* ctx, const std::string& id) {
return id + "_" + ctx->mod->metadata.id;
// Standardize the IDs to include the mod id (to prevent clashes) and set them as lowercase
std::string fullId = id + "_" + ctx->mod->metadata.id;
std::transform(fullId.begin(),fullId.end(),fullId.begin(),[](unsigned char c) {
return std::towlower(c);
});
return fullId;
}
void gamemode_remove_mod(LoadedMod& mod) {
+5
View File
@@ -22,6 +22,7 @@
#ifdef TARGET_PC
#include "dusk/ui/prelaunch.hpp"
#include "dusk/ui/menu_bar.hpp"
#include "dusk/ui/mods_window.hpp"
#include "dusk/gamemode.hpp"
#endif
@@ -167,6 +168,10 @@ void mDoRst_resetCallBack(int port, void*) {
// Hide the menu bar
menubar->Document::hide(true);
}
if (auto* modwindow = dynamic_cast<dusk::ui::ModsWindow*>(doc.get())) {
// Hide the mod window (if we were disasbling or reloading a mod)
modwindow->pop();
}
if (auto* prelaunch = dynamic_cast<dusk::ui::Prelaunch*>(doc.get())) {
prelaunchExists = true;
prelaunch->focus();