diff options
| author | Jameriquiah <42100286+Jameriquiah@users.noreply.github.com> | 2026-07-21 22:22:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-21 22:22:35 -0400 |
| commit | 65fb1b6e3cc49780057208f4050a160d1a4bdfc7 (patch) | |
| tree | c0f2434ea2ee47c51cbb47ede559d4d5b318ec23 /mm/2s2h/DeveloperTools/SaveEditor.cpp | |
| parent | f86e04b4d5492906718aa7bacf5b92d55756006c (diff) | |
Bump LUS to port-maintenance (#1801)
* bump lus to port-maintenance
* clang
* remove redundant cast
* clang again
* update lus commit
Diffstat (limited to 'mm/2s2h/DeveloperTools/SaveEditor.cpp')
| -rw-r--r-- | mm/2s2h/DeveloperTools/SaveEditor.cpp | 66 |
1 files changed, 41 insertions, 25 deletions
diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp index 0a1de5f73..aebf90c3a 100644 --- a/mm/2s2h/DeveloperTools/SaveEditor.cpp +++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp @@ -12,6 +12,9 @@ #include "interface/icon_item_dungeon_static/icon_item_dungeon_static.h" #include "archives/icon_item_24_static/icon_item_24_static_yar.h" +#include <fast/Fast3dGui.h> +#include <fast/Fast3dWindow.h> + extern "C" { #include <z64.h> #include <z64save.h> @@ -769,12 +772,13 @@ void DrawSlot(InventorySlot slot) { } ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 2.0f); - ImTextureID textureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[safeItemsForInventorySlot[slot][0]]); + ImTextureID textureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[safeItemsForInventorySlot[slot][0]]); if (currentItemId != ITEM_NONE) { - textureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[currentItemId]); + textureId = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[currentItemId]); } ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); @@ -816,7 +820,8 @@ void DrawSlot(InventorySlot slot) { ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); bool buttonPressed = ImGui::ImageButton( (const char*)gItemIcons[id], - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName((const char*)gItemIcons[id]), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[id]), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE)); ImGui::PopStyleVar(); if (buttonPressed) { @@ -1176,8 +1181,9 @@ void DrawQuestSlot(QuestItem slot) { ImGui::SetCursorPos( ImVec2(x * INV_GRID_WIDTH + INV_GRID_PADDING, y * INV_GRID_HEIGHT + INV_GRID_TOP_MARGIN + INV_GRID_PADDING)); - ImTextureID textureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[questToItemMap[slot]]); + ImTextureID textureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[questToItemMap[slot]]); if (ImGui::ImageButton(std::to_string(slot).c_str(), textureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, CHECK_QUEST_ITEM(slot) ? 1.0f : 0.4f))) { @@ -1189,11 +1195,12 @@ void DrawQuestSlot(QuestItem slot) { ImVec2 DrawSong(QuestItem slot) { SongInfo(slot); - if (ImGui::ImageButton(std::to_string(slot).c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[questToItemMap[(QuestItem)slot]]), - ImVec2(INV_GRID_ICON_SIZE / 1.5f, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), - ImVec4(0, 0, 0, 0), colorTint)) { + if (ImGui::ImageButton( + std::to_string(slot).c_str(), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[questToItemMap[(QuestItem)slot]]), + ImVec2(INV_GRID_ICON_SIZE / 1.5f, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), + colorTint)) { NextQuestInSlot(slot); } ImVec2 itemSize = ImGui::GetItemRectSize(); @@ -1272,8 +1279,9 @@ void DrawQuestStatusTab() { drawSongRange(QUEST_SONG_SONATA, QUEST_SONG_SARIA); ImGui::SeparatorText("Equipment"); if (GET_PLAYER_FORM == PLAYER_FORM_FIERCE_DEITY) { - ImTextureID swordTextureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[ITEM_SWORD_DEITY]); + ImTextureID swordTextureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[ITEM_SWORD_DEITY]); ImGui::ImageButton(std::to_string(ITEM_SWORD_DEITY).c_str(), swordTextureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1)); @@ -1282,8 +1290,9 @@ void DrawQuestStatusTab() { if (swordValue == EQUIP_VALUE_SWORD_NONE) { swordValue = EQUIP_VALUE_SWORD_KOKIRI; } - ImTextureID swordTextureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[ITEM_SWORD_KOKIRI + swordValue - EQUIP_VALUE_SWORD_KOKIRI]); + ImTextureID swordTextureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[ITEM_SWORD_KOKIRI + swordValue - EQUIP_VALUE_SWORD_KOKIRI]); if (ImGui::ImageButton(std::to_string(ITEM_SWORD_KOKIRI).c_str(), swordTextureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), @@ -1296,8 +1305,9 @@ void DrawQuestStatusTab() { if (shieldValue == EQUIP_VALUE_SHIELD_NONE) { shieldValue = EQUIP_VALUE_SHIELD_HERO; } - ImTextureID shieldTextureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[ITEM_SHIELD_HERO + shieldValue - EQUIP_VALUE_SHIELD_HERO]); + ImTextureID shieldTextureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[ITEM_SHIELD_HERO + shieldValue - EQUIP_VALUE_SHIELD_HERO]); if (ImGui::ImageButton(std::to_string(ITEM_SHIELD_HERO).c_str(), shieldTextureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), @@ -1305,8 +1315,9 @@ void DrawQuestStatusTab() { NextQuestInSlot(QUEST_SHIELD); } ImGui::SameLine(); - ImTextureID textureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName( - (const char*)gItemIcons[ITEM_BOMBERS_NOTEBOOK]); + ImTextureID textureId = + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName((const char*)gItemIcons[ITEM_BOMBERS_NOTEBOOK]); if (ImGui::ImageButton(std::to_string(ITEM_BOMBERS_NOTEBOOK).c_str(), textureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), @@ -1383,7 +1394,8 @@ void DrawDungeonItemTab() { ImGui::Text("%s", dungeonNames[i]); if (ImGui::ImageButton( stray_id.c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(fairyIcons[dungeonId]), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName(fairyIcons[dungeonId]), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, gSaveContext.save.saveInfo.inventory.strayFairies[dungeonId] ? 1.0f : 0.4f))) { ImGui::OpenPopup("strayFairies"); @@ -1391,7 +1403,8 @@ void DrawDungeonItemTab() { ImGui::SameLine(); if (ImGui::ImageButton( map_id.c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gQuestIconDungeonMapTex), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName(gQuestIconDungeonMapTex), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, CHECK_DUNGEON_ITEM(DUNGEON_MAP, i) ? 1.0f : 0.4f))) { SetDungeonItems(DUNGEON_MAP, i); @@ -1399,7 +1412,8 @@ void DrawDungeonItemTab() { ImGui::SameLine(); if (ImGui::ImageButton( comp_id.c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gQuestIconCompassTex), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName(gQuestIconCompassTex), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, i) ? 1.0f : 0.4f))) { SetDungeonItems(DUNGEON_COMPASS, i); @@ -1407,7 +1421,8 @@ void DrawDungeonItemTab() { ImGui::SameLine(); if (ImGui::ImageButton( sKey_id.c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gQuestIconSmallKeyTex), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName(gQuestIconSmallKeyTex), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, DUNGEON_KEY_COUNT(i) + 1 ? 1.0f : 0.4f))) { ImGui::OpenPopup("smallKeys"); @@ -1415,7 +1430,8 @@ void DrawDungeonItemTab() { ImGui::SameLine(); if (ImGui::ImageButton( bKey_id.c_str(), - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gQuestIconBossKeyTex), + std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui()) + ->GetTextureByName(gQuestIconBossKeyTex), ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, CHECK_DUNGEON_ITEM(DUNGEON_BOSS_KEY, i) ? 1.0f : 0.4f))) { SetDungeonItems(DUNGEON_BOSS_KEY, i); |
