summaryrefslogtreecommitdiff
path: root/mm/2s2h/DeveloperTools/SaveEditor.cpp
diff options
context:
space:
mode:
authorArchez <Archez@users.noreply.github.com>2025-02-04 10:28:18 -0500
committerGitHub <noreply@github.com>2025-02-04 10:28:18 -0500
commit7896a0f648170c8826ac8b2330d86933779a5545 (patch)
tree515813234a8987016816c9cdd17fea666595e6d8 /mm/2s2h/DeveloperTools/SaveEditor.cpp
parenteeed3ad36769445a98f92ef785d3eb2d31301251 (diff)
Bump LUS and OTRExporter pt.3 (#984)
* Bump LUS and OTRExporter pt.3 * Remove outdated controller disclaimer
Diffstat (limited to 'mm/2s2h/DeveloperTools/SaveEditor.cpp')
-rw-r--r--mm/2s2h/DeveloperTools/SaveEditor.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp
index 8effd21a4..4fbd38869 100644
--- a/mm/2s2h/DeveloperTools/SaveEditor.cpp
+++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp
@@ -734,8 +734,13 @@ void DrawSlot(InventorySlot slot) {
(const char*)gItemIcons[currentItemId]);
}
- if (ImGui::ImageButton(textureId, ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), 0,
- ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, currentItemId == ITEM_NONE ? 0.4f : 1.0f))) {
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ bool buttonPressed =
+ ImGui::ImageButton((const char*)gItemIcons[safeItemsForInventorySlot[slot][0]], 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, currentItemId == ITEM_NONE ? 0.4f : 1.0f));
+ ImGui::PopStyleVar();
+ if (buttonPressed) {
if (safeMode && safeItemsForInventorySlot[slot].size() < 2) {
NextItemInSlot(slot);
} else {
@@ -765,9 +770,13 @@ void DrawSlot(InventorySlot slot) {
}
ItemId id = safeMode ? safeItemsForInventorySlot[selectedInventorySlot][pickerIndex]
: static_cast<ItemId>(pickerIndex);
- if (ImGui::ImageButton(
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName((const char*)gItemIcons[id]),
- ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE), ImVec2(0, 0), ImVec2(1, 1), 0)) {
+ 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]),
+ ImVec2(INV_GRID_ICON_SIZE, INV_GRID_ICON_SIZE));
+ ImGui::PopStyleVar();
+ if (buttonPressed) {
gSaveContext.save.saveInfo.inventory.items[selectedInventorySlot] = id;
ImGui::CloseCurrentPopup();
}