mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-13 06:58:03 -05:00
Only show adult trade items in the save editor if they're shuffled
This commit is contained in:
parent
6603a9a474
commit
f41b939a71
@ -1,5 +1,6 @@
|
||||
#include "debugSaveEditor.h"
|
||||
#include "../../util.h"
|
||||
#include "../../OTRGlobals.h"
|
||||
#include "../libultraship/ImGuiImpl.h"
|
||||
#include "ImGuiHelpers.h"
|
||||
|
||||
@ -648,8 +649,9 @@ void DrawInventoryTab() {
|
||||
}
|
||||
|
||||
// Trade quest flags are only used when shuffling the trade sequence, so
|
||||
// this is only necessary when that's enabled.
|
||||
if (gSaveContext.n64ddFlag && ImGui::TreeNode("Adult trade quest items")) {
|
||||
// don't show this if it isn't needed.
|
||||
if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE)
|
||||
&& ImGui::TreeNode("Adult trade quest items")) {
|
||||
for (int i = ITEM_POCKET_EGG; i <= ITEM_CLAIM_CHECK; i++) {
|
||||
DrawBGSItemFlag(i);
|
||||
}
|
||||
|
@ -13,10 +13,10 @@ void Randomizer_ConsumeAdultTradeItem(GlobalContext* globalCtx, u8 itemId) {
|
||||
}
|
||||
|
||||
u8 Randomizer_GetNextAdultTradeItem() {
|
||||
const u16 numTradeItems = ITEM_CLAIM_CHECK - ITEM_POCKET_EGG + 1;
|
||||
u16 currentTradeItemIndex = INV_CONTENT(ITEM_TRADE_ADULT) - ITEM_POCKET_EGG;
|
||||
const u8 numTradeItems = ITEM_CLAIM_CHECK - ITEM_POCKET_EGG + 1;
|
||||
u8 currentTradeItemIndex = INV_CONTENT(ITEM_TRADE_ADULT) - ITEM_POCKET_EGG;
|
||||
for (int i = 0; i < numTradeItems; i++) {
|
||||
u16 tradeIndex = (currentTradeItemIndex + i + 1) % numTradeItems;
|
||||
u8 tradeIndex = (currentTradeItemIndex + i + 1) % numTradeItems;
|
||||
if (gSaveContext.adultTradeItems & (1 << tradeIndex)) {
|
||||
return ITEM_POCKET_EGG + tradeIndex;
|
||||
}
|
||||
@ -24,10 +24,10 @@ u8 Randomizer_GetNextAdultTradeItem() {
|
||||
}
|
||||
|
||||
u8 Randomizer_GetPrevAdultTradeItem() {
|
||||
const u16 numTradeItems = ITEM_CLAIM_CHECK - ITEM_POCKET_EGG + 1;
|
||||
u16 currentTradeItemIndex = INV_CONTENT(ITEM_TRADE_ADULT) - ITEM_POCKET_EGG;
|
||||
const u8 numTradeItems = ITEM_CLAIM_CHECK - ITEM_POCKET_EGG + 1;
|
||||
u8 currentTradeItemIndex = INV_CONTENT(ITEM_TRADE_ADULT) - ITEM_POCKET_EGG;
|
||||
for (int i = 0; i < numTradeItems; i++) {
|
||||
u16 tradeIndex = (currentTradeItemIndex - i - 1 + numTradeItems) % numTradeItems;
|
||||
u8 tradeIndex = (currentTradeItemIndex - i - 1 + numTradeItems) % numTradeItems;
|
||||
if (gSaveContext.adultTradeItems & (1 << tradeIndex)) {
|
||||
return ITEM_POCKET_EGG + tradeIndex;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user