Skip to content

Commit

Permalink
Merge branch 'new_item_menu' into mod-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Dec 21, 2023
2 parents 21a9f40 + b9c0ad3 commit 1652693
Show file tree
Hide file tree
Showing 30 changed files with 771 additions and 309 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions soh/assets/soh_assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ static const ALIGN_ASSET(2) char gTriforcePieceCompletedDL[] = dgTriforcePieceCo
static const ALIGN_ASSET(2) char gOptionsDividerChangeLangVtx[] = dgOptionsDividerChangeLangVtx;

// textures
#define dgArrowIconTex "__OTR__textures/icon_item_static/gArrowIconTex"
static const ALIGN_ASSET(2) char gArrowIconTex[] = dgArrowIconTex;

#define dgFireArrowPower "__OTR__textures/icon_item_static/gFireArrowPower"
static const ALIGN_ASSET(2) char gFireArrowPowerTex[] = dgFireArrowPower;

#define dgIceArrowPower "__OTR__textures/icon_item_static/gIceArrowPower"
static const ALIGN_ASSET(2) char gIceArrowPowerTex[] = dgIceArrowPower;

#define dgLightArrowPower "__OTR__textures/icon_item_static/gLightArrowPower"
static const ALIGN_ASSET(2) char gLightArrowPowerTex[] = dgLightArrowPower;

#define dgDPad "__OTR__textures/parameter_static/gDPad"
static const ALIGN_ASSET(2) char gDPadTex[] = dgDPad;

Expand Down
2 changes: 1 addition & 1 deletion soh/include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ extern "C"
extern void* gItemIcons[0x83];
extern u8 gItemAgeReqs[];
extern u8 gSlotAgeReqs[];
extern u8 gItemSlots[56];
extern u8 gItemSlots[71];
extern void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(PlayState*, SceneCmd*);
extern s16 gLinkObjectIds[2];
extern u32 gObjectTableSize;
Expand Down
2 changes: 2 additions & 0 deletions soh/include/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ typedef struct {
/* 0x0266 */ u8 worldMapPoints[20]; // 0 = hidden; 1 = displayed; 2 = highlighted
/* 0x027A */ u8 tradeQuestLocation;
/* 0x027C */ SkelAnime playerSkelAnime;
Vtx* arrowSelectVtx;
s16 arrowMenuAnimPos;
} PauseContext; // size = 0x2C0

typedef enum {
Expand Down
60 changes: 31 additions & 29 deletions soh/include/z64item.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,38 @@ typedef enum {
} DungeonItem;

typedef enum {
/* 0x00 */ SLOT_STICK,
/* 0x01 */ SLOT_NUT,
/* 0x02 */ SLOT_BOMB,
/* 0x03 */ SLOT_BOW,
/* 0x04 */ SLOT_ARROW_FIRE,
/* 0x05 */ SLOT_DINS_FIRE,
/* 0x06 */ SLOT_SLINGSHOT,
/* 0x07 */ SLOT_OCARINA,
/* 0x08 */ SLOT_BOMBCHU,
/* 0x09 */ SLOT_HOOKSHOT,
/* 0x0A */ SLOT_ARROW_ICE,
/* 0x0B */ SLOT_FARORES_WIND,
/* 0x0C */ SLOT_BOOMERANG,
/* 0x0D */ SLOT_LENS,
/* 0x0E */ SLOT_BEAN,
/* 0x00 */ SLOT_DINS_FIRE,
/* 0x01 */ SLOT_BOMB,
/* 0x02 */ SLOT_BOMBCHU,
/* 0x03 */ SLOT_NUT,
/* 0x04 */ SLOT_LENS,
/* 0x05 */ SLOT_BEAN,
/* 0x06 */ SLOT_FARORES_WIND,
/* 0x07 */ SLOT_SLINGSHOT,
/* 0x08 */ SLOT_BOOMERANG,
/* 0x09 */ SLOT_STICK,
/* 0x0A */ SLOT_BOOTS_HOVER,
/* 0x0B */ SLOT_TRADE_CHILD,
/* 0x0C */ SLOT_NAYRUS_LOVE,
/* 0x0D */ SLOT_BOW,
/* 0x0E */ SLOT_HOOKSHOT,
/* 0x0F */ SLOT_HAMMER,
/* 0x10 */ SLOT_ARROW_LIGHT,
/* 0x11 */ SLOT_NAYRUS_LOVE,
/* 0x12 */ SLOT_BOTTLE_1,
/* 0x13 */ SLOT_BOTTLE_2,
/* 0x14 */ SLOT_BOTTLE_3,
/* 0x15 */ SLOT_BOTTLE_4,
/* 0x16 */ SLOT_TRADE_ADULT,
/* 0x17 */ SLOT_TRADE_CHILD,
/* 0x18 */ SLOT_TUNIC_KOKIRI,
/* 0x19 */ SLOT_TUNIC_GORON,
/* 0x1A */ SLOT_TUNIC_ZORA,
/* 0x1B */ SLOT_BOOTS_KOKIRI,
/* 0x1C */ SLOT_BOOTS_IRON,
/* 0x1D */ SLOT_BOOTS_HOVER,
/* 0x10 */ SLOT_BOOTS_IRON,
/* 0x11 */ SLOT_TRADE_ADULT,
/* 0x12 */ SLOT_EMPTY_LEFT,
/* 0x13 */ SLOT_BOTTLE_1,
/* 0x14 */ SLOT_BOTTLE_2,
/* 0x15 */ SLOT_BOTTLE_3,
/* 0x16 */ SLOT_BOTTLE_4,
/* 0x17 */ SLOT_EMPTY_RIGHT,
/* 0x18 */ SLOT_OCARINA,
/* 0x19 */ SLOT_ARROW_FIRE,
/* 0x1A */ SLOT_ARROW_ICE,
/* 0x1B */ SLOT_ARROW_LIGHT,
/* 0x1C */ SLOT_TUNIC_KOKIRI,
/* 0x1D */ SLOT_TUNIC_GORON,
/* 0x1E */ SLOT_TUNIC_ZORA,
/* 0x1F */ SLOT_BOOTS_KOKIRI,
/* 0xFF */ SLOT_NONE = 0xFF
} InventorySlot;

Expand Down
4 changes: 2 additions & 2 deletions soh/include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct {
} ItemEquips; // size = 0x0A

typedef struct {
/* 0x00 */ u8 items[24];
/* 0x00 */ u8 items[28];
/* 0x18 */ s8 ammo[16];
/* 0x28 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each bit to an owned piece `EquipInv*`
/* 0x2C */ u32 upgrades;
Expand Down Expand Up @@ -389,7 +389,7 @@ typedef enum {

typedef enum {
/* 0 */ LINK_AGE_ADULT,
/* 1 */ LINK_AGE_CHILD
/* 1 */ LINK_AGE_CHILD,
} LinkAge;


Expand Down
39 changes: 22 additions & 17 deletions soh/soh/Enhancements/boss-rush/BossRush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct BossRushSetting {
std::vector<std::array<std::string, LANGUAGE_MAX>> choices;
} BossRushSetting;

BossRushSetting BossRushOptions[BOSSRUSH_OPTIONS_AMOUNT] = {
BossRushSetting BossRushOptions[BOSSRUSH_OPTIONS_AMOUNT] = {
{
{ "BOSSES:", "BOSSE:", "BOSS:" },
{
Expand Down Expand Up @@ -309,7 +309,7 @@ void BossRush_InitSave() {

// Set health
uint16_t health = 16;
switch (gSaveContext.bossRushOptions[BR_OPTIONS_HEARTS]) {
switch (gSaveContext.bossRushOptions[BR_OPTIONS_HEARTS]) {
case BR_CHOICE_HEARTS_7:
health *= 7;
break;
Expand Down Expand Up @@ -351,52 +351,57 @@ void BossRush_InitSave() {
}

// Set items
std::array<u8, 24> brItems = {
ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_NONE, ITEM_NONE,
ITEM_SLINGSHOT, ITEM_NONE, ITEM_NONE, ITEM_HOOKSHOT, ITEM_NONE, ITEM_NONE,
ITEM_BOOMERANG, ITEM_LENS, ITEM_NONE, ITEM_HAMMER, ITEM_ARROW_LIGHT, ITEM_NONE,
ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE,
std::array<u8, 28> brItems = {
ITEM_NONE, ITEM_BOMB, ITEM_NONE, ITEM_NUT, ITEM_LENS, ITEM_NONE,
ITEM_NONE, ITEM_SLINGSHOT, ITEM_BOOMERANG, ITEM_STICK, ITEM_NONE, ITEM_NONE,
ITEM_NONE, ITEM_BOW, ITEM_HOOKSHOT, ITEM_HAMMER, ITEM_NONE, ITEM_NONE,
ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE,
ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_ARROW_LIGHT,
};

if (gSaveContext.bossRushOptions[BR_OPTIONS_LONGSHOT] == BR_CHOICE_LONGSHOT_YES) {
brItems[9] = ITEM_LONGSHOT;
brItems[SLOT_HOOKSHOT] = ITEM_LONGSHOT;
}

switch (gSaveContext.bossRushOptions[BR_OPTIONS_BOTTLE]) {
case BR_CHOICE_BOTTLE_EMPTY:
brItems[18] = ITEM_BOTTLE;
brItems[SLOT_BOTTLE_1] = ITEM_BOTTLE;
break;
case BR_CHOICE_BOTTLE_FAIRY:
brItems[18] = ITEM_FAIRY;
brItems[SLOT_BOTTLE_1] = ITEM_FAIRY;
break;
case BR_CHOICE_BOTTLE_REDPOTION:
brItems[18] = ITEM_POTION_RED;
brItems[SLOT_BOTTLE_1] = ITEM_POTION_RED;
break;
case BR_CHOICE_BOTTLE_GREENPOTION:
brItems[18] = ITEM_POTION_GREEN;
brItems[SLOT_BOTTLE_1] = ITEM_POTION_GREEN;
break;
case BR_CHOICE_BOTTLE_BLUEPOTION:
brItems[18] = ITEM_POTION_BLUE;
brItems[SLOT_BOTTLE_1] = ITEM_POTION_BLUE;
break;
default:
break;
}

if (gSaveContext.bossRushOptions[BR_OPTIONS_BUNNYHOOD] == BR_CHOICE_BUNNYHOOD_YES) {
brItems[23] = ITEM_MASK_BUNNY;
brItems[SLOT_TRADE_CHILD] = ITEM_MASK_BUNNY;
}

if (gSaveContext.bossRushOptions[BR_OPTIONS_HOVERBOOTS] == BR_CHOICE_HOVERBOOTS_YES) {
brItems[SLOT_BOOTS_HOVER] = ITEM_BOOTS_HOVER;
}

for (int item = 0; item < ARRAY_COUNT(gSaveContext.inventory.items); item++) {
gSaveContext.inventory.items[item] = brItems[item];
}

// Set consumable counts
std::array<s8, 16> brAmmo = { 5, 5, 10, 10, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
std::array<s8, 16> brAmmo = { 0, 10, 0, 5, 0, 0, 0, 10, 0, 5, 0, 0, 0, 10, 0, 0 };

if (gSaveContext.bossRushOptions[BR_OPTIONS_AMMO] == BR_CHOICE_AMMO_FULL) {
brAmmo = { 10, 20, 20, 30, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
brAmmo = { 0, 20, 0, 20, 0, 0, 0, 30, 0, 10, 0, 0, 0, 30, 0, 0 };
} else if (gSaveContext.bossRushOptions[BR_OPTIONS_AMMO] == BR_CHOICE_AMMO_MAXED) {
brAmmo = { 30, 40, 40, 50, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
brAmmo = { 0, 40, 0, 40, 0, 0, 0, 50, 0, 30, 0, 0, 0, 50, 0, 0 };
}

for (int ammo = 0; ammo < ARRAY_COUNT(gSaveContext.inventory.ammo); ammo++) {
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/Enhancements/controls/GameControlEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ namespace GameControlEditor {
"To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gDpadHoldChange to 0");
UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips");
DrawHelpIcon("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate");
UIWidgets::PaddedEnhancementCheckbox("Toggle minimap with D-pad down", "gMapOnDDown");
DrawHelpIcon("Toggle the minimap by pressing down on the D-pad\nIf \"D-pad as Equip Items\" is enabled, equipping an item on D-pad down will prevent you from toggling the map");
window->EndGroupPanelPublic(0);
}

Expand Down
2 changes: 1 addition & 1 deletion soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ void Draw_Placements(){
ImGui::EndTable();
}
}
if (CVarGetInteger("gDpadEquips",0) && ImGui::CollapsingHeader("DPad items position")) {
if (ImGui::CollapsingHeader("DPad items position")) {
if (ImGui::BeginTable("tabledpaditems", 1, FlagsTable)) {
ImGui::TableSetupColumn("DPad items settings", FlagsCell, TablesCellsWidth);
Table_InitHeader(false);
Expand Down
3 changes: 3 additions & 0 deletions soh/soh/Enhancements/custom-message/CustomMessageTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ typedef enum {
TEXT_SHOOTING_GALLERY_MAN_COME_BACK_WITH_BOW = 0x9210,
TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN = 0x346, // 0x3yy for cuttable sign range
TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI = 0x1B3, // 0x1yy for Navi msg range
TEXT_FIRE_ARROW = 0x0070,
TEXT_ICE_ARROW = 0x0071,
TEXT_LIGHT_ARROW = 0x0072,
} TextIDs;

#ifdef __cplusplus
Expand Down
12 changes: 8 additions & 4 deletions soh/soh/Enhancements/debugger/debugSaveEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,16 @@ void DrawInventoryTab() {
ImGui::Checkbox("Restrict to valid items", &restrictToValid);
UIWidgets::InsertHelpHoverText("Restricts items and ammo to only what is possible to legally acquire in-game");

for (int32_t y = 0; y < 4; y++) {
for (int32_t y = 0; y < 5; y++) {
for (int32_t x = 0; x < 6; x++) {
int32_t index = x + y * 6;
static int32_t selectedIndex = -1;
static const char* itemPopupPicker = "itemPopupPicker";

if (index >= ARRAY_COUNT(gSaveContext.inventory.items)) {
break;
}

ImGui::PushID(index);

if (x != 0) {
Expand Down Expand Up @@ -1705,10 +1709,10 @@ void DrawPlayerTab() {
ImGui::SameLine();
ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL);

ImGui::NewLine();
ImGui::Text("Current D-pad Equips");
ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working
if (CVarGetInteger("gDpadEquips", 0)) {
ImGui::NewLine();
ImGui::Text("Current D-pad Equips");
ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working
ImGui::SameLine();
ImGui::InputScalar("D-pad Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[5], &one, NULL);
// Intentionnal to not put everything on the same line, else it's taking too much for lower resolution.
Expand Down
7 changes: 0 additions & 7 deletions soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ const std::vector<const char*> enhancementsCvars = {
"gDisableCritWiggle",
"gChestSizeDependsStoneOfAgony",
"gSkipArrowAnimation",
"gSeparateArrows",
"gCustomizeShootingGallery",
"gInstantShootingGalleryWin",
"gConstantAdultGallery",
Expand Down Expand Up @@ -633,9 +632,6 @@ const std::vector<PresetEntry> enhancedPresetEntries = {
// Skip Magic Arrow Equip Animation
PRESET_ENTRY_S32("gSkipArrowAnimation", 1),

// Equip arrows on multiple slots
PRESET_ENTRY_S32("gSeparateArrows", 1),

// Disable Navi Call Audio
PRESET_ENTRY_S32("gDisableNaviCallAudio", 1),

Expand Down Expand Up @@ -757,9 +753,6 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
// Exit Market at Night
PRESET_ENTRY_S32("gMarketSneak", 1),

// Equip arrows on multiple slots
PRESET_ENTRY_S32("gSeparateArrows", 1),

// Disable Navi Call Audio
PRESET_ENTRY_S32("gDisableNaviCallAudio", 1),

Expand Down
Loading

0 comments on commit 1652693

Please sign in to comment.