mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 19:32:17 -05:00
Does some cleanup of unecessary code and cases of no string provided.
This commit is contained in:
parent
4eaf70b859
commit
f57a912ca1
@ -60,8 +60,6 @@ void CustomMessage::CreateGetItemMessage(GetItemID giid, ItemID iid, std::string
|
||||
ReplaceColors(formattedMessage);
|
||||
formattedMessage += MESSAGE_END();
|
||||
this->getItemMessageTable[i].emplace(giid, formattedMessage);
|
||||
} else {
|
||||
this->getItemMessageTable[i].emplace(giid, MESSAGE_END());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,15 +68,7 @@ std::string CustomMessage::RetrieveGetItemMessage(GetItemID giid) {
|
||||
std::unordered_map<GetItemID, std::string>::const_iterator result =
|
||||
getItemMessageTable[gSaveContext.language].find(giid);
|
||||
if (result == getItemMessageTable[gSaveContext.language].end()) {
|
||||
switch (gSaveContext.language) {
|
||||
case LANGUAGE_FRA:
|
||||
return "Il n'y a pas de message personnalisé pour cet élément.";
|
||||
case LANGUAGE_GER:
|
||||
return "Für diesen Artikel gibt es keine benutzerdefinierte Nachricht.";
|
||||
case LANGUAGE_ENG:
|
||||
default:
|
||||
return "There is no custom message for this item.";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
return result->second;
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
#include "randomizer.h"
|
||||
#include "soh/Enhancements/custom_message/CustomMessage.h"
|
||||
|
||||
using namespace std::literals::string_literals;
|
||||
|
||||
#define MESSAGES(eng, ger, fra) (new std::string[]{eng, ger, fra})
|
||||
|
||||
void Randomizer::CreateCustomMessages() {
|
||||
|
@ -1507,5 +1507,8 @@ extern "C" s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck
|
||||
|
||||
extern "C" int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) {
|
||||
const std::string& getItemText = OTRGlobals::Instance->gRandomizer->GetCustomGetItemMessage(giid);
|
||||
if (getItemText == "") {
|
||||
return false;
|
||||
}
|
||||
return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user