Skip to content

Commit

Permalink
Add no UI functionality (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz authored Sep 15, 2022
1 parent 5c26a3d commit 8503b26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion soh/soh/Enhancements/debugconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern GlobalContext* gGlobalCtx;

#define CMD_REGISTER SohImGui::GetConsole()->AddCommand

uint32_t noUI;
uint32_t giantLink;
uint32_t minishLink;
uint32_t paperLink;
Expand Down Expand Up @@ -542,7 +543,13 @@ static bool NoUIHandler(std::shared_ptr<Ship::Console> Console, const std::vecto
return CMD_FAILED;
}

// TODO: Implement
try {
noUI = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;
return CMD_SUCCESS;
} catch (std::invalid_argument const& ex) {
SohImGui::GetConsole()->SendErrorMessage("[SOH] No UI value must be a number.");
return CMD_FAILED;
}
}

static bool FreezeHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
Expand Down
1 change: 1 addition & 0 deletions soh/soh/Enhancements/debugconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t noUI;
extern uint32_t giantLink;
extern uint32_t minishLink;
extern uint32_t paperLink;
Expand Down
4 changes: 4 additions & 0 deletions soh/src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -4499,6 +4499,10 @@ void Interface_Draw(GlobalContext* globalCtx) {
s16 svar6;
bool fullUi = !CVar_GetS32("gMinimalUI", 0) || !R_MINIMAP_DISABLED || globalCtx->pauseCtx.state != 0;

if (noUI) {
return;
}

OPEN_DISPS(globalCtx->state.gfxCtx);

// Invalidate Do Action textures as they may have changed
Expand Down

0 comments on commit 8503b26

Please sign in to comment.