From a2d64864dd581e4b72ea4d9911040db923541491 Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Wed, 6 Jul 2022 02:52:01 +0200 Subject: [PATCH] Cosmetics menu rework (#589) * - * DPad/some margin fix(left side) * various ImGui stuff and fixes * disabled kaleido menu (non working) * fix win being dumb * same for C btn this time * Fix windows build * Beating hearts fix * Default win size and some placement fix * Fix Dpad Ammo & C notes, Kaleido, white dog * some texts fix and tab move * Add stone of agony, some fixes and build correctly * precise item place with Dpad * Gamecube -> GameCube Co-authored-by: Baoulettes --- libultraship/libultraship/ImGuiImpl.cpp | 233 +--- soh/include/z64.h | 8 +- soh/soh.vcxproj | 2 + soh/soh.vcxproj.filters | 6 + .../cosmetics/CosmeticsEditor.cpp | 1036 ++++++++++++++ .../Enhancements/cosmetics/CosmeticsEditor.h | 3 + soh/soh/OTRGlobals.cpp | 2 + soh/src/code/z_actor.c | 60 +- soh/src/code/z_eff_blure.c | 29 + soh/src/code/z_lifemeter.c | 116 +- soh/src/code/z_map_exp.c | 206 ++- soh/src/code/z_map_mark.c | 71 +- soh/src/code/z_message_PAL.c | 241 +++- soh/src/code/z_parameter.c | 1222 +++++++++++++++-- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 21 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 21 +- .../actors/ovl_Arrow_Light/z_arrow_light.c | 21 +- soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c | 15 + .../actors/ovl_En_Firefly/z_en_firefly.c | 21 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 28 +- .../actors/ovl_Magic_Dark/z_magic_dark.c | 9 +- .../actors/ovl_Magic_Fire/z_magic_fire.c | 9 +- .../actors/ovl_player_actor/z_player.c | 70 +- .../ovl_kaleido_scope/z_kaleido_collect.c | 42 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 69 +- 25 files changed, 3027 insertions(+), 534 deletions(-) create mode 100644 soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp create mode 100644 soh/soh/Enhancements/cosmetics/CosmeticsEditor.h diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index a01defd3b..5e9b404d9 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -65,40 +65,22 @@ namespace SohImGui { GameOverlay* overlay = new GameOverlay; bool p_open = false; bool needs_save = false; - ImVec4 hearts_colors; - ImVec4 hearts_dd_colors; - ImVec4 a_btn_colors; - ImVec4 b_btn_colors; - ImVec4 c_btn_colors; - ImVec4 start_btn_colors; - ImVec4 magic_border_colors; - ImVec4 magic_remaining_colors; - ImVec4 magic_use_colors; - ImVec4 minimap_colors; - ImVec4 rupee_colors; - ImVec4 smolekey_colors; - ImVec4 fileselect_colors; - ImVec4 fileselect_text_colors; - ImVec4 kokiri_col; - ImVec4 goron_col; - ImVec4 zora_col; - ImVec4 navi_idle_i_col; - ImVec4 navi_idle_o_col; - ImVec4 navi_npc_i_col; - ImVec4 navi_npc_o_col; - ImVec4 navi_enemy_i_col; - ImVec4 navi_enemy_o_col; - ImVec4 navi_prop_i_col; - ImVec4 navi_prop_o_col; const char* RainbowColorCvarList[] = { //This is the list of possible CVars that has rainbow effect. - "gTunic_Kokiri_","gTunic_Goron_","gTunic_Zora_", - "gCCHeartsPrim","gDDCCHeartsPrim", - "gCCABtnPrim","gCCBBtnPrim","gCCCBtnPrim","gCCStartBtnPrim", - "gCCMagicBorderPrim","gCCMagicPrim","gCCMagicUsePrim", - "gCCMinimapPrim","gCCRupeePrim","gCCKeysPrim", - "gCCFileChoosePrim", "gCCFileChooseTextPrim" + "gTunic_Kokiri_", "gTunic_Goron_", "gTunic_Zora_", + "gCCHeartsPrim", "gDDCCHeartsPrim", "gCCDDHeartsPrim", + "gCCABtnPrim", "gCCBBtnPrim", "gCCCBtnPrim", "gCCStartBtnPrim", + "gCCCUBtnPrim", "gCCCLBtnPrim", "gCCCRBtnPrim", "gCCCDBtnPrim", "gCCDpadPrim", + "gCCMagicBorderNormPrim", "gCCMagicBorderPrim", "gCCMagicPrim", "gCCMagicUsePrim", + "gCCMinimapPrim", "gCCMinimapDGNPrim", "gCCMinimapCPPrim", "gCCMinimapLEPrim", + "gCCRupeePrim", "gCCKeysPrim", "gDog1Col", "gDog2Col", "gCCVSOAPrim", + "gKeese1_Ef_Prim","gKeese2_Ef_Prim","gKeese1_Ef_Env","gKeese2_Ef_Env", + "gDF_Col", "gDF_Env", + "gNL_Diamond_Col", "gNL_Diamond_Env", "gNL_Orb_Col", "gNL_Orb_Env", + "gTrailCol", "gCharged1Col", "gCharged1ColEnv", "gCharged2Col", "gCharged2ColEnv", + "gCCFileChoosePrim", "gCCFileChooseTextPrim", "gCCEquipmentsPrim", "gCCItemsPrim", + "gCCMapsPrim", "gCCQuestsPrim", "gCCSavePrim", "gCCGameoverPrim", }; const char* filters[3] = { @@ -652,7 +634,8 @@ namespace SohImGui { } void EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow, bool has_alpha, bool TitleSameLine) { - std::string Cvar_Red = cvarName; + //This will be moved to external cosmetics ed + std::string Cvar_Red = cvarName; Cvar_Red += "R"; std::string Cvar_Green = cvarName; Cvar_Green += "G"; @@ -689,21 +672,17 @@ namespace SohImGui { } //ImGui::SameLine(); // Removing that one to gain some width spacing on the HUD editor - ImGui::NewLine(); ImGui::PushItemWidth(-FLT_MIN); ResetColor(cvarName, &ColorRGBA, default_colors, has_alpha); ImGui::SameLine(); RandomizeColor(cvarName, &ColorRGBA); if (allow_rainbow) { - - if (ImGui::GetWindowSize().x > 560) { + if (ImGui::GetContentRegionAvail().x > 185) { ImGui::SameLine(); } - else { - ImGui::NewLine(); - } RainbowColor(cvarName, &ColorRGBA); } + ImGui::NewLine(); ImGui::PopItemWidth(); } @@ -1198,23 +1177,6 @@ namespace SohImGui { ImGui::EndMenu(); } - if (ImGui::BeginMenu("Cosmetics")) { - EnhancementCheckbox("Cosmetics editor", "gCosmeticEditor"); - Tooltip("Edit Navi and Link's Tunics color."); - EnhancementCheckbox("HUD Margins editor", "gUseMargins"); - EnhancementRadioButton("N64 interface", "gHudColors", 0); - Tooltip("Change interface color to N64 style."); - EnhancementRadioButton("GameCube interface", "gHudColors", 1); - Tooltip("Change interface color to GameCube style."); - EnhancementRadioButton("Custom interface", "gHudColors", 2); - Tooltip("Change interface color to your own made style."); - if (CVar_GetS32("gHudColors", 1) == 2) { - EnhancementCheckbox("Interface editor", "gColorsEditor"); - Tooltip("Edit the colors used for your own interface"); - } - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Cheats")) { if (ImGui::BeginMenu("Infinite...")) { @@ -1271,167 +1233,6 @@ namespace SohImGui { ImGui::EndMenu(); } - bool Margins_isOpen = CVar_GetS32("gUseMargins", 0); - bool Cosmetics_isOpen = CVar_GetS32("gCosmeticEditor", 0); - bool Interface_isOpen = CVar_GetS32("gColorsEditor", 0); - - if (Margins_isOpen) { - if (!Margins_isOpen) { - CVar_SetS32("gHUDMargins", 0); - return; - } - ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver); - ImGui::Begin("Margins Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing); - if (ImGui::BeginTabBar("Margins Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { - if (ImGui::BeginTabItem("Interface margins")) { - EnhancementCheckbox("Use margins", "gHUDMargins"); - Tooltip("Enable/Disable custom margins. \nIf disabled you will have original margins"); - EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", -20, 20, ""); - EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, 25, ""); - EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", -25, 25, ""); - EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", -20, 20, ""); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::End(); - } - if (Cosmetics_isOpen) { - if (!Cosmetics_isOpen) { - CVar_SetS32("gCosmeticEditor", 0); - return; - } - ImGui::SetNextWindowSize(ImVec2(500, 627), ImGuiCond_FirstUseEver); - ImGui::Begin("Cosmetics Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing); - if (ImGui::BeginTabBar("Cosmetics Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { - if (ImGui::BeginTabItem("Navi")) { - EnhancementCheckbox("Custom colors for Navi", "gUseNaviCol"); - Tooltip("Enable/Disable custom Navi's colors. \nIf disabled you will have original colors for Navi.\nColors are refreshed when Navi goes back in your pockets."); - EnhancementColor("Navi Idle Inner", "gNavi_Idle_Inner_", navi_idle_i_col, ImVec4(255, 255, 255, 255), false); - Tooltip("Inner color for Navi (idle flying around)"); - EnhancementColor("Navi Idle Outer", "gNavi_Idle_Outer_", navi_idle_o_col, ImVec4(0, 0, 255, 255), false); - Tooltip("Outer color for Navi (idle flying around)"); - ImGui::Separator(); - EnhancementColor("Navi NPC Inner", "gNavi_NPC_Inner_", navi_npc_i_col, ImVec4(150, 150, 255, 255), false); - Tooltip("Inner color for Navi (when Navi fly around NPCs)"); - EnhancementColor("Navi NPC Outer", "gNavi_NPC_Outer_", navi_npc_o_col, ImVec4(150, 150, 255, 255), false); - Tooltip("Outer color for Navi (when Navi fly around NPCs)"); - ImGui::Separator(); - EnhancementColor("Navi Enemy Inner", "gNavi_Enemy_Inner_", navi_enemy_i_col, ImVec4(255, 255, 0, 255), false); - Tooltip("Inner color for Navi (when Navi fly around Enemies or Bosses)"); - EnhancementColor("Navi Enemy Outer", "gNavi_Enemy_Outer_", navi_enemy_o_col, ImVec4(220, 155, 0, 255), false); - Tooltip("Outer color for Navi (when Navi fly around Enemies or Bosses)"); - ImGui::Separator(); - EnhancementColor("Navi Prop Inner", "gNavi_Prop_Inner_", navi_prop_i_col, ImVec4(0, 255, 0, 255), false); - Tooltip("Inner color for Navi (when Navi fly around props (signs etc))"); - EnhancementColor("Navi Prop Outer", "gNavi_Prop_Outer_", navi_prop_o_col, ImVec4(0, 255, 0, 255), false); - Tooltip("Outer color for Navi (when Navi fly around props (signs etc))"); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Tunics")) { - EnhancementCheckbox("Custom colors on tunics", "gUseTunicsCol"); - Tooltip("Enable/Disable custom Link's tunics colors. \nIf disabled you will have original colors for Link's tunics."); - EnhancementColor("Kokiri Tunic", "gTunic_Kokiri_", kokiri_col, ImVec4(30, 105, 27, 255)); - ImGui::Separator(); - EnhancementColor("Goron Tunic", "gTunic_Goron_", goron_col, ImVec4(100, 20, 0, 255)); - ImGui::Separator(); - EnhancementColor("Zora Tunic", "gTunic_Zora_", zora_col, ImVec4(0, 60, 100, 255)); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::End(); - } - if (Interface_isOpen) { - if (!Interface_isOpen) { - CVar_SetS32("gColorsEditor", 0); - return; - } - ImGui::SetNextWindowSize(ImVec2(215, 627), ImGuiCond_FirstUseEver); - ImGui::Begin("Interface Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing); - if (ImGui::BeginTabBar("Interface Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { - if (ImGui::BeginTabItem("HUD")) { - if (ImGui::BeginTable("tableInterfaceEditor", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { - ImGui::TableSetupColumn("Hearts", ImGuiTableColumnFlags_WidthStretch, 200.0f); - ImGui::TableSetupColumn("Magic Bar", ImGuiTableColumnFlags_WidthStretch, 200.0f); - ImGui::TableSetupColumn("Buttons", ImGuiTableColumnFlags_WidthStretch, 200.0f); - ImGui::TableHeadersRow(); - ImGui::TableNextRow(); - ImGui::TableNextColumn(); - // COLUMN 1.1 - HEARTS - ImGui::PushItemWidth(-FLT_MIN); - EnhancementColor("Hearts inner", "gCCHeartsPrim", hearts_colors, ImVec4(255, 70, 50, 255)); - Tooltip("Hearts inner color (red in original)\nAffect both Normal Hearts and the ones in Double Defense"); - ImGui::Separator(); - EnhancementColor("Hearts double def", "gDDCCHeartsPrim", hearts_dd_colors, ImVec4(255, 255, 255, 255)); - Tooltip("Hearts outline color (white in original)\nAffect Double Defense outline only."); - ImGui::PopItemWidth(); - ImGui::Separator(); - if (ImGui::BeginTable("tableMisc", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { - ImGui::TableSetupColumn("Misc", ImGuiTableColumnFlags_WidthStretch, 600.0f); - ImGui::TableHeadersRow(); - ImGui::TableNextRow(); - ImGui::TableNextColumn(); - // COLUMN 1.2 - MISC - ImGui::PushItemWidth(-FLT_MIN); - EnhancementColor("Minimap color", "gCCMinimapPrim", minimap_colors, ImVec4(0, 255, 255, 255)); - Tooltip("Affect the Dungeon and Overworld minimaps."); - ImGui::Separator(); - EnhancementColor("Rupee icon color", "gCCRupeePrim", rupee_colors, ImVec4(120, 120, 120, 255)); - Tooltip("Affect the Rupee icon on interface\nGreen by default."); - ImGui::Separator(); - EnhancementColor("Small Keys icon color", "gCCKeysPrim", smolekey_colors, ImVec4(200, 230, 255, 255)); - Tooltip("Affect the Small keys icon on interface\nGray by default."); - ImGui::PopItemWidth(); - ImGui::EndTable(); - } - ImGui::TableNextColumn(); - // COLUMN 2 - MAGIC BAR - ImGui::PushItemWidth(-FLT_MIN); - EnhancementColor("Magic bar borders", "gCCMagicBorderPrim", magic_border_colors, ImVec4(255, 255, 255, 255)); - Tooltip("Affect the border of the magic bar when being used\nWhite flash in original game."); - ImGui::Separator(); - EnhancementColor("Magic bar main color", "gCCMagicPrim", magic_remaining_colors, ImVec4(0, 200, 0, 255)); - Tooltip("Affect the magic bar color\nGreen in original game."); - ImGui::Separator(); - EnhancementColor("Magic bar being used", "gCCMagicUsePrim", magic_use_colors, ImVec4(250, 250, 0, 255)); - Tooltip("Affect the magic bar when being used\nYellow in original game."); - ImGui::Separator(); - ImGui::PopItemWidth(); - ImGui::TableNextColumn(); - // COLUMN 3 - BUTTON - ImGui::PushItemWidth(-FLT_MIN); - EnhancementColor("A Buttons", "gCCABtnPrim", a_btn_colors, ImVec4(90, 90, 255, 255)); - Tooltip("A Buttons colors (Green in original GameCube)\nAffect A buttons colors on interface, in shops, messages boxes, ocarina notes and inventory cursors."); - ImGui::Separator(); - EnhancementColor("B Buttons", "gCCBBtnPrim", b_btn_colors, ImVec4(0, 150, 0, 255)); - Tooltip("B Button colors (Red in original GameCube)\nAffect B button colors on interface"); - ImGui::Separator(); - EnhancementColor("C Buttons", "gCCCBtnPrim", c_btn_colors, ImVec4(255, 160, 0, 255)); - Tooltip("C Buttons colors (Yellowish / Oranges in originals)\nAffect C buttons colors on interface, in inventory and ocarina notes"); - ImGui::Separator(); - EnhancementColor("Start Buttons", "gCCStartBtnPrim", start_btn_colors, ImVec4(120, 120, 120, 255)); - Tooltip("Start Button colors (gray in GameCube)\nAffect Start button colors in inventory"); - ImGui::Separator(); - ImGui::PopItemWidth(); - ImGui::EndTable(); - ImGui::EndTabItem(); - } - } - - if (ImGui::BeginTabItem("File Choose")) { - EnhancementColor("File Choose color", "gCCFileChoosePrim", fileselect_colors, ImVec4(100, 150, 255, 255)); - Tooltip("Affect the File Select."); - ImGui::Separator(); - EnhancementColor("Bottom text color", "gCCFileChooseTextPrim", fileselect_text_colors, ImVec4(0, 100, 255, 255)); - Tooltip("Affect the File Select."); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::End(); - } - for (const auto& category : windowCategories) { if (ImGui::BeginMenu(category.first.c_str())) { for (const std::string& name : category.second) { diff --git a/soh/include/z64.h b/soh/include/z64.h index c7978aa6e..5057def3d 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -257,9 +257,11 @@ typedef struct { /* 0x0A */ u8 durationTimer; // how long the title card appears for before fading /* 0x0B */ u8 delayTimer; // how long the title card waits to appear /* 0x0C */ s16 alpha; - /* 0x0E */ s16 intensity; - /* ---- */ s16 isBossCard; //To detect if that a Boss name title card. - /* ---- */ s16 hasTranslation; // to detect if the current title card has translation (used for bosses only) + /* ---- */ s16 intensityR; //Splited intensity per channel to support precise recolor + /* ---- */ s16 intensityG; + /* ---- */ s16 intensityB; + /* ---- */ s16 isBossCard; //To detect if that a Boss name title card. + /* ---- */ s16 hasTranslation; // to detect if the current title card has translation (used for bosses only) } TitleCardContext; // size = 0x10 typedef struct { diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj index caedb3437..b7a2a32de 100644 --- a/soh/soh.vcxproj +++ b/soh/soh.vcxproj @@ -179,6 +179,7 @@ + @@ -887,6 +888,7 @@ + diff --git a/soh/soh.vcxproj.filters b/soh/soh.vcxproj.filters index 9834248ac..08d6f332f 100644 --- a/soh/soh.vcxproj.filters +++ b/soh/soh.vcxproj.filters @@ -2208,6 +2208,9 @@ Source Files\soh + + Header Files\include + @@ -3782,6 +3785,9 @@ Source Files\soh + + Header Files\include + diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp new file mode 100644 index 000000000..3448d25f3 --- /dev/null +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -0,0 +1,1036 @@ +#include "CosmeticsEditor.h" +#include "../../util.h" +#include "../libultraship/ImGuiImpl.h" + +#include +#include +#include +#include +#include + +/** + * Colors variables + */ +float TablesCellsWidth = 300.0f; //1 Col +ImVec4 hearts_colors; +ImVec4 hearts_dd_colors; +ImVec4 hearts_ddi_colors; //DD inner colors +ImVec4 a_btn_colors; +ImVec4 b_btn_colors; +ImVec4 c_btn_colors; +ImVec4 start_btn_colors; +ImVec4 magic_border_colors; +ImVec4 magic_remaining_colors; +ImVec4 magic_use_colors; +ImVec4 minimap_colors; +ImVec4 rupee_colors; +ImVec4 smolekey_colors; +ImVec4 fileselect_colors; +ImVec4 fileselect_text_colors; +ImVec4 kokiri_col; +ImVec4 goron_col; +ImVec4 zora_col; +ImVec4 navi_idle_i_col; +ImVec4 navi_idle_o_col; +ImVec4 navi_npc_i_col; +ImVec4 navi_npc_o_col; +ImVec4 navi_enemy_i_col; +ImVec4 navi_enemy_o_col; +ImVec4 navi_prop_i_col; +ImVec4 navi_prop_o_col; +ImVec4 trailscol; +ImVec4 c_btn_u_colors; +ImVec4 c_btn_l_colors; +ImVec4 c_btn_d_colors; +ImVec4 c_btn_r_colors; +ImVec4 magic_bordern_colors; +ImVec4 firearrow_col; +ImVec4 icearrow_col; +ImVec4 lightarrow_col; +ImVec4 firearrow_colenv; +ImVec4 icearrow_colenv; +ImVec4 lightarrow_colenv; +ImVec4 charged1_col; +ImVec4 charged2_col; +ImVec4 charged1_colenv; +ImVec4 charged2_colenv; +ImVec4 Keese1_primcol; +ImVec4 Keese2_primcol; +ImVec4 Keese1_envcol; +ImVec4 Keese2_envcol; +ImVec4 doggo1col; +ImVec4 doggo2col; +ImVec4 df_col; +ImVec4 df_colenv; +ImVec4 nl_diam_col; +ImVec4 nl_diam_colenv; +ImVec4 nl_orb_col; +ImVec4 nl_orb_colenv; +ImVec4 dgn_minimap_colors; +ImVec4 cp_minimap_colors; +ImVec4 le_minimap_colors; +ImVec4 tc_ou_colors; +ImVec4 tc_bu_colors; +ImVec4 dpad_colors; +ImVec4 visualagony_colors; +/*ImVec4 menu_equips_colors; +ImVec4 menu_items_colors; +ImVec4 menu_map_colors; +ImVec4 menu_quest_colors; +ImVec4 menu_save_colors; +ImVec4 menu_gameover_colors;*/ +void Table_InitHeader(bool has_header = true) { + if (has_header) { + ImGui::TableHeadersRow(); + } + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); //This is to adjust Vertical pos of item in a cell to be normlized. + ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); +} +void Table_NextCol() { + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); +} +void Table_NextLine() { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); +} +void Draw_HelpIcon(const std::string& helptext, bool sameline = true, int Pos = 0) { + // place the ? button to the most of the right side of the cell it is using. + ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 15); + ImGui::SmallButton("?"); + SohImGui::Tooltip(helptext.c_str()); + if (sameline) { + //I do not use ImGui::SameLine(); because it make some element vanish. + ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 22); + } +} +void Draw_Npcs(){ + SohImGui::EnhancementCheckbox("Custom colors for Navi", "gUseNaviCol"); + SohImGui::Tooltip("Enable/Disable custom Navi's colors. \nIf disabled you will have original colors for Navi.\nColors are refreshed when Navi goes back in your pockets."); + if (CVar_GetS32("gUseNaviCol",0) && ImGui::BeginTable("tableNavi", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Inner colors##Navi", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Outer colors##Navi", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Inner color for Navi (idle flying around)"); + SohImGui::EnhancementColor("Navi Idle", "gNavi_Idle_Inner_", navi_idle_i_col, ImVec4(255, 255, 255, 255), false); + Table_NextCol(); + Draw_HelpIcon("Outer color for Navi (idle flying around)"); + SohImGui::EnhancementColor("Navi Idle", "gNavi_Idle_Outer_", navi_idle_o_col, ImVec4(0, 0, 255, 255), false); + Table_NextLine(); + Draw_HelpIcon("Inner color for Navi (when Navi fly around NPCs)"); + SohImGui::EnhancementColor("Navi NPC", "gNavi_NPC_Inner_", navi_npc_i_col, ImVec4(150, 150, 255, 255), false); + Table_NextCol(); + Draw_HelpIcon("Outer color for Navi (when Navi fly around NPCs)"); + SohImGui::EnhancementColor("Navi NPC", "gNavi_NPC_Outer_", navi_npc_o_col, ImVec4(150, 150, 255, 255), false); + Table_NextLine(); + Draw_HelpIcon("Inner color for Navi (when Navi fly around Enemies or Bosses)"); + SohImGui::EnhancementColor("Navi Enemy", "gNavi_Enemy_Inner_", navi_enemy_i_col, ImVec4(255, 255, 0, 255), false); + Table_NextCol(); + Draw_HelpIcon("Outer color for Navi (when Navi fly around Enemies or Bosses)"); + SohImGui::EnhancementColor("Navi Enemy", "gNavi_Enemy_Outer_", navi_enemy_o_col, ImVec4(220, 155, 0, 255), false); + Table_NextLine(); + Draw_HelpIcon("Inner color for Navi (when Navi fly around props (signs etc))"); + SohImGui::EnhancementColor("Navi Prop", "gNavi_Prop_Inner_", navi_prop_i_col, ImVec4(0, 255, 0, 255), false); + Table_NextCol(); + Draw_HelpIcon("Outer color for Navi (when Navi fly around props (signs etc))"); + SohImGui::EnhancementColor("Navi Prop", "gNavi_Prop_Outer_", navi_prop_o_col, ImVec4(0, 255, 0, 255), false); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom colors for Keeses", "gUseKeeseCol"); + SohImGui::Tooltip("Enable/Disable custom Keese's elements colors. \nIf disabled you will have original element colors for Keese.\nColors are refreshed when Keese respawn (can be room reload)."); + if (CVar_GetS32("gUseKeeseCol",0) && ImGui::BeginTable("tableKeese", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Fire colors##Keese", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Ice colors##Keese", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(false); + Draw_HelpIcon("Affect the primary color of the Fire itself of the Keese"); + SohImGui::EnhancementColor("Fire Primary color", "gKeese1_Ef_Prim", Keese1_primcol, ImVec4(255, 255, 100, 255)); + Table_NextCol(); + Draw_HelpIcon("Affect the primary color of the Ice itself of the Keese"); + SohImGui::EnhancementColor("Fire Primary color", "gKeese2_Ef_Prim", Keese2_primcol, ImVec4(100, 200, 255, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the secondary color of the Fire itself of the Keese"); + SohImGui::EnhancementColor("Ice Secondary color", "gKeese1_Ef_Env", Keese1_envcol, ImVec4(255, 50, 0, 255)); + Table_NextCol(); + Draw_HelpIcon("Affect the secondary color of the Ice itself of the Keese"); + SohImGui::EnhancementColor("Ice Secondary color", "gKeese2_Ef_Env", Keese2_envcol, ImVec4(0, 0, 255, 255)); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom colors for Dogs", "gUseDogsCol"); + if (CVar_GetS32("gUseDogsCol",0) && ImGui::BeginTable("tableDogs", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Dog N.1 color", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Dog N.2 color", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect the colors of the white dog"); + SohImGui::EnhancementColor("Dog white", "gDog1Col", doggo1col, ImVec4(255,255,200,255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect the colors of the brown dog"); + SohImGui::EnhancementColor("Dog brown", "gDog2Col", doggo2col, ImVec4(150,100,50,255), true, false, true); + ImGui::EndTable(); + } +} +void Draw_ItemsSkills(){ + SohImGui::EnhancementCheckbox("Custom tunics color", "gUseTunicsCol"); + SohImGui::Tooltip("Enable/Disable custom Link's tunics colors. \nIf disabled you will have original colors for Link's tunics."); + if (CVar_GetS32("gUseTunicsCol",0) && ImGui::BeginTable("tableTunics", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Kokiri Tunic", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/3); + ImGui::TableSetupColumn("Goron Tunic", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/3); + ImGui::TableSetupColumn("Zora Tunic", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/3); + Table_InitHeader(); + Draw_HelpIcon("Affect Kokiri Tunic colors", false); + SohImGui::EnhancementColor("Kokiri Tunic", "gTunic_Kokiri_", kokiri_col, ImVec4(30, 105, 27, 255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect Goron Tunic colors", false); + SohImGui::EnhancementColor("Goron Tunic", "gTunic_Goron_", goron_col, ImVec4(100, 20, 0, 255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect Zora Tunic colors", false); + SohImGui::EnhancementColor("Zora Tunic", "gTunic_Zora_", zora_col, ImVec4(0, 60, 100, 255), true, false, true); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom arrows colors", "gUseArrowsCol"); + if (CVar_GetS32("gUseArrowsCol",0) && ImGui::BeginTable("tableArrows", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Primary colors##Arrows", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Env colors##Arrows", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Fire Arrows (primary)", "gFireArrowCol", firearrow_col, ImVec4(255,200,0,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Fire Arrows", "gFireArrowColEnv", firearrow_colenv, ImVec4(255,0,0,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Ice Arrows (primary)", "gIceArrowCol", icearrow_col, ImVec4(170,255,255,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Ice Arrows", "gIceArrowColEnv", icearrow_colenv, ImVec4(0,0,255,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Light Arrows (primary)", "gLightArrowCol", lightarrow_col, ImVec4(255,255,170,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Light Arrows", "gLightArrowColEnv", lightarrow_colenv, ImVec4(255,255,0,255)); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom spells colors", "gUseSpellsCol"); + if (CVar_GetS32("gUseSpellsCol",0) && ImGui::BeginTable("tableSpells", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Inner colors##Spells", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Outer colors##Spells", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Din's Fire (primary)", "gDF_Col", df_col, ImVec4(255,200,0,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Din's Fire", "gDF_Env", df_colenv, ImVec4(255,0,0,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Nayru's Love Diamond (primary)", "gNL_Diamond_Col", nl_diam_col, ImVec4(170,255,255,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Nayru's Love Diamond", "gNL_Diamond_Env", nl_diam_colenv, ImVec4(100,255,128,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Nayru's Love Orb (primary)", "gNL_Orb_Col", nl_orb_col, ImVec4(170,255,255,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Nayru's Love Orb", "gNL_Orb_Env", nl_orb_colenv, ImVec4(150,255,255,255)); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom spin attack colors", "gUseChargedCol"); + if (CVar_GetS32("gUseChargedCol",0) && ImGui::BeginTable("tableChargeAtk", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Primary colors##Charge", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Env colors##Charge", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Level 1 colors (primary)", "gCharged1Col", charged1_col, ImVec4(170,255,255,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Level 1 colors", "gCharged1ColEnv", charged1_colenv, ImVec4(0,100,255,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Primary colors"); + SohImGui::EnhancementColor("Level 2 colors (primary)", "gCharged2Col", charged2_col, ImVec4(255,255,170,255)); + Table_NextCol(); + Draw_HelpIcon("Affect Secondary colors"); + SohImGui::EnhancementColor("Level 2 colors", "gCharged2ColEnv", charged2_colenv, ImVec4(255,100,0,255)); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("Custom sword trails color", "gUseTrailsCol"); + if (CVar_GetS32("gUseTrailsCol",0) && ImGui::BeginTable("tabletrails", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Custom Swords trails", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + Draw_HelpIcon("Affect Slash trails colors"); + SohImGui::EnhancementColor("Trails colors", "gTrailCol", trailscol, ImVec4(255,255,255,255)); + SohImGui::EnhancementSliderInt("Trails duration: %dx", "##TrailsMul", "gTrailDurantion", 1, 5, ""); + SohImGui::Tooltip("The longer the trails the weirder it become"); + ImGui::NewLine(); + ImGui::EndTable(); + } +} +void Draw_Menus(){ + if (ImGui::BeginTable("tableFileChoose", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("File Choose color", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Bottom text color", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect the File Select menu background."); + SohImGui::EnhancementColor("File Choose color", "gCCFileChoosePrim", fileselect_colors, ImVec4(100, 150, 255, 255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect the File Select texts."); + SohImGui::EnhancementColor("Bottom text color", "gCCFileChooseTextPrim", fileselect_text_colors, ImVec4(0, 100, 255, 255), true, false, true); + ImGui::EndTable(); + } + /* + if (ImGui::BeginTable("tablePauseMenu", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Kaleido pages (Non working atm)", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + Draw_HelpIcon("Affect the Equipments menu background."); + SohImGui::EnhancementColor("Equipments", "gCCEquipmentsPrim", menu_equips_colors, ImVec4(0, 100, 255, 255), true, true); + Table_NextLine(); + Draw_HelpIcon("Affect the Select items menu background."); + SohImGui::EnhancementColor("Items", "gCCItemsPrim", menu_items_colors, ImVec4(0, 100, 255, 255), true, true); + Table_NextLine(); + Draw_HelpIcon("Affect the Map menu background."); + SohImGui::EnhancementColor("Maps", "gCCMapsPrim", menu_map_colors, ImVec4(0, 100, 255, 255), true, true); + Table_NextLine(); + Draw_HelpIcon("Affect the Quests statut menu background."); + SohImGui::EnhancementColor("Quests", "gCCQuestsPrim", menu_quest_colors, ImVec4(0, 100, 255, 255), true, true); + Table_NextLine(); + Draw_HelpIcon("Affect the Save menu background."); + SohImGui::EnhancementColor("Save", "gCCSavePrim", menu_save_colors, ImVec4(0, 100, 255, 255), true, true); + Table_NextLine(); + Draw_HelpIcon("Affect the Gameover screen background."); + SohImGui::EnhancementColor("Gameover", "gCCGameoverPrim", menu_gameover_colors, ImVec4(0, 100, 255, 255), true, true); + ImGui::EndTable(); + } + */ +} +void Draw_Placements(){ + if (ImGui::BeginTable("tableMargins", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("General margins settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + SohImGui::EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, ""); + SohImGui::EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, ImGui::GetWindowViewport()->Size.x, ""); + SohImGui::EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", (ImGui::GetWindowViewport()->Size.x)*-1, 25, ""); + SohImGui::EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, ""); + ImGui::NewLine(); + ImGui::EndTable(); + } + if (ImGui::CollapsingHeader("Hearts count position")) { + if (ImGui::BeginTable("tableHeartsCounts", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Hearts counts settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Hearts count use margins", "gHeartsUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gHeartsCountPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gHeartsCountPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gHeartsCountPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gHeartsCountPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gHeartsCountPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##HeartCountPosY", "gHeartsPosY", -22, ImGui::GetWindowViewport()->Size.y, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##HeartCountPosX", "gHeartsPosX", -25, ImGui::GetWindowViewport()->Size.x, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Magic Meter position")) { + if (ImGui::BeginTable("tablemmpos", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Magic meter settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Magic meter use margins", "gMagicBarUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gMagicBarPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gMagicBarPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gMagicBarPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gMagicBarPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gMagicBarPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MagicBarPosY", "gMagicBarPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MagicBarPosX", "gMagicBarPosX", -5, ImGui::GetWindowViewport()->Size.x/2, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (CVar_GetS32("gVisualAgony",0) && ImGui::CollapsingHeader("Visual stone of agony position")) { + if (ImGui::BeginTable("tabledvisualstoneofagony", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Visual stone of agony settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Visual stone of agony use margins", "gVSOAUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gVSOAPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gVSOAPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gVSOAPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gVSOAPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gVSOAPosType", 4); //in case you want only SFX + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##VSOAPosY", "gVSOAPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_Dpad = 0; + s16 Max_X_Dpad = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gVSOAPosType",0) == 2){ + Max_X_Dpad = 290; + } else if(CVar_GetS32("gVSOAPosType",0) == 4){ + Min_X_Dpad = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##VSOAPosX", "gVSOAPosX", Min_X_Dpad, Max_X_Dpad, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("B Button position")) { + if (ImGui::BeginTable("tablebbtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("B Button settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("B Button use margins", "gBBtnUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gBBtnPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gBBtnPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gBBtnPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gBBtnPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gBBtnPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##BBtnPosY", "gBBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/4+50, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##BBtnPosX", "gBBtnPosX", -1, ImGui::GetWindowViewport()->Size.x-50, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("A Button position")) { + if (ImGui::BeginTable("tableabtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("A Button settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("A Button use margins", "gABtnUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gABtnPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gABtnPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gABtnPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gABtnPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gABtnPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ABtnPosY", "gABtnPosY", -10, ImGui::GetWindowViewport()->Size.y/4+50, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ABtnPosX", "gABtnPosX", -20, ImGui::GetWindowViewport()->Size.x-50, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Start Button position")) { + if (ImGui::BeginTable("tablestartbtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Start Button settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Start Button use margins", "gStartBtnUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gStartBtnPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gStartBtnPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gStartBtnPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gStartBtnPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gStartBtnPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##StartBtnPosY", "gStartBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##StartBtnPosX", "gStartBtnPosX", 0, ImGui::GetWindowViewport()->Size.x/2+70, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("C Button Up position")) { + if (ImGui::BeginTable("tablecubtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("C Button Up settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("C Button Up use margins", "gCBtnUUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gCBtnUPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gCBtnUPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gCBtnUPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gCBtnUPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gCBtnUPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnUPosY", "gCBtnUPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_CU = 0; + s16 Max_X_CU = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gCBtnUPosType",0) == 2){ + Max_X_CU = 294; + } else if(CVar_GetS32("gCBtnUPosType",0) == 3){ + Max_X_CU = ImGui::GetWindowViewport()->Size.x/2; + } else if(CVar_GetS32("gCBtnUPosType",0) == 4){ + Min_X_CU = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnUPosX", "gCBtnUPosX", Min_X_CU, Max_X_CU, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("C Button Down position")) { + if (ImGui::BeginTable("tablecdbtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("C Button Down settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("C Button Down use margins", "gCBtnDUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gCBtnDPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gCBtnDPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gCBtnDPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gCBtnDPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gCBtnDPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnDPosY", "gCBtnDPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_CD = 0; + s16 Max_X_CD = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gCBtnDPosType",0) == 2){ + Max_X_CD = 294; + } else if(CVar_GetS32("gCBtnDPosType",0) == 3){ + Max_X_CD = ImGui::GetWindowViewport()->Size.x/2; + } else if(CVar_GetS32("gCBtnDPosType",0) == 4){ + Min_X_CD = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnDPosX", "gCBtnDPosX", Min_X_CD, Max_X_CD, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("C Button Left position")) { + if (ImGui::BeginTable("tableclbtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("C Button Left settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("C Button Left use margins", "gCBtnLUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gCBtnLPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gCBtnLPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gCBtnLPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gCBtnLPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gCBtnLPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnLPosY", "gCBtnLPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_CL = 0; + s16 Max_X_CL = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gCBtnDPosType",0) == 2){ + Max_X_CL = 294; + } else if(CVar_GetS32("gCBtnDPosType",0) == 3){ + Max_X_CL = ImGui::GetWindowViewport()->Size.x/2; + } else if(CVar_GetS32("gCBtnDPosType",0) == 4){ + Min_X_CL = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnLPosX", "gCBtnLPosX", Min_X_CL, Max_X_CL, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("C Button Right position")) { + if (ImGui::BeginTable("tablecrnbtn", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("C Button Right settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("C Button Right use margins", "gCBtnRUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gCBtnRPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gCBtnRPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gCBtnRPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gCBtnRPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gCBtnRPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnRPosY", "gCBtnRPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_CR = 0; + s16 Max_X_CR = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gCBtnRPosType",0) == 2){ + Max_X_CR = 294; + } else if(CVar_GetS32("gCBtnRPosType",0) == 3){ + Max_X_CR = ImGui::GetWindowViewport()->Size.x/2; + } else if(CVar_GetS32("gCBtnRPosType",0) == 4){ + Min_X_CR = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnRPosX", "gCBtnRPosX", Min_X_CR, Max_X_CR, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (CVar_GetS32("gDpadEquips",0) && ImGui::CollapsingHeader("DPad items position")) { + if (ImGui::BeginTable("tabledpaditems", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("DPad items settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("DPad items use margins", "gDPadUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gDPadPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gDPadPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gDPadPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gDPadPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gDPadPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##DPadPosY", "gDPadPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + s16 Min_X_Dpad = 0; + s16 Max_X_Dpad = ImGui::GetWindowViewport()->Size.x/2; + if(CVar_GetS32("gDPadPosType",0) == 2){ + Max_X_Dpad = 290; + } else if(CVar_GetS32("gDPadPosType",0) == 4){ + Min_X_Dpad = (ImGui::GetWindowViewport()->Size.x/2)*-1; + } + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##DPadPosX", "gDPadPosX", Min_X_Dpad, Max_X_Dpad, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Minimaps position")) { + if (ImGui::BeginTable("tableminimapspos", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("minimaps settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Minimap Button use margins", "gMinimapUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gMinimapPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gMinimapPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gMinimapPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + //SohImGui::EnhancementRadioButton("No anchors", "gMinimapPosType", 3); //currently bugged + //SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gMinimapPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MinimapPosY", "gMinimapPosY", (ImGui::GetWindowViewport()->Size.y/3)*-1, ImGui::GetWindowViewport()->Size.y/3, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MinimapPosX", "gMinimapPosX", ImGui::GetWindowViewport()->Size.x*-1, ImGui::GetWindowViewport()->Size.x/2, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Small Keys counter position")) { + if (ImGui::BeginTable("tablesmolekeys", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Small Keys counter settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Small Keys counter use margins", "gSKCUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gSKCPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gSKCPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gSKCPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gSKCPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gSKCPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##SKCPosY", "gSKCPosY", 0, ImGui::GetWindowViewport()->Size.y/3, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##SKCPosX", "gSKCPosX", -1, ImGui::GetWindowViewport()->Size.x/2, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Rupee counter position")) { + if (ImGui::BeginTable("tablerupeecount", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Rupee counter settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Rupee counter use margins", "gRCUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gRCPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gRCPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gRCPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gRCPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gRCPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##RCPosY", "gRCPosY", -2, ImGui::GetWindowViewport()->Size.y/3, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##RCPosX", "gRCPosX", -3, ImGui::GetWindowViewport()->Size.x/2, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Carrots position")) { + if (ImGui::BeginTable("tableCarrots", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Carrots settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Carrots use margins", "gCarrotsUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gCarrotsPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gCarrotsPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gCarrotsPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gCarrotsPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gCarrotsPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CarrotsPosY", "gCarrotsPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CarrotsPosX", "gCarrotsPosX", -50, ImGui::GetWindowViewport()->Size.x/2+25, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Timers position")) { + if (ImGui::BeginTable("tabletimers", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Timers settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Timers use margins", "gTimersUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gTimersPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gTimersPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gTimersPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gTimersPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gTimersPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TimersPosY", "gTimersPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TimersPosX", "gTimersPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Archery Scores position")) { + if (ImGui::BeginTable("tablearchery", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Archery Scores settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Archery Scores use margins", "gASUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gASPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gASPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gASPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + //SohImGui::EnhancementRadioButton("No anchors", "gASPosType", 3); //currently bugged + //SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gASPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ASPosY", "gASPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ASPosX", "gASPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Title cards (Maps) position")) { + if (ImGui::BeginTable("tabletcmaps", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Titlecard maps settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Title cards (Maps) use margins", "gTCMUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gTCMPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gTCMPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gTCMPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gTCMPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gTCMPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCMPosY", "gTCMPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCMPosX", "gTCMPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Title cards (Bosses) position")) { + if (ImGui::BeginTable("tabletcbosses", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Title cards (Bosses) settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + SohImGui::EnhancementCheckbox("Title cards (Bosses) use margins", "gTCBUseMargins"); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Original position", "gTCBPosType", 0); + SohImGui::Tooltip("This will use original intended elements position."); + SohImGui::EnhancementRadioButton("Anchor to the left", "gTCBPosType", 1); + SohImGui::Tooltip("This will make your elements follow the left side of your game window."); + SohImGui::EnhancementRadioButton("Anchor to the right", "gTCBPosType", 2); + SohImGui::Tooltip("This will make your elements follow the right side of your game window."); + SohImGui::EnhancementRadioButton("No anchors", "gTCBPosType", 3); + SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements."); + SohImGui::EnhancementRadioButton("Hidden", "gTCBPosType", 4); + SohImGui::Tooltip("This will make your elements hidden"); + SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCBPosY", "gTCBPosY", 0, ImGui::GetWindowViewport()->Size.y/2, ""); + SohImGui::Tooltip("This slider is used to move Up and Down your elements."); + SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCBPosX", "gTCBPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, ""); + SohImGui::Tooltip("This slider is used to move Left and Right your elements."); + ImGui::NewLine(); + ImGui::EndTable(); + } + } +} +void Draw_HUDButtons(){ + if (ImGui::CollapsingHeader("A Button colors & A Cursors")) { + if (ImGui::BeginTable("tableBTN_A", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Button A colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("Affect Button A colors (and various cursors that use the same theme)", false); + SohImGui::EnhancementColor("A Buttons", "gCCABtnPrim", a_btn_colors, ImVec4(90, 90, 255, 255), true, false, true); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("B Button colors")) { + if (ImGui::BeginTable("tableBTN_B", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Button B colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("Affect Button B colors", false); + SohImGui::EnhancementColor("B Buttons", "gCCBBtnPrim", b_btn_colors, ImVec4(0, 150, 0, 255), true, false, true); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("C Buttons & C Cursor")) { + if (ImGui::BeginTable("tableBTN_C", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Button C colors & C Cursor colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("Affect Button C Buttons colors (if not using separated colors)\nAnd various cursor that use C Button colors", false); + SohImGui::EnhancementColor("C Buttons", "gCCCBtnPrim", c_btn_colors, ImVec4(255, 160, 0, 255), true, false, true); + ImGui::EndTable(); + } + SohImGui::EnhancementCheckbox("C Buttons use separated colors", "gCCparated"); + if (CVar_GetS32("gCCparated",0) && ImGui::CollapsingHeader("C Button individual colors")) { + if (ImGui::BeginTable("tableBTN_CSep", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Button C individual colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("Affect Button C Up colors, but not C cursor colors\nTo edit C Cursor check C Button color on top"); + SohImGui::EnhancementColor("C Buttons Up", "gCCCUBtnPrim", c_btn_u_colors, ImVec4(255,160,0,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Button C Down colors, but not C cursor colors\nTo edit C Cursor check C Button color on top"); + SohImGui::EnhancementColor("C Buttons Down", "gCCCDBtnPrim", c_btn_d_colors, ImVec4(255,160,0,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Button C Left colors, but not C cursor colors\nTo edit C Cursor check C Button color on top"); + SohImGui::EnhancementColor("C Buttons Left", "gCCCLBtnPrim", c_btn_l_colors, ImVec4(255,160,0,255)); + Table_NextLine(); + Draw_HelpIcon("Affect Button C Right colors, but not C cursor colors\nTo edit C Cursor check C Button color on top"); + SohImGui::EnhancementColor("C Buttons Right", "gCCCRBtnPrim", c_btn_r_colors, ImVec4(255,160,0,255)); + ImGui::EndTable(); + } + } + } + if (ImGui::CollapsingHeader("Start button colors")) { + if (ImGui::BeginTable("tableBTN_Start", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Button Start colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("Affect Button Start colors", false); + SohImGui::EnhancementColor("Start Buttons", "gCCStartBtnPrim", start_btn_colors, ImVec4(120, 120, 120, 255), true, false, true); + ImGui::EndTable(); + } + } + if (CVar_GetS32("gDpadEquips",0) && ImGui::CollapsingHeader("DPad colors")) { + if (ImGui::BeginTable("tableDpadHud", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("DPad", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(false); + Draw_HelpIcon("DPad background color, should be white for default value"); + SohImGui::EnhancementColor("DPad background color", "gCCDpadPrim", dpad_colors, ImVec4(255, 255, 255, 255)); + ImGui::EndTable(); + } + } +} +void Draw_General(){ + if (ImGui::BeginTable("tableScheme", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV | ImGuiTableFlags_Hideable)) { + ImGui::TableSetupColumn("N64 Scheme", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + ImGui::TableSetupColumn("GameCube Scheme", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + ImGui::TableSetupColumn("Custom Schemes", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + Draw_HelpIcon("Change interface color to N64 style"); + SohImGui::EnhancementRadioButton("N64 Colors", "gHudColors", 0); + Table_NextCol(); + Draw_HelpIcon("Change interface color to GameCube style"); + SohImGui::EnhancementRadioButton("GCN Colors", "gHudColors", 1); + Table_NextCol(); + Draw_HelpIcon("Change interface color to your own made style"); + SohImGui::EnhancementRadioButton("Custom Colors", "gHudColors", 2); + ImGui::EndTable(); + } + if (ImGui::CollapsingHeader("Hearts colors")) { + SohImGui::Tooltip("Hearts colors in general\nDD stand for Double Defense"); + if (ImGui::BeginTable("tableHearts", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV | ImGuiTableFlags_Hideable)) { + ImGui::TableSetupColumn("Hearts (normal)", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable, TablesCellsWidth/3); + ImGui::TableSetupColumn("Hearts (DD)", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable, TablesCellsWidth/3); + ImGui::TableSetupColumn("Hearts Outline (DD)", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable, TablesCellsWidth/3); + Table_InitHeader(); + Draw_HelpIcon("Affect Hearts inner color when you do not have Double Defense", false); + SohImGui::EnhancementColor("Inner normal", "gCCHeartsPrim", hearts_colors, ImVec4(255,70,50,255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect Hearts inner color when you have Double Defense", false); + SohImGui::EnhancementColor("Inner DD", "gCCDDHeartsPrim", hearts_ddi_colors, ImVec4(255,70,50,255), true, false, true); + Table_NextCol(); + Draw_HelpIcon("Affect Hearts Outline color when you have Double Defense\nWhite by default", false); + SohImGui::EnhancementColor("Outline DD", "gDDCCHeartsPrim", hearts_dd_colors, ImVec4(255,255,255,255), true, false, true); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Magic Meter colors")) { + if (ImGui::BeginTable("tableMagicmeter", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV | ImGuiTableFlags_Hideable)) { + ImGui::TableSetupColumn("Magic meter", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Magic meter in use", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect the border of the magic meter\nWhite in original game, color change only when used one time"); + SohImGui::EnhancementColor("Borders", "gCCMagicBorderNormPrim", magic_bordern_colors, ImVec4(255,255,255,255), false); + Table_NextCol(); + Draw_HelpIcon("Affect the border of the magic meter when being used\nWhite flash in original game"); + SohImGui::EnhancementColor("Borders in use", "gCCMagicBorderPrim", magic_border_colors, ImVec4(255,255,255,255), false); + Table_NextLine(); + Draw_HelpIcon("Affect the magic meter color\nGreen in original game"); + SohImGui::EnhancementColor("Main color", "gCCMagicPrim", magic_remaining_colors, ImVec4(0,200,0,255)); + Table_NextCol(); + Draw_HelpIcon("Affect the magic meter when being used\nYellow in original game"); + SohImGui::EnhancementColor("Main color in use", "gCCMagicUsePrim", magic_use_colors, ImVec4(250,250,0,255)); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Minimap & compass colors")) { + if (ImGui::BeginTable("tableMinimapCol", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { + ImGui::TableSetupColumn("Minimap colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + Draw_HelpIcon("Affect the Overworld minimaps."); + SohImGui::EnhancementColor("Overworlds", "gCCMinimapPrim", minimap_colors, ImVec4(0, 255, 255, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the Dungeon minimaps."); + SohImGui::EnhancementColor("Dungeons", "gCCMinimapDGNPrim", dgn_minimap_colors, ImVec4(100, 255, 255, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the current position arrow on the minimap (yellow)."); + SohImGui::EnhancementColor("Current position arrow", "gCCMinimapCPPrim", cp_minimap_colors, ImVec4(200, 255, 0, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the last entrance position arrow on the minimap (red)."); + SohImGui::EnhancementColor("Last entrance arrow", "gCCMinimapLEPrim", le_minimap_colors, ImVec4(200, 0, 0, 255)); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Title cards colors")) { + if (ImGui::BeginTable("tableTitleCards", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV | ImGuiTableFlags_Hideable)) { + ImGui::TableSetupColumn("Title cards Overworld", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + ImGui::TableSetupColumn("Title cards Bosses", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth/2); + Table_InitHeader(); + Draw_HelpIcon("Affect all the overworld title cards color, white by default."); + SohImGui::EnhancementColor("Main color", "gCCTC_OW_U_Prim", tc_ou_colors, ImVec4(255, 255, 255, 255), false); + Table_NextCol(); + Draw_HelpIcon("Affect all the bosses title cards color, white by default."); + SohImGui::EnhancementColor("Main color", "gCCTC_B_U_Prim", tc_bu_colors, ImVec4(255, 255, 255, 255), false); + ImGui::EndTable(); + } + } + if (ImGui::CollapsingHeader("Misc. interface colors")) { + if (ImGui::BeginTable("tableMiscHudCol", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV | ImGuiTableFlags_Hideable)) { + ImGui::TableSetupColumn("Misc HUD colors", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth); + Table_InitHeader(); + Draw_HelpIcon("Affect the Rupee icon on interface\nGreen by default."); + SohImGui::EnhancementColor("Rupee icon", "gCCRupeePrim", rupee_colors, ImVec4(200, 255, 100, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the Small keys icon on interface\nGray by default."); + SohImGui::EnhancementColor("Small Keys icon", "gCCKeysPrim", smolekey_colors, ImVec4(200, 230, 255, 255)); + Table_NextLine(); + Draw_HelpIcon("Affect the Stone of Agony icon on interface\nWhite by default."); + SohImGui::EnhancementColor("Stone of agony icon", "gCCVSOAPrim", visualagony_colors, ImVec4(255, 255, 255, 255)); + ImGui::EndTable(); + } + } +} +void DrawCosmeticsEditor(bool& open) { + if (!open) { + CVar_SetS32("gCosmeticsEditorEnabled", 0); + return; + } + ImGui::SetNextWindowSize(ImVec2(465, 430), ImGuiCond_FirstUseEver); + if (!ImGui::Begin("Cosmetics Editor", &open, ImGuiWindowFlags_NoFocusOnAppearing)) { + ImGui::End(); + return; + } + + if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { + if (ImGui::BeginTabItem("General")) { + Draw_General(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("HUD Buttons")) { + Draw_HUDButtons(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Items & Skills")) { + Draw_ItemsSkills(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Npcs")) { + Draw_Npcs(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Menus")) { + Draw_Menus(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Placements")) { + Draw_Placements(); + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); + } + ImGui::End(); +} +void InitCosmeticsEditor() { + //Draw the bar in the menu. + SohImGui::AddWindow("Cosmetics", "Cosmetics Editor", DrawCosmeticsEditor); +} diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h new file mode 100644 index 000000000..c15ca0d22 --- /dev/null +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h @@ -0,0 +1,3 @@ +#pragma once + +void InitCosmeticsEditor();//Init the menu itself diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index eff66f700..31e9cd5fe 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -32,6 +32,7 @@ #define DRWAV_IMPLEMENTATION #include "Lib/dr_libs/wav.h" #include "AudioPlayer.h" +#include "Enhancements/cosmetics/CosmeticsEditor.h" #include "Enhancements/debugconsole.h" #include "Enhancements/debugger/debugger.h" #include "soh/frame_interpolation.h" @@ -113,6 +114,7 @@ extern "C" void InitOTR() { clearMtx = (uintptr_t)&gMtxClear; OTRMessage_Init(); OTRAudio_Init(); + InitCosmeticsEditor(); DebugConsole_Init(); Debug_Init(); OTRExtScanner(); diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index dbcb577d4..79ae75d56 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -780,7 +780,9 @@ void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) { } void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) { - titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0; + titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityR = titleCtx->alpha = 0; + titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityG = titleCtx->alpha = 0; + titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityB = titleCtx->alpha = 0; } void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, @@ -803,7 +805,6 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, s32 width, s32 height, s32 delay) { SceneTableEntry* loadedScene = globalCtx->loadedScene; - // size_t size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; switch (globalCtx->sceneNum) { case SCENE_YDAN: @@ -1021,13 +1022,32 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt } void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) { + s16* TitleCard_Colors[3] = {255,255,255}; + if (titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {//Bosses cards. + TitleCard_Colors[0] = CVar_GetS32("gCCTC_B_U_PrimR", 255); + TitleCard_Colors[1] = CVar_GetS32("gCCTC_B_U_PrimG", 255); + TitleCard_Colors[2] = CVar_GetS32("gCCTC_B_U_PrimB", 255); + } else if (!titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) { + TitleCard_Colors[0] = CVar_GetS32("gCCTC_OW_U_PrimR", 255); + TitleCard_Colors[1] = CVar_GetS32("gCCTC_OW_U_PrimG", 255); + TitleCard_Colors[2] = CVar_GetS32("gCCTC_OW_U_PrimB", 255); + } else { + TitleCard_Colors[0] = 255; + TitleCard_Colors[1] = 255; + TitleCard_Colors[2] = 255; + } + if (DECR(titleCtx->delayTimer) == 0) { if (DECR(titleCtx->durationTimer) == 0) { Math_StepToS(&titleCtx->alpha, 0, 30); - Math_StepToS(&titleCtx->intensity, 0, 70); + Math_StepToS(&titleCtx->intensityR, 0, 70); + Math_StepToS(&titleCtx->intensityG, 0, 70); + Math_StepToS(&titleCtx->intensityB, 0, 70); } else { Math_StepToS(&titleCtx->alpha, 255, 10); - Math_StepToS(&titleCtx->intensity, 255, 20); + Math_StepToS(&titleCtx->intensityR, TitleCard_Colors[0], 20); + Math_StepToS(&titleCtx->intensityG, TitleCard_Colors[1], 20); + Math_StepToS(&titleCtx->intensityB, TitleCard_Colors[2], 20); } } } @@ -1047,8 +1067,30 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { if (titleCtx->alpha != 0) { width = titleCtx->width; height = titleCtx->height; - titleX = (titleCtx->x * 4) - (width * 2); - titleY = (titleCtx->y * 4) - (height * 2); + s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosX", 0) : CVar_GetS32("gTCMPosX", 0)); + s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosY", 0) : CVar_GetS32("gTCMPosY", 0)); + s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosType", 0) : CVar_GetS32("gTCMPosType", 0)); + s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBUseMargins", 0) : CVar_GetS32("gTCMUseMargins", 0)); + s16 TitleCard_MarginX = 0; + s16 TitleCard_PosX = titleCtx->x; + s16 TitleCard_PosY = titleCtx->y; + if (TitleCard_PosType_Checker != 0) { + TitleCard_PosY = TitleCard_PosY_Modifier; + if (TitleCard_PosType_Checker == 1) {//Anchor Left + if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_L", 0)*-1;}; + TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier+TitleCard_MarginX)-11; + } else if (TitleCard_PosType_Checker == 2) {//Anchor Right + if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_R", 0);}; + TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier+TitleCard_MarginX); + } else if (TitleCard_PosType_Checker == 3) {//Anchor None + TitleCard_PosX = TitleCard_PosX_Modifier; + } else if (TitleCard_PosType_Checker == 4) {//Hidden + TitleCard_PosX = -9999; + } + } + + titleX = (TitleCard_PosX * 4) - (width * 2); + titleY = (TitleCard_PosY * 4) - (height * 2); doubleWidth = width * 2; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1075,7 +1117,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { // WORLD_OVERLAY_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP WORLD_OVERLAY_DISP = func_80093808(WORLD_OVERLAY_DISP); - gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, + gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensityR, (u8)titleCtx->intensityG, (u8)titleCtx->intensityB, (u8)titleCtx->alpha); gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftTopY, G_IM_FMT_IA, @@ -1083,7 +1125,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); //Removing the -1 there remove the gap between top and bottom textures. - gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4), + gSPWideTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); height = titleCtx->height - height; @@ -1095,7 +1137,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); //Removing the -1 there remove the gap between top and bottom textures. - gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, + gSPWideTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, titleSecondY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } diff --git a/soh/src/code/z_eff_blure.c b/soh/src/code/z_eff_blure.c index dc2793b75..47477f787 100644 --- a/soh/src/code/z_eff_blure.c +++ b/soh/src/code/z_eff_blure.c @@ -194,6 +194,10 @@ void EffectBlure_Destroy(void* thisx) { s32 EffectBlure_Update(void* thisx) { EffectBlure* this = (EffectBlure*)thisx; s32 i; + s16 RedColor; + s16 GreenColor; + s16 BlueColor; + s16 TrailDuration; if (this == NULL) { return 0; @@ -203,6 +207,31 @@ s32 EffectBlure_Update(void* thisx) { return 0; } + if (CVar_GetS32("gUseTrailsCol", 0) !=0) { + RedColor = CVar_GetS32("gTrailColR",255); + GreenColor = CVar_GetS32("gTrailColG",255); + BlueColor = CVar_GetS32("gTrailColB",255); + TrailDuration = 4.0f*CVar_GetS32("gTrailDurantion",1); + } else { + RedColor = 255; + GreenColor = 255; + BlueColor = 255; + TrailDuration=4.0f; + } + this->p1StartColor.r = RedColor; + this->p2StartColor.r = RedColor; + this->p1EndColor.r = RedColor; + this->p2EndColor.r = RedColor; + this->p1StartColor.g = GreenColor; + this->p2StartColor.g = GreenColor; + this->p1EndColor.g = GreenColor; + this->p2EndColor.g = GreenColor; + this->p1StartColor.b = BlueColor; + this->p2StartColor.b = BlueColor; + this->p1EndColor.b = BlueColor; + this->p2EndColor.b = BlueColor; + this->elemDuration = TrailDuration; + while (true) { if (this->elements[0].state == 0) { for (i = 0; i < 15; i++) { diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 43fd66084..e1bafb3d2 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -181,17 +181,10 @@ void HealthMeter_Update(GlobalContext* globalCtx) { s16 gFactor; s16 bFactor; - if (CVar_GetS32("gHUDMargins", 0) != 0) { - Top_LM_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_LM_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_LM_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_LM_Margin = CVar_GetS32("gHUDMargin_B", 0); - } else { - Top_LM_Margin = 0; - Left_LM_Margin = 0; - Right_LM_Margin = 0; - Bottom_LM_Margin = 0; - } + Top_LM_Margin = CVar_GetS32("gHUDMargin_T", 0); + Left_LM_Margin = CVar_GetS32("gHUDMargin_L", 0); + Right_LM_Margin = CVar_GetS32("gHUDMargin_R", 0); + Bottom_LM_Margin = CVar_GetS32("gHUDMargin_B", 0); if (CVar_GetS32("gHudColors", 1) == 2) { HeartInner[0] = CVar_GetS32("gCCHeartsPrimR", sHeartsPrimColors[0][0]); @@ -274,21 +267,25 @@ void HealthMeter_Update(GlobalContext* globalCtx) { sHeartsDDEnv[0][2] = HeartDDInner[2]; if (CVar_GetS32("gHudColors", 1) == 2) { - sHeartsDDPrim[2][0] = HeartInner[0]; - sHeartsDDPrim[2][1] = HeartInner[1]; - sHeartsDDPrim[2][2] = HeartInner[2]; + sHeartsDDPrim[2][0] = CVar_GetS32("gCCDDHeartsPrimR", 255); + sHeartsDDPrim[2][1] = CVar_GetS32("gCCDDHeartsPrimG", 70); + sHeartsDDPrim[2][2] = CVar_GetS32("gCCDDHeartsPrimB", 50); sHeartsDDPrim[1][0] = HeartDDOutline[0]; sHeartsDDPrim[1][1] = HeartDDOutline[1]; sHeartsDDPrim[1][2] = HeartDDOutline[2]; - sHeartsDDEnv[1][0] = HeartDDInner[0]; - sHeartsDDEnv[1][1] = HeartDDInner[1]; - sHeartsDDEnv[1][2] = HeartDDInner[2]; + sHeartsDDEnv[1][0] = CVar_GetS32("gCCDDHeartsPrimR", 255); + sHeartsDDEnv[1][1] = CVar_GetS32("gCCDDHeartsPrimG", 70); + sHeartsDDEnv[1][2] = CVar_GetS32("gCCDDHeartsPrimB", 50); - HeartDDInner[0] = HeartInner[0]; - HeartDDInner[1] = HeartInner[1]; - HeartDDInner[2] = HeartInner[2]; + HeartDDInner[0] = CVar_GetS32("gCCDDHeartsPrimR", 255); + HeartDDInner[1] = CVar_GetS32("gCCDDHeartsPrimG", 70); + HeartDDInner[2] = CVar_GetS32("gCCDDHeartsPrimB", 50); + + sHeartsDDEnv[0][0] = CVar_GetS32("gCCDDHeartsPrimR", 255); + sHeartsDDEnv[0][1] = CVar_GetS32("gCCDDHeartsPrimG", 70); + sHeartsDDEnv[0][2] = CVar_GetS32("gCCDDHeartsPrimB", 0); rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor; gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor; @@ -305,18 +302,22 @@ void HealthMeter_Update(GlobalContext* globalCtx) { sBeatingHeartsDDEnv[0] = (u8)(rFactor + HeartDDInner[0]) & 0xFF; sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF; sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF; - } else { - // sHeartsDDPrim[2][0] = HEARTS_PRIM_R; - // sHeartsDDPrim[2][1] = HEARTS_PRIM_G; - // sHeartsDDPrim[2][2] = HEARTS_PRIM_B; + } else { + sHeartsDDPrim[0][0] = HEARTS_DD_PRIM_R; + sHeartsDDPrim[0][1] = HEARTS_DD_PRIM_G; + sHeartsDDPrim[0][2] = HEARTS_DD_PRIM_B; - sHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R; - sHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G; - sHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B; + sHeartsDDEnv[0][0] = HEARTS_DD_ENV_R; + sHeartsDDEnv[0][1] = HEARTS_DD_ENV_G; + sHeartsDDEnv[0][2] = HEARTS_DD_ENV_B; - sHeartsDDEnv[1][0] = HEARTS_PRIM_R; - sHeartsDDEnv[1][1] = HEARTS_PRIM_G; - sHeartsDDEnv[1][2] = HEARTS_PRIM_B; + sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0]; + sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1]; + sHeartsDDPrim[1][2] = sHeartsDDPrimColors[ddType][2]; + + sHeartsDDEnv[1][0] = sHeartsDDEnvColors[ddType][0]; + sHeartsDDEnv[1][1] = sHeartsDDEnvColors[ddType][1]; + sHeartsDDEnv[1][2] = sHeartsDDEnvColors[ddType][2]; rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor; gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor; @@ -330,9 +331,9 @@ void HealthMeter_Update(GlobalContext* globalCtx) { gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor; bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor; - sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_PRIM_R) & 0xFF; - sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_PRIM_G) & 0xFF; - sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_PRIM_B) & 0xFF; + sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_DD_ENV_R) & 0xFF; + sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_DD_ENV_G) & 0xFF; + sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_DD_ENV_B) & 0xFF; } } @@ -419,8 +420,33 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { } curColorSet = -1; - offsetY = 0.0f+(Top_LM_Margin*-1); - offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1); + s16 X_Margins; + s16 Y_Margins; + if (CVar_GetS32("gHeartsUseMargins", 0) != 0) { + X_Margins = Left_LM_Margin; + Y_Margins = (Top_LM_Margin*-1); + } else { + X_Margins = 0; + Y_Margins = 0; + } + s16 PosX_original = OTRGetDimensionFromLeftEdge(0.0f)+X_Margins; + s16 PosY_original = 0.0f+Y_Margins; + if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { + offsetY = CVar_GetS32("gHeartsPosY", 0)+Y_Margins; + if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left + offsetX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right + X_Margins = Right_LM_Margin; + offsetX = OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None + offsetX = CVar_GetS32("gHeartsPosX", 0); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden + offsetX = -9999; + } + } else { + offsetY = PosY_original; + offsetX = PosX_original; + } for (i = 0; i < totalHeartCount; i++) { if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { @@ -579,8 +605,24 @@ void HealthMeter_Draw(GlobalContext* globalCtx) { offsetX += 10.0f; if (i == 9) { - offsetY += 10.0f; - offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1); + PosX_original = OTRGetDimensionFromLeftEdge(0.0f)+X_Margins; + PosY_original = 10.0f+Y_Margins; + if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { + offsetY = CVar_GetS32("gHeartsPosY", 0)+Y_Margins+10.0f; + if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left + offsetX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right + X_Margins = Right_LM_Margin; + offsetX = OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None + offsetX = CVar_GetS32("gHeartsPosX", 0); + } else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden + offsetX = -9999; + } + } else { + offsetY = PosY_original; + offsetX = PosX_original; + } } } diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 4b1e05c89..a636a0abf 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -598,22 +598,55 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) { s32 pad; Player* player = GET_PLAYER(globalCtx); s16 tempX, tempZ; + s16 X_Margins_Minimap; + s16 Y_Margins_Minimap; + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { + if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; + Y_Margins_Minimap = Bottom_MM_Margin; + } else { + X_Margins_Minimap = 0; + Y_Margins_Minimap = 0; + } OPEN_DISPS(globalCtx->state.gfxCtx); if (globalCtx->interfaceCtx.minimapAlpha >= 0xAA) { func_80094A14(globalCtx->state.gfxCtx); + //Player current position (yellow arrow) gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - tempX = player->actor.world.pos.x+Right_MM_Margin; - tempZ = player->actor.world.pos.z+Bottom_MM_Margin; + + tempX = player->actor.world.pos.x; + tempZ = player->actor.world.pos.z; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; - Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + Matrix_Translate( + OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + Matrix_Translate( + OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + Matrix_Translate( + (R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + Matrix_Translate( + (R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f), + (R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + } + } else { + Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(X_Margins_Minimap*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Y_Margins_Minimap*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + } Matrix_Scale(0.4f, 0.4f, 0.4f, MTXMODE_APPLY); Matrix_RotateX(-1.6f, MTXMODE_APPLY); tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400; @@ -621,21 +654,52 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) { gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, CVar_GetS32("gCCMinimapCPPrimR", 200), CVar_GetS32("gCCMinimapCPPrimG", 255), CVar_GetS32("gCCMinimapCPPrimB", 0), 255); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 255, 0, 255); + } gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL); - tempX = sPlayerInitialPosX+Right_MM_Margin; - tempZ = sPlayerInitialPosZ+Bottom_MM_Margin; + //Player map entry (red arrow) + tempX = sPlayerInitialPosX+X_Margins_Minimap; + tempZ = sPlayerInitialPosZ+Y_Margins_Minimap; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; - Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + Matrix_Translate( + OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + Matrix_Translate( + OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + Matrix_Translate( + (R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f), + (R_COMPASS_OFFSET_Y - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + Matrix_Translate( + (R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f), + (R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + } + } else { + Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(X_Margins_Minimap*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Y_Margins_Minimap*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); + } Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY); Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY); Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY); gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, CVar_GetS32("gCCMinimapLEPrimR", 200), CVar_GetS32("gCCMinimapLEPrimG", 0), CVar_GetS32("gCCMinimapLEPrimB", 0), 255); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255); + } gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL); } @@ -650,6 +714,17 @@ void Minimap_Draw(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (globalCtx->pauseCtx.state < 4) { + //Minimap margins + s16 X_Margins_Minimap; + s16 Y_Margins_Minimap; + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { + if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; + Y_Margins_Minimap = Bottom_MM_Margin; + } else { + X_Margins_Minimap = 0; + Y_Margins_Minimap = 0; + } + switch (globalCtx->sceneNum) { case SCENE_YDAN: case SCENE_DDAN: @@ -668,7 +743,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) { if (CVar_GetS32("gHudColors", 1) == 2) { //Dungeon minimap - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapDGNPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapDGNPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapDGNPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha); } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha); } @@ -678,9 +753,22 @@ void Minimap_Draw(GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - const s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + Right_MM_Margin); - const s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Bottom_MM_Margin; - + s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + X_Margins_Minimap); + s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + dgnMiniMapY = R_DGN_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + dgnMiniMapX = OTRGetDimensionFromLeftEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + dgnMiniMapX = OTRGetDimensionFromRightEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + dgnMiniMapX = CVar_GetS32("gMinimapPosX", 0); + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + dgnMiniMapX = -9999; + } + } gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, dgnMiniMapY << 2, (dgnMiniMapX + 96) << 2, (dgnMiniMapY + 85) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); @@ -740,9 +828,22 @@ void Minimap_Draw(GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - const s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + Right_MM_Margin); - const s16 oWMiniMapY = R_OW_MINIMAP_Y + Bottom_MM_Margin; - + s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + X_Margins_Minimap); + s16 oWMiniMapY = R_OW_MINIMAP_Y + Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + oWMiniMapY = R_OW_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + oWMiniMapX = OTRGetDimensionFromLeftEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + oWMiniMapX = OTRGetDimensionFromRightEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + oWMiniMapX = CVar_GetS32("gMinimapPosX", 0); + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + oWMiniMapX = -9999; + } + } gSPWideTextureRectangle(OVERLAY_DISP++, oWMiniMapX << 2, oWMiniMapY << 2, (oWMiniMapX + gMapData->owMinimapWidth[mapIndex]) << 2, (oWMiniMapY + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0, @@ -757,17 +858,43 @@ void Minimap_Draw(GlobalContext* globalCtx) { (LINK_AGE_IN_YEARS != YEARS_ADULT)) { bool Map0 = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2 == 0; s16 IconSize = 8; - s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + (Map0 ? 0 : Right_MM_Margin); - s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + (Map0 ? 0 : Bottom_MM_Margin); + s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + (Map0 ? 0 : X_Margins_Minimap); + s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + (Map0 ? 0 : Y_Margins_Minimap); //gFixDungeonMinimapIcon fix both Y position of visible icon and hide these non needed. - if (CVar_GetS32("gFixDungeonMinimapIcon", 0) != 0){ - //No idea why and how Original value work but this does actually fix them all. - PosY = PosY+1024; - } + s16 TopLeftX = (Map0 ? OTRGetRectDimensionFromLeftEdge(PosX) : OTRGetRectDimensionFromRightEdge(PosX)) << 2; s16 TopLeftY = PosY << 2; s16 TopLeftW = (Map0 ? OTRGetRectDimensionFromLeftEdge(PosX + IconSize) : OTRGetRectDimensionFromRightEdge(PosX + IconSize)) << 2; s16 TopLeftH = (PosY + IconSize) << 2; + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosX", 0) + X_Margins_Minimap; + PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosY", 0) + Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + TopLeftX = OTRGetRectDimensionFromLeftEdge(PosX) << 2; + TopLeftW = OTRGetRectDimensionFromLeftEdge(PosX + IconSize) << 2; + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + TopLeftX = OTRGetRectDimensionFromRightEdge(PosX) << 2; + TopLeftW = OTRGetRectDimensionFromRightEdge(PosX + IconSize) << 2; + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + TopLeftX = PosX << 2; + TopLeftW = PosX + IconSize << 2; + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + TopLeftX = -9999 << 2; + TopLeftW = -9999 + IconSize << 2; + } + if (!CVar_GetS32("gMinimapPosType", 0) != 4 && Map0 && !CVar_GetS32("gFixDungeonMinimapIcon", 0)) { //Force top left icon if fix not applied. + TopLeftX = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex]) << 2; + TopLeftY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2; + TopLeftW = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + IconSize) << 2; + TopLeftH = (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + IconSize) << 2; + } + } + if (CVar_GetS32("gFixDungeonMinimapIcon", 0) != 0){ + //No idea why and how Original value work but this does actually fix them all. + PosY = PosY+1024; + } if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && (gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) { @@ -785,8 +912,23 @@ void Minimap_Draw(GlobalContext* globalCtx) { } } - const s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + Right_MM_Margin); - const s16 entranceY = 154 + Bottom_MM_Margin; + s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap); + s16 entranceY = 154 + Y_Margins_Minimap; + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + entranceY = 154 + Y_Margins_Minimap + CVar_GetS32("gMinimapPosY", 0); + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + entranceX = OTRGetRectDimensionFromLeftEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0)); + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0)); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + entranceX = 270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0); + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + entranceX = -9999; + } + } + if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, @@ -794,6 +936,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } else if ((globalCtx->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){ + gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -834,17 +977,10 @@ void Map_Update(GlobalContext* globalCtx) { s16 floor; s16 i; - if (CVar_GetS32("gHUDMargins", 0) != 0) { - Top_MM_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_MM_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0); - } else { - Top_MM_Margin = 0; - Left_MM_Margin = 0; - Right_MM_Margin = 0; - Bottom_MM_Margin = 0; - } + Top_MM_Margin = CVar_GetS32("gHUDMargin_T", 0); + Left_MM_Margin = CVar_GetS32("gHUDMargin_L", 0); + Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0); + Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0); if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) { switch (globalCtx->sceneNum) { @@ -914,4 +1050,4 @@ void Map_Update(GlobalContext* globalCtx) { break; } } -} +} \ No newline at end of file diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c index 9102a457e..3ebbfd119 100644 --- a/soh/src/code/z_map_mark.c +++ b/soh/src/code/z_map_mark.c @@ -108,38 +108,71 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha); - s16 Top_MC_Margin = 0; - s16 Left_MC_Margin = 0; - s16 Right_MC_Margin = 0; - s16 Bottom_MC_Margin = 0; - if (CVar_GetS32("gHUDMargins", 0) != 0) { - Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0); + s32 Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0); + s32 Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0); + s32 Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0); + s32 Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0); + + s32 X_Margins_Minimap_ic; + s32 Y_Margins_Minimap_ic; + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { + if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; + Y_Margins_Minimap_ic = Bottom_MC_Margin; } else { - Top_MC_Margin = 0; - Left_MC_Margin = 0; - Right_MC_Margin = 0; - Bottom_MC_Margin = 0; + X_Margins_Minimap_ic = 0; + Y_Margins_Minimap_ic = 0; } markPoint = &mapMarkIconData->points[0]; + //Place each chest / boss room icon for (i = 0; i < mapMarkIconData->count; i++) { if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) { + //Minimap chest / boss icon + const s32 PosX_Minimap_ori = GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+X_Margins_Minimap_ic) + 204; + const s32 PosY_Minimap_ori = GREG(95) + markPoint->y + Y_Margins_Minimap_ic + 140; + if (CVar_GetS32("gMinimapPosType", 0) != 0) { + rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 + CVar_GetS32("gMinimapPosY", 0)); + if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Left_MC_Margin;}; + if (globalCtx->sceneNum == SCENE_YDAN || globalCtx->sceneNum == SCENE_DDAN || globalCtx->sceneNum == SCENE_BDAN || + globalCtx->sceneNum == SCENE_BMORI1 || globalCtx->sceneNum == SCENE_HIDAN || globalCtx->sceneNum == SCENE_MIZUSIN || + globalCtx->sceneNum == SCENE_JYASINZOU || globalCtx->sceneNum == SCENE_HAKADAN || globalCtx->sceneNum == SCENE_HAKADANCH || + globalCtx->sceneNum == SCENE_ICE_DOUKUTO) { + rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + } else { + rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + } + } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; + rectLeft = OTRGetRectDimensionFromRightEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + rectLeft = markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic; + } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + rectLeft = -9999; + } + } else { + rectLeft = PosX_Minimap_ori; + rectTop = PosY_Minimap_ori; + } + + int height = 8 * 1.0f; //Adjust Height with scale + int width = 8 * 1.0f; //Adjust Width with scale + int height_factor = (1 << 10) * 8 / height; + int width_factor = (1 << 10) * 8 / width; + markInfo = &sMapMarkInfoTable[mapMarkIconData->markType]; gDPPipeSync(OVERLAY_DISP++); + gDPLoadTextureBlock(OVERLAY_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK, markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - rectLeft = (GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+Right_MC_Margin) + 204) << 2; - rectTop = (GREG(95) + markPoint->y + Bottom_MC_Margin + 140) << 2; - gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, - rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, - markInfo->dtdy); + //Changed to a Wide texture to support Left anchor. + gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, rectLeft + width << 2, + rectTop + height << 2, G_TX_RENDERTILE, 0, 0, width_factor, + height_factor); } + markPoint++; } mapMarkIconData++; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 584322f30..c6cfa9db5 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -82,6 +82,18 @@ s16 sOcarinaNoteCPrimG; s16 sOcarinaNoteCEnvR; s16 sOcarinaNoteCEnvB; s16 sOcarinaNoteCEnvG; +s16 sOcarinaNoteCUpPrimR; +s16 sOcarinaNoteCUpPrimB; +s16 sOcarinaNoteCUpPrimG; +s16 sOcarinaNoteCLeftPrimR; +s16 sOcarinaNoteCLeftPrimB; +s16 sOcarinaNoteCLeftPrimG; +s16 sOcarinaNoteCDownPrimR; +s16 sOcarinaNoteCDownPrimB; +s16 sOcarinaNoteCDownPrimG; +s16 sOcarinaNoteCRightPrimR; +s16 sOcarinaNoteCRightPrimB; +s16 sOcarinaNoteCRightPrimG; void Message_ResetOcarinaNoteState(void) { R_OCARINA_NOTES_YPOS(0) = 189; @@ -93,18 +105,46 @@ void Message_ResetOcarinaNoteState(void) { sOcarinaNotesAlphaValues[0] = sOcarinaNotesAlphaValues[1] = sOcarinaNotesAlphaValues[2] = sOcarinaNotesAlphaValues[3] = sOcarinaNotesAlphaValues[4] = sOcarinaNotesAlphaValues[5] = sOcarinaNotesAlphaValues[6] = sOcarinaNotesAlphaValues[7] = sOcarinaNotesAlphaValues[8] = 0; - sOcarinaNoteAPrimR = 80; - sOcarinaNoteAPrimG = 255; - sOcarinaNoteAPrimB = 150; sOcarinaNoteAEnvR = 10; sOcarinaNoteAEnvG = 10; sOcarinaNoteAEnvB = 10; - sOcarinaNoteCPrimR = 255; - sOcarinaNoteCPrimG = 255; - sOcarinaNoteCPrimB = 50; sOcarinaNoteCEnvR = 10; sOcarinaNoteCEnvG = 10; sOcarinaNoteCEnvB = 10; + if (CVar_GetS32("gHudColors", 1) == 0) { + sOcarinaNoteAPrimR = 80; + sOcarinaNoteAPrimG = 150; + sOcarinaNoteAPrimB = 255; + sOcarinaNoteCPrimR = 255; + sOcarinaNoteCPrimG = 255; + sOcarinaNoteCPrimB = 50; + } else if (CVar_GetS32("gHudColors", 1) == 1) { + sOcarinaNoteAPrimR = 80; + sOcarinaNoteAPrimG = 255; + sOcarinaNoteAPrimB = 150; + sOcarinaNoteCPrimR = 255; + sOcarinaNoteCPrimG = 255; + sOcarinaNoteCPrimB = 50; + } else if (CVar_GetS32("gHudColors", 1) == 2) { + sOcarinaNoteAPrimR = CVar_GetS32("gCCABtnPrimR", 80); + sOcarinaNoteAPrimG = CVar_GetS32("gCCABtnPrimR", 255); + sOcarinaNoteAPrimB = CVar_GetS32("gCCABtnPrimR", 150); + sOcarinaNoteCPrimR = CVar_GetS32("gCCCBtnPrimR", 255); + sOcarinaNoteCPrimG = CVar_GetS32("gCCCBtnPrimG", 255); + sOcarinaNoteCPrimB = CVar_GetS32("gCCCBtnPrimB", 50); + sOcarinaNoteCUpPrimR = CVar_GetS32("gCCCUBtnPrimR", 255); + sOcarinaNoteCUpPrimG = CVar_GetS32("gCCCUBtnPrimG", 255); + sOcarinaNoteCUpPrimB = CVar_GetS32("gCCCUBtnPrimB", 50); + sOcarinaNoteCLeftPrimR = CVar_GetS32("gCCCLBtnPrimR", 255); + sOcarinaNoteCLeftPrimG = CVar_GetS32("gCCCLBtnPrimG", 255); + sOcarinaNoteCLeftPrimB = CVar_GetS32("gCCCLBtnPrimB", 50); + sOcarinaNoteCDownPrimR = CVar_GetS32("gCCCDBtnPrimR", 255); + sOcarinaNoteCDownPrimG = CVar_GetS32("gCCCDBtnPrimG", 255); + sOcarinaNoteCDownPrimB = CVar_GetS32("gCCCDBtnPrimB", 50); + sOcarinaNoteCRightPrimR = CVar_GetS32("gCCCRBtnPrimR", 255); + sOcarinaNoteCRightPrimG = CVar_GetS32("gCCCRBtnPrimG", 255); + sOcarinaNoteCRightPrimB = CVar_GetS32("gCCCRBtnPrimB", 50); + } } void Message_UpdateOcarinaGame(GlobalContext* globalCtx) { @@ -1948,22 +1988,80 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { static void* sOcarinaNoteTextures[] = { gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex, }; - static s16 sOcarinaNoteAPrimColors[][3] = { + s16 sOcarinaNoteAPrimColors[2][3]; + s16 sOcarinaNoteAPrimColors_GCN[][3] = { { 80, 255, 150 }, { 100, 255, 200 }, }; + s16 sOcarinaNoteAPrimColors_N64[][3] = { + { 80, 255, 150 }, + { 100, 255, 200 }, + }; + s16 ABtnR = CVar_GetS32("gCCABtnPrimR", 80); + s16 ABtnG = CVar_GetS32("gCCABtnPrimG", 255); + s16 ABtnB = CVar_GetS32("gCCABtnPrimB", 150); + s16 ABtnR_2 = CVar_GetS32("gCCABtnPrimR", 80)+20; + s16 ABtnG_2 = CVar_GetS32("gCCABtnPrimG", 235)+20; + s16 ABtnB_2 = CVar_GetS32("gCCABtnPrimB", 180)+20; + if(ABtnR_2 > 255){ABtnR_2=255;}; + if(ABtnG_2 > 255){ABtnG_2=255;}; + if(ABtnB_2 > 255){ABtnB_2=255;}; + s16 sOcarinaNoteAPrimColors_CUSTOM[][3] = { + { ABtnG, ABtnG, ABtnB }, + { ABtnR_2, ABtnG_2, ABtnB_2 }, + }; static s16 sOcarinaNoteAEnvColors[][3] = { { 10, 10, 10 }, { 50, 255, 50 }, }; - static s16 sOcarinaNoteCPrimColors[][3] = { + s16 sOcarinaNoteCPrimColors[2][3]; + s16 sOcarinaNoteCPrimColors_GCN[][3] = { { 255, 255, 50 }, { 255, 255, 180 }, }; + s16 CBtnR = CVar_GetS32("gCCCBtnPrimR", 255); + s16 CBtnG = CVar_GetS32("gCCCBtnPrimG", 255); + s16 CBtnB = CVar_GetS32("gCCCBtnPrimB", 50); + s16 CBtnR_2 = CVar_GetS32("gCCCBtnPrimR", 255)+20; + s16 CBtnG_2 = CVar_GetS32("gCCCBtnPrimG", 255)+20; + s16 CBtnB_2 = CVar_GetS32("gCCCBtnPrimB", 50)+20; + s16 CBtnRU = CVar_GetS32("gCCCUBtnPrimR", 255); + s16 CBtnGU = CVar_GetS32("gCCCUBtnPrimG", 255); + s16 CBtnBU = CVar_GetS32("gCCCUBtnPrimB", 50); + s16 CBtnRL = CVar_GetS32("gCCCLBtnPrimR", 255); + s16 CBtnGL = CVar_GetS32("gCCCLBtnPrimG", 255); + s16 CBtnBL = CVar_GetS32("gCCCLBtnPrimB", 50); + s16 CBtnRD = CVar_GetS32("gCCCDBtnPrimR", 255); + s16 CBtnGD = CVar_GetS32("gCCCDBtnPrimG", 255); + s16 CBtnBD = CVar_GetS32("gCCCDBtnPrimB", 50); + s16 CBtnRR = CVar_GetS32("gCCCRBtnPrimR", 255); + s16 CBtnGR = CVar_GetS32("gCCCRBtnPrimG", 255); + s16 CBtnBR = CVar_GetS32("gCCCRBtnPrimB", 50); + if(CBtnR_2 > 255){CBtnR_2=255;}; + if(CBtnG_2 > 255){CBtnG_2=255;}; + if(CBtnB_2 > 255){CBtnB_2=255;}; + s16 sOcarinaNoteCPrimColors_CUSTOM[][3] = { + { CBtnR, CBtnG, CBtnB }, //Unified + { CBtnR_2, CBtnG_2, CBtnB_2 }, + { CBtnRL, CBtnGL, CBtnBL }, //Left + { CBtnRD, CBtnGD, CBtnBD }, //Down + { CBtnRR, CBtnGR, CBtnBR }, //Right + { CBtnRU, CBtnGU, CBtnBU }, //Up + }; static s16 sOcarinaNoteCEnvColors[][3] = { { 10, 10, 10 }, { 110, 110, 50 }, }; + if (CVar_GetS32("gHudColors", 1) == 0) { //N64 + sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_N64; + sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_GCN; //GCN and N64 share same C buttons color. + } else if (CVar_GetS32("gHudColors", 1) == 1) { //GCN + sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_GCN; + sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_GCN; + } else if (CVar_GetS32("gHudColors", 1) == 2) { //Custom + sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_CUSTOM; + sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_CUSTOM; + } static s16 sOcarinaNoteFlashTimer = 12; static s16 sOcarinaNoteFlashColorIdx = 1; static s16 sOcarinaSongFanfares[] = { @@ -1980,6 +2078,18 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { s16 r; s16 g; s16 b; + s16 ru;//Red Up + s16 gu;//Green Up + s16 bu;//Blue Up + s16 rl;//Red Left + s16 gl;//green Left + s16 bl;//Blue Left + s16 rd;//And so on + s16 gd; + s16 bd; + s16 rr; + s16 gr; + s16 br; u16 i; u16 notePosX; u16 pad1; @@ -2221,6 +2331,31 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { b = ABS(sOcarinaNoteCPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][2]) / sOcarinaNoteFlashTimer; + ru = ABS(sOcarinaNoteCUpPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0]) / + sOcarinaNoteFlashTimer; + gu = ABS(sOcarinaNoteCUpPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1]) / + sOcarinaNoteFlashTimer; + bu = ABS(sOcarinaNoteCUpPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2]) / + sOcarinaNoteFlashTimer; + rl = ABS(sOcarinaNoteCLeftPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0]) / + sOcarinaNoteFlashTimer; + gl = ABS(sOcarinaNoteCLeftPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1]) / + sOcarinaNoteFlashTimer; + bl = ABS(sOcarinaNoteCLeftPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2]) / + sOcarinaNoteFlashTimer; + rd = ABS(sOcarinaNoteCDownPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0]) / + sOcarinaNoteFlashTimer; + gd = ABS(sOcarinaNoteCDownPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1]) / + sOcarinaNoteFlashTimer; + bd = ABS(sOcarinaNoteCDownPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2]) / + sOcarinaNoteFlashTimer; + rr = ABS(sOcarinaNoteCRightPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0]) / + sOcarinaNoteFlashTimer; + gr = ABS(sOcarinaNoteCRightPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1]) / + sOcarinaNoteFlashTimer; + br = ABS(sOcarinaNoteCRightPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2]) / + sOcarinaNoteFlashTimer; + if (sOcarinaNoteCPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][0]) { sOcarinaNoteCPrimR -= r; } else { @@ -2237,6 +2372,70 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { sOcarinaNoteCPrimB += b; } + if (sOcarinaNoteCUpPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0]) { + sOcarinaNoteCUpPrimR -= ru; + } else { + sOcarinaNoteCUpPrimR += ru; + } + if (sOcarinaNoteCUpPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1]) { + sOcarinaNoteCUpPrimG -= gu; + } else { + sOcarinaNoteCUpPrimG += gu; + } + if (sOcarinaNoteCUpPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2]) { + sOcarinaNoteCUpPrimB -= bu; + } else { + sOcarinaNoteCUpPrimB += bu; + } + + if (sOcarinaNoteCLeftPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0]) { + sOcarinaNoteCLeftPrimR -= rl; + } else { + sOcarinaNoteCLeftPrimR += rl; + } + if (sOcarinaNoteCLeftPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1]) { + sOcarinaNoteCLeftPrimG -= gl; + } else { + sOcarinaNoteCLeftPrimG += gl; + } + if (sOcarinaNoteCLeftPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2]) { + sOcarinaNoteCLeftPrimB -= bl; + } else { + sOcarinaNoteCLeftPrimB += bl; + } + + if (sOcarinaNoteCDownPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0]) { + sOcarinaNoteCDownPrimR -= rd; + } else { + sOcarinaNoteCDownPrimR += rd; + } + if (sOcarinaNoteCDownPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1]) { + sOcarinaNoteCDownPrimG -= gd; + } else { + sOcarinaNoteCDownPrimG += gd; + } + if (sOcarinaNoteCDownPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2]) { + sOcarinaNoteCDownPrimB -= bd; + } else { + sOcarinaNoteCDownPrimB += bd; + } + + if (sOcarinaNoteCRightPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0]) { + sOcarinaNoteCRightPrimR -= rr; + } else { + sOcarinaNoteCRightPrimR += rr; + } + if (sOcarinaNoteCRightPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1]) { + sOcarinaNoteCRightPrimG -= gr; + } else { + sOcarinaNoteCRightPrimG += gr; + } + if (sOcarinaNoteCRightPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2]) { + sOcarinaNoteCRightPrimB -= br; + } else { + sOcarinaNoteCRightPrimB += br; + } + r = ABS(sOcarinaNoteCEnvR - sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][0]) / sOcarinaNoteFlashTimer; g = ABS(sOcarinaNoteCEnvG - sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][1]) / @@ -2271,6 +2470,18 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { sOcarinaNoteCPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][0]; sOcarinaNoteCPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][1]; sOcarinaNoteCPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][2]; + sOcarinaNoteCUpPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0]; + sOcarinaNoteCUpPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1]; + sOcarinaNoteCUpPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2]; + sOcarinaNoteCLeftPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0]; + sOcarinaNoteCLeftPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1]; + sOcarinaNoteCLeftPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2]; + sOcarinaNoteCDownPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0]; + sOcarinaNoteCDownPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1]; + sOcarinaNoteCDownPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2]; + sOcarinaNoteCRightPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0]; + sOcarinaNoteCRightPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1]; + sOcarinaNoteCRightPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2]; sOcarinaNoteCEnvR = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][0]; sOcarinaNoteCEnvG = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][1]; sOcarinaNoteCEnvB = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][2]; @@ -2883,7 +3094,7 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteAPrimR, sOcarinaNoteAPrimG, sOcarinaNoteAPrimB, sOcarinaNotesAlphaValues[i]); } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCABtnPrimR", 0), CVar_GetS32("gCCABtnPrimG", 0), CVar_GetS32("gCCABtnPrimB", 0), sOcarinaNotesAlphaValues[i]); + gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCABtnPrimR", 80), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 150), sOcarinaNotesAlphaValues[i]); } gDPSetEnvColor(gfx++, sOcarinaNoteAEnvR, sOcarinaNoteAEnvG, sOcarinaNoteAEnvB, 0); } else { @@ -2891,8 +3102,16 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]); - } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 0), CVar_GetS32("gCCCBtnPrimG", 0), CVar_GetS32("gCCCBtnPrimB", 0), sOcarinaNotesAlphaValues[i]); + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 180), sOcarinaNotesAlphaValues[i]); + } else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCUpPrimR, sOcarinaNoteCUpPrimG, sOcarinaNoteCUpPrimB, sOcarinaNotesAlphaValues[i]); + } else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCLeftPrimR, sOcarinaNoteCLeftPrimG, sOcarinaNoteCLeftPrimB, sOcarinaNotesAlphaValues[i]); + } else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCRightPrimR, sOcarinaNoteCRightPrimG, sOcarinaNoteCRightPrimB, sOcarinaNotesAlphaValues[i]); + } else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCDownPrimR, sOcarinaNoteCDownPrimG, sOcarinaNoteCDownPrimB, sOcarinaNotesAlphaValues[i]); } gDPSetEnvColor(gfx++, sOcarinaNoteCEnvR, sOcarinaNoteCEnvG, sOcarinaNoteCEnvB, 0); } diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index f9669b3aa..dfe2e6529 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2700,10 +2700,22 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { if (gSaveContext.magic <= 0) { gSaveContext.magic = 0; gSaveContext.unk_13F0 = 3; - sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + if (CVar_GetS32("gHudColors", 1) == 2) { + sMagicBorderR = CVar_GetS32("gCCMagicBorderNormPrimR", 255); + sMagicBorderG = CVar_GetS32("gCCMagicBorderNormPrimG", 255); + sMagicBorderB = CVar_GetS32("gCCMagicBorderNormPrimB", 255); + } else { + sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + } } else if (gSaveContext.magic == gSaveContext.unk_13F8) { gSaveContext.unk_13F0 = 3; - sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + if (CVar_GetS32("gHudColors", 1) == 2) { + sMagicBorderR = CVar_GetS32("gCCMagicBorderNormPrimR", 255); + sMagicBorderG = CVar_GetS32("gCCMagicBorderNormPrimG", 255); + sMagicBorderB = CVar_GetS32("gCCMagicBorderNormPrimB", 255); + } else { + sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + } } case 3: case 4: @@ -2745,7 +2757,13 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { break; case 5: - sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + if (CVar_GetS32("gHudColors", 1) == 2) { + sMagicBorderR = CVar_GetS32("gCCMagicBorderNormPrimR", 255); + sMagicBorderG = CVar_GetS32("gCCMagicBorderNormPrimG", 255); + sMagicBorderB = CVar_GetS32("gCCMagicBorderNormPrimB", 255); + } else { + sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + } gSaveContext.unk_13F0 = 0; break; @@ -2767,7 +2785,13 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSaveContext.unk_13F0 = 0; - sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + if (CVar_GetS32("gHudColors", 1) == 2) { + sMagicBorderR = CVar_GetS32("gCCMagicBorderNormPrimR", 255); + sMagicBorderG = CVar_GetS32("gCCMagicBorderNormPrimG", 255); + sMagicBorderB = CVar_GetS32("gCCMagicBorderNormPrimB", 255); + } else { + sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; + } break; } @@ -2837,33 +2861,79 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (gSaveContext.magicLevel != 0) { - if (gSaveContext.healthCapacity > 0xA0) { - magicBarY = R_MAGIC_BAR_LARGE_Y + (Top_HUD_Margin*-1); + s16 X_Margins; + s16 Y_Margins; + if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) { + X_Margins = Left_HUD_Margin; + Y_Margins = (Top_HUD_Margin*-1); } else { - magicBarY = R_MAGIC_BAR_SMALL_Y + (Top_HUD_Margin*-1); + X_Margins = 0; + Y_Margins = 0; + } + const s16 magicBarY_original_l = R_MAGIC_BAR_LARGE_Y + Y_Margins; + const s16 magicBarY_original_s = R_MAGIC_BAR_SMALL_Y + Y_Margins; + const s16 PosX_Start_original = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + X_Margins); + const s16 PosX_MidEnd_original = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + X_Margins+8); + const s16 rMagicBarX_original = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + X_Margins); + const s16 rMagicFillX_original = OTRGetRectDimensionFromLeftEdge(R_MAGIC_FILL_X + X_Margins); + s16 PosX_Start; + s16 magicBarY; + s16 rMagicBarX; + s16 PosX_MidEnd; + s16 rMagicFillX; + if (CVar_GetS32("gMagicBarPosType", 0) != 0) { + magicBarY = CVar_GetS32("gMagicBarPosY", 0)+Y_Margins; + if (CVar_GetS32("gMagicBarPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) {X_Margins = Left_HUD_Margin;}; + PosX_Start = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); + rMagicBarX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); + PosX_MidEnd = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); + rMagicFillX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); + } else if (CVar_GetS32("gMagicBarPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) {X_Margins = Right_HUD_Margin;}; + PosX_Start = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); + rMagicBarX = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); + PosX_MidEnd = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); + rMagicFillX = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); + } else if (CVar_GetS32("gMagicBarPosType", 0) == 3) {//Anchor None + PosX_Start = CVar_GetS32("gMagicBarPosX", 0)+X_Margins; + rMagicBarX = CVar_GetS32("gMagicBarPosX", 0)+X_Margins; + PosX_MidEnd = CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8; + rMagicFillX = CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8; + } else if (CVar_GetS32("gMagicBarPosType", 0) == 4) {//hidden + PosX_Start = -9999; + rMagicBarX = -9999; + PosX_MidEnd = -9999; + rMagicFillX = -9999; + } + } else { + if (gSaveContext.healthCapacity > 0xA0) { + magicBarY = magicBarY_original_l; + } else { + magicBarY = magicBarY_original_s; + } + PosX_Start = PosX_Start_original; + rMagicBarX = rMagicBarX_original; + PosX_MidEnd = PosX_MidEnd_original; + rMagicFillX = rMagicFillX_original; } func_80094520(globalCtx->state.gfxCtx); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha); if (CVar_GetS32("gHudColors", 1) == 2) {//Original game add color there so to prevent miss match we make it all white :) - gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); + gDPSetEnvColor(OVERLAY_DISP++, 255, 255, 255, 255); } else { gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255); } + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha); - OVERLAY_DISP = - Gfx_TextureIA8(OVERLAY_DISP, gMagicBarEndTex, 8, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1)), - magicBarY, 8, 16, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicBarEndTex, 8, 16, PosX_Start, magicBarY, 8, 16, 1 << 10, 1 << 10); - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicBarMidTex, 24, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1)) + 8, magicBarY, - gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicBarMidTex, 24, 16, PosX_MidEnd, magicBarY, gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10); gDPLoadTextureBlock(OVERLAY_DISP++, gMagicBarEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - const s16 rMagicBarX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1)); - gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2, ((rMagicBarX + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE, 256, 0, 1 << 10, 1 << 10); @@ -2873,8 +2943,6 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); - const s16 rMagicFillX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_FILL_X + (Left_HUD_Margin*-1)); - if (gSaveContext.unk_13F0 == 4) { // Yellow part of the bar indicating the amount of magic to be subtracted if (CVar_GetS32("gHudColors", 1) == 2) { @@ -2982,10 +3050,214 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { s16 width; s16 height; - s16 C_Left_BTN_Pos[] = { C_LEFT_BUTTON_X+Right_HUD_Margin, C_LEFT_BUTTON_Y+(Top_HUD_Margin*-1) }; //(X,Y) - s16 C_Right_BTN_Pos[] = { C_RIGHT_BUTTON_X+Right_HUD_Margin, C_RIGHT_BUTTON_Y+(Top_HUD_Margin*-1) }; - s16 C_Up_BTN_Pos[] = { C_UP_BUTTON_X+Right_HUD_Margin, C_UP_BUTTON_Y+(Top_HUD_Margin*-1) }; - s16 C_Down_BTN_Pos[] = { C_DOWN_BUTTON_X+Right_HUD_Margin, C_DOWN_BUTTON_Y+(Top_HUD_Margin*-1) }; + //B Button + s16 X_Margins_BtnB; + s16 Y_Margins_BtnB; + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { + if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + Y_Margins_BtnB = (Top_HUD_Margin*-1); + } else { + X_Margins_BtnB = 0; + Y_Margins_BtnB = 0; + } + s16 PosX_BtnB_ori = OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(0)+X_Margins_BtnB); + s16 PosY_BtnB_ori = R_ITEM_BTN_Y(0)+Y_Margins_BtnB; + s16 PosX_BtnB; + s16 PosY_BtnB; + if (CVar_GetS32("gBBtnPosType", 0) != 0) { + PosY_BtnB = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB; + if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + PosX_BtnB = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + PosX_BtnB = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None + PosX_BtnB = CVar_GetS32("gBBtnPosX", 0); + } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + PosX_BtnB = -9999; + } + } else { + PosY_BtnB = PosY_BtnB_ori; + PosX_BtnB = PosX_BtnB_ori; + } + //Start Button + s16 X_Margins_StartBtn; + s16 Y_Margins_StartBtn; + if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) { + if (CVar_GetS32("gStartBtnPosType", 0) == 0) { + X_Margins_StartBtn = Right_HUD_Margin; + }; + Y_Margins_StartBtn = Top_HUD_Margin*-1; + } else { + X_Margins_StartBtn = 0; + Y_Margins_StartBtn = 0; + } + s16 StartBtn_Icon_H = 32; + s16 StartBtn_Icon_W = 32; + int StartBTN_H_Scaled = StartBtn_Icon_H * 0.75f; + int StartBTN_W_Scaled = StartBtn_Icon_W * 0.75f; + int StartBTN_W_factor = (1 << 10) * StartBtn_Icon_W / StartBTN_W_Scaled; + int StartBTN_H_factor = (1 << 10) * StartBtn_Icon_H / StartBTN_H_Scaled; + const s16 rStartLabelX_ori = OTRGetRectDimensionFromRightEdge(R_START_LABEL_X(gSaveContext.language)+X_Margins_StartBtn); + const s16 rStartLabelY_ori = R_START_LABEL_Y(gSaveContext.language)+Y_Margins_StartBtn; + const s16 PosX_StartBtn_ori = OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]+X_Margins_StartBtn); + const s16 PosY_StartBtn_ori = 16+Y_Margins_StartBtn; + s16 StartBTN_Label_W = DO_ACTION_TEX_WIDTH; + s16 StartBTN_Label_H = DO_ACTION_TEX_HEIGHT; + int StartBTN_Label_H_Scaled = StartBTN_Label_H * 1.0f; + int StartBTN_Label_W_Scaled = StartBTN_Label_W * 1.0f; + int StartBTN_Label_W_factor = (1 << 10) * StartBTN_Label_W / StartBTN_Label_W_Scaled; + int StartBTN_Label_H_factor = (1 << 10) * StartBTN_Label_H / StartBTN_Label_H_Scaled; + const s16 StartBtn_Label_W_ori = StartBTN_Label_W / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); + const s16 StartBtn_Label_H_ori = StartBTN_Label_H / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); + s16 PosX_StartBtn; + s16 PosY_StartBtn; + s16 rStartLabelX; + s16 rStartLabelY; + if (CVar_GetS32("gStartBtnPosType", 0) != 0) { + PosY_StartBtn = CVar_GetS32("gStartBtnPosY", 0)+Y_Margins_StartBtn; + rStartLabelY = CVar_GetS32("gStartBtnPosY", 0)+Y_Margins_StartBtn+3; + if (CVar_GetS32("gStartBtnPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Left_HUD_Margin;}; + PosX_StartBtn = OTRGetDimensionFromLeftEdge(CVar_GetS32("gStartBtnPosX", 0)+X_Margins_StartBtn); + rStartLabelX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gStartBtnPosX", 0)+X_Margins_StartBtn-12); + } else if (CVar_GetS32("gStartBtnPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Right_HUD_Margin;}; + PosX_StartBtn = OTRGetDimensionFromRightEdge(CVar_GetS32("gStartBtnPosX", 0)+X_Margins_StartBtn); + rStartLabelX = OTRGetDimensionFromRightEdge(CVar_GetS32("gStartBtnPosX", 0)+X_Margins_StartBtn-12); + } else if (CVar_GetS32("gStartBtnPosType", 0) == 3) {//Anchor None + PosX_StartBtn = CVar_GetS32("gStartBtnPosX", 0); + rStartLabelX = CVar_GetS32("gStartBtnPosX", 0)-12; + } else if (CVar_GetS32("gStartBtnPosType", 0) == 4) {//Hidden + PosX_StartBtn = -9999; + rStartLabelX = -9999; + } + } else { + PosY_StartBtn = PosY_StartBtn_ori; + PosX_StartBtn = PosX_StartBtn_ori; + rStartLabelY = rStartLabelY_ori; + rStartLabelX = rStartLabelX_ori; + } + //C Buttons position + s16 X_Margins_CL; + s16 X_Margins_CR; + s16 X_Margins_CU; + s16 X_Margins_CD; + s16 Y_Margins_CL; + s16 Y_Margins_CR; + s16 Y_Margins_CU; + s16 Y_Margins_CD; + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + Y_Margins_CL = (Top_HUD_Margin*-1); + } else { + X_Margins_CL = 0; + Y_Margins_CL = 0; + } + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + Y_Margins_CR = (Top_HUD_Margin*-1); + } else { + X_Margins_CR = 0; + Y_Margins_CR = 0; + } + if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnUPosType", 0) == 0) {X_Margins_CU = Right_HUD_Margin;}; + Y_Margins_CU = (Top_HUD_Margin*-1); + } else { + X_Margins_CU = 0; + Y_Margins_CU = 0; + } + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + Y_Margins_CD = (Top_HUD_Margin*-1); + } else { + X_Margins_CD = 0; + Y_Margins_CD = 0; + } + const s16 C_Left_BTN_Pos_ori[] = { C_LEFT_BUTTON_X+X_Margins_CL, C_LEFT_BUTTON_Y+Y_Margins_CL }; //(X,Y) + const s16 C_Right_BTN_Pos_ori[] = { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }; + const s16 C_Up_BTN_Pos_ori[] = { C_UP_BUTTON_X+X_Margins_CU, C_UP_BUTTON_Y+Y_Margins_CU }; + const s16 C_Down_BTN_Pos_ori[] = { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }; + s16 LabelX_Navi=8; + s16 LabelY_Navi=4 - !!CVar_GetS32("gNaviTextFix", 0); + s16 C_Left_BTN_Pos[2]; //(X,Y) + s16 C_Right_BTN_Pos[2]; + s16 C_Up_BTN_Pos[2]; + s16 C_Down_BTN_Pos[2]; + //C button Left + if (CVar_GetS32("gCBtnLPosType", 0) != 0) { + C_Left_BTN_Pos[1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + C_Left_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + C_Left_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None + C_Left_BTN_Pos[0] = CVar_GetS32("gCBtnLPosX", 0); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + C_Left_BTN_Pos[0] = -9999; + } + } else { + C_Left_BTN_Pos[1] = C_Left_BTN_Pos_ori[1]; + C_Left_BTN_Pos[0] = OTRGetRectDimensionFromRightEdge(C_Left_BTN_Pos_ori[0]); + } + //C button Right + if (CVar_GetS32("gCBtnRPosType", 0) != 0) { + C_Right_BTN_Pos[1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + C_Right_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + C_Right_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None + C_Right_BTN_Pos[0] = CVar_GetS32("gCBtnRPosX", 0); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + C_Right_BTN_Pos[0] = -9999; + } + } else { + C_Right_BTN_Pos[1] = C_Right_BTN_Pos_ori[1]; + C_Right_BTN_Pos[0] = OTRGetRectDimensionFromRightEdge(C_Right_BTN_Pos_ori[0]); + } + //C Button Up + if (CVar_GetS32("gCBtnUPosType", 0) != 0) { + C_Up_BTN_Pos[1] = CVar_GetS32("gCBtnUPosY", 0)+Y_Margins_CU; + if (CVar_GetS32("gCBtnUPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Left_HUD_Margin;}; + C_Up_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnUPosX", 0)+X_Margins_CU); + } else if (CVar_GetS32("gCBtnUPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Right_HUD_Margin;}; + C_Up_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnUPosX", 0)+X_Margins_CU); + } else if (CVar_GetS32("gCBtnUPosType", 0) == 3) {//Anchor None + C_Up_BTN_Pos[0] = CVar_GetS32("gCBtnUPosX", 0); + } else if (CVar_GetS32("gCBtnUPosType", 0) == 4) {//Hidden + C_Up_BTN_Pos[0] = -9999; + } + } else { + C_Up_BTN_Pos[1] = C_Up_BTN_Pos_ori[1]; + C_Up_BTN_Pos[0] = OTRGetRectDimensionFromRightEdge(C_Up_BTN_Pos_ori[0]); + } + //C Button down + if (CVar_GetS32("gCBtnDPosType", 0) != 0) { + C_Down_BTN_Pos[1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + C_Down_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + C_Down_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None + C_Down_BTN_Pos[0] = CVar_GetS32("gCBtnDPosX", 0); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + C_Down_BTN_Pos[0] = -9999; + } + } else { + C_Down_BTN_Pos[1] = C_Down_BTN_Pos_ori[1]; + C_Down_BTN_Pos[0] = OTRGetRectDimensionFromRightEdge(C_Down_BTN_Pos_ori[0]); + } OPEN_DISPS(globalCtx->state.gfxCtx); @@ -3002,9 +3274,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { } gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); - OVERLAY_DISP = - Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(0)+Right_HUD_Margin), R_ITEM_BTN_Y(0)+(Top_HUD_Margin*-1), - R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) << 1, R_ITEM_BTN_DD(0) << 1); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, PosX_BtnB, PosY_BtnB, R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) << 1, R_ITEM_BTN_DD(0) << 1); // C-Left Button Color & Texture gDPPipeSync(OVERLAY_DISP++); @@ -3012,11 +3282,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - } else if (CVar_GetS32("gHudColors", 1) == 2) { + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated",0)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cLeftAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated",0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCLBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCLBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cLeftAlpha); } - gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Left_BTN_Pos[0]) << 2, C_Left_BTN_Pos[1] << 2, - (OTRGetRectDimensionFromRightEdge(C_Left_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(1)) << 2, + gSPWideTextureRectangle(OVERLAY_DISP++, C_Left_BTN_Pos[0] << 2, C_Left_BTN_Pos[1] << 2, + (C_Left_BTN_Pos[0] + R_ITEM_BTN_WIDTH(1)) << 2, (C_Left_BTN_Pos[1] + R_ITEM_BTN_WIDTH(1)) << 2, G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) << 1, R_ITEM_BTN_DD(1) << 1); @@ -3025,11 +3297,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); - } else if (CVar_GetS32("gHudColors", 1) == 2) { + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated",0)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cDownAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated",0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCDBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCDBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cDownAlpha); } - gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Down_BTN_Pos[0]) << 2, C_Down_BTN_Pos[1] << 2, - (OTRGetRectDimensionFromRightEdge(C_Down_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(2)) << 2, + gSPWideTextureRectangle(OVERLAY_DISP++, C_Down_BTN_Pos[0] << 2, C_Down_BTN_Pos[1] << 2, + (C_Down_BTN_Pos[0] + R_ITEM_BTN_WIDTH(2)) << 2, (C_Down_BTN_Pos[1] + R_ITEM_BTN_WIDTH(2)) << 2, G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) << 1, R_ITEM_BTN_DD(2) << 1); @@ -3038,11 +3312,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); - } else if (CVar_GetS32("gHudColors", 1) == 2) { + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated",0)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cRightAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated",0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCRBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCRBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cRightAlpha); } - gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Right_BTN_Pos[0]) << 2, C_Right_BTN_Pos[1] << 2, - (OTRGetRectDimensionFromRightEdge(C_Right_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(3)) << 2, + gSPWideTextureRectangle(OVERLAY_DISP++, C_Right_BTN_Pos[0] << 2, C_Right_BTN_Pos[1] << 2, + (C_Right_BTN_Pos[0] + R_ITEM_BTN_WIDTH(3)) << 2, (C_Right_BTN_Pos[1] + R_ITEM_BTN_WIDTH(3)) << 2, G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1); @@ -3057,9 +3333,9 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { } else if (CVar_GetS32("gHudColors", 1) == 2) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCStartBtnPrimR", 120), CVar_GetS32("gCCStartBtnPrimG", 120), CVar_GetS32("gCCStartBtnPrimB", 120), interfaceCtx->startAlpha); } - gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]+Right_HUD_Margin) << 2, 68+((Top_HUD_Margin*-1)*4), - (OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]+Right_HUD_Margin) + 22) << 2, 156+((Top_HUD_Margin*-1)*4), - G_TX_RENDERTILE, 0, 0, 1462, 1462); + gSPWideTextureRectangle(OVERLAY_DISP++, PosX_StartBtn << 2, PosY_StartBtn << 2, + (PosX_StartBtn + StartBTN_W_Scaled) << 2, (PosY_StartBtn + StartBTN_H_Scaled) << 2, + G_TX_RENDERTILE, 0, 0, StartBTN_W_factor, StartBTN_H_factor); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->startAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); @@ -3089,14 +3365,11 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - dxdy = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); - width = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); - height = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); - const s16 rStartLabelX = OTRGetRectDimensionFromRightEdge(R_START_LABEL_X(gSaveContext.language)+Right_HUD_Margin); + //const s16 rStartLabelX = OTRGetRectDimensionFromRightEdge(R_START_LABEL_X(gSaveContext.language)+Right_HUD_Margin); gSPWideTextureRectangle( - OVERLAY_DISP++, rStartLabelX << 2, - R_START_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) << 2, (rStartLabelX + width) << 2, - (R_START_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) + height) << 2, G_TX_RENDERTILE, 0, 0, dxdy, dxdy); + OVERLAY_DISP++, rStartLabelX << 2, rStartLabelY << 2, + (rStartLabelX + StartBTN_Label_W) << 2, + (rStartLabelY + StartBTN_Label_H) << 2, G_TX_RENDERTILE, 0, 0, StartBTN_Label_W_factor, StartBTN_Label_H_factor); } } @@ -3115,18 +3388,18 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { temp = interfaceCtx->healthAlpha; } - const s16 rCUpBtnX = OTRGetRectDimensionFromRightEdge(R_C_UP_BTN_X+Right_HUD_Margin); - const s16 rCUPIconX = OTRGetRectDimensionFromRightEdge(R_C_UP_ICON_X+Right_HUD_Margin-!!CVar_GetS32("gNaviTextFix", 0)); if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp); - } else if (CVar_GetS32("gHudColors", 1) == 2) { + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated",0)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), temp); + } else if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated",0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCUBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCUBtnPrimB", R_C_BTN_COLOR(2)), temp); } gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gSPWideTextureRectangle(OVERLAY_DISP++, rCUpBtnX << 2, R_C_UP_BTN_Y+(Top_HUD_Margin*-1) << 2, (rCUpBtnX + 16) << 2, - (R_C_UP_BTN_Y+(Top_HUD_Margin*-1) + 16) << 2, G_TX_RENDERTILE, 0, 0, 2 << 10, 2 << 10); + gSPWideTextureRectangle(OVERLAY_DISP++, C_Up_BTN_Pos[0] << 2, C_Up_BTN_Pos[1] << 2, (C_Up_BTN_Pos[0] + 16) << 2, + (C_Up_BTN_Pos[1] + 16) << 2, G_TX_RENDERTILE, 0, 0, 2 << 10, 2 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, temp); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); @@ -3137,8 +3410,9 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPWideTextureRectangle(OVERLAY_DISP++, rCUPIconX << 2, R_C_UP_ICON_Y+(Top_HUD_Margin*-1) << 2, (rCUPIconX + 32) << 2, - (R_C_UP_ICON_Y+(Top_HUD_Margin*-1) + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPWideTextureRectangle(OVERLAY_DISP++, C_Up_BTN_Pos[0]-LabelX_Navi << 2, C_Up_BTN_Pos[1]+LabelY_Navi << 2, + (C_Up_BTN_Pos[0]-LabelX_Navi + 32) << 2, (C_Up_BTN_Pos[1]+LabelY_Navi + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } sCUpTimer--; @@ -3153,6 +3427,94 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { // Empty C Button Arrows for (temp = 1; temp < 4; temp++) { if (gSaveContext.equips.buttonItems[temp] > 0xF0) { + s16 X_Margins_CL; + s16 X_Margins_CR; + s16 X_Margins_CD; + s16 Y_Margins_CL; + s16 Y_Margins_CR; + s16 Y_Margins_CD; + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + Y_Margins_CL = (Top_HUD_Margin*-1); + } else { + X_Margins_CL = 0; + Y_Margins_CL = 0; + } + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + Y_Margins_CR = (Top_HUD_Margin*-1); + } else { + X_Margins_CR = 0; + Y_Margins_CR = 0; + } + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + Y_Margins_CD = (Top_HUD_Margin*-1); + } else { + X_Margins_CD = 0; + Y_Margins_CD = 0; + } + const s16 ItemIconPos_ori[3][2] = { + { R_ITEM_ICON_X(1)+X_Margins_CL, R_ITEM_ICON_Y(1)+Y_Margins_CL }, + { R_ITEM_ICON_X(2)+X_Margins_CD, R_ITEM_ICON_Y(2)+Y_Margins_CD }, + { R_ITEM_ICON_X(3)+X_Margins_CR, R_ITEM_ICON_Y(3)+Y_Margins_CR }, + }; + s16 ItemIconPos[3][2]; //(X,Y) + //C button Left + if (CVar_GetS32("gCBtnLPosType", 0) != 0) { + ItemIconPos[0][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVar_GetS32("gCBtnLPosX", 0); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + ItemIconPos[0][0] = -9999; + } + } else { + ItemIconPos[0][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[0][0]); + ItemIconPos[0][1] = ItemIconPos_ori[0][1]; + } + //C Button down + if (CVar_GetS32("gCBtnDPosType", 0) != 0) { + ItemIconPos[1][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVar_GetS32("gCBtnDPosX", 0); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + ItemIconPos[1][0] = -9999; + } + } else { + ItemIconPos[1][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[1][0]); + ItemIconPos[1][1] = ItemIconPos_ori[1][1]; + } + //C button Right + if (CVar_GetS32("gCBtnRPosType", 0) != 0) { + ItemIconPos[2][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVar_GetS32("gCBtnRPosX", 0); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + ItemIconPos[2][0] = -9999; + } + } else { + ItemIconPos[2][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[2][0]); + ItemIconPos[2][1] = ItemIconPos_ori[2][1]; + } + if (temp == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); @@ -3164,13 +3526,21 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { interfaceCtx->cRightAlpha); } - if (CVar_GetS32("gHudColors", 1) == 2) { - //This later will feature color per C button right now that it. + if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cRightAlpha); + } else if (temp == 1 && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCLBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCLBtnPrimB", R_C_BTN_COLOR(2)), + interfaceCtx->cLeftAlpha); + } else if (temp == 2 && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCDBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCDBtnPrimB", R_C_BTN_COLOR(2)), + interfaceCtx->cDownAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCRBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCRBtnPrimB", R_C_BTN_COLOR(2)), + interfaceCtx->cRightAlpha); } - - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex), 32, 32, - OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)+Right_HUD_Margin), R_ITEM_BTN_Y(temp)+(Top_HUD_Margin*-1), R_ITEM_BTN_WIDTH(temp), + + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex), 32, 32, + ItemIconPos[temp-1][0], ItemIconPos[temp-1][1], R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1); const char* cButtonIcons[] = { gButtonBackgroundTex, gEquippedItemOutlineTex, gEmptyCLeftArrowTex, @@ -3178,7 +3548,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { }; OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, cButtonIcons[(temp + 1)], 32, 32, - OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)+Right_HUD_Margin), R_ITEM_BTN_Y(temp)+(Top_HUD_Margin*-1), R_ITEM_BTN_WIDTH(temp), + ItemIconPos[temp-1][0], ItemIconPos[temp-1][1], R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1); } } @@ -3186,25 +3556,192 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -int16_t gItemIconX[] = { B_BUTTON_X, C_LEFT_BUTTON_X, C_DOWN_BUTTON_X, C_RIGHT_BUTTON_X, - DPAD_UP_X, DPAD_DOWN_X, DPAD_LEFT_X, DPAD_RIGHT_X }; -int16_t gItemIconY[] = { B_BUTTON_Y, C_LEFT_BUTTON_Y, C_DOWN_BUTTON_Y, C_RIGHT_BUTTON_Y, - DPAD_UP_Y, DPAD_DOWN_Y, DPAD_LEFT_Y, DPAD_RIGHT_Y }; int16_t gItemIconWidth[] = { 30, 24, 24, 24, 16, 16, 16, 16 }; int16_t gItemIconDD[] = { 550, 680, 680, 680, 1024, 1024, 1024, 1024 }; void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button) { OPEN_DISPS(globalCtx->state.gfxCtx); + s16 X_Margins_CL; + s16 X_Margins_CR; + s16 X_Margins_CD; + s16 Y_Margins_CL; + s16 Y_Margins_CR; + s16 Y_Margins_CD; + s16 X_Margins_BtnB; + s16 Y_Margins_BtnB; + s16 X_Margins_DPad_Items; + s16 Y_Margins_DPad_Items; + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { + if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + Y_Margins_BtnB = (Top_HUD_Margin*-1); + } else { + X_Margins_BtnB = 0; + Y_Margins_BtnB = 0; + } + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + Y_Margins_CL = (Top_HUD_Margin*-1); + } else { + X_Margins_CL = 0; + Y_Margins_CL = 0; + } + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + Y_Margins_CR = (Top_HUD_Margin*-1); + } else { + X_Margins_CR = 0; + Y_Margins_CR = 0; + } + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + Y_Margins_CD = (Top_HUD_Margin*-1); + } else { + X_Margins_CD = 0; + Y_Margins_CD = 0; + } + if (CVar_GetS32("gDPadUseMargins", 0) != 0) { + if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + Y_Margins_DPad_Items = (Top_HUD_Margin*-1); + } else { + X_Margins_DPad_Items = 0; + Y_Margins_DPad_Items = 0; + } + const s16 ItemIconPos_ori[8][2] = { + { B_BUTTON_X+X_Margins_BtnB, B_BUTTON_Y+Y_Margins_BtnB }, + { C_LEFT_BUTTON_X+X_Margins_CL, C_LEFT_BUTTON_Y+Y_Margins_CL }, + { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }, + { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }, + { DPAD_UP_X+X_Margins_DPad_Items, DPAD_UP_Y+Y_Margins_DPad_Items }, + { DPAD_DOWN_X+X_Margins_DPad_Items, DPAD_DOWN_Y+Y_Margins_DPad_Items }, + { DPAD_LEFT_X+X_Margins_DPad_Items, DPAD_LEFT_Y+Y_Margins_DPad_Items }, + { DPAD_RIGHT_X+X_Margins_DPad_Items, DPAD_RIGHT_Y+Y_Margins_DPad_Items } + }; + s16 DPad_ItemsOffset[4][2] = { + { 7,-8},//Up + { 7,24},//Down + {-9, 8},//Left + {23, 8},//Right + }; //(X,Y) Used with custom position to place it properly. + s16 ItemIconPos[8][2]; //(X,Y) + //DPadItems + if (CVar_GetS32("gDPadPosType", 0) != 0) { + ItemIconPos[4][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up + ItemIconPos[5][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down + ItemIconPos[6][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left + ItemIconPos[7][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right + if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None + ItemIconPos[4][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; + ItemIconPos[5][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; + ItemIconPos[6][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; + ItemIconPos[7][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; + } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + ItemIconPos[4][0] = -9999; + ItemIconPos[5][0] = -9999; + ItemIconPos[6][0] = -9999; + ItemIconPos[7][0] = -9999; + } + } else { + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[4][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[5][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[6][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[7][0]); + ItemIconPos[4][1] = ItemIconPos_ori[4][1]; + ItemIconPos[5][1] = ItemIconPos_ori[5][1]; + ItemIconPos[6][1] = ItemIconPos_ori[6][1]; + ItemIconPos[7][1] = ItemIconPos_ori[7][1]; + } + //B Button + if (CVar_GetS32("gBBtnPosType", 0) != 0) { + ItemIconPos[0][1] = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB; + if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVar_GetS32("gBBtnPosX", 0); + } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + ItemIconPos[0][0] = -9999; + } + } else { + ItemIconPos[0][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[0][0]); + ItemIconPos[0][1] = ItemIconPos_ori[0][1]; + } + //C button Left + if (CVar_GetS32("gCBtnLPosType", 0) != 0) { + ItemIconPos[1][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVar_GetS32("gCBtnLPosX", 0); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + ItemIconPos[1][0] = -9999; + } + } else { + ItemIconPos[1][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[1][0]); + ItemIconPos[1][1] = ItemIconPos_ori[1][1]; + } + //C Button down + if (CVar_GetS32("gCBtnDPosType", 0) != 0) { + ItemIconPos[2][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVar_GetS32("gCBtnDPosX", 0); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + ItemIconPos[2][0] = -9999; + } + } else { + ItemIconPos[2][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[2][0]); + ItemIconPos[2][1] = ItemIconPos_ori[2][1]; + } + //C button Right + if (CVar_GetS32("gCBtnRPosType", 0) != 0) { + ItemIconPos[3][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[3][0] = CVar_GetS32("gCBtnRPosX", 0); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + ItemIconPos[3][0] = -9999; + } + } else { + ItemIconPos[3][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[3][0]); + ItemIconPos[3][1] = ItemIconPos_ori[3][1]; + } gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPWideTextureRectangle( - OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(gItemIconX[button] + Right_HUD_Margin) << 2, - gItemIconY[button] + (Top_HUD_Margin * -1) << 2, - (OTRGetRectDimensionFromRightEdge(gItemIconX[button] + Right_HUD_Margin) + gItemIconWidth[button]) << 2, - (gItemIconY[button] + (Top_HUD_Margin * -1) + gItemIconWidth[button]) << 2, G_TX_RENDERTILE, 0, 0, - gItemIconDD[button] << 1, gItemIconDD[button] << 1); + gSPWideTextureRectangle(OVERLAY_DISP++, ItemIconPos[button][0] << 2, ItemIconPos[button][1] << 2, + (ItemIconPos[button][0] + gItemIconWidth[button]) << 2, + (ItemIconPos[button][1] + gItemIconWidth[button]) << 2, G_TX_RENDERTILE, 0, 0, + gItemIconDD[button] << 1, gItemIconDD[button] << 1); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -3223,6 +3760,181 @@ static int16_t gItemAmmoY[] = { B_BUTTON_Y + 18, C_LEFT_BUTTON_Y + 17, C_DOWN_BU void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) { s16 i; s16 ammo; + s16 X_Margins_CL; + s16 X_Margins_CR; + s16 X_Margins_CD; + s16 Y_Margins_CL; + s16 Y_Margins_CR; + s16 Y_Margins_CD; + s16 X_Margins_BtnB; + s16 Y_Margins_BtnB; + s16 X_Margins_DPad_Items; + s16 Y_Margins_DPad_Items; + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { + if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + Y_Margins_BtnB = (Top_HUD_Margin*-1); + } else { + X_Margins_BtnB = 0; + Y_Margins_BtnB = 0; + } + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + Y_Margins_CL = (Top_HUD_Margin*-1); + } else { + X_Margins_CL = 0; + Y_Margins_CL = 0; + } + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + Y_Margins_CR = (Top_HUD_Margin*-1); + } else { + X_Margins_CR = 0; + Y_Margins_CR = 0; + } + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { + if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + Y_Margins_CD = (Top_HUD_Margin*-1); + } else { + X_Margins_CD = 0; + Y_Margins_CD = 0; + } + if (CVar_GetS32("gDPadUseMargins", 0) != 0) { + if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + Y_Margins_DPad_Items = (Top_HUD_Margin*-1); + } else { + X_Margins_DPad_Items = 0; + Y_Margins_DPad_Items = 0; + } + const s16 ItemIconPos_ori[8][2] = { + { R_ITEM_AMMO_X(0)+X_Margins_BtnB, R_ITEM_AMMO_Y(0)+Y_Margins_BtnB }, //Bow on Epona? + { R_ITEM_AMMO_X(1)+X_Margins_CL, R_ITEM_AMMO_Y(1)+Y_Margins_CL }, + { R_ITEM_AMMO_X(2)+X_Margins_CD, R_ITEM_AMMO_Y(2)+Y_Margins_CD }, + { R_ITEM_AMMO_X(3)+X_Margins_CR, R_ITEM_AMMO_Y(3)+Y_Margins_CR }, + { DPAD_UP_X+X_Margins_DPad_Items, DPAD_UP_Y + 11 + Y_Margins_DPad_Items }, + { DPAD_DOWN_X+X_Margins_DPad_Items, DPAD_DOWN_Y + 11 + Y_Margins_DPad_Items }, + { DPAD_LEFT_X+X_Margins_DPad_Items, DPAD_LEFT_Y + 11 + Y_Margins_DPad_Items }, + { DPAD_RIGHT_X+X_Margins_DPad_Items, DPAD_RIGHT_Y + 11 + Y_Margins_DPad_Items } + }; + s16 ItemIconPos[8][2]; //(X,Y) + s16 DPad_ItemsOffset[4][2] = { + { 7, 3},//Up + { 7,35},//Down + {-9,19},//Left + {23,19},//Right + }; //(X,Y) Used with custom position to place it properly. + //DPadItems + if (CVar_GetS32("gDPadPosType", 0) != 0) { + ItemIconPos[4][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up + ItemIconPos[5][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down + ItemIconPos[6][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left + ItemIconPos[7][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right + if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None + ItemIconPos[4][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; + ItemIconPos[5][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; + ItemIconPos[6][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; + ItemIconPos[7][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; + } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + ItemIconPos[4][0] = -9999; + ItemIconPos[5][0] = -9999; + ItemIconPos[6][0] = -9999; + ItemIconPos[7][0] = -9999; + } + } else { + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[4][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[5][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[6][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[7][0]); + ItemIconPos[4][1] = ItemIconPos_ori[4][1]; + ItemIconPos[5][1] = ItemIconPos_ori[5][1]; + ItemIconPos[6][1] = ItemIconPos_ori[6][1]; + ItemIconPos[7][1] = ItemIconPos_ori[7][1]; + } + //B Button + s16 PosX_adjust = 1; + s16 PosY_adjust = 17; + if (CVar_GetS32("gBBtnPosType", 0) != 0) { + ItemIconPos[0][1] = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB+PosY_adjust; + if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); + } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); + } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVar_GetS32("gBBtnPosX", 0)+PosX_adjust; + } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + ItemIconPos[0][0] = -9999; + } + } else { + ItemIconPos[0][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[0][0]); + ItemIconPos[0][1] = ItemIconPos_ori[0][1]; + } + //C button Left + if (CVar_GetS32("gCBtnLPosType", 0) != 0) { + ItemIconPos[1][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL+PosY_adjust; + if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); + } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVar_GetS32("gCBtnLPosX", 0)+PosX_adjust; + } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + ItemIconPos[1][0] = -9999; + } + } else { + ItemIconPos[1][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[1][0]); + ItemIconPos[1][1] = ItemIconPos_ori[1][1]; + } + //C Button down + if (CVar_GetS32("gCBtnDPosType", 0) != 0) { + ItemIconPos[2][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD+PosY_adjust; + if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); + } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVar_GetS32("gCBtnDPosX", 0)+PosX_adjust; + } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + ItemIconPos[2][0] = -9999; + } + } else { + ItemIconPos[2][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[2][0]); + ItemIconPos[2][1] = ItemIconPos_ori[2][1]; + } + //C button Right + if (CVar_GetS32("gCBtnRPosType", 0) != 0) { + ItemIconPos[3][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR+PosY_adjust; + if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); + } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[3][0] = CVar_GetS32("gCBtnRPosX", 0)+PosX_adjust; + } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + ItemIconPos[3][0] = -9999; + } + } else { + ItemIconPos[3][0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[3][0]); + ItemIconPos[3][1] = ItemIconPos_ori[3][1]; + } OPEN_DISPS(globalCtx->state.gfxCtx); @@ -3267,14 +3979,13 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) { } if (i != 0) { - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[i], 8, 8, - OTRGetRectDimensionFromRightEdge(gItemAmmoX[button] + Right_HUD_Margin), - gItemAmmoY[button] + (Top_HUD_Margin * -1), 8, 8, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[i], 8, 8, + ItemIconPos[button][0], ItemIconPos[button][1], 8, 8, 1 << 10, 1 << 10); } - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ammo], 8, 8, - OTRGetRectDimensionFromRightEdge(gItemAmmoX[button] + Right_HUD_Margin) + 6, - gItemAmmoY[button] + (Top_HUD_Margin * -1), 8, 8, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ammo], 8, 8, + ItemIconPos[button][0] + 6, ItemIconPos[button][1], 8, 8, 1 << 10, 1 << 10); + } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -3442,7 +4153,7 @@ void Interface_Draw(GlobalContext* globalCtx) { { 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue) { 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red) }; - + s16 rColor[3] = { 200, 255, 100 }; static s16 spoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 }; static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused static s16 D_80125B5C[] = { 91, 91 }; // unused @@ -3485,24 +4196,68 @@ void Interface_Draw(GlobalContext* globalCtx) { if (fullUi) { // Rupee Icon - s16* rColor; - - if (CVar_GetS32("gDynamicWalletIcon", 0)) { - rColor = &rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)]; - } else { - rColor = &rupeeWalletColors[0]; - } - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCRupeePrimR", rColor[0]), CVar_GetS32("gCCRupeePrimG", rColor[1]), CVar_GetS32("gCCRupeePrimB", rColor[2]), interfaceCtx->magicAlpha); - gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); //We reset this here so it match user color :) + //Custom Color is on but check if Dynamic Wallet is on. + if (CVar_GetS32("gDynamicWalletIcon", 0) != 0) { + //if on let's use Dynamic Colors + rColor[0] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][0]; + rColor[1] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][1]; + rColor[2] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][2]; + } else { + //else use our custom color + rColor[0] = CVar_GetS32("gCCRupeePrimR", &rupeeWalletColors[0][0]); + rColor[1] = CVar_GetS32("gCCRupeePrimG", &rupeeWalletColors[0][1]); + rColor[2] = CVar_GetS32("gCCRupeePrimB", &rupeeWalletColors[0][2]); + } } else { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); - gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); + //Custom colors is off so check if Dynamic Wallet is on. + if (CVar_GetS32("gDynamicWalletIcon", 0) != 0) { + rColor[0] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][0]; + rColor[1] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][1]; + rColor[2] = rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)][2]; + } else { + rColor[0] = rupeeWalletColors[0][0]; + rColor[1] = rupeeWalletColors[0][1]; + rColor[2] = rupeeWalletColors[0][2]; + } } - - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26+(Left_HUD_Margin*-1)), - 206+(Bottom_HUD_Margin), 16, 16, 1 << 10, 1 << 10); + if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gDynamicWalletIcon", 0) != 1) { + //We reset this here so it match user color only if both HUD is on and Dynamic is off. + gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); + } + //Rupee icon & counter + s16 X_Margins_RC; + s16 Y_Margins_RC; + if (CVar_GetS32("gRCUseMargins", 0) != 0) { + if (CVar_GetS32("gRCPosType", 0) == 0) {X_Margins_RC = Left_HUD_Margin;}; + Y_Margins_RC = Bottom_HUD_Margin; + } else { + X_Margins_RC = 0; + Y_Margins_RC = 0; + } + s16 PosX_RC_ori = OTRGetRectDimensionFromLeftEdge(26+X_Margins_RC); + s16 PosY_RC_ori = 206+Y_Margins_RC; + s16 PosX_RC; + s16 PosY_RC; + if (CVar_GetS32("gRCPosType", 0) != 0) { + PosY_RC = CVar_GetS32("gRCPosY", 0)+Y_Margins_RC; + if (CVar_GetS32("gRCPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gRCUseMargins", 0) != 0) {X_Margins_RC = Left_HUD_Margin;}; + PosX_RC = OTRGetDimensionFromLeftEdge(CVar_GetS32("gRCPosX", 0)+X_Margins_RC); + } else if (CVar_GetS32("gRCPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gRCUseMargins", 0) != 0) {X_Margins_RC = Right_HUD_Margin;}; + PosX_RC = OTRGetDimensionFromRightEdge(CVar_GetS32("gRCPosX", 0)+X_Margins_RC); + } else if (CVar_GetS32("gRCPosType", 0) == 3) {//Anchor None + PosX_RC = CVar_GetS32("gRCPosX", 0); + } else if (CVar_GetS32("gRCPosType", 0) == 4) {//Hidden + PosX_RC = -9999; + } + } else { + PosY_RC = PosY_RC_ori; + PosX_RC = PosX_RC_ori; + } + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, PosX_RC, PosY_RC, 16, 16, 1 << 10, 1 << 10); switch (globalCtx->sceneNum) { case SCENE_BMORI1: @@ -3520,6 +4275,36 @@ void Interface_Draw(GlobalContext* globalCtx) { case SCENE_GANONTIKA_SONOGO: case SCENE_TAKARAYA: if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) { + s16 X_Margins_SKC; + s16 Y_Margins_SKC; + if (CVar_GetS32("gSKCUseMargins", 0) != 0) { + if (CVar_GetS32("gSKCPosType", 0) == 0) {X_Margins_SKC = Left_HUD_Margin;}; + Y_Margins_SKC = Bottom_HUD_Margin; + } else { + X_Margins_SKC = 0; + Y_Margins_SKC = 0; + } + s16 PosX_SKC_ori = OTRGetRectDimensionFromLeftEdge(26+X_Margins_SKC); + s16 PosY_SKC_ori = 190+Y_Margins_SKC; + s16 PosX_SKC; + s16 PosY_SKC; + if (CVar_GetS32("gSKCPosType", 0) != 0) { + PosY_SKC = CVar_GetS32("gSKCPosY", 0)+Y_Margins_SKC; + if (CVar_GetS32("gSKCPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Left_HUD_Margin;}; + PosX_SKC = OTRGetDimensionFromLeftEdge(CVar_GetS32("gSKCPosX", 0)+X_Margins_SKC); + } else if (CVar_GetS32("gSKCPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Right_HUD_Margin;}; + PosX_SKC = OTRGetDimensionFromRightEdge(CVar_GetS32("gSKCPosX", 0)+X_Margins_SKC); + } else if (CVar_GetS32("gSKCPosType", 0) == 3) {//Anchor None + PosX_SKC = CVar_GetS32("gSKCPosX", 0); + } else if (CVar_GetS32("gSKCPosType", 0) == 4) {//Hidden + PosX_SKC = -9999; + } + } else { + PosY_SKC = PosY_SKC_ori; + PosX_SKC = PosX_SKC_ori; + } // Small Key Icon gDPPipeSync(OVERLAY_DISP++); @@ -3530,7 +4315,7 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 230, 255, interfaceCtx->magicAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); } - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26+(Left_HUD_Margin*-1)), 190+(Bottom_HUD_Margin), 16, 16, + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, PosX_SKC, PosY_SKC, 16, 16, 1 << 10, 1 << 10); // Small Key Counter @@ -3547,17 +4332,11 @@ void Interface_Draw(GlobalContext* globalCtx) { interfaceCtx->counterDigits[3] -= 10; } - svar3 = OTRGetRectDimensionFromLeftEdge(42+(Left_HUD_Margin*-1)); - if (interfaceCtx->counterDigits[2] != 0) { - OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, - 16, svar3, 190+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10); - svar3 += 8; + OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, 16, PosX_SKC+8, PosY_SKC, 8, 16, 1 << 10, 1 << 10); } - OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, - ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, - svar3, 190+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, PosX_SKC+16, PosY_SKC, 8, 16, 1 << 10, 1 << 10); } break; default: @@ -3598,10 +4377,10 @@ void Interface_Draw(GlobalContext* globalCtx) { svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)]; svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; - for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) { + for (svar1 = 0, svar3 = 16; svar1 < svar5; svar1++, svar2++, svar3 += 8) { OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, - OTRGetRectDimensionFromLeftEdge(svar3+(Left_HUD_Margin*-1)), 206+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10); + PosX_RC+svar3, PosY_RC, 8, 16, 1 << 10, 1 << 10); } } else { @@ -3653,6 +4432,47 @@ void Interface_Draw(GlobalContext* globalCtx) { } } else { // B Button Do Action Label + s16 PosX_adjust; + s16 PosY_adjust; + if (gSaveContext.language == 2) { + PosX_adjust = -12; + PosY_adjust = 5; + } else if (gSaveContext.language == 1) { //ger + PosY_adjust = 6; + PosX_adjust = -9; + } else { + PosY_adjust = 6; + PosX_adjust = -10; + } + + s16 BbtnPosX; + s16 BbtnPosY; + s16 X_Margins_BtnB_label; + s16 Y_Margins_BtnB_label; + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { + if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; + Y_Margins_BtnB_label = (Top_HUD_Margin*-1); + } else { + X_Margins_BtnB_label = 0; + Y_Margins_BtnB_label = 0; + } + if (CVar_GetS32("gBBtnPosType", 0) != 0) { + BbtnPosY = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB_label+PosY_adjust; + if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Left_HUD_Margin;}; + BbtnPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); + } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; + BbtnPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); + } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None + BbtnPosX = CVar_GetS32("gBBtnPosX", 0)+PosX_adjust; + } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + BbtnPosX = -9999; + } + } else { + BbtnPosX = OTRGetRectDimensionFromRightEdge(R_B_LABEL_X(gSaveContext.language)+X_Margins_BtnB_label); + BbtnPosY = R_B_LABEL_Y(gSaveContext.language)+Y_Margins_BtnB_label; + } gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -3663,10 +4483,9 @@ void Interface_Draw(GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); R_B_LABEL_DD = (1 << 10) / (WREG(37 + gSaveContext.language) / 100.0f); - const s16 rBLabelX = OTRGetRectDimensionFromRightEdge(R_B_LABEL_X(gSaveContext.language)+Right_HUD_Margin); - gSPWideTextureRectangle(OVERLAY_DISP++, rBLabelX << 2, R_B_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) << 2, - (rBLabelX + DO_ACTION_TEX_WIDTH) << 2, - (R_B_LABEL_Y(gSaveContext.language) + DO_ACTION_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0, + gSPWideTextureRectangle(OVERLAY_DISP++, BbtnPosX << 2, BbtnPosY << 2, + (BbtnPosX + DO_ACTION_TEX_WIDTH) << 2, + (BbtnPosY + DO_ACTION_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0, R_B_LABEL_DD, R_B_LABEL_DD); } @@ -3716,16 +4535,48 @@ void Interface_Draw(GlobalContext* globalCtx) { interfaceCtx->dpadRightAlpha); // Draw DPad + s16 DpadPosX; + s16 DpadPosY; + s16 X_Margins_Dpad; + s16 Y_Margins_Dpad; + if (CVar_GetS32("gDPadUseMargins", 0) != 0) { + if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_Dpad = Right_HUD_Margin;}; + Y_Margins_Dpad = (Top_HUD_Margin*-1); + } else { + Y_Margins_Dpad = 0; + X_Margins_Dpad = 0; + } + if (CVar_GetS32("gDPadPosType", 0) != 0) { + DpadPosY = CVar_GetS32("gDPadPosY", 0)+Y_Margins_Dpad; + if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Left_HUD_Margin;}; + DpadPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_Dpad); + } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Right_HUD_Margin;}; + DpadPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_Dpad); + } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None + DpadPosX = CVar_GetS32("gDPadPosX", 0); + } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + DpadPosX = -9999; + } + } else { + DpadPosX = OTRGetRectDimensionFromRightEdge(DPAD_X+X_Margins_Dpad); + DpadPosY = DPAD_Y+Y_Margins_Dpad; + } + gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, dpadAlpha); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCDpadPrimR", 255), CVar_GetS32("gCCDpadPrimG", 255), CVar_GetS32("gCCDpadPrimB", 255), dpadAlpha); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, dpadAlpha); + } gDPLoadTextureBlock(OVERLAY_DISP++, ResourceMgr_LoadFileRaw("assets/ship_of_harkinian/buttons/dpad.bin"), G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(DPAD_X + Right_HUD_Margin) << 2, - (DPAD_Y + (Top_HUD_Margin * -1)) << 2, - (OTRGetRectDimensionFromRightEdge(DPAD_X + Right_HUD_Margin) + 32) << 2, - (DPAD_Y + 32 + (Top_HUD_Margin * -1)) << 2, G_TX_RENDERTILE, 0, 0, (1 << 10), - (1 << 10)); + gSPWideTextureRectangle(OVERLAY_DISP++, DpadPosX << 2, DpadPosY << 2, + (DpadPosX + 32) << 2, (DpadPosY + 32) << 2, + G_TX_RENDERTILE, 0, 0, (1 << 10), (1 << 10)); // DPad-Up Button Icon & Ammo Count if (gSaveContext.equips.buttonItems[4] < 0xF0) { @@ -3774,8 +4625,46 @@ void Interface_Draw(GlobalContext* globalCtx) { // A Button func_80094A14(globalCtx->state.gfxCtx); - const f32 rABtnX = OTRGetDimensionFromRightEdge(R_A_BTN_X+Right_HUD_Margin); - //func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, rABtnX, rABtnX + 45); + s16 X_Margins_BtnA; + s16 Y_Margins_BtnA; + if (CVar_GetS32("gABtnUseMargins", 0) != 0) { + X_Margins_BtnA = Right_HUD_Margin; + Y_Margins_BtnA = (Top_HUD_Margin*-1); + } else { + X_Margins_BtnA = 0; + Y_Margins_BtnA = 0; + } + s16 PosX_BtnA_ori = OTRGetDimensionFromRightEdge(R_A_BTN_X+X_Margins_BtnA); + s16 PosY_BtnA_ori = R_A_BTN_Y+Y_Margins_BtnA; + const f32 rAIconX_ori = OTRGetDimensionFromRightEdge(R_A_ICON_X+X_Margins_BtnA); + const f32 rAIconY_ori = 98.0f - (R_A_ICON_Y+Y_Margins_BtnA); + s16 PosX_BtnA; + s16 PosY_BtnA; + s16 rAIconX; + s16 rAIconY; + if (CVar_GetS32("gABtnPosType", 0) != 0) { + PosY_BtnA = CVar_GetS32("gABtnPosY", 0)+Y_Margins_BtnA; + rAIconY = 98.0f - PosY_BtnA; + if (CVar_GetS32("gABtnPosType", 0) == 1) {//Anchor Left + PosX_BtnA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); + rAIconX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); + } else if (CVar_GetS32("gABtnPosType", 0) == 2) {//Anchor Right + X_Margins_BtnA = Right_HUD_Margin; + PosX_BtnA = OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); + rAIconX= OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); + } else if (CVar_GetS32("gABtnPosType", 0) == 3) {//Anchor None + PosX_BtnA = CVar_GetS32("gABtnPosX", 0); + rAIconX = CVar_GetS32("gABtnPosX", 0); + } else if (CVar_GetS32("gABtnPosType", 0) == 4) {//Hidden + PosX_BtnA = -9999; + rAIconX = -9999; + } + } else { + PosY_BtnA = PosY_BtnA_ori; + PosX_BtnA = PosX_BtnA_ori; + rAIconY = rAIconY_ori; + rAIconX = rAIconX_ori; + } gSPClearGeometryMode(OVERLAY_DISP++, G_CULL_BOTH); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); if (CVar_GetS32("gHudColors", 1) == 0) { @@ -3786,17 +4675,15 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", R_A_BTN_COLOR(0)), CVar_GetS32("gCCABtnPrimG", R_A_BTN_COLOR(1)), CVar_GetS32("gCCABtnPrimB", R_A_BTN_COLOR(2)), interfaceCtx->aAlpha); } if (fullUi) { - Interface_DrawActionButton(globalCtx, rABtnX, R_A_BTN_Y+(Top_HUD_Margin*-1)); + Interface_DrawActionButton(globalCtx, PosX_BtnA, PosY_BtnA); } gDPPipeSync(OVERLAY_DISP++); - const f32 rAIconX = OTRGetDimensionFromRightEdge(R_A_ICON_X+Right_HUD_Margin); - //func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, rAIconX, rAIconX + 45); gSPSetGeometryMode(OVERLAY_DISP++, G_CULL_BACK); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - Matrix_Translate(-138.0f + rAIconX, 98.0f - (R_A_ICON_Y+(Top_HUD_Margin*-1)), WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW); + Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), @@ -3875,7 +4762,24 @@ void Interface_Draw(GlobalContext* globalCtx) { G_TX_NOLOD, G_TX_NOLOD); // Draw 6 carrots - for (svar1 = 1, svar5 = ZREG(14); svar1 < 7; svar1++, svar5 += 16) { + s16 CarrotsPosX = ZREG(14); + s16 CarrotsPosY = ZREG(15); + s16 CarrotsMargins_X = 0; + if (CVar_GetS32("gCarrotsPosType", 0) != 0) { + CarrotsPosY = CVar_GetS32("gCarrotsPosY", 0); + if (CVar_GetS32("gCarrotsPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Left_HUD_Margin;}; + CarrotsPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCarrotsPosX", 0)+CarrotsMargins_X); + } else if (CVar_GetS32("gCarrotsPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Right_HUD_Margin;}; + CarrotsPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gCarrotsPosX", 0)+CarrotsMargins_X); + } else if (CVar_GetS32("gCarrotsPosType", 0) == 3) {//Anchor None + CarrotsPosX = CVar_GetS32("gCarrotsPosX", 0); + } else if (CVar_GetS32("gCarrotsPosType", 0) == 4) {//Hidden + CarrotsPosX = -9999; + } + } + for (svar1 = 1, svar5 = CarrotsPosX; svar1 < 7; svar1++, svar5 += 16) { // Carrot Color (based on availability) if ((interfaceCtx->numHorseBoosts == 0) || (interfaceCtx->numHorseBoosts < svar1)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 150, 255, interfaceCtx->aAlpha); @@ -3883,13 +4787,36 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); } - gSPTextureRectangle(OVERLAY_DISP++, svar5 << 2, ZREG(15) << 2, (svar5 + 16) << 2, - (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPWideTextureRectangle(OVERLAY_DISP++, svar5 << 2, CarrotsPosY << 2, (svar5 + 16) << 2, + (CarrotsPosY + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } } } else { // Score for the Horseback Archery - svar5 = OTRGetRectDimensionFromRightEdge(WREG(32)); + s32 X_Margins_Archery; + if (CVar_GetS32("gASUseMargins", 0) != 0) { + if (CVar_GetS32("gASPosType", 0) == 0) {X_Margins_Archery = Right_HUD_Margin;}; + } else { + X_Margins_Archery = 0; + } + s16 ArcheryPos_Y = ZREG(15); + s16 ArcheryPos_X = OTRGetRectDimensionFromRightEdge(WREG(32)+X_Margins_Archery); + + if (CVar_GetS32("gASPosType", 0) != 0) { + ArcheryPos_Y = CVar_GetS32("gASPosY", 0); + if (CVar_GetS32("gASPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gASUseMargins", 0) != 0) {X_Margins_Archery = Left_HUD_Margin;}; + ArcheryPos_X = OTRGetRectDimensionFromLeftEdge(CVar_GetS32("gASPosX", 0)+X_Margins_Archery); + } else if (CVar_GetS32("gASPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gASUseMargins", 0) != 0) {X_Margins_Archery = Right_HUD_Margin;}; + ArcheryPos_X = OTRGetRectDimensionFromRightEdge(CVar_GetS32("gASPosX", 0)+X_Margins_Archery); + } else if (CVar_GetS32("gASPosType", 0) == 3) {//Anchor None + ArcheryPos_X = CVar_GetS32("gASPosX", 0)+204+X_Margins_Archery; + } else if (CVar_GetS32("gASPosType", 0) == 4) {//Hidden + ArcheryPos_X = -9999; + } + } + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); // Target Icon @@ -3897,22 +4824,22 @@ void Interface_Draw(GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, (svar5 + 28) << 2, ZREG(15) << 2, (svar5 + 52) << 2, - (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPWideTextureRectangle(OVERLAY_DISP++, (ArcheryPos_X + 28) << 2, ArcheryPos_Y << 2, (ArcheryPos_X + 52) << 2, + (ArcheryPos_Y + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); // Score Counter gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - svar5 = OTRGetRectDimensionFromRightEdge(WREG(32)) + 6 * 9; + ArcheryPos_X = ArcheryPos_X + 6 * 9; for (svar1 = svar2 = 0; svar1 < 4; svar1++) { if (sHBAScoreDigits[svar1] != 0 || (svar2 != 0) || (svar1 >= 3)) { OVERLAY_DISP = Gfx_TextureI8( - OVERLAY_DISP, digitTextures[sHBAScoreDigits[svar1]], 8, 16, svar5, - (ZREG(15) - 2), digitWidth[0], VREG(42), VREG(43) << 1, VREG(43) << 1); - svar5 += 9; + OVERLAY_DISP, digitTextures[sHBAScoreDigits[svar1]], 8, 16, ArcheryPos_X, + (ArcheryPos_Y - 2), digitWidth[0], VREG(42), VREG(43) << 1, VREG(43) << 1); + ArcheryPos_X += 9; svar2++; } } @@ -4303,8 +5230,29 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]); + s32 X_Margins_Timer; + if (CVar_GetS32("gTimersUseMargins", 0) != 0) { + if (CVar_GetS32("gTimersPosType", 0) == 0) {X_Margins_Timer = Left_HUD_Margin;}; + } else { + X_Margins_Timer = 0; + } + svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]+X_Margins_Timer); svar2 = gSaveContext.timerY[svar6]; + if (CVar_GetS32("gTimersPosType", 0) != 0) { + svar2 = (CVar_GetS32("gTimersPosY", 0)); + if (CVar_GetS32("gTimersPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Left_HUD_Margin;}; + svar5 = OTRGetRectDimensionFromLeftEdge(CVar_GetS32("gTimersPosX", 0)+X_Margins_Timer); + } else if (CVar_GetS32("gTimersPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Right_HUD_Margin;}; + svar5 = OTRGetRectDimensionFromRightEdge(CVar_GetS32("gTimersPosX", 0)+X_Margins_Timer); + } else if (CVar_GetS32("gTimersPosType", 0) == 3) {//Anchor None + svar5 = CVar_GetS32("gTimersPosX", 0)+204+X_Margins_Timer; + } else if (CVar_GetS32("gTimersPosType", 0) == 4) {//Hidden + svar5 = -9999; + } + } + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, svar5, svar2 + 2, 16, 16, 1 << 10, 1 << 10); @@ -4329,10 +5277,11 @@ void Interface_Draw(GlobalContext* globalCtx) { for (svar1 = 0; svar1 < 5; svar1++) { // clang-format off - svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]); + //svar5 = svar5 + 8; + //svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]); OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, digitTextures[timerDigits[svar1]], 8, 16, svar5 + timerDigitLeftPos[svar1], - svar2 = gSaveContext.timerY[svar6], digitWidth[svar1], VREG(42), VREG(43) << 1, + svar2, digitWidth[svar1], VREG(42), VREG(43) << 1, VREG(43) << 1); // clang-format on } @@ -4365,17 +5314,10 @@ void Interface_Update(GlobalContext* globalCtx) { u16 action; Input* debugInput = &globalCtx->state.input[2]; - if (CVar_GetS32("gHUDMargins", 0) != 0) { - Top_HUD_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_HUD_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_HUD_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_HUD_Margin = CVar_GetS32("gHUDMargin_B", 0); - } else { - Top_HUD_Margin = 0; - Left_HUD_Margin = 0; - Right_HUD_Margin = 0; - Bottom_HUD_Margin = 0; - } + Top_HUD_Margin = CVar_GetS32("gHUDMargin_T", 0); + Left_HUD_Margin = CVar_GetS32("gHUDMargin_L", 0); + Right_HUD_Margin = CVar_GetS32("gHUDMargin_R", 0); + Bottom_HUD_Margin = CVar_GetS32("gHUDMargin_B", 0); if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) { gSaveContext.language = LANGUAGE_ENG; diff --git a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 6819676e2..3674167d5 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -212,8 +212,16 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx2) { // Draw red effect over the screen when arrow hits if (this->unk_15C > 0) { POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0, 0, - (s32)(150.0f * this->unk_15C) & 0xFF); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, + (s32)(CVar_GetS32("gFireArrowColEnvR", 40) * this->unk_15C) & 0xFF, + (s32)(CVar_GetS32("gFireArrowColEnvG", 0) * this->unk_15C) & 0xFF, + (s32)(CVar_GetS32("gFireArrowColEnvB", 0) * this->unk_15C) & 0xFF, + (s32)(30.0f * this->unk_15C) & 0xFF); //Intentionnally made Alpha lower. + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0, 0, + (s32)(150.0f * this->unk_15C) & 0xFF); + } gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); @@ -221,8 +229,13 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx2) { // Draw fire on the arrow func_80093D84(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gFireArrowColR", 255), CVar_GetS32("gFireArrowColG", 200), CVar_GetS32("gFireArrowColB", 0), this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gFireArrowColEnvR", 255), CVar_GetS32("gFireArrowColEnvG", 0), CVar_GetS32("gFireArrowColEnvB", 0), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); + } Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); if (this->timer != 0) { Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 10b0af913..1af27f3ec 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -210,8 +210,16 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { // Draw blue effect over the screen when arrow hits if (this->unk_164 > 0) { POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF, - (s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, + (s32)(CVar_GetS32("gIceArrowColEnvR", 0) * this->unk_164) & 0xFF, + (s32)(CVar_GetS32("gIceArrowColEnvG", 10) * this->unk_164) & 0xFF, + (s32)(CVar_GetS32("gIceArrowColEnvB", 50) * this->unk_164) & 0xFF, + (s32)(30.0f * this->unk_164) & 0xFF); //Intentionnally made Alpha lower. + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF, + (s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF); + } gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); @@ -219,8 +227,13 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { // Draw ice on the arrow func_80093D84(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gIceArrowColR", 170), CVar_GetS32("gIceArrowColG", 255), CVar_GetS32("gIceArrowColB", 255), this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gIceArrowColEnvR", 0), CVar_GetS32("gIceArrowColEnvG", 0), CVar_GetS32("gIceArrowColEnvB", 255), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128); + } Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); if (this->timer != 0) { Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index be13a53f5..f756b4544 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -208,8 +208,16 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { // Draw yellow effect over the screen when arrow hits if (this->unk_164 > 0) { POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF, - (s32)(40.0f * this->unk_164) & 0xFF, 0, (s32)(150.0f * this->unk_164) & 0xFF); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, + (s32)(CVar_GetS32("gLightArrowColEnvR", 30) * this->unk_164) & 0xFF, + (s32)(CVar_GetS32("gLightArrowColEnvG", 40) * this->unk_164) & 0xFF, + (s32)(CVar_GetS32("gLightArrowColEnvB", 0) * this->unk_164) & 0xFF, + (s32)(30.0f * this->unk_164) & 0xFF); //Intentionnally made Alpha lower. + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF, + (s32)(40.0f * this->unk_164) & 0xFF, 0, (s32)(150.0f * this->unk_164) & 0xFF); + } gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE); gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); @@ -217,8 +225,13 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { // Draw light on the arrow func_80093D84(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128); + if (CVar_GetS32("gUseArrowsCol", 0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gLightArrowColR", 255), CVar_GetS32("gLightArrowColG", 255), CVar_GetS32("gLightArrowColB", 170), this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gLightArrowColEnvR", 255), CVar_GetS32("gLightArrowColEnvG", 255), CVar_GetS32("gLightArrowColEnvB", 0), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128); + } Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY); if (this->timer != 0) { Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 55e5b0100..77d2a2db0 100644 --- a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -478,6 +478,21 @@ void EnDog_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); + if (CVar_GetS32("gUseDogsCol",0)) { + colors[0].r = CVar_GetS32("gDog1ColR", 255); + colors[0].g = CVar_GetS32("gDog1ColG", 255); + colors[0].b = CVar_GetS32("gDog1ColB", 200); + colors[1].r = CVar_GetS32("gDog2ColR", 150); + colors[1].g = CVar_GetS32("gDog2ColG", 100); + colors[1].b = CVar_GetS32("gDog2ColB", 50); + } else { + colors[0].r = 255; + colors[0].g = 255; + colors[0].b = 200; + colors[1].r = 150; + colors[1].g = 100; + colors[1].b = 50; + } gDPSetEnvColor(POLY_OPA_DISP++, colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g, colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a); diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 176fd1013..c9f475e0e 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -746,7 +746,26 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList s16 effScaleStep; s16 effLife; EnFirefly* this = (EnFirefly*)thisx; - + if (CVar_GetS32("gUseKeeseCol", 0)) { + Color_RGBA8 fireAuraPrimColor_custom = { CVar_GetS32("gKeese1_Ef_PrimR", 255), CVar_GetS32("gKeese1_Ef_PrimG", 255), CVar_GetS32("gKeese1_Ef_PrimB", 100), 255 }; + Color_RGBA8 fireAuraEnvColor_custom = { CVar_GetS32("gKeese1_Ef_EnvR", 255), CVar_GetS32("gKeese1_Ef_Env", 50), CVar_GetS32("gKeese1_Ef_EnvB", 0), 0 }; + Color_RGBA8 iceAuraPrimColor_custom = { CVar_GetS32("gKeese2_Ef_PrimR", 100), CVar_GetS32("gKeese2_Ef_PrimG", 200), CVar_GetS32("gKeese2_Ef_PrimB", 255), 255 }; + Color_RGBA8 iceAuraEnvColor_custom = { CVar_GetS32("gKeese2_Ef_EnvR", 0), CVar_GetS32("gKeese2_Ef_Env", 0), CVar_GetS32("gKeese2_Ef_EnvB", 255), 0 }; + fireAuraPrimColor = fireAuraPrimColor_custom; + fireAuraEnvColor = fireAuraEnvColor_custom; + iceAuraPrimColor = iceAuraPrimColor_custom; + iceAuraEnvColor = iceAuraEnvColor_custom; + } else { + //Original colors are back there + Color_RGBA8 fireAuraPrimColor_custom = { 255, 255, 100, 255 }; + Color_RGBA8 fireAuraEnvColor_custom = { 255, 50, 0, 0 }; + Color_RGBA8 iceAuraPrimColor_custom = { 100, 200, 255, 255 }; + Color_RGBA8 iceAuraEnvColor_custom = { 0, 0, 255, 0 }; + fireAuraPrimColor = fireAuraPrimColor_custom; + fireAuraEnvColor = fireAuraEnvColor_custom; + iceAuraPrimColor = iceAuraPrimColor_custom; + iceAuraEnvColor = iceAuraEnvColor_custom; + } if (!this->onFire && (limbIndex == 27)) { gSPDisplayList((*gfx)++, gKeeseEyesDL); } else { diff --git a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 30ff3cf50..84b5fd654 100644 --- a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -340,12 +340,20 @@ void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) { switch (this->unk_1C6) { case 0: - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->unk_1B0 * 255)); + if (CVar_GetS32("gUseChargedCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged2ColR",255), CVar_GetS32("gCharged2ColG",255), CVar_GetS32("gCharged2ColB",170), (u8)(this->unk_1B0 * 255)); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->unk_1B0 * 255)); + } gSPDisplayList(POLY_XLU_DISP++, gSpinAttack3DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack4DL); break; case 1: - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->unk_1B0 * 255)); + if (CVar_GetS32("gUseChargedCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged1ColR",170), CVar_GetS32("gCharged1ColG",255), CVar_GetS32("gCharged1ColB",255), (u8)(this->unk_1B0 * 255)); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->unk_1B0 * 255)); + } gSPDisplayList(POLY_XLU_DISP++, gSpinAttack1DL); gSPDisplayList(POLY_XLU_DISP++, gSpinAttack2DL); break; @@ -373,12 +381,24 @@ void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_1B8 >= 0.85f) { phi_f14 = (D_80AA046C[(globalCtx->gameplayFrames & 7)] * 6.0f) + 1.0f; - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8); + if (CVar_GetS32("gUseChargedCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged2ColR",255), CVar_GetS32("gCharged2ColG",255), CVar_GetS32("gCharged2ColB",170), this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gCharged2ColEnvR",255), CVar_GetS32("gCharged2ColEnvG",100), CVar_GetS32("gCharged2ColEnvB",0), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); + } gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); phi_t1 = 0x28; } else { phi_f14 = (D_80AA046C[globalCtx->gameplayFrames & 7] * 2.0f) + 1.0f; - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8); + if (CVar_GetS32("gUseChargedCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged1ColR",170), CVar_GetS32("gCharged1ColG",255), CVar_GetS32("gCharged1ColB",255), this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gCharged1ColEnvR",0), CVar_GetS32("gCharged1ColEnvG",100), CVar_GetS32("gCharged1ColEnvB",255), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); + } gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); phi_t1 = 0x14; } diff --git a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 8b472ab4d..4958eacf5 100644 --- a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -220,8 +220,13 @@ void MagicDark_DiamondDraw(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateY(this->actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, (s32)(this->primAlpha * 0.6f) & 0xFF); - gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); + if (CVar_GetS32("gUseSpellsCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gNL_Diamond_ColR",170), CVar_GetS32("gNL_Diamond_ColG",255), CVar_GetS32("gNL_Diamond_ColB",255), (s32)(this->primAlpha * 0.6f) & 0xFF); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gNL_Diamond_EnvR",100), CVar_GetS32("gNL_Diamond_EnvG",100), CVar_GetS32("gNL_Diamond_EnvB",255), 128); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, (s32)(this->primAlpha * 0.6f) & 0xFF); + gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); + } gSPDisplayList(POLY_XLU_DISP++, sDiamondMaterialDL); gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, gameplayFrames * -4, 32, 32, 1, diff --git a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index c226ad2f6..279d88f8f 100644 --- a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -227,8 +227,13 @@ void MagicFire_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPFillRectangle(POLY_XLU_DISP++, 0, 0, 319, 239); func_80093D84(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 255, 200, 0, (u8)(this->alphaMultiplier * 255)); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, (u8)(this->alphaMultiplier * 255)); + if (CVar_GetS32("gUseSpellsCol",0)) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gDF_ColR",255), CVar_GetS32("gDF_ColG",200), CVar_GetS32("gDF_ColB",0), (u8)(this->alphaMultiplier * 255)); + gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gDF_EnvR",255), CVar_GetS32("gDF_EnvG",0), CVar_GetS32("gDF_EnvB",0), (u8)(this->alphaMultiplier * 255)); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 255, 200, 0, (u8)(this->alphaMultiplier * 255)); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, (u8)(this->alphaMultiplier * 255)); + } Matrix_Scale(0.15f, 0.15f, 0.15f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index dc12a29da..f0be829d4 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -10415,29 +10415,69 @@ void func_80848EF8(Player* this, GlobalContext* globalCtx) { /*Prevent it on horse, while jumping and on title screen. If you fly around no stone of agony for you! */ if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) { - int rectLeft = OTRGetRectDimensionFromLeftEdge(26); //Left X Pos - int rectTop = 60; //Top Y Pos + s16 Top_Margins = (CVar_GetS32("gHUDMargin_T", 0)*-1); + s16 Left_Margins = CVar_GetS32("gHUDMargin_L", 0); + s16 Right_Margins = CVar_GetS32("gHUDMargin_R", 0); + s16 X_Margins_VSOA; + s16 Y_Margins_VSOA; + if (CVar_GetS32("gVSOAUseMargins", 0) != 0) { + if (CVar_GetS32("gVSOAPosType", 0) == 0) {X_Margins_VSOA = Left_Margins;}; + Y_Margins_VSOA = Top_Margins; + } else { + X_Margins_VSOA = 0; + Y_Margins_VSOA = 0; + } + s16 PosX_VSOA_ori = OTRGetRectDimensionFromLeftEdge(26)+X_Margins_VSOA; + s16 PosY_VSOA_ori = 60+Y_Margins_VSOA; + s16 PosX_VSOA; + s16 PosY_VSOA; + if (CVar_GetS32("gVSOAPosType", 0) != 0) { + PosY_VSOA = CVar_GetS32("gVSOAPosY", 0)+Y_Margins_VSOA; + if (CVar_GetS32("gVSOAPosType", 0) == 1) {//Anchor Left + if (CVar_GetS32("gVSOAUseMargins", 0) != 0) {X_Margins_VSOA = Left_Margins;}; + PosX_VSOA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gVSOAPosX", 0)+X_Margins_VSOA); + } else if (CVar_GetS32("gVSOAPosType", 0) == 2) {//Anchor Right + if (CVar_GetS32("gVSOAUseMargins", 0) != 0) {X_Margins_VSOA = Right_Margins;}; + PosX_VSOA = OTRGetDimensionFromRightEdge(CVar_GetS32("gVSOAPosX", 0)+X_Margins_VSOA); + } else if (CVar_GetS32("gVSOAPosType", 0) == 3) {//Anchor None + PosX_VSOA = CVar_GetS32("gVSOAPosX", 0); + } else if (CVar_GetS32("gVSOAPosType", 0) == 4) {//Hidden + PosX_VSOA = -9999; + } + } else { + PosY_VSOA = PosY_VSOA_ori; + PosX_VSOA = PosX_VSOA_ori; + } + + int rectLeft = PosX_VSOA; //Left X Pos + int rectTop = PosY_VSOA; //Top Y Pos int rectWidth = 24; //Texture Width int rectHeight = 24; //Texture Heigh - int DefaultIconA= 50; //Default icon alphe (55 on 255) - - if (CVar_GetS32("gHUDMargins", 0) != 0) { - rectLeft = OTRGetRectDimensionFromLeftEdge(26+(CVar_GetS32("gHUDMargin_L", 0)*-1)); - rectTop = 60+(CVar_GetS32("gHUDMargin_T", 0)*-1); - } else { - rectTop = 60; - rectLeft = OTRGetRectDimensionFromLeftEdge(26); - } + int DefaultIconA= 50; //Default icon alpha (55 on 255) OPEN_DISPS(globalCtx->state.gfxCtx); gDPPipeSync(OVERLAY_DISP++); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); - gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - if (this->unk_6A0 > 4000000.0f) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), DefaultIconA); } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); } + + gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + if (this->unk_6A0 > 4000000.0f) { + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), 255); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); + } + } else { + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), DefaultIconA); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + } + } if (temp == 0 || temp <= 0.1f) { /*Fail check, it is used to draw off the icon when link is standing out range but do not refresh unk_6A0. diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 23ce66d57..a2f73677d 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -506,8 +506,16 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]); - } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), D_8082A150[sp218]); + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[sp218]); + } else if (D_8082A124[sp218] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 160), CVar_GetS32("gCCCUBtnPrimB", 0), D_8082A150[sp218]); + } else if (D_8082A124[sp218] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 160), CVar_GetS32("gCCCLBtnPrimB", 0), D_8082A150[sp218]); + } else if (D_8082A124[sp218] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 160), CVar_GetS32("gCCCRBtnPrimB", 0), D_8082A150[sp218]); + } else if (D_8082A124[sp218] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 160), CVar_GetS32("gCCCDBtnPrimB", 0), D_8082A150[sp218]); } } @@ -548,8 +556,16 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200); - } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), 200); + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), 200); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 160), CVar_GetS32("gCCCUBtnPrimB", 0), 200); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 160), CVar_GetS32("gCCCLBtnPrimB", 0), 200); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 160), CVar_GetS32("gCCCRBtnPrimB", 0), 200); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 160), CVar_GetS32("gCCCDBtnPrimB", 0), 200); } } } else { @@ -604,7 +620,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx if (D_8082A124[phi_s3] == 0) { if (CVar_GetS32("gHudColors", 1) == 0) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, D_8082A150[phi_s3]); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, 200); } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[phi_s3]); } else if (CVar_GetS32("gHudColors", 1) == 2) { @@ -612,11 +628,17 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx } } else { if (CVar_GetS32("gHudColors", 1) == 0) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]); - } else if (CVar_GetS32("gHudColors", 1) == 1) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]); - } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[phi_s3]); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200); + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[phi_s3]); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 255), CVar_GetS32("gCCCUBtnPrimB", 0), D_8082A150[phi_s3]); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 255), CVar_GetS32("gCCCLBtnPrimB", 0), D_8082A150[phi_s3]); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 255), CVar_GetS32("gCCCRBtnPrimB", 0), D_8082A150[phi_s3]); + } else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 255), CVar_GetS32("gCCCDBtnPrimB", 0), D_8082A150[phi_s3]); } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index ee8039e21..c126ec600 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1947,23 +1947,56 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = D_8082ADD8[gSaveContext.language] << 5; - if (CVar_GetS32("gHudColors", 1) == 0) {//To equip text C button icon - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255); - } else if (CVar_GetS32("gHudColors", 1) == 1) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255); - } else if (CVar_GetS32("gHudColors", 1) == 2) { + s16 PosX; //General Pos of C button icon + if (gSaveContext.language == 0) { //eng + PosX = 112; + } else if (gSaveContext.language == 1) { //ger + PosX = 175; + } else {//baguettes + PosX = 98; + } + s16 PosY = 200; //General Pos of C button icon + s16 icon_w = 46; // Original texture size + s16 icon_h = 16; + s32 icon_x_offset; + s16 icon_w_crop = 17.0f; //Left + int height = icon_h * 1.0f; //Adjust Height with scale + int width = icon_w * 1.0f; //Adjust Width with scale + int width_crop = icon_w_crop * 1.0f; //Adjust Width with scale + int height_factor = (1 << 10) * icon_h / height; + int width_factor = (1 << 10) * icon_w / width; + if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255); + for (s16 i=0; i < 3; i++) { + if (i == 0) { + icon_x_offset = width_crop*3-3; + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCRBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCRBtnPrimB", R_C_BTN_COLOR(2)), 255); + } else if (i == 1) { + icon_x_offset = width_crop*2-3; + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCDBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCDBtnPrimB", R_C_BTN_COLOR(2)), 255); + } else if (i == 2) { + icon_x_offset = width_crop; + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCLBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCLBtnPrimB", R_C_BTN_COLOR(2)), 255); + } + gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, icon_w, icon_h, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + //gSPScisTextureRectangle(POLY_KAL_DISP++,PosX << 2, PosY << 2, (PosX + icon_x_offset) << 2, (PosY + height) << 2, G_TX_RENDERTILE, 0, 0, width_factor, height_factor); + gSPWideTextureRectangle(POLY_KAL_DISP++, PosX << 2, PosY << 2, (PosX + icon_x_offset) << 2, (PosY + height) << 2, G_TX_WRAP, 0, 0, width_factor, height_factor); + } + } else { + if (CVar_GetS32("gHudColors", 1) == 0) {//To equip text C button icon + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255); + } else if (CVar_GetS32("gHudColors", 1) == 1) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255); + } else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255); + } + gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, icon_w, icon_h, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSPWideTextureRectangle(POLY_KAL_DISP++, PosX << 2, PosY << 2, (PosX + width) << 2, (PosY + height) << 2, G_TX_RENDERTILE, 0, 0, width_factor, height_factor); } - if (gSaveContext.inventory.items[pauseCtx->cursorSlot[PAUSE_ITEM]] != ITEM_NONE) { - //gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); //Same reason for every A button, to be able to recolor them. - gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0); - - gDPPipeSync(POLY_KAL_DISP++); - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); - POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToEquipTextures[gSaveContext.language], - D_8082ADD8[gSaveContext.language], 16, 4); - } + gDPPipeSync(POLY_KAL_DISP++); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); + POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToEquipTextures[gSaveContext.language], + D_8082ADD8[gSaveContext.language], 16, 4); } else if ((pauseCtx->pageIndex == PAUSE_MAP) && sInDungeonScene) { } else if ((pauseCtx->pageIndex == PAUSE_QUEST) && (pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && @@ -1992,11 +2025,11 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { D_8082ADE8[gSaveContext.language] << 5; if (CVar_GetS32("gHudColors", 1) == 0) {//To play melody A button - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]); } else if (CVar_GetS32("gHudColors", 1) == 1) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[0][0], gABtnTexColour[0][1], gABtnTexColour[0][2], gABtnTexColour[0][3]); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[0][0], gABtnTexColour[0][1], gABtnTexColour[0][2], gABtnTexColour[0][3]); } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", gABtnTexColour[0][0]), CVar_GetS32("gCCABtnPrimG", gABtnTexColour[0][1]), CVar_GetS32("gCCABtnPrimB", gABtnTexColour[0][2]), gABtnTexColour[0][3]); + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", gABtnTexColour[0][0]), CVar_GetS32("gCCABtnPrimG", gABtnTexColour[0][1]), CVar_GetS32("gCCABtnPrimB", gABtnTexColour[0][2]), gABtnTexColour[0][3]); } //gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL); gDPLoadTextureBlock(POLY_KAL_DISP++, gABtnSymbolTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);