Gamemode service fixes

This commit is contained in:
jdflyer
2026-08-08 17:12:38 -07:00
parent 8be95d3aa3
commit 315897e45a
7 changed files with 17 additions and 25 deletions
+1 -1
View File
@@ -734,7 +734,7 @@ bool onNewSaveSelect(dFile_select_c *fileSelect) {
svc_ui->window_close(ctx, *static_cast<UiWindowHandle*>(userdata));
};
desc.user_data = &windowHandle;
svc_ui->pane_add_control(mod_ctx, leftPane, &desc, &windowHandle);
svc_ui->pane_add_control(mod_ctx, leftPane, &desc, nullptr);
return MOD_OK;
};
+1 -3
View File
@@ -7,8 +7,6 @@
#define GAMEMODE_SERVICE_MAJOR 1u
#define GAMEMODE_SERVICE_MINOR 0u
struct dFile_select_c;
typedef struct {
const char* gamemodeId;
const char* fullName;
@@ -18,7 +16,7 @@ typedef struct {
void (*onPlayFunction)();
void (*onSaveLoadedFunction)();
void (*onNewSaveFunction)();
bool (*onNewSaveSelectFunction)(dFile_select_c* fileSelect); // Should return true when any custom options flows are finished
bool (*onNewSaveSelectFunction)(struct dFile_select_c* fileSelect); // Should return true when any custom options flows are finished
void (*onGameResetFunction)();
void (*onTickFunction)();
} GamemodeDesc;
-7
View File
@@ -186,13 +186,6 @@ void dBrightCheck_c::modeMove() {
if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) {
mDoAud_seStart(Z2SE_ENTER_GAME, NULL, 0, 0);
#ifdef TARGET_PC
if (!dusk::getSettings().game.hideTvSettingsScreen) {
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnSaveLoadedFunction();
}
}
toggleAutoSave(true);
#endif
mCompleteCheck = true;
+10
View File
@@ -1416,6 +1416,11 @@ void dFile_select_c::menuSelectStart() {
dComIfGs_setDataNum(mSelectNum);
#if TARGET_PC
dusk::mods::svc::save_slot_loaded(mSelectNum, &mSaveData[mSelectNum]);
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnSaveLoadedFunction();
}
#endif
} else if (mSelectMenuNum == 0) {
mSelIcon->setAlphaRate(0.0f);
@@ -1769,6 +1774,11 @@ void dFile_select_c::nameInput2() {
mIsSelectEnd = true;
#if TARGET_PC
dusk::mods::svc::save_slot_new(mSelectNum);
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnNewSaveFunction();
gamemode->invokeOnSaveLoadedFunction();
}
#endif
mDataSelProc = DATASELPROC_NEXT_MODE_WAIT;
}
+5
View File
@@ -27,6 +27,7 @@
#include "dusk/logging.h"
#include "dusk/main.h"
#include "dusk/mods/svc/save.hpp"
#include "dusk/gamemode.hpp"
#include "dusk/version.hpp"
#include "m_Do/m_Do_MemCard.h"
#endif
@@ -785,6 +786,10 @@ void dScnLogo_c::nextSceneChange() {
if (status == 1) {
dusk::mods::svc::save_slot_loaded(
saveSlot, buf + saveSlot * SAVEDATA_SIZE);
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnSaveLoadedFunction();
}
}
dComIfGs_gameStart();
-7
View File
@@ -422,13 +422,6 @@ void dScnName_c::changeGameScene() {
dComIfGs_setRestartRoomParam(0);
#if TARGET_PC
if (dusk::getSettings().game.hideTvSettingsScreen) {
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnSaveLoadedFunction();
}
}
toggleAutoSave(true);
#endif
}
-7
View File
@@ -1537,13 +1537,6 @@ void dSv_save_c::init() {
mEvent.init();
mMiniGame.init();
#ifdef TARGET_PC
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->invokeOnNewSaveFunction();
}
#endif
}
dSv_memory2_c* dSv_save_c::getSave2(int i_stage2No) {