noUI placeholder

This commit is contained in:
David Chavez 2022-08-12 02:49:07 +02:00
parent 9e54c6d4ff
commit 8b0117bc58
3 changed files with 23 additions and 4 deletions

View File

@ -39,7 +39,7 @@ uint32_t giantLink;
uint32_t minishLink;
uint32_t gravityLevel;
uint32_t resetLinkScale;
uint32_t noUi;
uint32_t noUI;
uint32_t invisibleLink;
static bool ActorSpawnHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
@ -468,6 +468,22 @@ static bool GravityHandler(std::shared_ptr<Ship::Console> Console, const std::ve
}
}
// TODO: Does not yet function
static bool NoUIHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
if (args.size() != 2) {
SohImGui::console->SendErrorMessage("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
try {
bool noUI = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;
return CMD_SUCCESS;
} catch (std::invalid_argument const& ex) {
SohImGui::console->SendErrorMessage("[SOH] NoUI value must be a number.");
return CMD_FAILED;
}
}
#define VARTYPE_INTEGER 0
#define VARTYPE_FLOAT 1
#define VARTYPE_STRING 2
@ -634,5 +650,9 @@ void DebugConsole_Init(void) {
{ "value", Ship::ArgumentType::NUMBER }
}});
CMD_REGISTER("no_ui", { NoUIHandler, "Disable the UI.", {
{ "value", Ship::ArgumentType::NUMBER }
}});
CVar_Load();
}

View File

@ -10,7 +10,6 @@ extern uint32_t giantLink;
extern uint32_t minishLink;
extern uint32_t gravityLevel;
extern uint32_t resetLinkScale;
extern uint32_t noUi;
extern uint32_t invisibleLink;
#ifdef __cplusplus
}

View File

@ -1562,7 +1562,7 @@ void RemoveEffect(const char* effectId) {
gravityLevel = 1;
return;
} else if (strcmp(effectId, "no_ui") == 0) {
noUi = 0;
noUI = 0;
return;
} else if (strcmp(effectId, "invisible") == 0) {
invisibleLink = 0;
@ -1670,7 +1670,7 @@ u8 ExecuteEffect(const char* effectId, uint32_t value) {
Actor_Spawn(&gGlobalCtx->actorCtx, gGlobalCtx, ACTOR_EN_WALLMAS, player->actor.world.pos.x, player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 0);
return 1;
} else if (strcmp(effectId, "no_ui") == 0) {
noUi = 1;
noUI = 1;
return 1;
} else if (strcmp(effectId, "invisible") == 0) {
invisibleLink = 1;