mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-25 01:28:54 -05:00
Merge remote-tracking branch 'origin/develop' into develop-lightless_arrows
This commit is contained in:
commit
8823ff7ce7
@ -135,6 +135,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(GBI_UCODE F3DEX_GBI_2)
|
||||
|
||||
################################################################################
|
||||
# Set CONTROLLERBUTTONS_T
|
||||
################################################################################
|
||||
add_compile_definitions(CONTROLLERBUTTONS_T=uint32_t)
|
||||
|
||||
################################################################################
|
||||
# Sub-projects
|
||||
################################################################################
|
||||
|
@ -311,7 +311,7 @@ void InputViewer::DrawElement() {
|
||||
if (CVarGetInteger(CVAR_INPUT_VIEWER("Mod1"), 0)) {
|
||||
ImGui::SetNextItemAllowOverlap();
|
||||
ImGui::SetCursorPos(aPos);
|
||||
RenderButton("Modifier-1", "Modifier-1 Outline", pads[0].button & BTN_MODIFIER1, scaledBGSize,
|
||||
RenderButton("Modifier-1", "Modifier-1 Outline", pads[0].button & BTN_CUSTOM_MODIFIER1, scaledBGSize,
|
||||
useGlobalOutlineMode
|
||||
? buttonOutlineMode
|
||||
: CVarGetInteger(CVAR_INPUT_VIEWER("Mod1OutlineMode"), BUTTON_OUTLINE_NOT_PRESSED));
|
||||
@ -320,7 +320,7 @@ void InputViewer::DrawElement() {
|
||||
if (CVarGetInteger(CVAR_INPUT_VIEWER("Mod2"), 0)) {
|
||||
ImGui::SetNextItemAllowOverlap();
|
||||
ImGui::SetCursorPos(aPos);
|
||||
RenderButton("Modifier-2", "Modifier-2 Outline", pads[0].button & BTN_MODIFIER2, scaledBGSize,
|
||||
RenderButton("Modifier-2", "Modifier-2 Outline", pads[0].button & BTN_CUSTOM_MODIFIER2, scaledBGSize,
|
||||
useGlobalOutlineMode
|
||||
? buttonOutlineMode
|
||||
: CVarGetInteger(CVAR_INPUT_VIEWER("Mod2OutlineMode"), BUTTON_OUTLINE_NOT_PRESSED));
|
||||
|
@ -21,7 +21,14 @@ void SohInputEditorWindow::InitElement() {
|
||||
|
||||
mButtonsBitmasks = { BTN_A, BTN_B, BTN_START, BTN_L, BTN_R, BTN_Z, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT };
|
||||
mDpadBitmasks = { BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT };
|
||||
mModifierButtonsBitmasks = { BTN_MODIFIER1, BTN_MODIFIER2 };
|
||||
mModifierButtonsBitmasks = { BTN_CUSTOM_MODIFIER1, BTN_CUSTOM_MODIFIER2 };
|
||||
mCustomOcarinaButtonsBitmasks = {
|
||||
BTN_CUSTOM_OCARINA_NOTE_D4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_F4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_A4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_B4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_D5
|
||||
};
|
||||
|
||||
addButtonName(BTN_A, "A");
|
||||
addButtonName(BTN_B, "B");
|
||||
@ -220,7 +227,7 @@ void SohInputEditorWindow::DrawInputChip(const char* buttonName, ImVec4 color =
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t bitmask) {
|
||||
void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, N64ButtonMask bitmask) {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
|
||||
auto popupId = StringHelper::Sprintf("addButtonMappingPopup##%d-%d", port, bitmask);
|
||||
if (ImGui::Button(StringHelper::Sprintf("%s###addButtonMappingButton%d-%d", ICON_FA_PLUS, port, bitmask).c_str(),
|
||||
@ -249,7 +256,7 @@ void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t
|
||||
}
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id) {
|
||||
void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, N64ButtonMask bitmask, std::string id) {
|
||||
auto mapping = Ship::Context::GetInstance()
|
||||
->GetControlDeck()
|
||||
->GetControllerByPort(port)
|
||||
@ -456,7 +463,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_
|
||||
ImGui::SameLine(0, SCALE_IMGUI_SIZE(4.0f));
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawButtonLine(const char* buttonName, uint8_t port, uint16_t bitmask,
|
||||
void SohInputEditorWindow::DrawButtonLine(const char* buttonName, uint8_t port, N64ButtonMask bitmask,
|
||||
ImVec4 color = CHIP_COLOR_N64_GREY) {
|
||||
ImGui::NewLine();
|
||||
ImGui::SameLine(SCALE_IMGUI_SIZE(32.0f));
|
||||
@ -1248,7 +1255,7 @@ void SohInputEditorWindow::DrawGyroSection(uint8_t port) {
|
||||
}
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks) {
|
||||
void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<N64ButtonMask> bitmasks) {
|
||||
std::set<Ship::ShipDeviceIndex> allLusDeviceIndices;
|
||||
allLusDeviceIndices.insert(Ship::ShipDeviceIndex::Keyboard);
|
||||
for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
|
||||
@ -1483,23 +1490,11 @@ namespace TableHelper {
|
||||
}
|
||||
}
|
||||
|
||||
typedef uint32_t N64ButtonMask;
|
||||
|
||||
void SohInputEditorWindow::addButtonName(N64ButtonMask mask, const char* name) {
|
||||
buttons.push_back(std::make_pair(mask, name));
|
||||
buttonNames[mask] = std::prev(buttons.end());
|
||||
}
|
||||
|
||||
// Ocarina button maps
|
||||
static CustomButtonMap ocarinaD5 = {"D5", CVAR_SETTING("CustomOcarina.D5Button"), BTN_CUP};
|
||||
static CustomButtonMap ocarinaB4 = {"B4", CVAR_SETTING("CustomOcarina.B4Button"), BTN_CLEFT};
|
||||
static CustomButtonMap ocarinaA4 = {"A4", CVAR_SETTING("CustomOcarina.A4Button"), BTN_CRIGHT};
|
||||
static CustomButtonMap ocarinaF4 = {"F4", CVAR_SETTING("CustomOcarina.F4Button"), BTN_CDOWN};
|
||||
static CustomButtonMap ocarinaD4 = {"D4", CVAR_SETTING("CustomOcarina.D4Button"), BTN_A};
|
||||
static CustomButtonMap ocarinaSongDisable = {"Disable songs", CVAR_SETTING("CustomOcarina.DisableButton"), BTN_L};
|
||||
static CustomButtonMap ocarinaSharp = {"Pitch up", CVAR_SETTING("CustomOcarina.SharpButton"), BTN_R};
|
||||
static CustomButtonMap ocarinaFlat = {"Pitch down", CVAR_SETTING("CustomOcarina.FlatButton"), BTN_Z};
|
||||
|
||||
// Draw a button mapping setting consisting of a padded label and button dropdown.
|
||||
// excludedButtons indicates which buttons are unavailable to choose from.
|
||||
void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidth, N64ButtonMask excludedButtons) {
|
||||
@ -1538,73 +1533,35 @@ void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidt
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawOcarinaControlPanel() {
|
||||
if (!ImGui::BeginTable("tableCustomOcarinaControls", 1, PANEL_TABLE_FLAGS)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::TableSetupColumn("Custom Ocarina Controls", PANEL_TABLE_COLUMN_FLAGS | ImGuiTableColumnFlags_WidthStretch);
|
||||
TableHelper::InitHeader(false);
|
||||
|
||||
ImVec2 cursor = ImGui::GetCursorPos();
|
||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||
ImGui::SetCursorPos(ImVec2(cursor.x + 24, cursor.y + 5));
|
||||
|
||||
UIWidgets::EnhancementCheckbox("Customize Ocarina Controls", CVAR_SETTING("CustomOcarina.Enabled"));
|
||||
|
||||
if (CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0) == 1) {
|
||||
if (ImGui::BeginTable("tableCustomMainOcarinaControls", 2, ImGuiTableFlags_SizingStretchProp)) {
|
||||
float labelWidth;
|
||||
N64ButtonMask disableMask = BTN_B;
|
||||
if (CVarGetInteger(CVAR_SETTING("OcarinaControl.Dpad"), 0)) {
|
||||
disableMask |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
|
||||
ImGui::TableSetupColumn("Notes##CustomOcarinaNotes", PANEL_TABLE_COLUMN_FLAGS);
|
||||
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
|
||||
TableHelper::InitHeader(false);
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::BulletText("Notes");
|
||||
DrawButtonLine("A (D4)", 0, BTN_CUSTOM_OCARINA_NOTE_D4);
|
||||
DrawButtonLine(ICON_FA_ARROW_DOWN " (F4)", 0, BTN_CUSTOM_OCARINA_NOTE_F4);
|
||||
DrawButtonLine(ICON_FA_ARROW_RIGHT " (A4)", 0, BTN_CUSTOM_OCARINA_NOTE_A4);
|
||||
DrawButtonLine(ICON_FA_ARROW_LEFT " (B4)", 0, BTN_CUSTOM_OCARINA_NOTE_B4);
|
||||
DrawButtonLine(ICON_FA_ARROW_UP " (D5)", 0, BTN_CUSTOM_OCARINA_NOTE_D5);
|
||||
|
||||
Ship::GuiWindow::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
|
||||
labelWidth = ImGui::CalcTextSize("D5").x + 10;
|
||||
DrawMapping(ocarinaD5, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaB4, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaA4, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaF4, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaD4, labelWidth, disableMask);
|
||||
ImGui::Dummy(ImVec2(0, 5));
|
||||
float cursorY = ImGui::GetCursorPosY();
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::BulletText("Disable song detection");
|
||||
DrawButtonLine(ICON_FA_BAN, 0, BTN_CUSTOM_OCARINA_DISABLE_SONGS);
|
||||
|
||||
TableHelper::NextCol();
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::BulletText("Pitch");
|
||||
DrawButtonLine(ICON_FA_ARROW_UP, 0, BTN_CUSTOM_OCARINA_PITCH_UP);
|
||||
DrawButtonLine(ICON_FA_ARROW_DOWN, 0, BTN_CUSTOM_OCARINA_PITCH_DOWN);
|
||||
|
||||
Ship::GuiWindow::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
|
||||
labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10;
|
||||
DrawMapping(ocarinaSongDisable, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaSharp, labelWidth, disableMask);
|
||||
DrawMapping(ocarinaFlat, labelWidth, disableMask);
|
||||
Ship::GuiWindow::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
|
||||
|
||||
ImGui::EndTable();
|
||||
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
} else {
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 5);
|
||||
ImGui::TextWrapped("To modify the main ocarina controls, select the \"Customize Ocarina Controls\" checkbox.");
|
||||
UIWidgets::Spacer(0);
|
||||
}
|
||||
|
||||
Ship::GuiWindow::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
|
||||
if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) {
|
||||
ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS);
|
||||
ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS);
|
||||
TableHelper::InitHeader(false);
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 5);
|
||||
UIWidgets::EnhancementCheckbox("Play with D-pad", CVAR_SETTING("OcarinaControl.Dpad"));
|
||||
TableHelper::NextCol();
|
||||
UIWidgets::EnhancementCheckbox("Play with camera stick", CVAR_SETTING("OcarinaControl.RStick"));
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawCameraControlPanel() {
|
||||
@ -1673,48 +1630,21 @@ void SohInputEditorWindow::DrawDpadControlPanel() {
|
||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||
Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", CVAR_SETTING("DPadOnPause"));
|
||||
UIWidgets::Tooltip("Navigate Pause with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate\n"
|
||||
"To make the cursor only move a single space no matter how long a direction is held, manually set gSettings.DpadHoldChange to 0");
|
||||
UIWidgets::Tooltip("Navigate Pause with the D-pad\nIf used with \"D-pad as Equip Items\", you must hold C-Up to equip instead of navigate");
|
||||
UIWidgets::PaddedEnhancementCheckbox("D-pad Support in Text Boxes", CVAR_SETTING("DpadInText"));
|
||||
UIWidgets::Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry screens with the D-pad\n"
|
||||
"To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gSettings.DpadHoldChange to 0");
|
||||
UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", CVAR_SETTING("DpadEquips"));
|
||||
UIWidgets::Tooltip("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate");
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
UIWidgets::Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry screens with the D-pad");
|
||||
|
||||
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
|
||||
void SohInputEditorWindow::DrawMiscControlPanel() {
|
||||
ImVec2 cursor = ImGui::GetCursorPos();
|
||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||
Ship::GuiWindow::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedText("Allow the cursor to be on any slot");
|
||||
static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" };
|
||||
UIWidgets::EnhancementCombobox(CVAR_SETTING("PauseAnyCursor"), cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY);
|
||||
UIWidgets::Tooltip("Allows the cursor on the pause menu to be over any slot. Sometimes required in rando to select "
|
||||
"certain items.");
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
||||
UIWidgets::PaddedEnhancementCheckbox("Enable speed modifiers", CVAR_SETTING("WalkModifier.Enabled"), true, false);
|
||||
UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed");
|
||||
if (CVarGetInteger(CVAR_SETTING("WalkModifier.Enabled"), 0)) {
|
||||
UIWidgets::Spacer(5);
|
||||
Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", CVAR_SETTING("WalkModifier.SpeedToggle"), true, false);
|
||||
Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity", CVAR_SETTING("WalkModifier.DoesntChangeJump"), true, false);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1", CVAR_SETTING("WalkModifier.Mapping1"), 0.0f, 5.0f, "", 1.0f, true, true, false, true);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2", CVAR_SETTING("WalkModifier.Mapping2"), 0.0f, 5.0f, "", 1.0f, true, true, false, true);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1", CVAR_SETTING("WalkModifier.SwimMapping1"), 0.0f, 5.0f, "", 1.0f, true, true, false, true);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2", CVAR_SETTING("WalkModifier.SwimMapping2"), 0.0f, 5.0f, "", 1.0f, true, true, false, true);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
}
|
||||
UIWidgets::PaddedEnhancementCheckbox("D-pad hold change", CVAR_SETTING("DpadHoldChange"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
|
||||
UIWidgets::Tooltip("The cursor will only move a single space no matter how long a D-pad direction is held");
|
||||
|
||||
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
|
||||
ImGui::EndDisabled();
|
||||
UIWidgets::Spacer(0);
|
||||
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", CVAR_SETTING("NaviOnL"));
|
||||
UIWidgets::Tooltip("Speak to Navi with L but enter first-person camera with C-Up");
|
||||
}
|
||||
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
}
|
||||
|
||||
@ -1862,20 +1792,47 @@ void SohInputEditorWindow::DrawLinkTab() {
|
||||
|
||||
if (ImGui::CollapsingHeader("Modifier Buttons")) {
|
||||
DrawButtonDeviceIcons(portIndex, mModifierButtonsBitmasks);
|
||||
DrawButtonLine("M1", portIndex, BTN_MODIFIER1);
|
||||
DrawButtonLine("M2", portIndex, BTN_MODIFIER2);
|
||||
DrawButtonLine("M1", portIndex, BTN_CUSTOM_MODIFIER1);
|
||||
DrawButtonLine("M2", portIndex, BTN_CUSTOM_MODIFIER2);
|
||||
|
||||
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
||||
UIWidgets::PaddedEnhancementCheckbox("Enable speed modifiers", CVAR_SETTING("WalkModifier.Enabled"), true, false);
|
||||
UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed");
|
||||
if (CVarGetInteger(CVAR_SETTING("WalkModifier.Enabled"), 0)) {
|
||||
UIWidgets::Spacer(5);
|
||||
Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding",
|
||||
CVAR_SETTING("WalkModifier.SpeedToggle"), true, false);
|
||||
Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity",
|
||||
CVAR_SETTING("WalkModifier.DoesntChangeJump"), true, false);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1",
|
||||
CVAR_SETTING("WalkModifier.Mapping1"), 0.0f, 5.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2",
|
||||
CVAR_SETTING("WalkModifier.Mapping2"), 0.0f, 5.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1",
|
||||
CVAR_SETTING("WalkModifier.SwimMapping1"), 0.0f, 5.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2",
|
||||
CVAR_SETTING("WalkModifier.SwimMapping2"), 0.0f, 5.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
} else {
|
||||
DrawButtonDeviceIcons(portIndex, mModifierButtonsBitmasks);
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Ocarina Controls")) {
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
DrawButtonDeviceIcons(portIndex, mCustomOcarinaButtonsBitmasks);
|
||||
DrawOcarinaControlPanel();
|
||||
ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.133f, 0.133f, 0.133f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
} else {
|
||||
DrawButtonDeviceIcons(portIndex, mCustomOcarinaButtonsBitmasks);
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Camera Controls")) {
|
||||
@ -1898,16 +1855,6 @@ void SohInputEditorWindow::DrawLinkTab() {
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Miscellaneous Controls")) {
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
DrawMiscControlPanel();
|
||||
ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.133f, 0.133f, 0.133f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleColor();
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <set>
|
||||
#include <list>
|
||||
|
||||
typedef uint32_t N64ButtonMask;
|
||||
typedef CONTROLLERBUTTONS_T N64ButtonMask;
|
||||
|
||||
typedef struct {
|
||||
const char* label;
|
||||
@ -40,9 +40,9 @@ class SohInputEditorWindow : public Ship::GuiWindow {
|
||||
private:
|
||||
void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, Ship::Direction direction,
|
||||
ImVec4 color);
|
||||
void DrawButtonLine(const char* buttonName, uint8_t port, uint16_t bitmask, ImVec4 color);
|
||||
void DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id);
|
||||
void DrawButtonLineAddMappingButton(uint8_t port, uint16_t bitmask);
|
||||
void DrawButtonLine(const char* buttonName, uint8_t port, N64ButtonMask bitmask, ImVec4 color);
|
||||
void DrawButtonLineEditMappingButton(uint8_t port, N64ButtonMask bitmask, std::string id);
|
||||
void DrawButtonLineAddMappingButton(uint8_t port, N64ButtonMask bitmask);
|
||||
|
||||
void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction, std::string id);
|
||||
void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction);
|
||||
@ -69,7 +69,6 @@ class SohInputEditorWindow : public Ship::GuiWindow {
|
||||
void DrawOcarinaControlPanel();
|
||||
void DrawCameraControlPanel();
|
||||
void DrawDpadControlPanel();
|
||||
void DrawMiscControlPanel();
|
||||
|
||||
int32_t mGameInputBlockTimer;
|
||||
int32_t mMappingInputBlockTimer;
|
||||
@ -77,7 +76,7 @@ class SohInputEditorWindow : public Ship::GuiWindow {
|
||||
std::shared_ptr<Ship::ControllerRumbleMapping> mRumbleMappingToTest;
|
||||
|
||||
// mBitmaskToMappingIds[port][bitmask] = { id0, id1, ... }
|
||||
std::unordered_map<uint8_t, std::unordered_map<uint16_t, std::vector<std::string>>> mBitmaskToMappingIds;
|
||||
std::unordered_map<uint8_t, std::unordered_map<N64ButtonMask, std::vector<std::string>>> mBitmaskToMappingIds;
|
||||
|
||||
// mStickDirectionToMappingIds[port][stick][direction] = { id0, id1, ... }
|
||||
std::unordered_map<uint8_t,
|
||||
@ -92,10 +91,11 @@ class SohInputEditorWindow : public Ship::GuiWindow {
|
||||
void DrawLinkTab();
|
||||
void DrawIvanTab();
|
||||
void DrawDebugPortTab(uint8_t portIndex, std::string customName = "");
|
||||
std::set<uint16_t> mButtonsBitmasks;
|
||||
std::set<uint16_t> mDpadBitmasks;
|
||||
std::set<uint16_t> mModifierButtonsBitmasks;
|
||||
void DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks);
|
||||
std::set<N64ButtonMask> mButtonsBitmasks;
|
||||
std::set<N64ButtonMask> mDpadBitmasks;
|
||||
std::set<N64ButtonMask> mModifierButtonsBitmasks;
|
||||
std::set<N64ButtonMask> mCustomOcarinaButtonsBitmasks;
|
||||
void DrawButtonDeviceIcons(uint8_t portIndex, std::set<N64ButtonMask> bitmasks);
|
||||
void DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick);
|
||||
void DrawRumbleDeviceIcons(uint8_t portIndex);
|
||||
void DrawGyroDeviceIcons(uint8_t portIndex);
|
||||
|
@ -1277,7 +1277,7 @@ void Draw_Placements(){
|
||||
C_Button_Dropdown("C Button Down position", "tablecdbtn", "C Button Down settings", "C Button Down", CVAR_COSMETIC("HUD.CDownButton"), CVAR_COSMETIC("HUD.CDownButton.PosType"), 0.87f);
|
||||
C_Button_Dropdown("C Button Left position", "tableclbtn", "C Button Left settings", "C Button Left", CVAR_COSMETIC("HUD.CLeftButton"), CVAR_COSMETIC("HUD.CLeftButton.PosType"), 0.87f);
|
||||
C_Button_Dropdown("C Button Right position", "tablecrbtn", "C Button Right settings", "C Button Right", CVAR_COSMETIC("HUD.CRightButton"), CVAR_COSMETIC("HUD.CRightButton.PosType"), 0.87f);
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"),0) && ImGui::CollapsingHeader("DPad items position")) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) && ImGui::CollapsingHeader("DPad items position")) {
|
||||
if (ImGui::BeginTable("tabledpaditems", 1, FlagsTable)) {
|
||||
ImGui::TableSetupColumn("DPad items settings", FlagsCell, TablesCellsWidth);
|
||||
Table_InitHeader(false);
|
||||
|
@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ConnectorLib.SimpleTCP;
|
||||
using CrowdControl.Common;
|
||||
using ConnectorType = CrowdControl.Common.ConnectorType;
|
||||
|
||||
namespace CrowdControl.Games.Packs;
|
||||
namespace CrowdControl.Games.Packs.ShipOfHarkinian;
|
||||
|
||||
public class ShipOfHarkinian : SimpleTCPPack
|
||||
public class ShipOfHarkinian : SimpleTCPPack<SimpleTCPServerConnector>
|
||||
{
|
||||
public override string Host => "127.0.0.1";
|
||||
|
||||
@ -19,9 +18,8 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
|
||||
public override Game Game { get; } = new("Ship of Harkinian", "ShipOfHarkinian", "PC", ConnectorType.SimpleTCPServerConnector);
|
||||
|
||||
public override EffectList Effects => new List<Effect>
|
||||
public override EffectList Effects { get; } = new List<Effect>
|
||||
{
|
||||
|
||||
// Spawn Enemies and Objects
|
||||
new("Cucco Storm", "spawn_cucco_storm") { Category = "Spawn Enemies/Objects", Price = 35, Description = "Spawns an angry cucco that summons his friends to attack the poor streamer." },
|
||||
new("Lit Bomb", "spawn_lit_bomb") { Category = "Spawn Enemies/Objects", Price = 15, Description = "Spawns a bomb that is already lit." },
|
||||
@ -39,7 +37,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Wolfos", "spawn_wolfos") { Category = "Spawn Enemies/Objects", Price = 15, Description = "Awooooooo" },
|
||||
new("Wallmaster", "spawn_wallmaster") { Category = "Spawn Enemies/Objects", Price = 30, Description = "Need a hand? Try it together with electrocuting Link." },
|
||||
|
||||
|
||||
// Link Modifiers
|
||||
new("Take Half Damage", "take_half_damage") { Category = "Link Modifiers", Duration = 30, Price = 20, Description = "Halves the damage Link takes. Won't save the streamer if they're bad at the game though." },
|
||||
new("Take Double Damage", "take_double_damage") { Category = "Link Modifiers", Duration = 30, Price = 30, Description = "Doubles the damage Link takes. Turns OoT into Dark Souls.. kinda." },
|
||||
@ -56,7 +53,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Random Wind", "random_wind") { Category = "Link Modifiers", Duration = 30, Price = 30, Description = "A wind blows, which changes to a random direction every 5 seconds." },
|
||||
new("Random Bonks When Rolling", "random_bonks") { Category = "Link Modifiers", Duration = 60, Price = 15, Description = "Why do I keep bonking while there's nothing here!?" },
|
||||
|
||||
|
||||
// Hurt or Heal Link
|
||||
new("Empty Heart", "empty_heart") { Category = "Hurt/Heal Link", Quantity = 20, Price = 10, Description = "Damage Link for however many hearts you choose." },
|
||||
new("Fill Heart", "fill_heart") { Category = "Hurt/Heal Link", Quantity = 20, Price = 5, Description = "Heal Link for however many hearts you choose." },
|
||||
@ -68,7 +64,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Electrocute Link", "electrocute_link") { Category = "Hurt/Heal Link", Price = 20, Description = "Ganon used Thundershock!" },
|
||||
new("Kill Link", "kill_link") { Category = "Hurt/Heal Link", Price = 150, Description = "Rest in RIP." },
|
||||
|
||||
|
||||
// Give Items and Consumables
|
||||
new("Add Heart Container", "add_heart_container") { Category = "Give Items/Consumables", Price = 25, Description = "The limit is 20 heart containers." },
|
||||
new("Fill Magic", "fill_magic") { Category = "Give Items/Consumables", Price = 20, Description = "Fills the entire magic bar. Abra-kadabra." },
|
||||
@ -82,7 +77,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Refill Arrows", "refill_arrows") { Category = "Give Items/Consumables", Price = 1, Description = "Only works when the player already has a bow." },
|
||||
new("Refill Bombchus", "refill_bombchus") { Category = "Give Items/Consumables", Quantity = 30, Price = 5, Description = "Only works when the player already had Bombchus before." },
|
||||
|
||||
|
||||
// Take Items and Consumables
|
||||
new("Remove Heart Container", "remove_heart_container") { Category = "Take Items/Consumables", Price = 35, Description = "The limit is 1 heart. But you wouldn't go that far, would you?" },
|
||||
new("Empty Magic", "empty_magic") { Category = "Take Items/Consumables", Price = 25, Description = "Empties the entire magic bar. They didn't need it anyway." },
|
||||
@ -96,7 +90,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Take Arrows", "take_arrows") { Category = "Take Items/Consumables", Quantity = 30, Price = 2, Description = "*ploink*" },
|
||||
new("Take Bombchus", "take_bombchus") { Category = "Take Items/Consumables", Quantity = 30, Price = 10, Description = "Hopefully they still have some regular bombs." },
|
||||
|
||||
|
||||
// Link Size Modifiers
|
||||
new("Giant Lonk", "giant_link") { Category = "Change Link's Size", Duration = 30, Price = 20, Description = "Big Lonk equals big sword." },
|
||||
new("Minish Link", "minish_link") { Category = "Change Link's Size", Duration = 30, Price = 20, Description = "They say size doesn't matter." },
|
||||
@ -104,20 +97,17 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Squished Link", "squished_link") { Category = "Change Link's Size", Duration = 30, Price = 20, Description = "Drop an anvil on Link, but the anvil is invisible." },
|
||||
new("Invisible Link", "invisible_link") { Category = "Change Link's Size", Duration = 30, Price = 20, Description = "Now you see me, now you don't." },
|
||||
|
||||
|
||||
// Generic Effects
|
||||
new("Random Bomb Fuse Timer", "random_bomb_timer") { Category = "Generic Effects", Duration = 60, Price = 5, Description = "Sets the timer for new bombs to either super short, super long or something inbetween (does not work for bombchus)." },
|
||||
new("Set Time to Dawn", "set_time_to_dawn") { Category = "Generic Effects", Price = 25, Description = "Sets the time to early day. Might require an area reload to take effect." },
|
||||
new("Set Time to Dusk", "set_time_to_dusk") { Category = "Generic Effects", Price = 25, Description = "Sets the time to early night. Might require an area reload to take effect." },
|
||||
|
||||
|
||||
// Visual Effects
|
||||
new("No UI", "no_ui") { Category = "Visual Effects", Duration = 60, Price = 20, Description = "No need to see ammo counts. The cinematic experience." },
|
||||
new("Rainstorm", "rainstorm") { Category = "Visual Effects", Duration = 30, Price = 5, Description = "Summon a rainstorm for a sad moment." },
|
||||
new("Debug Mode", "debug_mode") { Category = "Visual Effects", Duration = 30, Price = 20, Description = "if (debug_mode) { ShowCollision(); }" },
|
||||
new("Randomize Cosmetics", "random_cosmetics") { Category = "Visual Effects", Price = 30, Description = "Randomize most cosmetics options. Cosmetics changed by bidding wars are unaffected." },
|
||||
|
||||
|
||||
// Controls
|
||||
new("No Z Button", "no_z_button") { Category = "Controls", Duration = 30, Price = 20, Description = "No sidehops, no backflips, no jump attacks, no camera adjustments." },
|
||||
new("Reverse Controls", "reverse_controls") { Category = "Controls", Duration = 60, Price = 25, Description = "Just hold the controller upside down." },
|
||||
@ -126,7 +116,6 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Clear C-Buttons", "clear_cbuttons") { Category = "Controls", Price = 10, Description = "Clear the assigned items from the C-buttons." },
|
||||
new("Clear D-pad", "clear_dpad") { Category = "Controls", Price = 10, Description = "Clear the assigned items from the D-pad." },
|
||||
|
||||
|
||||
// Teleport Player
|
||||
new("Link's House", "tp_links_house") { Category = "Teleport Player", Price = 100, Description = "Teleport the player to Link's House. Welcome Home!" },
|
||||
new("Minuet Destination", "tp_minuet") { Category = "Teleport Player", Price = 100, Description = "Teleport the player to Sacred Forest Meadow." },
|
||||
@ -136,52 +125,49 @@ public class ShipOfHarkinian : SimpleTCPPack
|
||||
new("Nocturne Destination", "tp_nocturne") { Category = "Teleport Player", Price = 100, Description = "Teleport the player to the Raveyard." },
|
||||
new("Prelude Destination", "tp_prelude") { Category = "Teleport Player", Price = 100, Description = "Teleport the player to the Temple of Time." },
|
||||
|
||||
|
||||
// Tunic Color (Bidding War)
|
||||
new("Tunic Color", "tunic", ItemKind.BidWar)
|
||||
{
|
||||
Parameters = new ParameterDef("Color", "color_tunic_param",
|
||||
new("Red", "red"),
|
||||
new("Green", "green"),
|
||||
new("Blue", "blue"),
|
||||
new("Orange", "orange"),
|
||||
new("Yellow", "yellow"),
|
||||
new("Purple", "purple"),
|
||||
new("Pink", "pink"),
|
||||
new("Brown", "brown"),
|
||||
new("Black", "black"))
|
||||
new Parameter("Red", "red"),
|
||||
new Parameter("Green", "green"),
|
||||
new Parameter("Blue", "blue"),
|
||||
new Parameter("Orange", "orange"),
|
||||
new Parameter("Yellow", "yellow"),
|
||||
new Parameter("Purple", "purple"),
|
||||
new Parameter("Pink", "pink"),
|
||||
new Parameter("Brown", "brown"),
|
||||
new Parameter("Black", "black"))
|
||||
},
|
||||
|
||||
|
||||
// Navi Color (Bidding War)
|
||||
new("Navi Color", "navi", ItemKind.BidWar)
|
||||
{
|
||||
Parameters = new ParameterDef("Color", "color_navi_param",
|
||||
new("Red", "red"),
|
||||
new("Green", "green"),
|
||||
new("Blue", "blue"),
|
||||
new("Orange", "orange"),
|
||||
new("Yellow", "yellow"),
|
||||
new("Purple", "purple"),
|
||||
new("Pink", "pink"),
|
||||
new("Brown", "brown"),
|
||||
new("Black", "black"))
|
||||
new Parameter("Red", "red"),
|
||||
new Parameter("Green", "green"),
|
||||
new Parameter("Blue", "blue"),
|
||||
new Parameter("Orange", "orange"),
|
||||
new Parameter("Yellow", "yellow"),
|
||||
new Parameter("Purple", "purple"),
|
||||
new Parameter("Pink", "pink"),
|
||||
new Parameter("Brown", "brown"),
|
||||
new Parameter("Black", "black"))
|
||||
},
|
||||
|
||||
|
||||
// Link's Hair Color (Bidding War)
|
||||
new("Link's Hair Color", "hair", ItemKind.BidWar)
|
||||
{
|
||||
Parameters = new ParameterDef("Color", "color_hair_param",
|
||||
new("Red", "red"),
|
||||
new("Green", "green"),
|
||||
new("Blue", "blue"),
|
||||
new("Orange", "orange"),
|
||||
new("Yellow", "yellow"),
|
||||
new("Purple", "purple"),
|
||||
new("Pink", "pink"),
|
||||
new("Brown", "brown"),
|
||||
new("Black", "black"))
|
||||
new Parameter("Red", "red"),
|
||||
new Parameter("Green", "green"),
|
||||
new Parameter("Blue", "blue"),
|
||||
new Parameter("Orange", "orange"),
|
||||
new Parameter("Yellow", "yellow"),
|
||||
new Parameter("Purple", "purple"),
|
||||
new Parameter("Pink", "pink"),
|
||||
new Parameter("Brown", "brown"),
|
||||
new Parameter("Black", "black"))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "debugSaveEditor.h"
|
||||
#include "../../util.h"
|
||||
#include "../../ImGuiUtils.h"
|
||||
#include "../../OTRGlobals.h"
|
||||
#include "../../UIWidgets.hpp"
|
||||
|
||||
@ -25,130 +26,6 @@ extern PlayState* gPlayState;
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
std::string texturePath;
|
||||
} ItemMapEntry;
|
||||
|
||||
#define ITEM_MAP_ENTRY(id) \
|
||||
{ \
|
||||
id, { \
|
||||
id, #id, #id "_Faded", static_cast<char*>(gItemIcons[id]) \
|
||||
} \
|
||||
}
|
||||
|
||||
// Maps items ids to info for use in ImGui
|
||||
std::map<uint32_t, ItemMapEntry> itemMapping = {
|
||||
ITEM_MAP_ENTRY(ITEM_STICK),
|
||||
ITEM_MAP_ENTRY(ITEM_NUT),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_DINS_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_SLINGSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_OCARINA_FAIRY),
|
||||
ITEM_MAP_ENTRY(ITEM_OCARINA_TIME),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMBCHU),
|
||||
ITEM_MAP_ENTRY(ITEM_HOOKSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_LONGSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_ICE),
|
||||
ITEM_MAP_ENTRY(ITEM_FARORES_WIND),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOMERANG),
|
||||
ITEM_MAP_ENTRY(ITEM_LENS),
|
||||
ITEM_MAP_ENTRY(ITEM_BEAN),
|
||||
ITEM_MAP_ENTRY(ITEM_HAMMER),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_LIGHT),
|
||||
ITEM_MAP_ENTRY(ITEM_NAYRUS_LOVE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOTTLE),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_RED),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_GREEN),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_BLUE),
|
||||
ITEM_MAP_ENTRY(ITEM_FAIRY),
|
||||
ITEM_MAP_ENTRY(ITEM_FISH),
|
||||
ITEM_MAP_ENTRY(ITEM_MILK_BOTTLE),
|
||||
ITEM_MAP_ENTRY(ITEM_LETTER_RUTO),
|
||||
ITEM_MAP_ENTRY(ITEM_BLUE_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_BUG),
|
||||
ITEM_MAP_ENTRY(ITEM_BIG_POE),
|
||||
ITEM_MAP_ENTRY(ITEM_MILK_HALF),
|
||||
ITEM_MAP_ENTRY(ITEM_POE),
|
||||
ITEM_MAP_ENTRY(ITEM_WEIRD_EGG),
|
||||
ITEM_MAP_ENTRY(ITEM_CHICKEN),
|
||||
ITEM_MAP_ENTRY(ITEM_LETTER_ZELDA),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_KEATON),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_SKULL),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_SPOOKY),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_BUNNY),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_GORON),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_ZORA),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_GERUDO),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_TRUTH),
|
||||
ITEM_MAP_ENTRY(ITEM_SOLD_OUT),
|
||||
ITEM_MAP_ENTRY(ITEM_POCKET_EGG),
|
||||
ITEM_MAP_ENTRY(ITEM_POCKET_CUCCO),
|
||||
ITEM_MAP_ENTRY(ITEM_COJIRO),
|
||||
ITEM_MAP_ENTRY(ITEM_ODD_MUSHROOM),
|
||||
ITEM_MAP_ENTRY(ITEM_ODD_POTION),
|
||||
ITEM_MAP_ENTRY(ITEM_SAW),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_BROKEN),
|
||||
ITEM_MAP_ENTRY(ITEM_PRESCRIPTION),
|
||||
ITEM_MAP_ENTRY(ITEM_FROG),
|
||||
ITEM_MAP_ENTRY(ITEM_EYEDROPS),
|
||||
ITEM_MAP_ENTRY(ITEM_CLAIM_CHECK),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_ICE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_LIGHT),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_MASTER),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_BGS),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_DEKU),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_HYLIAN),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_MIRROR),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_GORON),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_ZORA),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_IRON),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_HOVER),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_30),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_40),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_50),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_30),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_40),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_50),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_20),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_30),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_40),
|
||||
ITEM_MAP_ENTRY(ITEM_BRACELET),
|
||||
ITEM_MAP_ENTRY(ITEM_GAUNTLETS_SILVER),
|
||||
ITEM_MAP_ENTRY(ITEM_GAUNTLETS_GOLD),
|
||||
ITEM_MAP_ENTRY(ITEM_SCALE_SILVER),
|
||||
ITEM_MAP_ENTRY(ITEM_SCALE_GOLDEN),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_KNIFE),
|
||||
ITEM_MAP_ENTRY(ITEM_WALLET_ADULT),
|
||||
ITEM_MAP_ENTRY(ITEM_WALLET_GIANT),
|
||||
ITEM_MAP_ENTRY(ITEM_SEEDS),
|
||||
ITEM_MAP_ENTRY(ITEM_FISHING_POLE),
|
||||
ITEM_MAP_ENTRY(ITEM_KEY_BOSS),
|
||||
ITEM_MAP_ENTRY(ITEM_COMPASS),
|
||||
ITEM_MAP_ENTRY(ITEM_DUNGEON_MAP),
|
||||
ITEM_MAP_ENTRY(ITEM_KEY_SMALL),
|
||||
ITEM_MAP_ENTRY(ITEM_HEART_CONTAINER),
|
||||
ITEM_MAP_ENTRY(ITEM_HEART_PIECE),
|
||||
ITEM_MAP_ENTRY(ITEM_MAGIC_SMALL),
|
||||
ITEM_MAP_ENTRY(ITEM_MAGIC_LARGE)
|
||||
};
|
||||
|
||||
std::map<uint32_t, ItemMapEntry> gregMapping = {
|
||||
{ITEM_RUPEE_GREEN, {ITEM_RUPEE_GREEN, "ITEM_RUPEE_GREEN", "ITEM_RUPEE_GREEN_Faded", gRupeeCounterIconTex}}
|
||||
};
|
||||
|
||||
std::map<uint32_t, ItemMapEntry> triforcePieceMapping = {
|
||||
{RG_TRIFORCE_PIECE, {RG_TRIFORCE_PIECE, "RG_TRIFORCE_PIECE", "RG_TRIFORCE_PIECE_Faded", gTriforcePieceTex}}
|
||||
};
|
||||
|
||||
// Maps entries in the GS flag array to the area name it represents
|
||||
std::vector<std::string> gsMapping = {
|
||||
"Deku Tree",
|
||||
@ -186,85 +63,6 @@ u8 gAllAmmoItems[] = {
|
||||
ITEM_BOOMERANG, ITEM_LENS, ITEM_BEAN, ITEM_HAMMER,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
std::string texturePath;
|
||||
} QuestMapEntry;
|
||||
|
||||
#define QUEST_MAP_ENTRY(id, tex) \
|
||||
{ \
|
||||
id, { \
|
||||
id, #id, #id "_Faded", tex \
|
||||
} \
|
||||
}
|
||||
|
||||
// Maps quest items ids to info for use in ImGui
|
||||
std::map<uint32_t, QuestMapEntry> questMapping = {
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_FOREST, dgQuestIconMedallionForestTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_FIRE, dgQuestIconMedallionFireTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_WATER, dgQuestIconMedallionWaterTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_SPIRIT, dgQuestIconMedallionSpiritTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_SHADOW, dgQuestIconMedallionShadowTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_LIGHT, dgQuestIconMedallionLightTex),
|
||||
QUEST_MAP_ENTRY(QUEST_KOKIRI_EMERALD, dgQuestIconKokiriEmeraldTex),
|
||||
QUEST_MAP_ENTRY(QUEST_GORON_RUBY, dgQuestIconGoronRubyTex),
|
||||
QUEST_MAP_ENTRY(QUEST_ZORA_SAPPHIRE, dgQuestIconZoraSapphireTex),
|
||||
QUEST_MAP_ENTRY(QUEST_STONE_OF_AGONY, dgQuestIconStoneOfAgonyTex),
|
||||
QUEST_MAP_ENTRY(QUEST_GERUDO_CARD, dgQuestIconGerudosCardTex),
|
||||
QUEST_MAP_ENTRY(QUEST_SKULL_TOKEN, dgQuestIconGoldSkulltulaTex),
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
ImVec4 color;
|
||||
} SongMapEntry;
|
||||
|
||||
#define SONG_MAP_ENTRY(id, r, g, b) \
|
||||
{ \
|
||||
id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \
|
||||
}
|
||||
|
||||
// Maps song ids to info for use in ImGui
|
||||
std::array<SongMapEntry, 12> songMapping = { {
|
||||
SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 224, 107, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 195, 60),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SARIA, 127, 255, 137),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SUN, 255, 255, 60),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_TIME, 119, 236, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_STORMS, 165, 165, 165),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_MINUET, 150, 255, 100),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_BOLERO, 255, 80, 40),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SERENADE, 100, 150, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100),
|
||||
} };
|
||||
|
||||
#define VANILLA_SONG_MAP_ENTRY(id, r, g, b) \
|
||||
{ \
|
||||
id, #id "_Vanilla", #id "_Vanilla_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \
|
||||
}
|
||||
|
||||
// Maps song ids to info for use in ImGui
|
||||
std::array<SongMapEntry, 12> vanillaSongMapping = { {
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SARIA, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SUN, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_TIME, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_STORMS, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_MINUET, 150, 255, 100),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_BOLERO, 255, 80, 40),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SERENADE, 100, 150, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100),
|
||||
} };
|
||||
|
||||
// Encapsulates what is drawn by the passed-in function within a border
|
||||
template<typename T>
|
||||
void DrawGroupWithBorder(T&& drawFunc) {
|
||||
@ -1735,7 +1533,7 @@ void DrawPlayerTab() {
|
||||
ImGui::SameLine();
|
||||
ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL);
|
||||
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0)) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0)) {
|
||||
ImGui::NewLine();
|
||||
ImGui::Text("Current D-pad Equips");
|
||||
ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working
|
||||
@ -1812,37 +1610,4 @@ void SaveEditorWindow::DrawElement() {
|
||||
}
|
||||
}
|
||||
|
||||
void SaveEditorWindow::InitElement() {
|
||||
// Load item icons into ImGui
|
||||
for (const auto& entry : itemMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
for (const auto& entry : gregMapping) {
|
||||
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
|
||||
ImVec4 gregFadedGreen = gregGreen;
|
||||
gregFadedGreen.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen);
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
|
||||
}
|
||||
for (const auto& entry : triforcePieceMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
for (const auto& entry : questMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
for (const auto& entry : songMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
for (const auto& entry : vanillaSongMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
}
|
||||
void SaveEditorWindow::InitElement() {}
|
||||
|
@ -770,6 +770,13 @@ void UpdatePatchHand() {
|
||||
ResourceMgr_UnpatchGfxByName(gLinkChildLeftFistAndBoomerangNearDL, "adultBoomerang");
|
||||
ResourceMgr_UnpatchGfxByName(gLinkChildRightFistAndDekuShieldNearDL, "adultDekuShield");
|
||||
}
|
||||
if (CVarGetInteger("gEnhancements.FixHammerHand", 0) && LINK_IS_ADULT) {
|
||||
ResourceMgr_PatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "hammerHand1", 92, gsSPDisplayListOTRFilePath(gLinkAdultLeftHandClosedNearDL));
|
||||
ResourceMgr_PatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "hammerHand2", 93, gsSPEndDisplayList());
|
||||
} else {
|
||||
ResourceMgr_UnpatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "hammerHand1");
|
||||
ResourceMgr_UnpatchGfxByName(gLinkAdultLeftHandHoldingHammerNearDL, "hammerHand2");
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPatchHandHandler() {
|
||||
|
@ -65,10 +65,10 @@ const std::vector<const char*> enhancementsCvars = {
|
||||
CVAR_SETTING("DpadInText"),
|
||||
CVAR_SETTING("OcarinaControl.Dpad"),
|
||||
CVAR_SETTING("OcarinaControl.RStick"),
|
||||
CVAR_SETTING("DpadEquips"),
|
||||
CVAR_SETTING("PauseAnyCursor"),
|
||||
CVAR_ENHANCEMENT("DpadEquips"),
|
||||
CVAR_ENHANCEMENT("PauseAnyCursor"),
|
||||
CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"),
|
||||
CVAR_SETTING("NaviOnL"),
|
||||
CVAR_ENHANCEMENT("NaviOnL"),
|
||||
CVAR_SETTING("FreeLook.InvertXAxis"),
|
||||
CVAR_SETTING("FreeLook.InvertYAxis"),
|
||||
CVAR_SETTING("Controls.RightStickAim"),
|
||||
@ -551,7 +551,7 @@ const std::vector<PresetEntry> vanillaPlusPresetEntries = {
|
||||
// Play Ocarina with Right Stick
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1),
|
||||
// D-pad as Equip Items
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("DpadEquips"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
|
||||
// Prevent Dropped Ocarina Inputs
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
|
||||
// Right Stick Aiming
|
||||
@ -622,7 +622,7 @@ const std::vector<PresetEntry> enhancedPresetEntries = {
|
||||
// Play Ocarina with Right Stick
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1),
|
||||
// D-pad as Equip Items
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("DpadEquips"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
|
||||
// Prevent Dropped Ocarina Inputs
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
|
||||
// Right Stick Aiming
|
||||
@ -754,7 +754,7 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
|
||||
// Play Ocarina with Right Stick
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1),
|
||||
// D-pad as Equip Items
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("DpadEquips"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
|
||||
// Prevent Dropped Ocarina Inputs
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
|
||||
// Right Stick Aiming
|
||||
@ -925,7 +925,7 @@ const std::vector<PresetEntry> spockRacePresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("DpadInText"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.Dpad"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("OcarinaControl.RStick"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("DpadEquips"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1),
|
||||
@ -941,7 +941,7 @@ const std::vector<PresetEntry> spockRacePresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("PauseAnyCursor"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseAnyCursor"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1),
|
||||
@ -1037,7 +1037,7 @@ const std::vector<PresetEntry> spockRaceNoLogicPresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_SETTING("PauseAnyCursor"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseAnyCursor"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1),
|
||||
|
@ -127,7 +127,6 @@ void Context::AddLocations(const Container& locations, std::vector<RandomizerChe
|
||||
|
||||
void Context::GenerateLocationPool() {
|
||||
allLocations.clear();
|
||||
//AddLocation(RC_LINKS_POCKET); this is being added twice now
|
||||
if (mSettings->GetOption(RSK_TRIFORCE_HUNT)) {
|
||||
AddLocation(RC_TRIFORCE_COMPLETED);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ const std::string& Rando::Location::GetShortName() const {
|
||||
|
||||
bool Rando::Location::IsDungeon() const {
|
||||
return (checkType != RCTYPE_SKULL_TOKEN &&
|
||||
(scene < SCENE_GANONS_TOWER_COLLAPSE_INTERIOR ||
|
||||
(scene < SCENE_THIEVES_HIDEOUT || scene == SCENE_INSIDE_GANONS_CASTLE ||
|
||||
(scene > SCENE_TREASURE_BOX_SHOP && scene < SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR))) ||
|
||||
(checkType == RCTYPE_SKULL_TOKEN && scene < SCENE_GANONS_TOWER);
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ class SpoilerCollectionCheck {
|
||||
|
||||
class Location {
|
||||
public:
|
||||
//RANDOTODO fix wacky ordering
|
||||
Location() : rc(RC_UNKNOWN_CHECK), quest(RCQUEST_BOTH), checkType(RCTYPE_STANDARD), area(RCAREA_INVALID), actorId(ACTOR_ID_MAX), scene(SCENE_ID_MAX), actorParams(0),
|
||||
hintKey(RHT_NONE), vanillaItem(RG_NONE), isVanillaCompletion(false), collectionCheck(SpoilerCollectionCheck()) {}
|
||||
|
||||
|
@ -131,7 +131,7 @@ std::vector<RandomizerCheck> Rando::StaticData::GetDungeonLocations() {
|
||||
return overworldLocations;
|
||||
}
|
||||
|
||||
void Rando::StaticData::InitLocationTable() { // Randomizer Check Quest Type Area Actor ID Scene ID Params Flags Short Name Hint Text Key Vanilla Item Spoiler Collection Check Collection Check Group Vanilla Progression
|
||||
void Rando::StaticData::InitLocationTable() { // Randomizer Check Quest Type Area Actor ID Scene ID Params Flags Short Name Hint Text Key Vanilla Item Spoiler Collection Check Vanilla Progression Price
|
||||
// clang-format off
|
||||
locationTable[RC_UNKNOWN_CHECK] = Location::Base(RC_UNKNOWN_CHECK, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_INVALID, ACTOR_ID_MAX, SCENE_ID_MAX, 0x00, "Invalid Location", "Invalid Location", RHT_NONE, RG_NONE);
|
||||
// Kokiri Forest
|
||||
@ -197,7 +197,7 @@ void Rando::StaticData::InitLocationTable() { //
|
||||
locationTable[RC_GF_SOUTH_F2_CARPENTER] = Location::Collectable(RC_GF_SOUTH_F2_CARPENTER, RCQUEST_BOTH, RCTYPE_GF_KEY, ACTOR_EN_ITEM00, SCENE_THIEVES_HIDEOUT, 3857, 0x0F, "GF South F2 Carpenter", RHT_GF_SOUTH_F2_CARPENTER, RG_GERUDO_FORTRESS_SMALL_KEY, true);
|
||||
// Haunted Wasteland
|
||||
locationTable[RC_WASTELAND_CHEST] = Location::Chest(RC_WASTELAND_CHEST, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_WASTELAND, ACTOR_EN_BOX, SCENE_HAUNTED_WASTELAND, -30048, 0x00, "Chest", RHT_WASTELAND_CHEST, RG_PURPLE_RUPEE);
|
||||
locationTable[RC_WASTELAND_BOMBCHU_SALESMAN] = Location::Base(RC_WASTELAND_BOMBCHU_SALESMAN, RCQUEST_BOTH, RCTYPE_MERCHANT, RCAREA_WASTELAND, ACTOR_ID_MAX, SCENE_HAUNTED_WASTELAND, 0x00, "Carpet Salesman", RHT_WASTELAND_BOMBCHU_SALESMAN, RG_BUY_BOMBCHUS_10, SpoilerCollectionCheck::RandomizerInf(RAND_INF_MERCHANTS_CARPET_SALESMAN));
|
||||
locationTable[RC_WASTELAND_BOMBCHU_SALESMAN] = Location::Base(RC_WASTELAND_BOMBCHU_SALESMAN, RCQUEST_BOTH, RCTYPE_MERCHANT, RCAREA_WASTELAND, ACTOR_ID_MAX, SCENE_HAUNTED_WASTELAND, 0x00, "Carpet Salesman", RHT_WASTELAND_BOMBCHU_SALESMAN, RG_BUY_BOMBCHUS_10, SpoilerCollectionCheck::RandomizerInf(RAND_INF_MERCHANTS_CARPET_SALESMAN), false, 200);
|
||||
// Desert Colossus
|
||||
locationTable[RC_COLOSSUS_FREESTANDING_POH] = Location::Collectable(RC_COLOSSUS_FREESTANDING_POH, RCQUEST_BOTH, RCTYPE_STANDARD, ACTOR_EN_ITEM00, SCENE_DESERT_COLOSSUS, 3334, 0x0D, "Freestanding PoH", RHT_COLOSSUS_FREESTANDING_POH, RG_PIECE_OF_HEART, true);
|
||||
locationTable[RC_COLOSSUS_DEKU_SCRUB_GROTTO_REAR] = Location::Base(RC_COLOSSUS_DEKU_SCRUB_GROTTO_REAR, RCQUEST_BOTH, RCTYPE_SCRUB, RCAREA_DESERT_COLOSSUS, ACTOR_EN_DNS, SCENE_GROTTOS, TWO_ACTOR_PARAMS(0x07, 0xFD), "Deku Scrub Grotto Rear", RHT_COLOSSUS_DEKU_SCRUB_GROTTO_REAR, RG_BUY_RED_POTION_40, SpoilerCollectionCheck::RandomizerInf(RAND_INF_SCRUBS_PURCHASED_COLOSSUS_DEKU_SCRUB_GROTTO_REAR), false, 40);
|
||||
@ -911,7 +911,7 @@ void Rando::StaticData::InitLocationTable() { //
|
||||
7 5 1 3
|
||||
-------------------------------*/
|
||||
// Kokiri Forest
|
||||
locationTable[RC_KF_SHOP_ITEM_1] = Location::Base(RC_KF_SHOP_ITEM_1, RCQUEST_BOTH, RCTYPE_SHOP, ACTOR_EN_GIRLA, SCENE_KOKIRI_SHOP, 0x00, "Shop Item 1", RHT_KF_SHOP_ITEM_1, RG_BUY_DEKU_SHIELD, SpoilerCollectionCheck(), false, 40);
|
||||
locationTable[RC_KF_SHOP_ITEM_1] = Location::Base(RC_KF_SHOP_ITEM_1, RCQUEST_BOTH, RCTYPE_SHOP, ACTOR_EN_GIRLA, SCENE_KOKIRI_SHOP, 0x00, "Shop Item 1", RHT_KF_SHOP_ITEM_1, RG_BUY_DEKU_SHIELD, SpoilerCollectionCheck(), true, 40);
|
||||
locationTable[RC_KF_SHOP_ITEM_2] = Location::Base(RC_KF_SHOP_ITEM_2, RCQUEST_BOTH, RCTYPE_SHOP, ACTOR_EN_GIRLA, SCENE_KOKIRI_SHOP, 0x01, "Shop Item 2", RHT_KF_SHOP_ITEM_2, RG_BUY_DEKU_NUTS_5, SpoilerCollectionCheck(), false, 15);
|
||||
locationTable[RC_KF_SHOP_ITEM_3] = Location::Base(RC_KF_SHOP_ITEM_3, RCQUEST_BOTH, RCTYPE_SHOP, ACTOR_EN_GIRLA, SCENE_KOKIRI_SHOP, 0x02, "Shop Item 3", RHT_KF_SHOP_ITEM_3, RG_BUY_DEKU_NUTS_10, SpoilerCollectionCheck(), false, 30);
|
||||
locationTable[RC_KF_SHOP_ITEM_4] = Location::Base(RC_KF_SHOP_ITEM_4, RCQUEST_BOTH, RCTYPE_SHOP, ACTOR_EN_GIRLA, SCENE_KOKIRI_SHOP, 0x03, "Shop Item 4", RHT_KF_SHOP_ITEM_4, RG_BUY_DEKU_STICK_1, SpoilerCollectionCheck(), false, 10);
|
||||
|
@ -147,6 +147,15 @@ void UpdateInventoryChecks();
|
||||
void UpdateOrdering(RandomizerCheckArea);
|
||||
int sectionId;
|
||||
|
||||
bool hideUnchecked = false;
|
||||
bool hideScummed = false;
|
||||
bool hideSeen = false;
|
||||
bool hideSkipped = false;
|
||||
bool hideSaved = false;
|
||||
bool hideCollected = false;
|
||||
bool showHidden = true;
|
||||
bool mystery = false;
|
||||
bool showLogicTooltip = false;
|
||||
|
||||
SceneID DungeonSceneLookupByArea(RandomizerCheckArea area) {
|
||||
switch (area) {
|
||||
@ -638,6 +647,10 @@ void CheckTrackerItemReceive(GetItemEntry giEntry) {
|
||||
}
|
||||
|
||||
void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag) {
|
||||
if (IS_RANDO) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flagType != FLAG_SCENE_TREASURE && flagType != FLAG_SCENE_COLLECTIBLE) {
|
||||
return;
|
||||
}
|
||||
@ -659,6 +672,10 @@ void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag)
|
||||
}
|
||||
|
||||
void CheckTrackerFlagSet(int16_t flagType, int32_t flag) {
|
||||
if (IS_RANDO) {
|
||||
return;
|
||||
}
|
||||
|
||||
SpoilerCollectionCheckType checkMatchType = SpoilerCollectionCheckType::SPOILER_CHK_NONE;
|
||||
switch (flagType) {
|
||||
case FLAG_GS_TOKEN:
|
||||
@ -883,8 +900,6 @@ void CheckTrackerWindow::DrawElement() {
|
||||
return;
|
||||
}
|
||||
|
||||
RegionTable_Init();
|
||||
|
||||
ImGui::TableNextRow(0, headerHeight);
|
||||
ImGui::TableNextColumn();
|
||||
UIWidgets::EnhancementCheckbox(
|
||||
@ -933,7 +948,7 @@ void CheckTrackerWindow::DrawElement() {
|
||||
RainbowTick();
|
||||
bool doDraw = false;
|
||||
bool thisAreaFullyChecked = false;
|
||||
bool showHidden = CVarGetInteger(CVAR_TRACKER_CHECK("ShowHidden"), 0);
|
||||
bool mqSpoilers = CVarGetInteger(CVAR_TRACKER_CHECK("MQSpoilers"), 0);
|
||||
bool hideIncomplete = CVarGetInteger(CVAR_TRACKER_CHECK("AreaIncomplete.Hide"), 0);
|
||||
bool hideComplete = CVarGetInteger(CVAR_TRACKER_CHECK("AreaComplete.Hide"), 0);
|
||||
bool collapseLogic;
|
||||
@ -1000,7 +1015,7 @@ void CheckTrackerWindow::DrawElement() {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(extraColor.r / 255.0f, extraColor.g / 255.0f,
|
||||
extraColor.b / 255.0f, extraColor.a / 255.0f));
|
||||
|
||||
isThisAreaSpoiled = IsAreaSpoiled(rcArea) || CVarGetInteger(CVAR_TRACKER_CHECK("MQSpoilers"), 0);
|
||||
isThisAreaSpoiled = IsAreaSpoiled(rcArea) || mqSpoilers;
|
||||
|
||||
if (isThisAreaSpoiled) {
|
||||
if (showVOrMQ && RandomizerCheckObjects::AreaIsDungeon(rcArea)) {
|
||||
@ -1282,8 +1297,12 @@ bool IsCheckShuffled(RandomizerCheck rc) {
|
||||
|
||||
bool IsVisibleInCheckTracker(RandomizerCheck rc) {
|
||||
auto loc = Rando::StaticData::GetLocation(rc);
|
||||
if (IS_RANDO) {
|
||||
return IsCheckShuffled(rc) || (loc->GetRCType() == RCTYPE_SKULL_TOKEN && alwaysShowGS) ||
|
||||
(loc->GetRCType() == RCTYPE_SHOP && (showShops && (!hideShopRightChecks)));
|
||||
} else {
|
||||
return loc->IsVanillaCompletion() && (!loc->IsDungeon() || (loc->IsDungeon() && loc->GetQuest() == gSaveContext.questId));
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateInventoryChecks() {
|
||||
@ -1380,65 +1399,64 @@ void DrawLocation(RandomizerCheck rc) {
|
||||
Color_RGBA8 mainColor;
|
||||
Color_RGBA8 extraColor;
|
||||
std::string txt;
|
||||
bool showHidden = CVarGetInteger(CVAR_TRACKER_CHECK("ShowHidden"), 0);
|
||||
Rando::Location* loc = Rando::StaticData::GetLocation(rc);
|
||||
Rando::ItemLocation* itemLoc = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
RandomizerCheckStatus status = itemLoc->GetCheckStatus();
|
||||
bool skipped = itemLoc->GetIsSkipped();
|
||||
if (status == RCSHOW_COLLECTED) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Collected.Hide"), 0)) {
|
||||
if (!showHidden && hideCollected) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Collected.ExtraColor"), Color_Collected_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Collected.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Collected.ExtraColor"), Color_Collected_Extra_Default);
|
||||
? Color_Collected_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Collected_Extra_Default;
|
||||
} else if (status == RCSHOW_SAVED) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Saved.Hide"), 0)) {
|
||||
if (!showHidden && hideSaved) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Saved.ExtraColor"), Color_Saved_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Saved.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Saved.ExtraColor"), Color_Saved_Extra_Default);
|
||||
? Color_Saved_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Saved_Extra_Default;
|
||||
} else if (skipped) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Skipped.Hide"), 0)) {
|
||||
if (!showHidden && hideSkipped) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Skipped.ExtraColor"), Color_Skipped_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Skipped.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Skipped.ExtraColor"), Color_Skipped_Extra_Default);
|
||||
? Color_Skipped_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Skipped_Extra_Default;
|
||||
} else if (status == RCSHOW_SEEN || status == RCSHOW_IDENTIFIED) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Seen.Hide"), 0)) {
|
||||
if (!showHidden && hideSeen) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Seen.ExtraColor"), Color_Seen_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Seen.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Seen.ExtraColor"), Color_Seen_Extra_Default);
|
||||
? Color_Seen_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Seen_Extra_Default;
|
||||
} else if (status == RCSHOW_SCUMMED) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Scummed.Hide"), 0)) {
|
||||
if (!showHidden && hideScummed) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Scummed.ExtraColor"), Color_Scummed_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Scummed.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Scummed.ExtraColor"), Color_Scummed_Extra_Default);
|
||||
? Color_Scummed_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Scummed_Extra_Default;
|
||||
} else if (status == RCSHOW_UNCHECKED) {
|
||||
if (!showHidden && CVarGetInteger(CVAR_TRACKER_CHECK("Unchecked.Hide"), 0)) {
|
||||
if (!showHidden && hideUnchecked) {
|
||||
return;
|
||||
}
|
||||
mainColor =
|
||||
!IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID()) && !IS_RANDO
|
||||
? CVarGetColor(CVAR_TRACKER_CHECK("Unchecked.ExtraColor"), Color_Unchecked_Extra_Default)
|
||||
: CVarGetColor(CVAR_TRACKER_CHECK("Unchecked.MainColor"), Color_Main_Default);
|
||||
extraColor = CVarGetColor(CVAR_TRACKER_CHECK("Unchecked.ExtraColor"), Color_Unchecked_Extra_Default);
|
||||
? Color_Unchecked_Extra_Default
|
||||
: Color_Main_Default;
|
||||
extraColor = Color_Unchecked_Extra_Default;
|
||||
}
|
||||
|
||||
//Main Text
|
||||
@ -1481,8 +1499,6 @@ void DrawLocation(RandomizerCheck rc) {
|
||||
//Draw the extra info
|
||||
txt = "";
|
||||
|
||||
bool mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && itemLoc->IsAddedToPool();
|
||||
|
||||
if (status != RCSHOW_UNCHECKED) {
|
||||
switch (status) {
|
||||
case RCSHOW_SAVED:
|
||||
@ -1503,16 +1519,16 @@ void DrawLocation(RandomizerCheck rc) {
|
||||
case RCSHOW_IDENTIFIED:
|
||||
case RCSHOW_SEEN:
|
||||
if (IS_RANDO) {
|
||||
if (itemLoc->GetPlacedRandomizerGet() == RG_ICE_TRAP && !mystery) {
|
||||
if (itemLoc->GetPlacedRandomizerGet() == RG_ICE_TRAP && !mystery && !itemLoc->IsAddedToPool()) {
|
||||
if (status == RCSHOW_IDENTIFIED) {
|
||||
txt = OTRGlobals::Instance->gRandoContext->overrides[rc].GetTrickName().GetForLanguage(gSaveContext.language);
|
||||
} else {
|
||||
txt = Rando::StaticData::RetrieveItem(OTRGlobals::Instance->gRandoContext->overrides[rc].LooksLike()).GetName().GetForLanguage(gSaveContext.language);
|
||||
}
|
||||
} else if (!mystery) {
|
||||
} else if (!mystery && !itemLoc->IsAddedToPool()) {
|
||||
txt = itemLoc->GetPlacedItem().GetName().GetForLanguage(gSaveContext.language);
|
||||
}
|
||||
if (IsVisibleInCheckTracker(rc) && status == RCSHOW_IDENTIFIED && !mystery) {
|
||||
if (IsVisibleInCheckTracker(rc) && status == RCSHOW_IDENTIFIED && !mystery && !itemLoc->IsAddedToPool()) {
|
||||
txt += fmt::format(" - {}", OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->GetPrice());
|
||||
}
|
||||
} else {
|
||||
@ -1538,7 +1554,7 @@ void DrawLocation(RandomizerCheck rc) {
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
if (CVarGetInteger("gCheckTrackerOptionShowLogic", 0)) {
|
||||
if (showLogicTooltip) {
|
||||
for (auto& locationInRegion : areaTable[itemLoc->GetParentRegionKey()].locations) {
|
||||
if (locationInRegion.GetLocation() == rc) {
|
||||
std::string conditionStr = locationInRegion.GetConditionStr();
|
||||
@ -1635,6 +1651,15 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName,
|
||||
}
|
||||
}
|
||||
|
||||
void CheckTrackerWindow::Draw() {
|
||||
if (!IsVisible()) {
|
||||
return;
|
||||
}
|
||||
DrawElement();
|
||||
// Sync up the IsVisible flag if it was changed by ImGui
|
||||
SyncVisibilityConsoleVariable();
|
||||
}
|
||||
|
||||
static const char* windowType[] = { "Floating", "Window" };
|
||||
static const char* displayType[] = { "Always", "Combo Button Hold" };
|
||||
static const char* buttonStrings[] = { "A Button", "B Button", "C-Up", "C-Down", "C-Left", "C-Right", "L Button",
|
||||
@ -1705,6 +1730,22 @@ void CheckTrackerSettingsWindow::DrawElement() {
|
||||
}
|
||||
|
||||
void CheckTrackerWindow::InitElement() {
|
||||
SaveManager::Instance->AddInitFunction(InitTrackerData);
|
||||
sectionId = SaveManager::Instance->AddSaveFunction("trackerData", 1, SaveFile, true, SECTION_PARENT_NONE);
|
||||
SaveManager::Instance->AddLoadFunction("trackerData", 1, LoadFile);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>(CheckTrackerLoadGame);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([](uint32_t fileNum) {
|
||||
Teardown();
|
||||
});
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>(CheckTrackerItemReceive);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(CheckTrackerFrame);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnTransitionEnd>(CheckTrackerTransition);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnShopSlotChange>(CheckTrackerShopSlotChange);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneFlagSet>(CheckTrackerSceneFlagSet);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFlagSet>(CheckTrackerFlagSet);
|
||||
}
|
||||
|
||||
void CheckTrackerWindow::UpdateElement() {
|
||||
Color_Background = CVarGetColor(CVAR_TRACKER_CHECK("BgColor"), Color_Bg_Default);
|
||||
Color_Area_Incomplete_Main = CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.MainColor"), Color_Main_Default);
|
||||
Color_Area_Incomplete_Extra = CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.ExtraColor"), Color_Area_Incomplete_Extra_Default);
|
||||
@ -1724,23 +1765,17 @@ void CheckTrackerWindow::InitElement() {
|
||||
Color_Scummed_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Scummed.ExtraColor"), Color_Scummed_Extra_Default);
|
||||
Color_Saved_Main = CVarGetColor(CVAR_TRACKER_CHECK("Saved.MainColor"), Color_Main_Default);
|
||||
Color_Saved_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Saved.ExtraColor"), Color_Saved_Extra_Default);
|
||||
|
||||
SaveManager::Instance->AddInitFunction(InitTrackerData);
|
||||
sectionId = SaveManager::Instance->AddSaveFunction("trackerData", 1, SaveFile, true, SECTION_PARENT_NONE);
|
||||
SaveManager::Instance->AddLoadFunction("trackerData", 1, LoadFile);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>(CheckTrackerLoadGame);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([](uint32_t fileNum) {
|
||||
Teardown();
|
||||
});
|
||||
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>(CheckTrackerItemReceive);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(CheckTrackerFrame);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnTransitionEnd>(CheckTrackerTransition);
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnShopSlotChange>(CheckTrackerShopSlotChange);
|
||||
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneFlagSet>(CheckTrackerSceneFlagSet);
|
||||
// GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFlagSet>(CheckTrackerFlagSet);
|
||||
hideUnchecked = CVarGetInteger(CVAR_TRACKER_CHECK("Unchecked.Hide"), 0);
|
||||
hideScummed = CVarGetInteger(CVAR_TRACKER_CHECK("Scummed.Hide"), 0);
|
||||
hideSeen = CVarGetInteger(CVAR_TRACKER_CHECK("Seen.Hide"), 0);
|
||||
hideSkipped = CVarGetInteger(CVAR_TRACKER_CHECK("Skipped.Hide"), 0);
|
||||
hideSaved = CVarGetInteger(CVAR_TRACKER_CHECK("Saved.Hide"), 0);
|
||||
hideCollected = CVarGetInteger(CVAR_TRACKER_CHECK("Collected.Hide"), 0);
|
||||
showHidden = CVarGetInteger(CVAR_TRACKER_CHECK("ShowHidden"), 0);
|
||||
mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0);
|
||||
showLogicTooltip = CVarGetInteger("gCheckTrackerOptionShowLogic", 0);
|
||||
|
||||
hideShopRightChecks = CVarGetInteger(CVAR_TRACKER_CHECK("HideRightShopChecks"), 1);
|
||||
alwaysShowGS = CVarGetInteger(CVAR_TRACKER_CHECK("AlwaysShowGSLocs"), 0);
|
||||
}
|
||||
|
||||
} // namespace CheckTracker
|
||||
|
@ -21,12 +21,13 @@ class CheckTrackerSettingsWindow : public Ship::GuiWindow {
|
||||
class CheckTrackerWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using GuiWindow::GuiWindow;
|
||||
void Draw() override;
|
||||
~CheckTrackerWindow() {};
|
||||
|
||||
protected:
|
||||
void InitElement() override;
|
||||
void DrawElement() override;
|
||||
void UpdateElement() override {};
|
||||
void UpdateElement() override;
|
||||
};
|
||||
|
||||
//Converts an index into a Little Endian bitmask, as follows:
|
||||
|
@ -2789,6 +2789,8 @@ void Settings::ParseJson(nlohmann::json spoilerFileJson) {
|
||||
case RSK_ALL_LOCATIONS_REACHABLE:
|
||||
case RSK_TRIFORCE_HUNT:
|
||||
case RSK_MQ_DUNGEON_SET:
|
||||
case RSK_SHUFFLE_DEKU_NUT_BAG:
|
||||
case RSK_SHUFFLE_DEKU_STICK_BAG:
|
||||
if (it.value() == "Off") {
|
||||
mOptions[index].SetSelectedIndex(RO_GENERIC_OFF);
|
||||
} else if (it.value() == "On") {
|
||||
|
196
soh/soh/ImGuiUtils.cpp
Normal file
196
soh/soh/ImGuiUtils.cpp
Normal file
@ -0,0 +1,196 @@
|
||||
#include "ImGuiUtils.h"
|
||||
#include <Context.h>
|
||||
#include "assets/soh_assets.h"
|
||||
|
||||
std::map<uint32_t, ItemMapEntry> itemMapping = {
|
||||
ITEM_MAP_ENTRY(ITEM_STICK),
|
||||
ITEM_MAP_ENTRY(ITEM_NUT),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_DINS_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_SLINGSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_OCARINA_FAIRY),
|
||||
ITEM_MAP_ENTRY(ITEM_OCARINA_TIME),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMBCHU),
|
||||
ITEM_MAP_ENTRY(ITEM_HOOKSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_LONGSHOT),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_ICE),
|
||||
ITEM_MAP_ENTRY(ITEM_FARORES_WIND),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOMERANG),
|
||||
ITEM_MAP_ENTRY(ITEM_LENS),
|
||||
ITEM_MAP_ENTRY(ITEM_BEAN),
|
||||
ITEM_MAP_ENTRY(ITEM_HAMMER),
|
||||
ITEM_MAP_ENTRY(ITEM_ARROW_LIGHT),
|
||||
ITEM_MAP_ENTRY(ITEM_NAYRUS_LOVE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOTTLE),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_RED),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_GREEN),
|
||||
ITEM_MAP_ENTRY(ITEM_POTION_BLUE),
|
||||
ITEM_MAP_ENTRY(ITEM_FAIRY),
|
||||
ITEM_MAP_ENTRY(ITEM_FISH),
|
||||
ITEM_MAP_ENTRY(ITEM_MILK_BOTTLE),
|
||||
ITEM_MAP_ENTRY(ITEM_LETTER_RUTO),
|
||||
ITEM_MAP_ENTRY(ITEM_BLUE_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_BUG),
|
||||
ITEM_MAP_ENTRY(ITEM_BIG_POE),
|
||||
ITEM_MAP_ENTRY(ITEM_MILK_HALF),
|
||||
ITEM_MAP_ENTRY(ITEM_POE),
|
||||
ITEM_MAP_ENTRY(ITEM_WEIRD_EGG),
|
||||
ITEM_MAP_ENTRY(ITEM_CHICKEN),
|
||||
ITEM_MAP_ENTRY(ITEM_LETTER_ZELDA),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_KEATON),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_SKULL),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_SPOOKY),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_BUNNY),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_GORON),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_ZORA),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_GERUDO),
|
||||
ITEM_MAP_ENTRY(ITEM_MASK_TRUTH),
|
||||
ITEM_MAP_ENTRY(ITEM_SOLD_OUT),
|
||||
ITEM_MAP_ENTRY(ITEM_POCKET_EGG),
|
||||
ITEM_MAP_ENTRY(ITEM_POCKET_CUCCO),
|
||||
ITEM_MAP_ENTRY(ITEM_COJIRO),
|
||||
ITEM_MAP_ENTRY(ITEM_ODD_MUSHROOM),
|
||||
ITEM_MAP_ENTRY(ITEM_ODD_POTION),
|
||||
ITEM_MAP_ENTRY(ITEM_SAW),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_BROKEN),
|
||||
ITEM_MAP_ENTRY(ITEM_PRESCRIPTION),
|
||||
ITEM_MAP_ENTRY(ITEM_FROG),
|
||||
ITEM_MAP_ENTRY(ITEM_EYEDROPS),
|
||||
ITEM_MAP_ENTRY(ITEM_CLAIM_CHECK),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_FIRE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_ICE),
|
||||
ITEM_MAP_ENTRY(ITEM_BOW_ARROW_LIGHT),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_MASTER),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_BGS),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_DEKU),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_HYLIAN),
|
||||
ITEM_MAP_ENTRY(ITEM_SHIELD_MIRROR),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_GORON),
|
||||
ITEM_MAP_ENTRY(ITEM_TUNIC_ZORA),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_KOKIRI),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_IRON),
|
||||
ITEM_MAP_ENTRY(ITEM_BOOTS_HOVER),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_30),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_40),
|
||||
ITEM_MAP_ENTRY(ITEM_BULLET_BAG_50),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_30),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_40),
|
||||
ITEM_MAP_ENTRY(ITEM_QUIVER_50),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_20),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_30),
|
||||
ITEM_MAP_ENTRY(ITEM_BOMB_BAG_40),
|
||||
ITEM_MAP_ENTRY(ITEM_BRACELET),
|
||||
ITEM_MAP_ENTRY(ITEM_GAUNTLETS_SILVER),
|
||||
ITEM_MAP_ENTRY(ITEM_GAUNTLETS_GOLD),
|
||||
ITEM_MAP_ENTRY(ITEM_SCALE_SILVER),
|
||||
ITEM_MAP_ENTRY(ITEM_SCALE_GOLDEN),
|
||||
ITEM_MAP_ENTRY(ITEM_SWORD_KNIFE),
|
||||
ITEM_MAP_ENTRY(ITEM_WALLET_ADULT),
|
||||
ITEM_MAP_ENTRY(ITEM_WALLET_GIANT),
|
||||
ITEM_MAP_ENTRY(ITEM_SEEDS),
|
||||
ITEM_MAP_ENTRY(ITEM_FISHING_POLE),
|
||||
ITEM_MAP_ENTRY(ITEM_KEY_BOSS),
|
||||
ITEM_MAP_ENTRY(ITEM_COMPASS),
|
||||
ITEM_MAP_ENTRY(ITEM_DUNGEON_MAP),
|
||||
ITEM_MAP_ENTRY(ITEM_KEY_SMALL),
|
||||
ITEM_MAP_ENTRY(ITEM_HEART_CONTAINER),
|
||||
ITEM_MAP_ENTRY(ITEM_HEART_PIECE),
|
||||
ITEM_MAP_ENTRY(ITEM_MAGIC_SMALL),
|
||||
ITEM_MAP_ENTRY(ITEM_MAGIC_LARGE)
|
||||
};
|
||||
|
||||
std::map<uint32_t, ItemMapEntry> gregMapping = {
|
||||
{ITEM_RUPEE_GREEN, {ITEM_RUPEE_GREEN, "ITEM_RUPEE_GREEN", "ITEM_RUPEE_GREEN_Faded", gRupeeCounterIconTex}}
|
||||
};
|
||||
|
||||
std::map<uint32_t, ItemMapEntry> triforcePieceMapping = {
|
||||
{RG_TRIFORCE_PIECE, {RG_TRIFORCE_PIECE, "RG_TRIFORCE_PIECE", "RG_TRIFORCE_PIECE_Faded", gTriforcePieceTex}}
|
||||
};
|
||||
|
||||
std::map<uint32_t, QuestMapEntry> questMapping = {
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_FOREST, dgQuestIconMedallionForestTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_FIRE, dgQuestIconMedallionFireTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_WATER, dgQuestIconMedallionWaterTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_SPIRIT, dgQuestIconMedallionSpiritTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_SHADOW, dgQuestIconMedallionShadowTex),
|
||||
QUEST_MAP_ENTRY(QUEST_MEDALLION_LIGHT, dgQuestIconMedallionLightTex),
|
||||
QUEST_MAP_ENTRY(QUEST_KOKIRI_EMERALD, dgQuestIconKokiriEmeraldTex),
|
||||
QUEST_MAP_ENTRY(QUEST_GORON_RUBY, dgQuestIconGoronRubyTex),
|
||||
QUEST_MAP_ENTRY(QUEST_ZORA_SAPPHIRE, dgQuestIconZoraSapphireTex),
|
||||
QUEST_MAP_ENTRY(QUEST_STONE_OF_AGONY, dgQuestIconStoneOfAgonyTex),
|
||||
QUEST_MAP_ENTRY(QUEST_GERUDO_CARD, dgQuestIconGerudosCardTex),
|
||||
QUEST_MAP_ENTRY(QUEST_SKULL_TOKEN, dgQuestIconGoldSkulltulaTex),
|
||||
};
|
||||
|
||||
std::array<SongMapEntry, 12> songMapping = { {
|
||||
SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 224, 107, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 195, 60),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SARIA, 127, 255, 137),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SUN, 255, 255, 60),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_TIME, 119, 236, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_STORMS, 165, 165, 165),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_MINUET, 150, 255, 100),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_BOLERO, 255, 80, 40),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_SERENADE, 100, 150, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255),
|
||||
SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100),
|
||||
} };
|
||||
|
||||
std::array<SongMapEntry, 12> vanillaSongMapping = { {
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SARIA, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SUN, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_TIME, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_STORMS, 255, 255, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_MINUET, 150, 255, 100),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_BOLERO, 255, 80, 40),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_SERENADE, 100, 150, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255),
|
||||
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100),
|
||||
} };
|
||||
|
||||
void RegisterImGuiItemIcons() {
|
||||
for (const auto& entry : itemMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
|
||||
for (const auto& entry : gregMapping) {
|
||||
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
|
||||
ImVec4 gregFadedGreen = gregGreen;
|
||||
gregFadedGreen.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen);
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
|
||||
}
|
||||
|
||||
for (const auto& entry : triforcePieceMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
|
||||
for (const auto& entry : questMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
|
||||
}
|
||||
|
||||
for (const auto& entry : songMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
|
||||
for (const auto& entry : vanillaSongMapping) {
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
|
||||
ImVec4 fadedCol = entry.color;
|
||||
fadedCol.w = 0.3f;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
|
||||
}
|
||||
}
|
83
soh/soh/ImGuiUtils.h
Normal file
83
soh/soh/ImGuiUtils.h
Normal file
@ -0,0 +1,83 @@
|
||||
#ifndef IM_GUI_UTILS_H
|
||||
#define IM_GUI_UTILS_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "Enhancements/randomizer/randomizerTypes.h"
|
||||
#include "variables.h" //only for gItemIcons
|
||||
|
||||
extern "C" {
|
||||
#include "textures/icon_item_static/icon_item_static.h"
|
||||
#include "textures/icon_item_24_static/icon_item_24_static.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
}
|
||||
|
||||
void RegisterImGuiItemIcons();
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
std::string texturePath;
|
||||
} ItemMapEntry;
|
||||
|
||||
#define ITEM_MAP_ENTRY(id) \
|
||||
{ \
|
||||
id, { \
|
||||
id, #id, #id "_Faded", static_cast<char*>(gItemIcons[id]) \
|
||||
} \
|
||||
}
|
||||
|
||||
// Maps items ids to info for use in ImGui
|
||||
extern std::map<uint32_t, ItemMapEntry> itemMapping;
|
||||
|
||||
extern std::map<uint32_t, ItemMapEntry> gregMapping;
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
std::string texturePath;
|
||||
} QuestMapEntry;
|
||||
|
||||
#define QUEST_MAP_ENTRY(id, tex) \
|
||||
{ \
|
||||
id, { \
|
||||
id, #id, #id "_Faded", tex \
|
||||
} \
|
||||
}
|
||||
|
||||
// Maps quest items ids to info for use in ImGui
|
||||
extern std::map<uint32_t, QuestMapEntry> questMapping;
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string nameFaded;
|
||||
ImVec4 color;
|
||||
} SongMapEntry;
|
||||
|
||||
#define SONG_MAP_ENTRY(id, r, g, b) \
|
||||
{ \
|
||||
id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \
|
||||
}
|
||||
|
||||
// Maps song ids to info for use in ImGui
|
||||
extern std::array<SongMapEntry, 12> songMapping;
|
||||
|
||||
#define VANILLA_SONG_MAP_ENTRY(id, r, g, b) \
|
||||
{ \
|
||||
id, #id "_Vanilla", #id "_Vanilla_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \
|
||||
}
|
||||
|
||||
// Maps song ids to info for use in ImGui
|
||||
extern std::array<SongMapEntry, 12> vanillaSongMapping;
|
||||
|
||||
#endif //IM_GUI_UTILS_H
|
@ -46,6 +46,7 @@
|
||||
#include "Fonts.h"
|
||||
#include <utils/StringHelper.h>
|
||||
#include "Enhancements/custom-message/CustomMessageManager.h"
|
||||
#include "ImGuiUtils.h"
|
||||
#include "Enhancements/presets.h"
|
||||
#include "util.h"
|
||||
#include <boost_custom/container_hash/hash_32.hpp>
|
||||
@ -330,7 +331,18 @@ OTRGlobals::OTRGlobals() {
|
||||
prevAltAssets = CVarGetInteger(CVAR_ENHANCEMENT("AltAssets"), 0);
|
||||
context->GetResourceManager()->SetAltAssetsEnabled(prevAltAssets);
|
||||
|
||||
context->InitControlDeck({BTN_MODIFIER1, BTN_MODIFIER2});
|
||||
context->InitControlDeck({
|
||||
BTN_CUSTOM_MODIFIER1,
|
||||
BTN_CUSTOM_MODIFIER2,
|
||||
BTN_CUSTOM_OCARINA_NOTE_D4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_F4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_A4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_B4,
|
||||
BTN_CUSTOM_OCARINA_NOTE_D5,
|
||||
BTN_CUSTOM_OCARINA_DISABLE_SONGS,
|
||||
BTN_CUSTOM_OCARINA_PITCH_UP,
|
||||
BTN_CUSTOM_OCARINA_PITCH_DOWN,
|
||||
});
|
||||
context->GetControlDeck()->SetSinglePlayerMappingMode(true);
|
||||
|
||||
context->InitCrashHandler();
|
||||
@ -1171,6 +1183,8 @@ extern "C" void InitOTR() {
|
||||
// #endregion
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFileDropped>(SoH_ProcessDroppedFiles);
|
||||
|
||||
RegisterImGuiItemIcons();
|
||||
|
||||
time_t now = time(NULL);
|
||||
tm *tm_now = localtime(&now);
|
||||
if (tm_now->tm_mon == 11 && tm_now->tm_mday >= 24 && tm_now->tm_mday <= 25) {
|
||||
|
@ -12,8 +12,17 @@
|
||||
#define GAME_PLATFORM_N64 0
|
||||
#define GAME_PLATFORM_GC 1
|
||||
|
||||
#define BTN_MODIFIER1 0x00040
|
||||
#define BTN_MODIFIER2 0x00080
|
||||
#define BTN_CUSTOM_MODIFIER1 0x0040
|
||||
#define BTN_CUSTOM_MODIFIER2 0x0080
|
||||
|
||||
#define BTN_CUSTOM_OCARINA_NOTE_D4 ((CONTROLLERBUTTONS_T)0x00010000)
|
||||
#define BTN_CUSTOM_OCARINA_NOTE_F4 ((CONTROLLERBUTTONS_T)0x00020000)
|
||||
#define BTN_CUSTOM_OCARINA_NOTE_A4 ((CONTROLLERBUTTONS_T)0x00040000)
|
||||
#define BTN_CUSTOM_OCARINA_NOTE_B4 ((CONTROLLERBUTTONS_T)0x00080000)
|
||||
#define BTN_CUSTOM_OCARINA_NOTE_D5 ((CONTROLLERBUTTONS_T)0x00100000)
|
||||
#define BTN_CUSTOM_OCARINA_DISABLE_SONGS ((CONTROLLERBUTTONS_T)0x00200000)
|
||||
#define BTN_CUSTOM_OCARINA_PITCH_UP ((CONTROLLERBUTTONS_T)0x00400000)
|
||||
#define BTN_CUSTOM_OCARINA_PITCH_DOWN ((CONTROLLERBUTTONS_T)0x00800000)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <Context.h>
|
||||
|
@ -1160,17 +1160,14 @@ void SaveManager::SaveFileThreaded(int fileNum, SaveContext* saveContext, int se
|
||||
for (auto& sectionHandlerPair : sectionSaveHandlers) {
|
||||
auto& saveFuncInfo = sectionHandlerPair.second;
|
||||
// Don't call SaveFuncs for sections that aren't tied to game save
|
||||
if (!saveFuncInfo.saveWithBase) {
|
||||
if (!saveFuncInfo.saveWithBase || (saveFuncInfo.name == "randomizer" && !IS_RANDO)) {
|
||||
continue;
|
||||
}
|
||||
nlohmann::json& sectionBlock = saveBlock["sections"][saveFuncInfo.name];
|
||||
sectionBlock["version"] = sectionHandlerPair.second.version;
|
||||
// If any save file is loaded for medatata, or a spoiler log is loaded (not sure which at this point), there is still data in the "randomizer" section
|
||||
// This clears the randomizer data block if and only if the section being called is "randomizer" and the current save file is not a randomizer save file.
|
||||
if (sectionHandlerPair.second.name == "randomizer" && !IS_RANDO) {
|
||||
sectionBlock["data"] = nlohmann::json::object();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
currentJsonContext = §ionBlock["data"];
|
||||
sectionHandlerPair.second.func(saveContext, sectionID, true);
|
||||
@ -1309,6 +1306,9 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
continue;
|
||||
}
|
||||
currentJsonContext = &block.value()["data"];
|
||||
if (currentJsonContext->empty()) {
|
||||
continue;
|
||||
}
|
||||
handler[sectionVersion]();
|
||||
}
|
||||
break;
|
||||
@ -2841,11 +2841,12 @@ extern "C" void Save_SaveGlobal(void) {
|
||||
}
|
||||
|
||||
extern "C" void Save_LoadFile(void) {
|
||||
if (SaveManager::Instance->fileMetaInfo[gSaveContext.fileNum].randoSave) {
|
||||
// Reset rando context for rando saves.
|
||||
// Handle vanilla context reset
|
||||
OTRGlobals::Instance->gRandoContext.reset();
|
||||
OTRGlobals::Instance->gRandoContext = Rando::Context::CreateInstance();
|
||||
OTRGlobals::Instance->gRandoContext->GetLogic()->SetSaveContext(&gSaveContext);
|
||||
|
||||
if (SaveManager::Instance->fileMetaInfo[gSaveContext.fileNum].randoSave) {
|
||||
OTRGlobals::Instance->gRandoContext->AddExcludedOptions();
|
||||
OTRGlobals::Instance->gRandoContext->GetSettings()->CreateOptions();
|
||||
}
|
||||
|
@ -773,6 +773,9 @@ void DrawEnhancementsMenu() {
|
||||
|
||||
if (ImGui::BeginMenu("Items"))
|
||||
{
|
||||
UIWidgets::PaddedEnhancementCheckbox("Equip Items on D-pad", CVAR_ENHANCEMENT("DpadEquips"), true, false);
|
||||
UIWidgets::Tooltip("Equip items and equipment on the D-pad\nIf used with \"D-pad on Pause Screen\", you "
|
||||
"must hold C-Up to equip instead of navigate");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Instant Putaway", CVAR_ENHANCEMENT("InstantPutaway"), true, false);
|
||||
UIWidgets::Tooltip("Allow Link to put items away without having to wait around");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Instant Boomerang Recall", CVAR_ENHANCEMENT("FastBoomerang"), true, false);
|
||||
@ -1146,6 +1149,10 @@ void DrawEnhancementsMenu() {
|
||||
|
||||
UIWidgets::EnhancementCheckbox("Visual Stone of Agony", CVAR_ENHANCEMENT("VisualAgony"));
|
||||
UIWidgets::Tooltip("Displays an icon and plays a sound when Stone of Agony should be activated, for those without rumble");
|
||||
static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" };
|
||||
UIWidgets::PaddedText("Allow the cursor to be on any slot", true, false);
|
||||
UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("PauseAnyCursor"), cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY);
|
||||
UIWidgets::Tooltip("Allows the cursor on the pause menu to be over any slot. Sometimes required in rando to select certain items.");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Assignable Tunics and Boots", CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), true, false);
|
||||
UIWidgets::Tooltip("Allows equipping the tunic and boots to c-buttons");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Equipment Toggle", CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), true, false);
|
||||
@ -1173,6 +1180,8 @@ void DrawEnhancementsMenu() {
|
||||
UIWidgets::Tooltip("Allows dogs to follow you anywhere you go, even if you leave the market");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Don't require input for Credits sequence", CVAR_ENHANCEMENT("NoInputForCredits"), true, false);
|
||||
UIWidgets::Tooltip("Removes the input requirement on textboxes after defeating Ganon, allowing Credits sequence to continue to progress");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", CVAR_ENHANCEMENT("NaviOnL"), true, false);
|
||||
UIWidgets::Tooltip("Speak to Navi with L but enter first-person camera with C-Up");
|
||||
|
||||
// Blue Fire Arrows
|
||||
bool forceEnableBlueFireArrows = IS_RANDO &&
|
||||
@ -1412,6 +1421,10 @@ void DrawEnhancementsMenu() {
|
||||
"This will lower them, making activating them easier");
|
||||
UIWidgets::PaddedEnhancementCheckbox("Fix Zora hint dialogue", CVAR_ENHANCEMENT("FixZoraHintDialogue"), true, false);
|
||||
UIWidgets::Tooltip("Fixes one Zora's dialogue giving a hint about bringing Ruto's Letter to King Zora to properly occur before moving King Zora rather than after");
|
||||
if (UIWidgets::PaddedEnhancementCheckbox("Fix hand holding Hammer", "gEnhancements.FixHammerHand", true, false)) {
|
||||
UpdatePatchHand();
|
||||
}
|
||||
UIWidgets::Tooltip("Fixes Adult Link have a backwards left hand when holding the Megaton Hammer.");
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
@ -1252,20 +1252,14 @@ void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId);
|
||||
s32 Audio_SetGanonDistVol(u8 targetVol);
|
||||
void Audio_PlayFanfare_Rando(GetItemEntry getItem);
|
||||
|
||||
// Right stick as virtual C buttons
|
||||
#define RSTICK_UP 0x100000
|
||||
#define RSTICK_DOWN 0x200000
|
||||
#define RSTICK_LEFT 0x400000
|
||||
#define RSTICK_RIGHT 0x800000
|
||||
|
||||
// Function originally not called, so repurposing for control mapping
|
||||
void Audio_OcaUpdateBtnMap(bool customControls, bool dpad, bool rStick) {
|
||||
void Audio_OcaUpdateBtnMap(bool customControls) {
|
||||
if (customControls) {
|
||||
sOcarinaD5BtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.D5Button"), BTN_CUP);
|
||||
sOcarinaB4BtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.B4Button"), BTN_CLEFT);
|
||||
sOcarinaA4BtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.A4Button"), BTN_CRIGHT);
|
||||
sOcarinaF4BtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.F4Button"), BTN_CDOWN);
|
||||
sOcarinaD4BtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.D4Button"), BTN_A);
|
||||
sOcarinaD5BtnMap = BTN_CUSTOM_OCARINA_NOTE_D5;
|
||||
sOcarinaB4BtnMap = BTN_CUSTOM_OCARINA_NOTE_B4;
|
||||
sOcarinaA4BtnMap = BTN_CUSTOM_OCARINA_NOTE_A4;
|
||||
sOcarinaF4BtnMap = BTN_CUSTOM_OCARINA_NOTE_F4;
|
||||
sOcarinaD4BtnMap = BTN_CUSTOM_OCARINA_NOTE_D4;
|
||||
} else {
|
||||
sOcarinaD5BtnMap = BTN_CUP;
|
||||
sOcarinaB4BtnMap = BTN_CLEFT;
|
||||
@ -1274,20 +1268,6 @@ void Audio_OcaUpdateBtnMap(bool customControls, bool dpad, bool rStick) {
|
||||
sOcarinaD4BtnMap = BTN_A;
|
||||
}
|
||||
|
||||
if (dpad) {
|
||||
sOcarinaD5BtnMap |= BTN_DUP;
|
||||
sOcarinaB4BtnMap |= BTN_DLEFT;
|
||||
sOcarinaA4BtnMap |= BTN_DRIGHT;
|
||||
sOcarinaF4BtnMap |= BTN_DDOWN;
|
||||
}
|
||||
|
||||
if (rStick) {
|
||||
sOcarinaD5BtnMap |= RSTICK_UP;
|
||||
sOcarinaB4BtnMap |= RSTICK_LEFT;
|
||||
sOcarinaA4BtnMap |= RSTICK_RIGHT;
|
||||
sOcarinaF4BtnMap |= RSTICK_DOWN;
|
||||
}
|
||||
|
||||
sOcarinaAllowedBtnMask = (
|
||||
sOcarinaD5BtnMap |
|
||||
sOcarinaB4BtnMap |
|
||||
@ -1308,22 +1288,6 @@ void Audio_GetOcaInput(void) {
|
||||
sPrevOcarinaBtnPress = sp18;
|
||||
sCurOcaStick.x = input->rel.stick_x;
|
||||
sCurOcaStick.y = input->rel.stick_y;
|
||||
|
||||
s8 rstick_x = input->cur.right_stick_x;
|
||||
s8 rstick_y = input->cur.right_stick_y;
|
||||
const s8 sensitivity = 64;
|
||||
if (rstick_x > sensitivity) {
|
||||
sCurOcarinaBtnPress |= RSTICK_RIGHT;
|
||||
}
|
||||
if (rstick_x < -sensitivity) {
|
||||
sCurOcarinaBtnPress |= RSTICK_LEFT;
|
||||
}
|
||||
if (rstick_y > sensitivity) {
|
||||
sCurOcarinaBtnPress |= RSTICK_UP;
|
||||
}
|
||||
if (rstick_y < -sensitivity) {
|
||||
sCurOcarinaBtnPress |= RSTICK_DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
f32 Audio_OcaAdjStick(s8 inp) {
|
||||
@ -1543,7 +1507,7 @@ void func_800ED200(void) {
|
||||
|
||||
u32 disableSongBtnMap;
|
||||
if (CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
||||
disableSongBtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.DisableButton"), BTN_L);
|
||||
disableSongBtnMap = BTN_CUSTOM_OCARINA_DISABLE_SONGS;
|
||||
} else {
|
||||
disableSongBtnMap = BTN_L;
|
||||
}
|
||||
@ -1605,8 +1569,6 @@ void func_800ED200(void) {
|
||||
void func_800ED458(s32 arg0) {
|
||||
u32 phi_v1_2;
|
||||
bool customControls = CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0);
|
||||
bool dpad = CVarGetInteger(CVAR_SETTING("OcarinaControl.Dpad"), 0);
|
||||
bool rStick = CVarGetInteger(CVAR_SETTING("OcarinaControl.RStick"), 0);
|
||||
|
||||
if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) {
|
||||
sOcarinaDropInputTimer--;
|
||||
@ -1627,7 +1589,7 @@ void func_800ED458(s32 arg0) {
|
||||
D_8016BA18 &= phi_v1_2;
|
||||
}
|
||||
|
||||
Audio_OcaUpdateBtnMap(customControls, dpad, rStick);
|
||||
Audio_OcaUpdateBtnMap(customControls);
|
||||
if (D_8016BA18 & sOcarinaD4BtnMap && GameInteractor_Should(VB_HAVE_OCARINA_NOTE_D4, true)) {
|
||||
osSyncPrintf("Presss NA_KEY_D4 %08x\n", sOcarinaD4BtnMap);
|
||||
sCurOcarinaBtnVal = 2;
|
||||
@ -1652,7 +1614,7 @@ void func_800ED458(s32 arg0) {
|
||||
|
||||
u32 noteSharpBtnMap;
|
||||
if (customControls) {
|
||||
noteSharpBtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.SharpButton"), BTN_R);
|
||||
noteSharpBtnMap = BTN_CUSTOM_OCARINA_PITCH_UP;
|
||||
} else {
|
||||
noteSharpBtnMap = BTN_R;
|
||||
}
|
||||
@ -1663,7 +1625,7 @@ void func_800ED458(s32 arg0) {
|
||||
|
||||
u32 noteFlatBtnMap;
|
||||
if (customControls) {
|
||||
noteFlatBtnMap = CVarGetInteger(CVAR_SETTING("CustomOcarina.FlatButton"), BTN_Z);
|
||||
noteFlatBtnMap = BTN_CUSTOM_OCARINA_PITCH_DOWN;
|
||||
} else {
|
||||
noteFlatBtnMap = BTN_Z;
|
||||
}
|
||||
|
@ -835,6 +835,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
u16 i;
|
||||
u16 sfxHi;
|
||||
u16 charTexIdx;
|
||||
int gTextSpeed;
|
||||
Font* font = &play->msgCtx.font;
|
||||
Gfx* gfx = *gfxP;
|
||||
|
||||
@ -1115,11 +1116,17 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (msgCtx->textDelayTimer == 0) {
|
||||
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
|
||||
|
||||
gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
|
||||
if (msgCtx->textDelay == 0) {
|
||||
msgCtx->textDrawPos = i + gTextSpeed;
|
||||
} else if (msgCtx->textDelayTimer == 0) {
|
||||
msgCtx->textDrawPos = i + 1;
|
||||
msgCtx->textDelayTimer = msgCtx->textDelay;
|
||||
} else if (msgCtx->textDelayTimer <= gTextSpeed) {
|
||||
msgCtx->textDelayTimer = 0;
|
||||
} else {
|
||||
msgCtx->textDelayTimer--;
|
||||
msgCtx->textDelayTimer -= gTextSpeed;
|
||||
}
|
||||
*gfxP = gfx;
|
||||
}
|
||||
|
@ -3692,7 +3692,8 @@ void Interface_UpdateMagicBar(PlayState* play) {
|
||||
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
|
||||
bool hasLens = false;
|
||||
for (int buttonIndex = 1; buttonIndex < (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) ? ARRAY_COUNT(gSaveContext.equips.buttonItems) : 4; buttonIndex++) {
|
||||
for (int buttonIndex = 1; buttonIndex < (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) ? ARRAY_COUNT(gSaveContext.equips.buttonItems) : 4;
|
||||
buttonIndex++) {
|
||||
if (gSaveContext.equips.buttonItems[buttonIndex] == ITEM_LENS) {
|
||||
hasLens = true;
|
||||
break;
|
||||
@ -5727,7 +5728,7 @@ void Interface_Draw(PlayState* play) {
|
||||
Interface_DrawAmmoCount(play, 3, interfaceCtx->cRightAlpha);
|
||||
}
|
||||
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
// DPad is only greyed-out when all 4 DPad directions are too
|
||||
uint16_t dpadAlpha =
|
||||
MAX(MAX(MAX(interfaceCtx->dpadUpAlpha, interfaceCtx->dpadDownAlpha), interfaceCtx->dpadLeftAlpha),
|
||||
|
@ -250,12 +250,12 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
|
||||
|
||||
u8 currentQuest = fileChooseCtx->questType[fileChooseCtx->buttonIndex];
|
||||
|
||||
if (Randomizer_IsSeedGenerated() || Randomizer_IsPlandoLoaded()) {
|
||||
if (currentQuest == QUEST_RANDOMIZER && (Randomizer_IsSeedGenerated() || Randomizer_IsPlandoLoaded())) {
|
||||
gSaveContext.questId = QUEST_RANDOMIZER;
|
||||
|
||||
Randomizer_InitSaveFile();
|
||||
} else if (currentQuest == QUEST_MASTER) {
|
||||
gSaveContext.questId = QUEST_MASTER;
|
||||
} else {
|
||||
gSaveContext.questId = currentQuest;
|
||||
}
|
||||
|
||||
Save_SaveFile();
|
||||
|
@ -258,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
|
||||
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
|
||||
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true,
|
||||
|
@ -689,7 +689,7 @@ void EnPartner_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
uint16_t partnerButtons[7] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT, BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT};
|
||||
uint8_t buttonMax = 3;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonMax = ARRAY_COUNT(gSaveContext.equips.cButtonSlots);
|
||||
}
|
||||
|
||||
|
@ -2213,7 +2213,7 @@ s32 Player_ItemIsItemAction(s32 item1, s32 itemAction) {
|
||||
}
|
||||
|
||||
s32 Player_GetItemOnButton(PlayState* play, s32 index) {
|
||||
if (index >= ((CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) ? 8 : 4)) {
|
||||
if (index >= ((CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) ? 8 : 4)) {
|
||||
return ITEM_NONE;
|
||||
} else if (play->bombchuBowlingStatus != 0) {
|
||||
return (play->bombchuBowlingStatus > 0) ? ITEM_BOMBCHU : ITEM_NONE;
|
||||
@ -2254,7 +2254,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
|
||||
maskItemAction = this->currentMask - 1 + PLAYER_IA_MASK_KEATON;
|
||||
|
||||
bool hasOnDpad = false;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) {
|
||||
hasOnDpad |= Player_ItemIsItemAction(DPAD_ITEM(buttonIndex), maskItemAction);
|
||||
}
|
||||
@ -2269,7 +2269,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
|
||||
if (!(this->stateFlags1 & (PLAYER_STATE1_ITEM_OVER_HEAD | PLAYER_STATE1_IN_CUTSCENE)) && !func_8008F128(this)) {
|
||||
if (this->itemAction >= PLAYER_IA_FISHING_POLE) {
|
||||
bool hasOnDpad = false;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) {
|
||||
hasOnDpad |= Player_ItemIsInUse(this, DPAD_ITEM(buttonIndex));
|
||||
}
|
||||
@ -2660,7 +2660,7 @@ int func_80834E44(PlayState* play) {
|
||||
|
||||
int func_80834E7C(PlayState* play) {
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
return (play->shootingGalleryStatus != 0) &&
|
||||
@ -5634,7 +5634,7 @@ s32 Player_ActionChange_4(Player* this, PlayState* play) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_NAVI_ALERT;
|
||||
}
|
||||
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, CVarGetInteger(CVAR_SETTING("NaviOnL"), 0) ? BTN_L : BTN_CUP) && !sp28) {
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, CVarGetInteger(CVAR_ENHANCEMENT("NaviOnL"), 0) ? BTN_L : BTN_CUP) && !sp28) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5683,7 +5683,7 @@ s32 Player_ActionChange_0(Player* this, PlayState* play) {
|
||||
if ((this->unk_664 != NULL) && (CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_NAVI_HAS_INFO) ||
|
||||
(this->unk_664->naviEnemyId != 0xFF))) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_NAVI_ALERT;
|
||||
} else if ((this->naviTextId == 0 || CVarGetInteger(CVAR_SETTING("NaviOnL"), 0)) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
} else if ((this->naviTextId == 0 || CVarGetInteger(CVAR_ENHANCEMENT("NaviOnL"), 0)) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
(YREG(15) != 0x10) &&
|
||||
(YREG(15) != 0x20) && !func_8083B8F4(this, play)) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
@ -6540,9 +6540,9 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) {
|
||||
maxSpeed *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping2"), 1.0f);
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER1)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER1)) {
|
||||
maxSpeed *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping1"), 1.0f);
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER2)) {
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER2)) {
|
||||
maxSpeed *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping2"), 1.0f);
|
||||
}
|
||||
}
|
||||
@ -6921,7 +6921,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) {
|
||||
|
||||
s32 Player_ActionChange_9(Player* this, PlayState* play) {
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if ((this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) && (this->heldActor != NULL) &&
|
||||
@ -8286,9 +8286,9 @@ void Player_Action_80842180(Player* this, PlayState* play) {
|
||||
sp2C *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping2"), 1.0f);
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER1)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER1)) {
|
||||
sp2C *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping1"), 1.0f);
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER2)) {
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER2)) {
|
||||
sp2C *= CVarGetFloat(CVAR_SETTING("WalkModifier.Mapping2"), 1.0f);
|
||||
}
|
||||
}
|
||||
@ -9066,7 +9066,7 @@ void Player_Action_8084411C(Player* this, PlayState* play) {
|
||||
Actor* heldActor = this->heldActor;
|
||||
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) &&
|
||||
@ -9846,7 +9846,7 @@ void Player_Action_80846260(Player* this, PlayState* play) {
|
||||
}
|
||||
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if (this->av2.actionVar2 == 0) {
|
||||
@ -11645,10 +11645,10 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
if (CVarGetInteger(CVAR_SETTING("WalkModifier.Enabled"), 0) && CVarGetInteger(CVAR_SETTING("WalkModifier.SpeedToggle"), 0)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER1)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_CUSTOM_MODIFIER1)) {
|
||||
gWalkSpeedToggle1 = !gWalkSpeedToggle1;
|
||||
}
|
||||
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER2)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_CUSTOM_MODIFIER2)) {
|
||||
gWalkSpeedToggle2 = !gWalkSpeedToggle2;
|
||||
}
|
||||
}
|
||||
@ -12101,9 +12101,9 @@ void func_8084AEEC(Player* this, f32* arg1, f32 arg2, s16 arg3) {
|
||||
}
|
||||
// sControlInput is NULL to prevent inputs while surfacing after obtaining an underwater item so we want to ignore it for that case
|
||||
} else if (sControlInput != NULL) {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER1)) {
|
||||
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER1)) {
|
||||
swimMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SwimMapping1"), 1.0f);
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER2)) {
|
||||
} else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_CUSTOM_MODIFIER2)) {
|
||||
swimMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SwimMapping2"), 1.0f);
|
||||
}
|
||||
}
|
||||
@ -12252,7 +12252,7 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) {
|
||||
}
|
||||
|
||||
u16 buttonsToCheck = BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) != 0) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if ((this->csAction != 0) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || func_80833B54(this) ||
|
||||
|
@ -963,7 +963,7 @@ void DrawSeedHashSprites(FileChooseContext* this) {
|
||||
if (this->configMode == CM_MAIN_MENU &&
|
||||
(this->selectMode != SM_CONFIRM_FILE || Save_GetSaveMetaInfo(this->selectedFileIndex)->randoSave == 1)) {
|
||||
|
||||
if (this->fileInfoAlpha[this->selectedFileIndex] > 0) {
|
||||
if (this->fileInfoAlpha[this->selectedFileIndex] > 0 && Save_GetSaveMetaInfo(this->selectedFileIndex)->randoSave) {
|
||||
// Use file info alpha to match fading
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileInfoAlpha[this->selectedFileIndex]);
|
||||
|
||||
|
@ -214,8 +214,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||
s16 cursorY;
|
||||
s16 oldCursorPoint;
|
||||
bool dpad = (CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
||||
bool pauseAnyCursor = (CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
bool pauseAnyCursor = (CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
@ -552,7 +552,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||
}
|
||||
|
||||
u16 buttonsToCheck = BTN_A | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) && (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) && (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
|
||||
|
@ -423,8 +423,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||
s16 oldCursorPoint;
|
||||
s16 moveCursorResult;
|
||||
bool dpad = (CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
||||
bool pauseAnyCursor = pauseCtx->cursorSpecialPos == 0 && ((CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON));
|
||||
bool pauseAnyCursor = pauseCtx->cursorSpecialPos == 0 && ((CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON));
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
@ -677,7 +677,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||
if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) {
|
||||
KaleidoScope_HandleItemCycles(play);
|
||||
u16 buttonsToCheck = BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT;
|
||||
if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0) && (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0) && (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
}
|
||||
if (CHECK_BTN_ANY(input->press.button, buttonsToCheck)) {
|
||||
@ -811,7 +811,7 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX,
|
||||
pauseCtx->equipTargetCBtn = 1;
|
||||
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
|
||||
pauseCtx->equipTargetCBtn = 2;
|
||||
} else if (CVarGetInteger(CVAR_SETTING("DpadEquips"), 0)) {
|
||||
} else if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0)) {
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) {
|
||||
pauseCtx->equipTargetCBtn = 3;
|
||||
} else if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) {
|
||||
|
@ -2067,8 +2067,8 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
bool pauseAnyCursor =
|
||||
(CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
(CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
if (!pauseCtx->pageIndex && (!pauseAnyCursor || (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { // pageIndex == PAUSE_ITEM
|
||||
pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] =
|
||||
WREG(49 + gSaveContext.language);
|
||||
@ -2205,8 +2205,8 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) {
|
||||
void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
u16 sp2A;
|
||||
bool pauseAnyCursor = (CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_SETTING("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
bool pauseAnyCursor = (CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) ||
|
||||
(CVarGetInteger(CVAR_ENHANCEMENT("PauseAnyCursor"), 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||
|
||||
if ((pauseCtx->namedItem != pauseCtx->cursorItem[pauseCtx->pageIndex]) ||
|
||||
((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->cursorSpecialPos != 0))) {
|
||||
@ -2874,7 +2874,7 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) {
|
||||
|
||||
for (phi_t3 = 1; phi_t3 < ARRAY_COUNT(gSaveContext.equips.buttonItems); phi_t3++, phi_t2 += 4) {
|
||||
if (gSaveContext.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE &&
|
||||
((phi_t3 < 4) || CVarGetInteger(CVAR_SETTING("DpadEquips"), 0))) {
|
||||
((phi_t3 < 4) || CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0))) {
|
||||
phi_t4 = gSaveContext.equips.cButtonSlots[phi_t3 - 1] * 4;
|
||||
|
||||
pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] =
|
||||
|
Loading…
Reference in New Issue
Block a user