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
This commit is contained in:
inspectredc
2024-05-22 09:05:04 -05:00
committed by Garrett Cox
parent 1d5d9be069
commit ad478cfc59
28 changed files with 2962 additions and 60 deletions
+20 -17
View File
@@ -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();
}
}