diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index a2e36f28f..9306f7276 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -41,11 +41,6 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); #endif -// #include "../../soh/include/randomizer/main.cpp" -// #include "../../soh/include/randomizer/main.hpp" -// #include "../../soh/include/randomizer/rando_main.hpp" -// #include "../../soh/include/randomizer/spoiler_log.hpp" -// #include "../../soh/soh/OTRGlobals.h" using namespace Ship; bool oldCursorState = true; @@ -61,8 +56,6 @@ OSContPad* pads; std::map DefaultAssets; -// SpoilerData gSpoilerData; - namespace SohImGui { WindowImpl impl; @@ -98,13 +91,13 @@ namespace SohImGui { ImVec4 navi_prop_i_col; ImVec4 navi_prop_o_col; + //This is the list of possible CVars that has rainbow effect. 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" + "gTunic_Kokiri_","gTunic_Goron_","gTunic_Zora_", + "gCCHeartsPrim","gDDCCHeartsPrim", + "gCCABtnPrim","gCCBBtnPrim","gCCCBtnPrim","gCCStartBtnPrim", + "gCCMagicBorderPrim","gCCMagicPrim","gCCMagicUsePrim", + "gCCMinimapPrim","gCCRupeePrim","gCCKeysPrim" }; const char* filters[3] = { @@ -279,8 +272,8 @@ namespace SohImGui { std::string Cvar_RBM = cvarName; Cvar_RBM += "RBM"; std::string RBM_HUE = cvarName; - RBM_HUE += "Hue"; - f32 Canon = 10.f * s; + RBM_HUE+="Hue"; + f32 Canon = 10.f*s; ImVec4 NewColor; const f32 deltaTime = 1.0f / ImGui::GetIO().Framerate; f32 hue = CVar_GetFloat(RBM_HUE.c_str(), 0.0f); @@ -292,20 +285,20 @@ namespace SohImGui { u8 i = current_hue / 60 + 1; u8 a = (-current_hue / 60.0f + i) * 255; u8 b = (current_hue / 60.0f + (1 - i)) * 255; - + switch (i) { - case 1: NewColor.x = 255; NewColor.y = b; NewColor.z = 0; break; - case 2: NewColor.x = a; NewColor.y = 255; NewColor.z = 0; break; - case 3: NewColor.x = 0; NewColor.y = 255; NewColor.z = b; break; - case 4: NewColor.x = 0; NewColor.y = a; NewColor.z = 255; break; - case 5: NewColor.x = b; NewColor.y = 0; NewColor.z = 255; break; - case 6: NewColor.x = 255; NewColor.y = 0; NewColor.z = a; break; + case 1: NewColor.x = 255; NewColor.y = b; NewColor.z = 0; break; + case 2: NewColor.x = a; NewColor.y = 255; NewColor.z = 0; break; + case 3: NewColor.x = 0; NewColor.y = 255; NewColor.z = b; break; + case 4: NewColor.x = 0; NewColor.y = a; NewColor.z = 255; break; + case 5: NewColor.x = b; NewColor.y = 0; NewColor.z = 255; break; + case 6: NewColor.x = 255; NewColor.y = 0; NewColor.z = a; break; } - if (CVar_GetS32(Cvar_RBM.c_str(), 0) != 0) { - CVar_SetS32(Cvar_Red.c_str(), ClampFloatToInt(NewColor.x, 0, 255)); - CVar_SetS32(Cvar_Green.c_str(), ClampFloatToInt(NewColor.y, 0, 255)); - CVar_SetS32(Cvar_Blue.c_str(), ClampFloatToInt(NewColor.z, 0, 255)); + if(CVar_GetS32(Cvar_RBM.c_str(), 0) != 0) { + CVar_SetS32(Cvar_Red.c_str(), ClampFloatToInt(NewColor.x,0,255)); + CVar_SetS32(Cvar_Green.c_str(), ClampFloatToInt(NewColor.y,0,255)); + CVar_SetS32(Cvar_Blue.c_str(), ClampFloatToInt(NewColor.z,0,255)); } } } @@ -431,7 +424,6 @@ namespace SohImGui { Game::SaveSettings(); needs_save = false; } - ImGuiProcessEvent(event); } @@ -450,6 +442,28 @@ namespace SohImGui { } } + + void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue = 0){ + if (FirstTimeValue <= 0){ + FirstTimeValue = 0; + } + uint8_t selected=CVar_GetS32(name, FirstTimeValue); + uint8_t DefaultValue=selected; + if (ImGui::BeginCombo("##name", ComboArray[DefaultValue])) { + uint8_t ComboxSize = sizeof(&ComboArray); + for (uint8_t i = 0; i <= ComboxSize; i++) { + if (strlen(ComboArray[i]) > 1) { + if (ImGui::Selectable(ComboArray[i], i==selected)) { + CVar_SetS32(name, i); + selected=i; + needs_save = true; + } + } + } + ImGui::EndCombo(); + } + } + void EnhancementRadioButton(const char* text, const char* cvarName, int id) { /*Usage : EnhancementRadioButton("My Visible Name","gMyCVarName", MyID); @@ -821,20 +835,9 @@ namespace SohImGui { EXPERIMENTAL(); ImGui::Text("Texture Filter (Needs reload)"); + EnhancementCombobox("gTextureFilter", filters); GfxRenderingAPI* gapi = gfx_get_current_rendering_api(); - if (ImGui::BeginCombo("##filters", filters[gapi->get_texture_filter()])) { - for (int fId = 0; fId <= FilteringMode::FILTER_NONE; fId++) { - if (ImGui::Selectable(filters[fId], fId == gapi->get_texture_filter())) { - INFO("New Filter: %s", filters[fId]); - gapi->set_texture_filter((FilteringMode)fId); - - CVar_SetS32("gTextureFilter", (int)fId); - needs_save = true; - } - - } - ImGui::EndCombo(); - } + gapi->set_texture_filter((FilteringMode)CVar_GetS32("gTextureFilter", 0)); overlay->DrawSettings(); ImGui::EndMenu(); } @@ -1093,22 +1096,22 @@ namespace 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."); 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(115,230,255,255), false); + 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(100,100,255,255), false); + 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(90,90,255,255), false); + 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,220,0,255), false); + 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,220,0,255), false); + 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(); } diff --git a/libultraship/libultraship/SohImGuiImpl.h b/libultraship/libultraship/SohImGuiImpl.h index 421c71778..3a4a18e07 100644 --- a/libultraship/libultraship/SohImGuiImpl.h +++ b/libultraship/libultraship/SohImGuiImpl.h @@ -70,6 +70,7 @@ namespace SohImGui { void EnhancementButton(const char* text, const char* cvarName); void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format); void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage); + void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue); void EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow = true, bool has_alpha=false, bool TitleSameLine=false); void DrawMainMenuAndCalculateGameSize(void); diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index ca1b67798..a0d27f70f 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1316,6 +1316,9 @@ void DrawPlayerTab() { case ITEM_SWORD_BGS: curSword = "Biggoron's Sword"; break; + case ITEM_FISHING_POLE: + curSword = "Fishing Pole"; + break; case ITEM_NONE: curSword = "None"; break; @@ -1463,6 +1466,11 @@ void DrawPlayerTab() { Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_BGS); } + if (ImGui::Selectable("Fishing Pole")) { + player->currentSwordItem = ITEM_FISHING_POLE; + gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE; + Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_MASTER); + } ImGui::EndCombo(); } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 0e5b960f6..c4e0f5752 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -339,19 +339,19 @@ void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, Gl if (CVar_GetS32("gUseNaviCol",0) != 1 ) { if (actorCategory == ACTORCAT_PLAYER) { naviColor->inner.r = 255; naviColor->inner.g = 255; naviColor->inner.b = 255; - naviColor->outer.r = 115; naviColor->outer.g = 230; naviColor->outer.b = 255; + naviColor->outer.r = 0; naviColor->outer.g = 0; naviColor->outer.b = 255; } if (actorCategory == ACTORCAT_NPC) { - naviColor->inner.r = 100; naviColor->inner.g = 100; naviColor->inner.b = 255; - naviColor->outer.r = 90; naviColor->outer.g = 90; naviColor->outer.b = 255; + naviColor->inner.r = 150; naviColor->inner.g = 150; naviColor->inner.b = 255; + naviColor->outer.r = 150; naviColor->outer.g = 150; naviColor->outer.b = 255; } if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) { naviColor->inner.r = 255; naviColor->inner.g = 255; naviColor->inner.b = 0; - naviColor->outer.r = 220; naviColor->outer.g = 220; naviColor->outer.b = 0; + naviColor->outer.r = 220; naviColor->outer.g = 155; naviColor->outer.b = 0; } if (actorCategory == ACTORCAT_PROP) { - naviColor->inner.r = 0; naviColor->inner.g = 255; naviColor->inner.b = 90; - naviColor->outer.r = 0; naviColor->outer.g = 220; naviColor->outer.b = 0; + naviColor->inner.r = 0; naviColor->inner.g = 255; naviColor->inner.b = 0; + naviColor->outer.r = 0; naviColor->outer.g = 255; naviColor->outer.b = 0; } } else { if (actorCategory == ACTORCAT_PLAYER) {