Add window to customize specific controls (#1122)

This commit is contained in:
lilDavid 2022-08-16 02:43:09 -05:00 committed by GitHub
commit 46a421f933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 753 additions and 363 deletions

View file

@ -1162,10 +1162,27 @@ namespace SohImGui {
PaddedSeparator();
if (ImGui::BeginMenu("Controls")) {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(12.0f, 6.0f));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
float availableWidth = ImGui::GetContentRegionAvail().x;
if (ImGui::Button(
GetWindowButtonText("Customize Game Controls", CVar_GetS32("gGameControlEditorEnabled", 0)).c_str(),
ImVec2(availableWidth, 0)
)) {
bool currentValue = CVar_GetS32("gGameControlEditorEnabled", 0);
CVar_SetS32("gGameControlEditorEnabled", !currentValue);
needs_save = true;
customWindows["Game Control Editor"].enabled = CVar_GetS32("gGameControlEditorEnabled", 0);
}
ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1);
// TODO mutual exclusions -- There should be some system to prevent conclifting enhancements from being selected
EnhancementCheckbox("D-pad Support on Pause and File Select", "gDpadPauseName");
PaddedEnhancementCheckbox("D-pad Support on Pause and File Select", "gDpadPauseName");
Tooltip("Enables Pause and File Select screen navigation with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate");
PaddedEnhancementCheckbox("D-pad Support in Ocarina and Text Choice", "gDpadOcarinaText", true, false);
PaddedEnhancementCheckbox("D-pad Support in Text Choice", "gDpadText", true, false);
PaddedEnhancementCheckbox("D-pad Support for Browsing Shop Items", "gDpadShop", true, false);
PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips", true, false);
Tooltip("Allows the D-pad to be used as extra C buttons");