mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-02 09:39:48 -04:00
First time setup preset menu with transition & cool sfx
This commit is contained in:
@@ -116,7 +116,7 @@ ConfigVarBase* GetConfigVar(std::string_view name);
|
||||
*
|
||||
* For detect first run to prompt the user to choose a preset.
|
||||
*/
|
||||
bool WasConfigFileMissing();
|
||||
bool IsConfigFileMissing();
|
||||
|
||||
template <ConfigValue T>
|
||||
const ConfigImplBase* GetConfigImpl() {
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#include "JSystem/JAudio2/JAIStreamDataMgr.h"
|
||||
#include "JSystem/JAudio2/JAIAudience.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include <dusk/config.hpp>
|
||||
#endif
|
||||
|
||||
static void JAIStream_JASAramStreamCallback_(u32 type, JASAramStream* aramStream, void* userData) {
|
||||
JAIStream* stream = (JAIStream*)userData;
|
||||
|
||||
@@ -35,6 +39,12 @@ JAIStream::JAIStream(JAIStreamMgr* streamMgr, JAISoundStrategyMgr<JAIStream>* so
|
||||
void JAIStream::JAIStreamMgr_startID_(JAISoundID id, s32 streamFileEntry,
|
||||
const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience,
|
||||
int category) {
|
||||
#if TARGET_PC
|
||||
if (dusk::config::IsConfigFileMissing()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0x298 = category;
|
||||
field_0x294 = streamFileEntry;
|
||||
start_JAISound_(id, posPtr, audience);
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include <dusk/config.hpp>
|
||||
#endif
|
||||
|
||||
class daTit_HIO_c : public JORReflexible {
|
||||
public:
|
||||
daTit_HIO_c();
|
||||
@@ -152,6 +156,12 @@ int daTitle_c::createHeapCallBack(fopAc_ac_c* actor) {
|
||||
}
|
||||
|
||||
int daTitle_c::Execute() {
|
||||
#if TARGET_PC
|
||||
if (dusk::config::IsConfigFileMissing()) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
mDoGph_gInf_c::resetDimming();
|
||||
#endif
|
||||
@@ -364,6 +374,12 @@ int daTitle_c::getDemoPrm() {
|
||||
}
|
||||
|
||||
int daTitle_c::Draw() {
|
||||
#if TARGET_PC
|
||||
if (dusk::config::IsConfigFileMissing()) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
J3DModelData* modelData = mpModel->getModelData();
|
||||
cMtx_trans(mpModel->getBaseTRMtx(), IREG_F(7), IREG_F(8), IREG_F(9) + -430.0f);
|
||||
mpModel->getBaseScale()->x = -1.0f;
|
||||
|
||||
@@ -39,7 +39,10 @@
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/memory.h"
|
||||
#include <dusk/config.hpp>
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#include "d/d_s_menu.h"
|
||||
@@ -698,6 +701,10 @@ static u8 lbl_8074CAE4;
|
||||
static u32 l_sceneChangeStartTick;
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
BOOL firstTime = FALSE;
|
||||
#endif
|
||||
|
||||
static int dScnPly_Execute(dScnPly_c* i_this) {
|
||||
#if DEBUG
|
||||
fapGm_HIO_c::startCpuTimer();
|
||||
@@ -778,7 +785,19 @@ static int dScnPly_Execute(dScnPly_c* i_this) {
|
||||
dJprev_c::get()->update();
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::config::IsConfigFileMissing()) {
|
||||
firstTime = true;
|
||||
} else if (firstTime) {
|
||||
mDoAud_seStart(Z2SE_TITLE_ENTER, NULL, 0, 0);
|
||||
JUTGamePad::C3ButtonReset::sResetSwitchPushing = true;
|
||||
firstTime = false;
|
||||
} else {
|
||||
dDemo_c::update();
|
||||
}
|
||||
#else
|
||||
dDemo_c::update();
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
dJcame_c::get()->update();
|
||||
|
||||
+3
-1
@@ -212,9 +212,11 @@ void dusk::config::Save() {
|
||||
}
|
||||
|
||||
io::FileStream::WriteAllText(configJsonPath.c_str(), j.dump(4));
|
||||
|
||||
s_configFileMissing = false;
|
||||
}
|
||||
|
||||
bool dusk::config::WasConfigFileMissing() {
|
||||
bool dusk::config::IsConfigFileMissing() {
|
||||
return s_configFileMissing;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,15 +179,16 @@ namespace dusk {
|
||||
ImGuiConsole::ImGuiConsole() {}
|
||||
|
||||
void ImGuiConsole::PreDraw() {
|
||||
if (config::IsConfigFileMissing()) {
|
||||
m_firstRunPreset.draw();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_isLaunchInitialized) {
|
||||
m_toasts.emplace_back("Press F1 to toggle menu"s, 5.f);
|
||||
m_isLaunchInitialized = true;
|
||||
}
|
||||
|
||||
if (config::WasConfigFileMissing()) {
|
||||
m_firstRunPreset.draw();
|
||||
}
|
||||
|
||||
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
|
||||
|
||||
if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
|
||||
|
||||
Reference in New Issue
Block a user