Mod SDK: Gamemode Service, Change Speedrun mode to a gamemode, Allow prelaunch to be restarted

This commit is contained in:
jdflyer
2026-07-19 00:50:49 -07:00
parent 1bae8a5e6a
commit 61a4ab3117
38 changed files with 974 additions and 250 deletions
+10 -8
View File
@@ -9,11 +9,15 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_msg_string.h"
#include "m_Do/m_Do_controller_pad.h"
#ifdef TARGET_PC
#include <dusk/autosave.h>
#include "dusk/livesplit.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "dusk/speedrun.h"
#include "m_Do/m_Do_controller_pad.h"
#include <dusk/autosave.h>
#include "dusk/gamemode.hpp"
#endif
dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
mArchive = i_archive;
@@ -143,12 +147,10 @@ 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.speedrunMode && !dusk::getSettings().game.hideTvSettingsScreen) {
// start a new run if a run isn't already in progress
if (!dusk::m_speedrunInfo.m_isRunStarted) {
dusk::resetForSpeedrunMode();
dusk::m_speedrunInfo.startRun();
dusk::speedrun::start();
if (!dusk::getSettings().game.hideTvSettingsScreen) {
const dusk::gamemode::Gamemode* gamemode = dusk::gamemode::getGamemodeManager().getCurrentGamemode();
if (gamemode) {
gamemode->mOnSaveLoadedFunction();
}
}