mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-23 17:45:13 -04:00
Add reset/randomize all SFX and Cosmetic commands to console (#2378)
* add reset/randomize all commands to debug console for sfx and cosmetic editor * fix cvar func
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include <string>
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include <soh/Enhancements/item-tables/ItemTableManager.h>
|
||||
#include "soh/Enhancements/cosmetics/CosmeticsEditor.h"
|
||||
#include "soh/Enhancements/sfx-editor/SfxEditor.h"
|
||||
|
||||
|
||||
#define Path _Path
|
||||
@@ -906,6 +908,42 @@ static bool CuccoStormHandler(std::shared_ptr<Ship::Console> Console, const std:
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static bool CosmeticsHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
|
||||
if (args.size() != 2) {
|
||||
SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed");
|
||||
return CMD_FAILED;
|
||||
}
|
||||
|
||||
if (args[1].compare("reset") == 0) {
|
||||
CosmeticsEditor_ResetAll();
|
||||
} else if (args[1].compare("randomize") == 0) {
|
||||
CosmeticsEditor_RandomizeAll();
|
||||
} else {
|
||||
SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'");
|
||||
return CMD_FAILED;
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static bool SfxHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args) {
|
||||
if (args.size() != 2) {
|
||||
SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed");
|
||||
return CMD_FAILED;
|
||||
}
|
||||
|
||||
if (args[1].compare("reset") == 0) {
|
||||
SfxEditor_ResetAll();
|
||||
} else if (args[1].compare("randomize") == 0) {
|
||||
SfxEditor_RandomizeAll();
|
||||
} else {
|
||||
SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'");
|
||||
return CMD_FAILED;
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
#define VARTYPE_INTEGER 0
|
||||
#define VARTYPE_FLOAT 1
|
||||
#define VARTYPE_STRING 2
|
||||
@@ -1159,5 +1197,13 @@ void DebugConsole_Init(void) {
|
||||
|
||||
CMD_REGISTER("cucco_storm", { CuccoStormHandler, "Cucco Storm" });
|
||||
|
||||
CMD_REGISTER("cosmetics", { CosmeticsHandler, "Change cosmetics.", {
|
||||
{ "reset|randomize", Ship::ArgumentType::TEXT },
|
||||
}});
|
||||
|
||||
CMD_REGISTER("sfx", { SfxHandler, "Change SFX.", {
|
||||
{ "reset|randomize", Ship::ArgumentType::TEXT },
|
||||
}});
|
||||
|
||||
CVarLoad();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user