From ad478cfc594ec8820bda726b3dc5fffe2df65e30 Mon Sep 17 00:00:00 2001 From: inspectredc <78732756+inspectredc@users.noreply.github.com> Date: Thu, 9 May 2024 15:58:52 +0100 Subject: DPad Items (#228) * Initial Dpad * remove old hud stuff * and comment * s.. * add dpad equip macro back in * fix inputs * fix equipping (hopefully all) * finish some todos * add 2s2h asset header * check dpad macro * remove 2s2h_assets * re-add empty texture * use correct struct for default dpad equips * dpad save stuff * fix item offering, use correct equip offset values * finally figure out unk_154 and fix mask equipping * avoid ugly code * add necessary condition * correct save names for dpad items/slots * remove todos and sort out suggestions and rename cvar * func standardise renaming * Add dpad to hud presets * dpad save migration --- mm/2s2h/DeveloperTools/SaveEditor.cpp | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'mm/2s2h/DeveloperTools/SaveEditor.cpp') diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp index 4eeb95661..57621b861 100644 --- a/mm/2s2h/DeveloperTools/SaveEditor.cpp +++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp @@ -387,23 +387,26 @@ void DrawEquipItemMenu(InventorySlot slot) { gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][EQUIP_SLOT_C_RIGHT] = slot; Interface_LoadItemIconImpl(gPlayState, EQUIP_SLOT_C_RIGHT); } - // Todo: DPAD equips support - // if (ImGui::MenuItem("D-Up")) { - // gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][4] = currentItemId; - // gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][3] = slot; - // } - // if (ImGui::MenuItem("D-Down")) { - // gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][5] = currentItemId; - // gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][4] = slot; - // } - // if (ImGui::MenuItem("D-Left")) { - // gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][6] = currentItemId; - // gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][5] = slot; - // } - // if (ImGui::MenuItem("D-Right")) { - // gSaveContext.save.saveInfo.equips.buttonItems[CUR_FORM][7] = currentItemId; - // gSaveContext.save.saveInfo.equips.cButtonSlots[CUR_FORM][6] = slot; - // } + if (ImGui::MenuItem("D-Up")) { + gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_RIGHT] = currentItemId; + gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_RIGHT] = slot; + Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_RIGHT); + } + if (ImGui::MenuItem("D-Down")) { + gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_LEFT] = currentItemId; + gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_LEFT] = slot; + Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_LEFT); + } + if (ImGui::MenuItem("D-Left")) { + gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_DOWN] = currentItemId; + gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_DOWN] = slot; + Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_DOWN); + } + if (ImGui::MenuItem("D-Right")) { + gSaveContext.save.shipSaveInfo.dpadEquips.dpadItems[CUR_FORM][EQUIP_SLOT_D_UP] = currentItemId; + gSaveContext.save.shipSaveInfo.dpadEquips.dpadSlots[CUR_FORM][EQUIP_SLOT_D_UP] = slot; + Interface_Dpad_LoadItemIconImpl(gPlayState, EQUIP_SLOT_D_UP); + } ImGui::EndMenu(); } } -- cgit v1.2.3