mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 00:28:51 -05:00
Fixes some miscellaneous issues for Switch builds.
This commit is contained in:
parent
c7c29034eb
commit
674645ef14
@ -127,6 +127,20 @@ ItemLocation* Context::GetItemLocation(size_t locKey) {
|
||||
return &itemLocationTable[static_cast<RandomizerCheck>(locKey)];
|
||||
}
|
||||
|
||||
ItemOverride& Context::GetItemOverride(RandomizerCheck locKey) {
|
||||
if (!overrides.contains(locKey)) {
|
||||
overrides.emplace(locKey, ItemOverride());
|
||||
}
|
||||
return overrides.at(locKey);
|
||||
}
|
||||
|
||||
ItemOverride& Context::GetItemOverride(size_t locKey) {
|
||||
if (!overrides.contains(static_cast<RandomizerCheck>(locKey))) {
|
||||
overrides.emplace(static_cast<RandomizerCheck>(locKey), ItemOverride());
|
||||
}
|
||||
return overrides.at(static_cast<RandomizerCheck>(locKey));
|
||||
}
|
||||
|
||||
void Context::PlaceItemInLocation(const RandomizerCheck locKey, const RandomizerGet item, const bool applyEffectImmediately,
|
||||
const bool setHidden) {
|
||||
const auto loc = GetItemLocation(locKey);
|
||||
|
@ -37,6 +37,8 @@ class Context {
|
||||
RandomizerArea hintedArea = RA_NONE);
|
||||
ItemLocation* GetItemLocation(RandomizerCheck locKey);
|
||||
ItemLocation* GetItemLocation(size_t locKey);
|
||||
ItemOverride& GetItemOverride(RandomizerCheck locKey);
|
||||
ItemOverride& GetItemOverride(size_t locKey);
|
||||
void PlaceItemInLocation(RandomizerCheck locKey, RandomizerGet item, bool applyEffectImmediately = false,
|
||||
bool setHidden = false);
|
||||
std::vector<RandomizerCheck> allLocations;
|
||||
|
@ -2355,6 +2355,9 @@ extern "C" GetItemEntry ItemTable_Retrieve(int16_t getItemID) {
|
||||
}
|
||||
|
||||
extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 tableID, s16 getItemID) {
|
||||
if (tableID == MOD_RANDOMIZER) {
|
||||
return Rando::StaticData::RetrieveItem(static_cast<RandomizerGet>(getItemID)).GetGIEntry_Copy();
|
||||
}
|
||||
return ItemTableManager::Instance->RetrieveItemEntry(tableID, getItemID);
|
||||
}
|
||||
|
||||
|
@ -331,13 +331,12 @@ void SaveManager::LoadRandomizerVersion3() {
|
||||
RandomizerGet rg = RG_NONE;
|
||||
SaveManager::Instance->LoadData("fakeRgID", rg, RG_NONE);
|
||||
if (rg != RG_NONE) {
|
||||
randoContext->overrides[static_cast<RandomizerCheck>(i)] =
|
||||
Rando::ItemOverride(static_cast<RandomizerCheck>(i), rg);
|
||||
randoContext->overrides.emplace(static_cast<RandomizerCheck>(i), Rando::ItemOverride(static_cast<RandomizerCheck>(i), rg));
|
||||
SaveManager::Instance->LoadStruct("trickName", [&]() {
|
||||
SaveManager::Instance->LoadData(
|
||||
"english", randoContext->overrides[static_cast<RandomizerCheck>(i)].GetTrickName().english);
|
||||
"english", randoContext->GetItemOverride(i).GetTrickName().english);
|
||||
SaveManager::Instance->LoadData(
|
||||
"french", randoContext->overrides[static_cast<RandomizerCheck>(i)].GetTrickName().french);
|
||||
"french", randoContext->GetItemOverride(i).GetTrickName().french);
|
||||
});
|
||||
}
|
||||
uint16_t price = 0;
|
||||
@ -437,10 +436,10 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool f
|
||||
SaveManager::Instance->SaveStruct("", [&]() {
|
||||
SaveManager::Instance->SaveData("rgID", randoContext->GetItemLocation(i)->GetPlacedRandomizerGet());
|
||||
if (randoContext->GetItemLocation(i)->GetPlacedRandomizerGet() == RG_ICE_TRAP) {
|
||||
SaveManager::Instance->SaveData("fakeRgID", randoContext->overrides[static_cast<RandomizerCheck>(i)].LooksLike());
|
||||
SaveManager::Instance->SaveData("fakeRgID", randoContext->GetItemOverride(i).LooksLike());
|
||||
SaveManager::Instance->SaveStruct("trickName", [&]() {
|
||||
SaveManager::Instance->SaveData("english", randoContext->overrides[static_cast<RandomizerCheck>(i)].GetTrickName().GetEnglish());
|
||||
SaveManager::Instance->SaveData("french", randoContext->overrides[static_cast<RandomizerCheck>(i)].GetTrickName().GetFrench());
|
||||
SaveManager::Instance->SaveData("english", randoContext->GetItemOverride(i).GetTrickName().GetEnglish());
|
||||
SaveManager::Instance->SaveData("french", randoContext->GetItemOverride(i).GetTrickName().GetFrench());
|
||||
// TODO: German (trick names don't have german translations yet)
|
||||
});
|
||||
}
|
||||
|
@ -1336,7 +1336,8 @@ void FileChoose_GenerateRandoSeed(GameState* thisx) {
|
||||
memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName,
|
||||
CVarGetInteger("gLinkDefaultName", 0) ? &linkName : &emptyName, 8);
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
if (!generating) {
|
||||
Randomizer_GenerateSeed();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user