mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-12 06:28:09 -05:00
Rand(), option to disable, attempted fix special chars
This commit is contained in:
parent
3a438d9d5a
commit
a2243634cd
@ -1912,6 +1912,10 @@ namespace SohImGui {
|
|||||||
"(medallions/stones/songs). Note that these fanfares\n"
|
"(medallions/stones/songs). Note that these fanfares\n"
|
||||||
"are longer than usual."
|
"are longer than usual."
|
||||||
);
|
);
|
||||||
|
PaddedEnhancementCheckbox("Disable Random Rupee Names", "gRandoDisableRandomRupeeNames", true, false);
|
||||||
|
Tooltip(
|
||||||
|
"Disables the random rupee names in the textbox when obtaining rupees."
|
||||||
|
);
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1455,23 +1455,27 @@ extern "C" std::string Randomizer_InsertRupeeName(std::string message, int langu
|
|||||||
"Coins", "Rings", "Gil", "Pokédollars", "Bells", "Orbs", "Bottle Caps", "Simoleons", "Pokémon", "Toys",
|
"Coins", "Rings", "Gil", "Pokédollars", "Bells", "Orbs", "Bottle Caps", "Simoleons", "Pokémon", "Toys",
|
||||||
"Smackaroos", "Zorkmids", "Zenny", "Bones"
|
"Smackaroos", "Zorkmids", "Zenny", "Bones"
|
||||||
};
|
};
|
||||||
const char* germanRupeeNames[1] = { "Rubine" };
|
const char* germanRupeeNames[1] = {
|
||||||
const char* frenchRupeeNames[36] = { "Rubis", "Bitcoin", "Bananes", "Euros", "Dollars", "Émeraudes", "Joyaux",
|
"Rubine"
|
||||||
|
};
|
||||||
|
const char* frenchRupeeNames[36] = {
|
||||||
|
"Rubis", "Bitcoin", "Bananes", "Euros", "Dollars", "Émeraudes", "Joyaux",
|
||||||
"Diamants", "Balles", "Pokémon", "Pièces", "Lunes", "Étoiles", "Dogecoin", "Anneaux", "Radis", "Pokédollars",
|
"Diamants", "Balles", "Pokémon", "Pièces", "Lunes", "Étoiles", "Dogecoin", "Anneaux", "Radis", "Pokédollars",
|
||||||
"Zennies", "Pépètes", "Mailles", "Éthers", "Clochettes", "Capsules", "Gils", "Champignons", "Blés", "Halos",
|
"Zennies", "Pépètes", "Mailles", "Éthers", "Clochettes", "Capsules", "Gils", "Champignons", "Blés", "Halos",
|
||||||
"Munnies", "Orens", "Florens", "Crédits", "Galds", "Bling", "Orbes", "Baguettes", "Croissants" };
|
"Munnies", "Orens", "Florens", "Crédits", "Galds", "Bling", "Orbes", "Baguettes", "Croissants"
|
||||||
|
};
|
||||||
int randomIndex;
|
int randomIndex;
|
||||||
switch (language) {
|
switch (language) {
|
||||||
case LANGUAGE_ENG:
|
case LANGUAGE_ENG:
|
||||||
randomIndex = gSaveContext.naviTimer % (sizeof(englishRupeeNames) / sizeof(englishRupeeNames[0]));
|
randomIndex = rand() % (sizeof(englishRupeeNames) / sizeof(englishRupeeNames[0]));
|
||||||
replaceWith = englishRupeeNames[randomIndex];
|
replaceWith = englishRupeeNames[randomIndex];
|
||||||
break;
|
break;
|
||||||
case LANGUAGE_GER:
|
case LANGUAGE_GER:
|
||||||
randomIndex = gSaveContext.naviTimer % (sizeof(germanRupeeNames) / sizeof(germanRupeeNames[0]));
|
randomIndex = rand() % (sizeof(germanRupeeNames) / sizeof(germanRupeeNames[0]));
|
||||||
replaceWith = germanRupeeNames[randomIndex];
|
replaceWith = germanRupeeNames[randomIndex];
|
||||||
break;
|
break;
|
||||||
case LANGUAGE_FRA:
|
case LANGUAGE_FRA:
|
||||||
randomIndex = gSaveContext.naviTimer % (sizeof(frenchRupeeNames) / sizeof(frenchRupeeNames[0]));
|
randomIndex = rand() % (sizeof(frenchRupeeNames) / sizeof(frenchRupeeNames[0]));
|
||||||
replaceWith = frenchRupeeNames[randomIndex];
|
replaceWith = frenchRupeeNames[randomIndex];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1479,6 +1483,7 @@ extern "C" std::string Randomizer_InsertRupeeName(std::string message, int langu
|
|||||||
size_t pos = message.find(replaceString);
|
size_t pos = message.find(replaceString);
|
||||||
size_t len = replaceString.length();
|
size_t len = replaceString.length();
|
||||||
message.replace(pos, len, replaceWith);
|
message.replace(pos, len, replaceWith);
|
||||||
|
CustomMessageManager::Instance->FormatCustomMessage(message);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1583,8 +1588,9 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) {
|
|||||||
}
|
}
|
||||||
} else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) {
|
} else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) {
|
||||||
messageEntry = Randomizer_GetScrubMessage(textId);
|
messageEntry = Randomizer_GetScrubMessage(textId);
|
||||||
} else if (textId == TEXT_BLUE_RUPEE || textId == TEXT_RED_RUPEE || textId == TEXT_PURPLE_RUPEE ||
|
} else if (!CVar_GetS32("gRandoDisableRandomRupeeNames", 0) &&
|
||||||
textId == TEXT_HUGE_RUPEE) {
|
(textId == TEXT_BLUE_RUPEE || textId == TEXT_RED_RUPEE || textId == TEXT_PURPLE_RUPEE ||
|
||||||
|
textId == TEXT_HUGE_RUPEE)) {
|
||||||
messageEntry = Randomizer_GetRupeeMessage(textId);
|
messageEntry = Randomizer_GetRupeeMessage(textId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user