Change gPauseAnyCursor into combobox (#2423)
* Change gPauseAnyCursor into combobox * Add enums * Change naming
This commit is contained in:
parent
4e08eca1b9
commit
612700c2ab
|
@ -2222,6 +2222,13 @@ typedef struct {
|
||||||
const char** palettes;
|
const char** palettes;
|
||||||
} SkyboxTableEntry;
|
} SkyboxTableEntry;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
/* 0x00 */ PAUSE_ANY_CURSOR_RANDO_ONLY,
|
||||||
|
/* 0x01 */ PAUSE_ANY_CURSOR_ALWAYS_ON,
|
||||||
|
/* 0x02 */ PAUSE_ANY_CURSOR_ALWAYS_OFF,
|
||||||
|
/* 0x03 */ PAUSE_ANY_CURSOR_MAX
|
||||||
|
} PauseCursorAnySlotOptions;
|
||||||
|
|
||||||
#define ROM_FILE(name) \
|
#define ROM_FILE(name) \
|
||||||
{ 0, 0, #name }
|
{ 0, 0, #name }
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
#include <variables.h>
|
||||||
|
|
||||||
#include <ImGui/imgui.h>
|
#include <ImGui/imgui.h>
|
||||||
#include <ImGui/imgui_internal.h>
|
#include <ImGui/imgui_internal.h>
|
||||||
|
@ -296,6 +297,12 @@ namespace GameControlEditor {
|
||||||
ImVec2 cursor = ImGui::GetCursorPos();
|
ImVec2 cursor = ImGui::GetCursorPos();
|
||||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||||
SohImGui::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail());
|
SohImGui::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("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_MAX, PAUSE_ANY_CURSOR_RANDO_ONLY);
|
||||||
|
DrawHelpIcon("Allows the cursor on the pause menu to be over any slot. Sometimes required in rando to select "
|
||||||
|
"certain items.");
|
||||||
|
UIWidgets::Spacer(0);
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Enable walk speed modifiers", "gEnableWalkModify", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Enable walk speed modifiers", "gEnableWalkModify", true, false);
|
||||||
DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above");
|
DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above");
|
||||||
if (CVarGetInteger("gEnableWalkModify", 0)) {
|
if (CVarGetInteger("gEnableWalkModify", 0)) {
|
||||||
|
@ -307,8 +314,6 @@ namespace GameControlEditor {
|
||||||
SohImGui::EndGroupPanel();
|
SohImGui::EndGroupPanel();
|
||||||
}
|
}
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Allow the cursor to be on any slot", "gPauseAnyCursor");
|
|
||||||
DrawHelpIcon("Allows the cursor on the pause menu to be over any slot\nSimilar to Rando and Spaceworld 97");
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
|
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
|
||||||
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
|
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
|
||||||
SohImGui::EndGroupPanel();
|
SohImGui::EndGroupPanel();
|
||||||
|
|
|
@ -599,8 +599,6 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
|
||||||
|
|
||||||
// Autosave
|
// Autosave
|
||||||
PRESET_ENTRY_S32("gAutosave", 1),
|
PRESET_ENTRY_S32("gAutosave", 1),
|
||||||
// Allow the cursor to be on any slot
|
|
||||||
PRESET_ENTRY_S32("gPauseAnyCursor", 1),
|
|
||||||
|
|
||||||
// Customize Fishing Behaviour
|
// Customize Fishing Behaviour
|
||||||
PRESET_ENTRY_S32("gCustomizeFishing", 1),
|
PRESET_ENTRY_S32("gCustomizeFishing", 1),
|
||||||
|
|
|
@ -177,6 +177,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
s16 cursorY;
|
s16 cursorY;
|
||||||
s16 oldCursorPoint;
|
s16 oldCursorPoint;
|
||||||
bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
||||||
|
bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) ||
|
||||||
|
(CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
@ -226,7 +228,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
cursorMoveResult = 1;
|
cursorMoveResult = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) {
|
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || pauseAnyCursor) {
|
||||||
cursorMoveResult = 2;
|
cursorMoveResult = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -260,7 +262,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) {
|
if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) {
|
||||||
cursorMoveResult = 1;
|
cursorMoveResult = 1;
|
||||||
}
|
}
|
||||||
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) {
|
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || pauseAnyCursor) {
|
||||||
cursorMoveResult = 2;
|
cursorMoveResult = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -311,7 +313,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
cursorMoveResult = 1;
|
cursorMoveResult = 1;
|
||||||
}
|
}
|
||||||
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
|
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
|
||||||
gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) {
|
gSaveContext.inventory.equipment) || pauseAnyCursor) {
|
||||||
cursorMoveResult = 2;
|
cursorMoveResult = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -329,7 +331,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
cursorMoveResult = 1;
|
cursorMoveResult = 1;
|
||||||
}
|
}
|
||||||
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
|
} else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] &
|
||||||
gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) {
|
gSaveContext.inventory.equipment) || pauseAnyCursor) {
|
||||||
cursorMoveResult = 2;
|
cursorMoveResult = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -101,6 +101,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
s16 oldCursorPoint;
|
s16 oldCursorPoint;
|
||||||
s16 moveCursorResult;
|
s16 moveCursorResult;
|
||||||
bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP));
|
||||||
|
bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) ||
|
||||||
|
(CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
@ -142,7 +144,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
pauseCtx->cursorX[PAUSE_ITEM] -= 1;
|
pauseCtx->cursorX[PAUSE_ITEM] -= 1;
|
||||||
pauseCtx->cursorPoint[PAUSE_ITEM] -= 1;
|
pauseCtx->cursorPoint[PAUSE_ITEM] -= 1;
|
||||||
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
||||||
CVarGetInteger("gPauseAnyCursor", 0)) {
|
pauseAnyCursor) {
|
||||||
moveCursorResult = 1;
|
moveCursorResult = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -174,7 +176,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
pauseCtx->cursorX[PAUSE_ITEM] += 1;
|
pauseCtx->cursorX[PAUSE_ITEM] += 1;
|
||||||
pauseCtx->cursorPoint[PAUSE_ITEM] += 1;
|
pauseCtx->cursorPoint[PAUSE_ITEM] += 1;
|
||||||
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
||||||
CVarGetInteger("gPauseAnyCursor", 0)) {
|
pauseAnyCursor) {
|
||||||
moveCursorResult = 1;
|
moveCursorResult = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -296,7 +298,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
pauseCtx->cursorY[PAUSE_ITEM] -= 1;
|
pauseCtx->cursorY[PAUSE_ITEM] -= 1;
|
||||||
pauseCtx->cursorPoint[PAUSE_ITEM] -= 6;
|
pauseCtx->cursorPoint[PAUSE_ITEM] -= 6;
|
||||||
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
||||||
CVarGetInteger("gPauseAnyCursor", 0)) {
|
pauseAnyCursor) {
|
||||||
moveCursorResult = 1;
|
moveCursorResult = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -310,7 +312,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
pauseCtx->cursorY[PAUSE_ITEM] += 1;
|
pauseCtx->cursorY[PAUSE_ITEM] += 1;
|
||||||
pauseCtx->cursorPoint[PAUSE_ITEM] += 6;
|
pauseCtx->cursorPoint[PAUSE_ITEM] += 6;
|
||||||
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) ||
|
||||||
CVarGetInteger("gPauseAnyCursor", 0)) {
|
pauseAnyCursor) {
|
||||||
moveCursorResult = 1;
|
moveCursorResult = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1912,7 +1912,10 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!pauseCtx->pageIndex && (!CVarGetInteger("gPauseAnyCursor", 0) || (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { // pageIndex == PAUSE_ITEM
|
bool pauseAnyCursor =
|
||||||
|
(CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) ||
|
||||||
|
(CVarGetInteger("gPauseAnyCursor", 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] =
|
pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] =
|
||||||
WREG(49 + gSaveContext.language);
|
WREG(49 + gSaveContext.language);
|
||||||
|
|
||||||
|
@ -2048,6 +2051,8 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) {
|
||||||
void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
u16 sp2A;
|
u16 sp2A;
|
||||||
|
bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) ||
|
||||||
|
(CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON);
|
||||||
|
|
||||||
if ((pauseCtx->namedItem != pauseCtx->cursorItem[pauseCtx->pageIndex]) ||
|
if ((pauseCtx->namedItem != pauseCtx->cursorItem[pauseCtx->pageIndex]) ||
|
||||||
((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->cursorSpecialPos != 0))) {
|
((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->cursorSpecialPos != 0))) {
|
||||||
|
@ -2057,7 +2062,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
||||||
|
|
||||||
osCreateMesgQueue(&pauseCtx->loadQueue, &pauseCtx->loadMsg, 1);
|
osCreateMesgQueue(&pauseCtx->loadQueue, &pauseCtx->loadMsg, 1);
|
||||||
|
|
||||||
if (CVarGetInteger("gPauseAnyCursor", 0) &&
|
if (pauseAnyCursor &&
|
||||||
((pauseCtx->pageIndex == PAUSE_EQUIP && pauseCtx->cursorX[PAUSE_EQUIP] != 0 && !CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) ||
|
((pauseCtx->pageIndex == PAUSE_EQUIP && pauseCtx->cursorX[PAUSE_EQUIP] != 0 && !CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) ||
|
||||||
(pauseCtx->pageIndex == PAUSE_ITEM && gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] == ITEM_NONE))) {
|
(pauseCtx->pageIndex == PAUSE_ITEM && gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] == ITEM_NONE))) {
|
||||||
pauseCtx->namedItem = PAUSE_ITEM_NONE;
|
pauseCtx->namedItem = PAUSE_ITEM_NONE;
|
||||||
|
|
Loading…
Reference in New Issue