mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Added Available Checks - Process Undiscovered Exits DebugConsole command.
This commit is contained in:
parent
2e0e01d2c2
commit
b8796926a9
3 changed files with 32 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/cosmetics/CosmeticsEditor.h"
|
||||
#include "soh/Enhancements/audio/AudioEditor.h"
|
||||
#include "soh/Enhancements/randomizer/logic.h"
|
||||
|
||||
#define Path _Path
|
||||
#define PATH_HACK
|
||||
|
@ -1450,6 +1451,29 @@ static bool SfxHandler(std::shared_ptr<Ship::Console> Console, const std::vector
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool AvailabeChecksProcessUndiscoveredExitsHandler(std::shared_ptr<Ship::Console> Console,
|
||||
const std::vector<std::string>& args, std::string* output) {
|
||||
const auto& logic = Rando::Context::GetInstance()->GetLogic();
|
||||
bool enabled = false;
|
||||
|
||||
if (args.size() == 1) {
|
||||
enabled = !logic->ACProcessUndiscoveredExits;
|
||||
} else {
|
||||
try {
|
||||
enabled = std::stoi(args[1]);
|
||||
} catch (std::invalid_argument const& ex) {
|
||||
ERROR_MESSAGE("[SOH] Enable should be 0 or 1");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
logic->ACProcessUndiscoveredExits = enabled;
|
||||
INFO_MESSAGE("[SOH] Available Checks - Process Undiscovered Exits %s",
|
||||
logic->ACProcessUndiscoveredExits ? "enabled" : "disabled");
|
||||
CheckTracker::RecalculateAvailableChecks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DebugConsole_Init(void) {
|
||||
// Console
|
||||
CMD_REGISTER("file_select", { FileSelectHandler, "Returns to the file select." });
|
||||
|
@ -1708,5 +1732,9 @@ void DebugConsole_Init(void) {
|
|||
{ "group_name", Ship::ArgumentType::TEXT, true },
|
||||
} });
|
||||
|
||||
CMD_REGISTER("acpue", { AvailabeChecksProcessUndiscoveredExitsHandler,
|
||||
"Available Checks - Process Undiscovered Exits",
|
||||
{ { "enable", Ship::ArgumentType::NUMBER, true } } });
|
||||
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
|
|
|
@ -210,8 +210,9 @@ void ProcessExits(Region* region, GetAccessibleLocationsStruct& gals, Randomizer
|
|||
auto ctx = Rando::Context::GetInstance();
|
||||
for (auto& exit : region->exits) {
|
||||
int16_t entranceIndex = exit.GetIndex();
|
||||
if (logic->CalculatingAvailableChecks && ctx->GetOption(RSK_SHUFFLE_ENTRANCES).Get() && exit.IsShuffled() &&
|
||||
entranceIndex != -1 && !Entrance_GetIsEntranceDiscovered(entranceIndex)) {
|
||||
if (!logic->ACProcessUndiscoveredExits && logic->CalculatingAvailableChecks &&
|
||||
ctx->GetOption(RSK_SHUFFLE_ENTRANCES).Get() && exit.IsShuffled() && entranceIndex != -1 &&
|
||||
!Entrance_GetIsEntranceDiscovered(entranceIndex)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,6 +184,7 @@ class Logic {
|
|||
/* --- END OF HELPERS AND LOCATION ACCESS --- */
|
||||
|
||||
bool CalculatingAvailableChecks = false;
|
||||
bool ACProcessUndiscoveredExits = false;
|
||||
|
||||
SaveContext* mSaveContext = nullptr;
|
||||
Logic();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue