Merge pull request #985 from aMannus/rando-no-logic-option

Rando: Added no logic option
This commit is contained in:
briaguya 2022-08-02 03:25:03 -07:00 committed by GitHub
commit 491fe8e84d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View File

@ -2463,6 +2463,17 @@ namespace Settings {
//Function to set flags depending on settings //Function to set flags depending on settings
void UpdateSettings(std::unordered_map<RandomizerSettingKey, uint8_t> cvarSettings) { void UpdateSettings(std::unordered_map<RandomizerSettingKey, uint8_t> cvarSettings) {
// RANDTODO: Switch this back once all logic options are implemented
// Logic.SetSelectedIndex(cvarSettings[RSK_LOGIC_RULES]);
switch (cvarSettings[RSK_LOGIC_RULES]) {
case 0:
Logic.SetSelectedIndex(0);
break;
case 1:
Logic.SetSelectedIndex(2);
break;
}
OpenForest.SetSelectedIndex(cvarSettings[RSK_FOREST]); OpenForest.SetSelectedIndex(cvarSettings[RSK_FOREST]);
OpenKakariko.SetSelectedIndex(cvarSettings[RSK_KAK_GATE]); OpenKakariko.SetSelectedIndex(cvarSettings[RSK_KAK_GATE]);
ZorasFountain.SetSelectedIndex(cvarSettings[RSK_ZORAS_FOUNTAIN]); ZorasFountain.SetSelectedIndex(cvarSettings[RSK_ZORAS_FOUNTAIN]);

View File

@ -3414,6 +3414,7 @@ void GenerateRandomizerImgui() {
Game::SaveSettings(); Game::SaveSettings();
std::unordered_map<RandomizerSettingKey, u8> cvarSettings; std::unordered_map<RandomizerSettingKey, u8> cvarSettings;
cvarSettings[RSK_LOGIC_RULES] = CVar_GetS32("gRandomizeLogicRules", 0);
cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", 0); cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", 0);
cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", 0); cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", 0);
cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", 0); cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", 0);
@ -3497,6 +3498,9 @@ void DrawRandoEditor(bool& open) {
} }
// Randomizer settings // Randomizer settings
// Logic Settings
const char* randoLogicRules[2] = { "Glitchless", "No logic"};
// Open Settings // Open Settings
const char* randoForest[3] = { "Closed", "Closed Deku", "Open" }; const char* randoForest[3] = { "Closed", "Closed Deku", "Open" };
const char* randoKakarikoGate[2] = { "Closed", "Open" }; const char* randoKakarikoGate[2] = { "Closed", "Open" };
@ -3739,6 +3743,20 @@ void DrawRandoEditor(bool& open) {
if (CVar_GetS32("gRandomizer", 0) == 1 && ImGui::BeginTabBar("Randomizer Settings", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (CVar_GetS32("gRandomizer", 0) == 1 && ImGui::BeginTabBar("Randomizer Settings", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Main Rules")) { if (ImGui::BeginTabItem("Main Rules")) {
if (ImGui::BeginTable("tableRandoLogic", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushItemWidth(170.0);
ImGui::Text("Logic Rules");
InsertHelpHoverText("Glitchless - No glitches are required, but may require some minor tricks.\n"
"\n"
"No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT."
);
SohImGui::EnhancementCombobox("gRandomizeLogicRules", randoLogicRules, 2, 0);
ImGui::PopItemWidth();
ImGui::EndTable();
}
if (ImGui::BeginTable("tableRandoMainRules", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { if (ImGui::BeginTable("tableRandoMainRules", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("Open Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f); ImGui::TableSetupColumn("Open Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableSetupColumn("Shuffle Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f); ImGui::TableSetupColumn("Shuffle Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);

View File

@ -952,6 +952,7 @@ typedef enum {
typedef enum { typedef enum {
RSK_NONE, RSK_NONE,
RSK_LOGIC_RULES,
RSK_FOREST, RSK_FOREST,
RSK_KAK_GATE, RSK_KAK_GATE,
RSK_DOOR_OF_TIME, RSK_DOOR_OF_TIME,