mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 21:33:40 -07:00
fix plandomiser
This commit is contained in:
parent
5826958404
commit
4240f7d8ab
10 changed files with 34 additions and 34 deletions
|
@ -792,7 +792,7 @@ static void AssumedFill(const std::vector<RandomizerGet>& items, const std::vect
|
|||
// NOLINTNEXTLINE(clang-diagnostic-unused-variable)
|
||||
for (const RandomizerGet item : items) {
|
||||
SPDLOG_DEBUG("\t");
|
||||
SPDLOG_DEBUG(Rando::StaticData::RetrieveItem(item).GetName().GetEnglish());
|
||||
SPDLOG_DEBUG(Rando::StaticData::RetrieveItem(item).GetName().GetForCurrentLanguage(MF_RAW));
|
||||
SPDLOG_DEBUG("\n");
|
||||
}
|
||||
SPDLOG_DEBUG("\nAllowed Locations:\n");
|
||||
|
@ -851,7 +851,7 @@ static void AssumedFill(const std::vector<RandomizerGet>& items, const std::vect
|
|||
if (accessibleLocations.empty()) {
|
||||
|
||||
SPDLOG_DEBUG("\nCANNOT PLACE ");
|
||||
SPDLOG_DEBUG(Rando::StaticData::RetrieveItem(item).GetName().GetEnglish());
|
||||
SPDLOG_DEBUG(Rando::StaticData::RetrieveItem(item).GetName().GetForCurrentLanguage(MF_RAW));
|
||||
SPDLOG_DEBUG(". TRYING AGAIN...\n");
|
||||
|
||||
// reset any locations that got an item
|
||||
|
|
|
@ -40,7 +40,7 @@ const CustomMessage& HintText::GetClear() const {
|
|||
}
|
||||
|
||||
const CustomMessage& HintText::GetName() const {
|
||||
return name.GetEnglish() == "" ? name : clearText;
|
||||
return name.GetEnglish() == "" ? clearText : name;
|
||||
}
|
||||
|
||||
const CustomMessage& HintText::GetObscure() const {
|
||||
|
@ -454,7 +454,7 @@ static RandomizerCheck CreateRandomHint(std::vector<RandomizerCheck>& possibleHi
|
|||
SPDLOG_DEBUG("\n");
|
||||
|
||||
SPDLOG_DEBUG("\tItem: ");
|
||||
SPDLOG_DEBUG(ctx->GetItemLocation(hintedLocation)->GetPlacedItemName().GetForCurrentLanguage());
|
||||
SPDLOG_DEBUG(ctx->GetItemLocation(hintedLocation)->GetPlacedItemName().GetForCurrentLanguage(MF_RAW));
|
||||
SPDLOG_DEBUG("\n");
|
||||
|
||||
placed = CreateHint(hintedLocation, copies, type, distributionName);
|
||||
|
|
|
@ -75,7 +75,7 @@ static void WriteLocation(
|
|||
Rando::Location* location = Rando::StaticData::GetLocation(locationKey);
|
||||
Rando::ItemLocation* itemLocation = Rando::Context::GetInstance()->GetItemLocation(locationKey);
|
||||
|
||||
jsonData["playthrough"][sphere][location->GetName()] = itemLocation->GetPlacedItemName().GetForCurrentLanguage();
|
||||
jsonData["playthrough"][sphere][location->GetName()] = itemLocation->GetPlacedItemName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
|
||||
//Writes a shuffled entrance to the specified node
|
||||
|
@ -254,7 +254,7 @@ static void WriteAllLocations() {
|
|||
auto ctx = Rando::Context::GetInstance();
|
||||
for (const RandomizerCheck key : ctx->allLocations) {
|
||||
Rando::ItemLocation* location = ctx->GetItemLocation(key);
|
||||
std::string placedItemName = location->GetPlacedItemName().GetForCurrentLanguage();
|
||||
std::string placedItemName = location->GetPlacedItemName().GetForCurrentLanguage(MF_RAW);
|
||||
|
||||
// If it's a simple item (not an ice trap, doesn't have a price)
|
||||
// just add the name of the item and move on
|
||||
|
@ -278,7 +278,7 @@ static void WriteAllLocations() {
|
|||
|
||||
if (location->GetPlacedRandomizerGet() == RG_ICE_TRAP) {
|
||||
jsonData["locations"][Rando::StaticData::GetLocation(location->GetRandomizerCheck())->GetName()]["model"] =
|
||||
Rando::StaticData::RetrieveItem(ctx->overrides[location->GetRandomizerCheck()].LooksLike()).GetName().GetForCurrentLanguage();
|
||||
Rando::StaticData::RetrieveItem(ctx->overrides[location->GetRandomizerCheck()].LooksLike()).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
switch (gSaveContext.language) {
|
||||
case 0:
|
||||
default:
|
||||
|
|
|
@ -542,8 +542,8 @@ void PlandomizerSaveSpoilerLog() {
|
|||
for (auto& import : plandoLogData) {
|
||||
if (import.checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
||||
spoilerSave["locations"][import.checkName] = {
|
||||
{ "item", import.checkRewardItem.GetName().GetForCurrentLanguage() },
|
||||
{ "model", import.iceTrapModel.GetName().GetForCurrentLanguage() },
|
||||
{ "item", import.checkRewardItem.GetName().GetForCurrentLanguage(MF_RAW) },
|
||||
{ "model", import.iceTrapModel.GetName().GetForCurrentLanguage(MF_RAW) },
|
||||
{ "trickName", import.iceTrapName.c_str() }
|
||||
};
|
||||
if (import.shopPrice > -1) {
|
||||
|
@ -551,11 +551,11 @@ void PlandomizerSaveSpoilerLog() {
|
|||
}
|
||||
} else if (import.shopPrice > -1) {
|
||||
spoilerSave["locations"][import.checkName] = {
|
||||
{ "item", import.checkRewardItem.GetName().GetForCurrentLanguage() },
|
||||
{ "item", import.checkRewardItem.GetName().GetForCurrentLanguage(MF_RAW) },
|
||||
{ "price", import.shopPrice }
|
||||
};
|
||||
} else {
|
||||
spoilerSave["locations"][import.checkName] = import.checkRewardItem.GetName().GetForCurrentLanguage();
|
||||
spoilerSave["locations"][import.checkName] = import.checkRewardItem.GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -669,7 +669,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject ) {
|
|||
ImGui::SetCursorScreenPos(textPos);
|
||||
ImGui::Text("+");
|
||||
}
|
||||
std::string parenthesesNum = extractNumberInParentheses(drawObject.first.GetName().GetEnglish().c_str());
|
||||
std::string parenthesesNum = extractNumberInParentheses(drawObject.first.GetName().GetEnglish(MF_RAW).c_str());
|
||||
if (parenthesesNum != "" && parenthesesNum != "WINNER" && parenthesesNum != "LOSER") {
|
||||
textPos = ImVec2(imageMin.x + 2, imageMin.y + 2);
|
||||
|
||||
|
@ -715,7 +715,7 @@ void PlandomizerDrawItemPopup(uint32_t index) {
|
|||
ImGui::PushID(item);
|
||||
ImGui::TableNextColumn();
|
||||
PlandomizerItemImageCorrection(plandomizerRandoRetrieveItem(item));
|
||||
auto name = plandomizerRandoRetrieveItem(item).GetName().GetForCurrentLanguage();
|
||||
auto name = plandomizerRandoRetrieveItem(item).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
|
||||
auto ret = ImGui::ImageButton(name.c_str(), textureID, imageSize, textureUV0, textureUV1, ImVec4(0, 0, 0, 0), itemColor);
|
||||
ImGui::PopStyleVar();
|
||||
|
@ -744,7 +744,7 @@ void PlandomizerDrawItemPopup(uint32_t index) {
|
|||
ImGui::PushID(itemIndex);
|
||||
auto itemToDraw = drawSlots.first;
|
||||
PlandomizerItemImageCorrection(drawSlots.first);
|
||||
auto name = drawSlots.first.GetName().GetForCurrentLanguage();
|
||||
auto name = drawSlots.first.GetName().GetForCurrentLanguage(MF_RAW);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
|
||||
auto ret = ImGui::ImageButton(name.c_str(), textureID, imageSize, textureUV0, textureUV1, ImVec4(0, 0, 0, 0), itemColor);
|
||||
ImGui::PopStyleVar();
|
||||
|
@ -792,7 +792,7 @@ void PlandomizerDrawIceTrapPopUp(uint32_t index) {
|
|||
}
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushID(items.first);
|
||||
auto name = Rando::StaticData::RetrieveItem(items.first).GetName().GetForCurrentLanguage();
|
||||
auto name = Rando::StaticData::RetrieveItem(items.first).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
PlandomizerItemImageCorrection(Rando::StaticData::RetrieveItem(items.first));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
|
||||
auto ret = ImGui::ImageButton(name.c_str(), textureID, imageSize, textureUV0, textureUV1, ImVec4(0, 0, 0, 0), itemColor);
|
||||
|
@ -818,7 +818,7 @@ void PlandomizerDrawItemSlots(uint32_t index) {
|
|||
ImGui::PushID(index);
|
||||
PlandoPushImageButtonStyle();
|
||||
PlandomizerItemImageCorrection(plandoLogData[index].checkRewardItem);
|
||||
auto name = plandoLogData[index].checkRewardItem.GetName().GetForCurrentLanguage();
|
||||
auto name = plandoLogData[index].checkRewardItem.GetName().GetForCurrentLanguage(MF_RAW);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
|
||||
auto ret = ImGui::ImageButton(name.c_str(), textureID, imageSize, textureUV0, textureUV1, ImVec4(0, 0, 0, 0), itemColor);
|
||||
ImGui::PopStyleVar();
|
||||
|
@ -854,7 +854,7 @@ void PlandomizerDrawIceTrapSetup(uint32_t index) {
|
|||
ImGui::TableNextColumn();
|
||||
PlandomizerItemImageCorrection(plandoLogData[index].iceTrapModel);
|
||||
PlandoPushImageButtonStyle();
|
||||
auto name = plandoLogData[index].iceTrapModel.GetName().GetForCurrentLanguage();
|
||||
auto name = plandoLogData[index].iceTrapModel.GetName().GetForCurrentLanguage(MF_RAW);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
|
||||
auto ret = ImGui::ImageButton(name.c_str(), textureID, imageSize, textureUV0, textureUV1, ImVec4(0, 0, 0, 0), itemColor);
|
||||
ImGui::PopStyleVar();
|
||||
|
@ -1090,7 +1090,7 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
|||
ImGui::TableNextColumn();
|
||||
ImGui::TextWrapped(spoilerData.checkName.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextWrapped(spoilerData.checkRewardItem.GetName().GetForCurrentLanguage().c_str());
|
||||
ImGui::TextWrapped(spoilerData.checkRewardItem.GetName().GetForCurrentLanguage(MF_RAW).c_str());
|
||||
ImGui::TableNextColumn();
|
||||
PlandomizerDrawItemSlots(index);
|
||||
if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
||||
|
|
|
@ -120,7 +120,7 @@ ItemOverride& Context::GetItemOverride(size_t locKey) {
|
|||
void Context::PlaceItemInLocation(const RandomizerCheck locKey, const RandomizerGet item, const bool applyEffectImmediately,
|
||||
const bool setHidden) {
|
||||
const auto loc = GetItemLocation(locKey);
|
||||
SPDLOG_DEBUG(StaticData::RetrieveItem(item).GetName().GetEnglish() + " placed at " + StaticData::GetLocation(locKey)->GetName() + "\n");
|
||||
SPDLOG_DEBUG(StaticData::RetrieveItem(item).GetName().GetForCurrentLanguage(MF_RAW) + " placed at " + StaticData::GetLocation(locKey)->GetName() + "\n");
|
||||
|
||||
if (applyEffectImmediately || mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_GLITCHLESS) || mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_VANILLA)) {
|
||||
StaticData::RetrieveItem(item).ApplyEffect();
|
||||
|
@ -294,7 +294,7 @@ void Context::CreateItemOverrides() {
|
|||
}
|
||||
SPDLOG_DEBUG(loc->GetName());
|
||||
SPDLOG_DEBUG(": ");
|
||||
SPDLOG_DEBUG(itemLoc->GetPlacedItemName().GetForCurrentLanguage());
|
||||
SPDLOG_DEBUG(itemLoc->GetPlacedItemName().GetForCurrentLanguage(MF_RAW));
|
||||
SPDLOG_DEBUG("\n");
|
||||
}
|
||||
SPDLOG_DEBUG("Overrides Created: ");
|
||||
|
|
|
@ -411,11 +411,11 @@ oJson Hint::toJSON() {
|
|||
if (!(StaticData::staticHintInfoMap.contains(ownKey) &&
|
||||
StaticData::staticHintInfoMap[ownKey].targetItems.size() > 0)){
|
||||
if (items.size() == 1){
|
||||
log["item"] = StaticData::GetItemTable()[items[0]].GetName().GetForCurrentLanguage();
|
||||
log["item"] = StaticData::GetItemTable()[items[0]].GetName().GetForCurrentLanguage(MF_RAW);
|
||||
} else if (items.size() > 1){
|
||||
std::vector<std::string> itemStrings = {};
|
||||
for (size_t c = 0; c < items.size(); c++){
|
||||
itemStrings.push_back(StaticData::GetItemTable()[items[c]].GetName().GetForCurrentLanguage());
|
||||
itemStrings.push_back(StaticData::GetItemTable()[items[c]].GetName().GetForCurrentLanguage(MF_RAW));
|
||||
}
|
||||
log["items"] = itemStrings;
|
||||
}
|
||||
|
|
|
@ -1000,7 +1000,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
|
|||
} else if (item00->itemEntry.modIndex == MOD_RANDOMIZER) {
|
||||
Notification::Emit({
|
||||
.message = "You found ",//RANDOTODO change based on language
|
||||
.suffix = Rando::StaticData::RetrieveItem((RandomizerGet)item00->itemEntry.getItemId).GetName().GetForCurrentLanguage(),
|
||||
.suffix = Rando::StaticData::RetrieveItem((RandomizerGet)item00->itemEntry.getItemId).GetName().GetForCurrentLanguage(MF_RAW),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -409,9 +409,9 @@ void Rando::StaticData::InitItemTable() {
|
|||
if (itemNameToEnum.contains(string) && string != ""){
|
||||
if (itemNameToEnum[string] != item.GetRandomizerGet()){
|
||||
SPDLOG_DEBUG("\tREPEATED STRING WITH " + string + "\n\n");
|
||||
} else {
|
||||
itemNameToEnum[string] = item.GetRandomizerGet();
|
||||
}
|
||||
} else {
|
||||
itemNameToEnum[string] = item.GetRandomizerGet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1111,11 +1111,11 @@ bool ShouldShowCheck(RandomizerCheck check) {
|
|||
RandomizerCheckObjects::GetRCAreaName(Rando::StaticData::GetLocation(check)->GetArea()));
|
||||
if (itemLoc->HasObtained() || itemLoc->GetCheckStatus() == RCSHOW_SCUMMED ||
|
||||
(!mystery && (itemLoc->GetCheckStatus() == RCSHOW_IDENTIFIED || itemLoc->GetCheckStatus() == RCSHOW_SEEN) && itemLoc->GetPlacedRandomizerGet() != RG_ICE_TRAP)) {
|
||||
search += " " + itemLoc->GetPlacedItemName().GetForCurrentLanguage();
|
||||
search += " " + itemLoc->GetPlacedItemName().GetForCurrentLanguage(MF_RAW);
|
||||
} else if (itemLoc->GetCheckStatus() == RCSHOW_IDENTIFIED && !mystery) {
|
||||
search += OTRGlobals::Instance->gRandoContext->overrides[check].GetTrickName().GetForLanguage(gSaveContext.language);
|
||||
} else if (itemLoc->GetCheckStatus() == RCSHOW_SEEN && !mystery) {
|
||||
search += Rando::StaticData::RetrieveItem(OTRGlobals::Instance->gRandoContext->overrides[check].LooksLike()).GetName().GetForCurrentLanguage();
|
||||
search += Rando::StaticData::RetrieveItem(OTRGlobals::Instance->gRandoContext->overrides[check].LooksLike()).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
return (
|
||||
IsVisibleInCheckTracker(check) &&
|
||||
|
@ -1607,10 +1607,10 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
case RCSHOW_COLLECTED:
|
||||
case RCSHOW_SCUMMED:
|
||||
if (IS_RANDO) {
|
||||
txt = itemLoc->GetPlacedItem().GetName().GetForCurrentLanguage();
|
||||
txt = itemLoc->GetPlacedItem().GetName().GetForCurrentLanguage(MF_RAW);
|
||||
} else {
|
||||
if (IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID())) {
|
||||
txt = Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetName().GetForCurrentLanguage();
|
||||
txt = Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1621,10 +1621,10 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
if (status == RCSHOW_IDENTIFIED) {
|
||||
txt = OTRGlobals::Instance->gRandoContext->overrides[rc].GetTrickName().GetForLanguage(gSaveContext.language);
|
||||
} else {
|
||||
txt = Rando::StaticData::RetrieveItem(OTRGlobals::Instance->gRandoContext->overrides[rc].LooksLike()).GetName().GetForCurrentLanguage();
|
||||
txt = Rando::StaticData::RetrieveItem(OTRGlobals::Instance->gRandoContext->overrides[rc].LooksLike()).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
} else if (!mystery && !itemLoc->IsAddedToPool()) {
|
||||
txt = itemLoc->GetPlacedItem().GetName().GetForCurrentLanguage();
|
||||
txt = itemLoc->GetPlacedItem().GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
if (IsVisibleInCheckTracker(rc) && status == RCSHOW_IDENTIFIED && !mystery && !itemLoc->IsAddedToPool()) {
|
||||
auto price = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->GetPrice();
|
||||
|
@ -1634,7 +1634,7 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
}
|
||||
} else {
|
||||
if (IsHeartPiece((GetItemID)Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetItemID())) {
|
||||
txt = Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetName().GetForCurrentLanguage();
|
||||
txt = Rando::StaticData::RetrieveItem(loc->GetVanillaItem()).GetName().GetForCurrentLanguage(MF_RAW);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -541,7 +541,7 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool f
|
|||
|
||||
std::vector<RandomizerGet> items = hint->GetHintedItems();
|
||||
SaveManager::Instance->SaveArray("items", items.size(), [&](size_t i) {
|
||||
SaveManager::Instance->SaveData("", Rando::StaticData::GetItemTable()[items[i]].GetName().GetEnglish());
|
||||
SaveManager::Instance->SaveData("", Rando::StaticData::GetItemTable()[items[i]].GetName().GetEnglish(MF_RAW));
|
||||
});
|
||||
|
||||
std::vector<uint8_t> itemNamesChosen = hint->GetItemNamesChosen();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue