numbers aren't magic (#2976)

* numbers aren't magic

* chest style matches contents

renamed everything except the cvar itself at this point
(waiting for versioned configs for that)

* tracker as part of names

* finish the tracker rename

---------

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2023-06-09 17:22:25 -04:00 committed by GitHub
parent e46c60a7a1
commit d69c07cd75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 305 additions and 180 deletions

View file

@ -8,6 +8,7 @@
#include <libultraship/libultraship.h>
#include "3drando/item_location.hpp"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "randomizerTypes.h"
extern "C" {
@ -118,20 +119,21 @@ void CheckTrackerWindow::DrawElement() {
return;
}
if (CVarGetInteger("gCheckTrackerWindowType", 1) == 0) {
if (CVarGetInteger("gCheckTrackerShowOnlyPaused", 0) == 1)
if (gPlayState == nullptr || gPlayState->pauseCtx.state == 0)
return;
if (CVarGetInteger("gCheckTrackerWindowType", TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
if (CVarGetInteger("gCheckTrackerShowOnlyPaused", 0) && (gPlayState == nullptr || gPlayState->pauseCtx.state == 0)) {
return;
}
if (CVarGetInteger("gCheckTrackerDisplayType", 0) == 1) {
int comboButton1Mask = buttons[CVarGetInteger("gCheckTrackerComboButton1", 6)];
int comboButton2Mask = buttons[CVarGetInteger("gCheckTrackerComboButton2", 8)];
if (CVarGetInteger("gCheckTrackerDisplayType", TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_COMBO_BUTTON) {
int comboButton1Mask = buttons[CVarGetInteger("gCheckTrackerComboButton1", TRACKER_COMBO_BUTTON_L)];
int comboButton2Mask = buttons[CVarGetInteger("gCheckTrackerComboButton2", TRACKER_COMBO_BUTTON_R)];
OSContPad* trackerButtonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads();
bool comboButtonsHeld = trackerButtonsPressed != nullptr &&
trackerButtonsPressed[0].button & comboButton1Mask &&
trackerButtonsPressed[0].button & comboButton2Mask;
if (!comboButtonsHeld)
if (!comboButtonsHeld) {
return;
}
}
}
@ -333,7 +335,7 @@ void BeginFloatWindows(std::string UniqueName, bool& open, ImGuiWindowFlags flag
ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoFocusOnAppearing;
}
if (!CVarGetInteger("gCheckTrackerWindowType", 1)) {
if (CVarGetInteger("gCheckTrackerWindowType", TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID);
windowFlags |= ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoTitleBar |
ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoScrollbar;
@ -980,14 +982,14 @@ void CheckTrackerSettingsWindow::DrawElement() {
}
ImGui::PopItemWidth();
UIWidgets::LabeledRightAlignedEnhancementCombobox("Window Type", "gCheckTrackerWindowType", windowType, 1);
if (CVarGetInteger("gCheckTrackerWindowType", 1) == 0) {
UIWidgets::LabeledRightAlignedEnhancementCombobox("Window Type", "gCheckTrackerWindowType", windowType, TRACKER_WINDOW_WINDOW);
if (CVarGetInteger("gCheckTrackerWindowType", TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
UIWidgets::EnhancementCheckbox("Enable Dragging", "gCheckTrackerHudEditMode");
UIWidgets::EnhancementCheckbox("Only enable while paused", "gCheckTrackerShowOnlyPaused");
UIWidgets::LabeledRightAlignedEnhancementCombobox("Display Mode", "gCheckTrackerDisplayType", displayType, 0);
if (CVarGetInteger("gCheckTrackerDisplayType", 0) > 0) {
UIWidgets::LabeledRightAlignedEnhancementCombobox("Combo Button 1", "gCheckTrackerComboButton1", buttonStrings, 6);
UIWidgets::LabeledRightAlignedEnhancementCombobox("Combo Button 2", "gCheckTrackerComboButton2", buttonStrings, 8);
if (CVarGetInteger("gCheckTrackerDisplayType", TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_COMBO_BUTTON) {
UIWidgets::LabeledRightAlignedEnhancementCombobox("Combo Button 1", "gCheckTrackerComboButton1", buttonStrings, TRACKER_COMBO_BUTTON_L);
UIWidgets::LabeledRightAlignedEnhancementCombobox("Combo Button 2", "gCheckTrackerComboButton2", buttonStrings, TRACKER_COMBO_BUTTON_R);
}
}
UIWidgets::EnhancementCheckbox("Performance mode", "gCheckTrackerOptionPerformanceMode");