mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-23 09:52:20 -05:00
Renames CustomMessage to CustomMessageManager
This commit is contained in:
parent
4c9e4b2d84
commit
822476373b
@ -179,7 +179,7 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="soh\Enhancements\custom_message\CustomMessage.cpp" />
|
<ClCompile Include="soh\Enhancements\custom_message\CustomMessageManager.cpp" />
|
||||||
<ClCompile Include="soh\Enhancements\cosmetics\CosmeticsEditor.cpp" />
|
<ClCompile Include="soh\Enhancements\cosmetics\CosmeticsEditor.cpp" />
|
||||||
<ClCompile Include="soh\Enhancements\debugger\actorViewer.cpp" />
|
<ClCompile Include="soh\Enhancements\debugger\actorViewer.cpp" />
|
||||||
<ClCompile Include="soh\Enhancements\gfx.c" />
|
<ClCompile Include="soh\Enhancements\gfx.c" />
|
||||||
@ -944,7 +944,7 @@
|
|||||||
<ClCompile Include="src\overlays\misc\ovl_map_mark_data\z_map_mark_data.c" />
|
<ClCompile Include="src\overlays\misc\ovl_map_mark_data\z_map_mark_data.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="soh\Enhancements\custom_message\CustomMessage.h" />
|
<ClInclude Include="soh\Enhancements\custom_message\CustomMessageManager.h" />
|
||||||
<ClInclude Include="soh\Enhancements\cosmetics\CosmeticsEditor.h" />
|
<ClInclude Include="soh\Enhancements\cosmetics\CosmeticsEditor.h" />
|
||||||
<ClInclude Include="soh\Enhancements\debugger\actorViewer.h" />
|
<ClInclude Include="soh\Enhancements\debugger\actorViewer.h" />
|
||||||
<ClCompile Include="soh\Enhancements\randomizer\randomizer.h" />
|
<ClCompile Include="soh\Enhancements\randomizer\randomizer.h" />
|
||||||
|
@ -2379,7 +2379,7 @@
|
|||||||
<ClCompile Include="soh\Enhancements\randomizer\randomizer_item_tracker.cpp">
|
<ClCompile Include="soh\Enhancements\randomizer\randomizer_item_tracker.cpp">
|
||||||
<Filter>Source Files\src</Filter>
|
<Filter>Source Files\src</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="soh\Enhancements\custom_message\CustomMessage.cpp">
|
<ClCompile Include="soh\Enhancements\custom_message\CustomMessageManager.cpp">
|
||||||
<Filter>Source Files\soh\Enhancements\custom-message</Filter>
|
<Filter>Source Files\soh\Enhancements\custom-message</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -4070,7 +4070,7 @@
|
|||||||
<ClInclude Include="soh\Enhancements\randomizer\randomizer_item_tracker.h">
|
<ClInclude Include="soh\Enhancements\randomizer\randomizer_item_tracker.h">
|
||||||
<Filter>Source Files\src</Filter>
|
<Filter>Source Files\src</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="soh\Enhancements\custom_message\CustomMessage.h">
|
<ClInclude Include="soh\Enhancements\custom_message\CustomMessageManager.h">
|
||||||
<Filter>Header Files\soh\Enhancements\custom-message</Filter>
|
<Filter>Header Files\soh\Enhancements\custom-message</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "CustomMessage.h"
|
#include "CustomMessageManager.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace std::literals::string_literals;
|
using namespace std::literals::string_literals;
|
||||||
|
|
||||||
CustomMessage::CustomMessage() {
|
CustomMessageManager::CustomMessageManager() {
|
||||||
this->textBoxSpecialCharacters = { { "À", 0x80 }, { "î", 0x81 }, { "Â", 0x82 }, { "Ä", 0x83 }, { "Ç", 0x84 },
|
this->textBoxSpecialCharacters = { { "À", 0x80 }, { "î", 0x81 }, { "Â", 0x82 }, { "Ä", 0x83 }, { "Ç", 0x84 },
|
||||||
{ "È", 0x85 }, { "É", 0x86 }, { "Ê", 0x87 }, { "Ë", 0x88 }, { "Ï", 0x89 },
|
{ "È", 0x85 }, { "É", 0x86 }, { "Ê", 0x87 }, { "Ë", 0x88 }, { "Ï", 0x89 },
|
||||||
{ "Ô", 0x8A }, { "Ö", 0x8B }, { "Ù", 0x8C }, { "Û", 0x8D }, { "Ü", 0x8E },
|
{ "Ô", 0x8A }, { "Ö", 0x8B }, { "Ù", 0x8C }, { "Û", 0x8D }, { "Ü", 0x8E },
|
||||||
@ -15,13 +15,13 @@ CustomMessage::CustomMessage() {
|
|||||||
{ "c", QM_LBLUE }, { "p", QM_PINK }, { "y", QM_YELLOW }, { "B", QM_BLACK } };
|
{ "c", QM_LBLUE }, { "p", QM_PINK }, { "y", QM_YELLOW }, { "B", QM_BLACK } };
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMessage::~CustomMessage() {
|
CustomMessageManager::~CustomMessageManager() {
|
||||||
this->textBoxSpecialCharacters.clear();
|
this->textBoxSpecialCharacters.clear();
|
||||||
this->colors.clear();
|
this->colors.clear();
|
||||||
this->messageTables.clear();
|
this->messageTables.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMessage::ReplaceSpecialCharacters(std::string& string) {
|
void CustomMessageManager::ReplaceSpecialCharacters(std::string& string) {
|
||||||
// add special characters
|
// add special characters
|
||||||
for (auto specialCharacterPair : this->textBoxSpecialCharacters) {
|
for (auto specialCharacterPair : this->textBoxSpecialCharacters) {
|
||||||
size_t start_pos = 0;
|
size_t start_pos = 0;
|
||||||
@ -34,7 +34,7 @@ void CustomMessage::ReplaceSpecialCharacters(std::string& string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMessage::ReplaceColors(std::string& string) {
|
void CustomMessageManager::ReplaceColors(std::string& string) {
|
||||||
for (auto colorPair : colors) {
|
for (auto colorPair : colors) {
|
||||||
std::string textToReplace = "%";
|
std::string textToReplace = "%";
|
||||||
textToReplace += colorPair.first;
|
textToReplace += colorPair.first;
|
||||||
@ -46,7 +46,7 @@ void CustomMessage::ReplaceColors(std::string& string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMessage::FormatCustomMessage(std::string& message, ItemID iid) {
|
void CustomMessageManager::FormatCustomMessage(std::string& message, ItemID iid) {
|
||||||
message.insert(0, ITEM_OBTAINED(iid));
|
message.insert(0, ITEM_OBTAINED(iid));
|
||||||
size_t start_pos = 0;
|
size_t start_pos = 0;
|
||||||
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
||||||
@ -60,7 +60,7 @@ void CustomMessage::FormatCustomMessage(std::string& message, ItemID iid) {
|
|||||||
message += MESSAGE_END();
|
message += MESSAGE_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMessage::FormatCustomMessage(std::string& message) {
|
void CustomMessageManager::FormatCustomMessage(std::string& message) {
|
||||||
size_t start_pos = 0;
|
size_t start_pos = 0;
|
||||||
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
||||||
std::replace(message.begin(), message.end(), '^', WAIT_FOR_INPUT()[0]);
|
std::replace(message.begin(), message.end(), '^', WAIT_FOR_INPUT()[0]);
|
||||||
@ -70,7 +70,7 @@ void CustomMessage::FormatCustomMessage(std::string& message) {
|
|||||||
message += MESSAGE_END();
|
message += MESSAGE_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomMessage::InsertCustomMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages) {
|
bool CustomMessageManager::InsertCustomMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages) {
|
||||||
auto result = messageTables.find(tableID);
|
auto result = messageTables.find(tableID);
|
||||||
if (result == messageTables.end()) {
|
if (result == messageTables.end()) {
|
||||||
return false;
|
return false;
|
||||||
@ -82,7 +82,7 @@ bool CustomMessage::InsertCustomMessage(std::string tableID, uint16_t textID, Cu
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CustomMessage::CreateGetItemMessage(std::string tableID, GetItemID giid, ItemID iid, CustomMessageEntry messages) {
|
bool CustomMessageManager::CreateGetItemMessage(std::string tableID, GetItemID giid, ItemID iid, CustomMessageEntry messages) {
|
||||||
FormatCustomMessage(messages.english, iid);
|
FormatCustomMessage(messages.english, iid);
|
||||||
FormatCustomMessage(messages.german, iid);
|
FormatCustomMessage(messages.german, iid);
|
||||||
FormatCustomMessage(messages.french, iid);
|
FormatCustomMessage(messages.french, iid);
|
||||||
@ -90,14 +90,14 @@ bool CustomMessage::CreateGetItemMessage(std::string tableID, GetItemID giid, It
|
|||||||
return InsertCustomMessage(tableID, textID, messages);
|
return InsertCustomMessage(tableID, textID, messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomMessage::CreateMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages) {
|
bool CustomMessageManager::CreateMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages) {
|
||||||
FormatCustomMessage(messages.english);
|
FormatCustomMessage(messages.english);
|
||||||
FormatCustomMessage(messages.german);
|
FormatCustomMessage(messages.german);
|
||||||
FormatCustomMessage(messages.french);
|
FormatCustomMessage(messages.french);
|
||||||
return InsertCustomMessage(tableID, textID, messages);
|
return InsertCustomMessage(tableID, textID, messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMessageEntry CustomMessage::RetrieveMessage(std::string tableID, uint16_t textID) {
|
CustomMessageEntry CustomMessageManager::RetrieveMessage(std::string tableID, uint16_t textID) {
|
||||||
std::unordered_map<std::string, CustomMessageTable>::const_iterator result = messageTables.find(tableID);
|
std::unordered_map<std::string, CustomMessageTable>::const_iterator result = messageTables.find(tableID);
|
||||||
if (result == messageTables.end()) {
|
if (result == messageTables.end()) {
|
||||||
return NULL_CUSTOM_MESSAGE;
|
return NULL_CUSTOM_MESSAGE;
|
||||||
@ -111,7 +111,7 @@ CustomMessageEntry CustomMessage::RetrieveMessage(std::string tableID, uint16_t
|
|||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomMessage::ClearMessageTable(std::string tableID) {
|
bool CustomMessageManager::ClearMessageTable(std::string tableID) {
|
||||||
auto result = messageTables.find(tableID);
|
auto result = messageTables.find(tableID);
|
||||||
if (result == messageTables.end()) {
|
if (result == messageTables.end()) {
|
||||||
return false;
|
return false;
|
||||||
@ -120,31 +120,31 @@ bool CustomMessage::ClearMessageTable(std::string tableID) {
|
|||||||
messageTable.clear();
|
messageTable.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomMessage::AddCustomMessageTable(std::string tableID) {
|
bool CustomMessageManager::AddCustomMessageTable(std::string tableID) {
|
||||||
CustomMessageTable newMessageTable;
|
CustomMessageTable newMessageTable;
|
||||||
return messageTables.emplace(tableID, newMessageTable).second;
|
return messageTables.emplace(tableID, newMessageTable).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::MESSAGE_END() {
|
std::string CustomMessageManager::MESSAGE_END() {
|
||||||
return "\x02"s;
|
return "\x02"s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::ITEM_OBTAINED(uint8_t x) {
|
std::string CustomMessageManager::ITEM_OBTAINED(uint8_t x) {
|
||||||
return "\x13"s + char(x);
|
return "\x13"s + char(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::NEWLINE() {
|
std::string CustomMessageManager::NEWLINE() {
|
||||||
return "\x01"s;
|
return "\x01"s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::COLOR(uint8_t x) {
|
std::string CustomMessageManager::COLOR(uint8_t x) {
|
||||||
return "\x05"s + char(x);
|
return "\x05"s + char(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::WAIT_FOR_INPUT() {
|
std::string CustomMessageManager::WAIT_FOR_INPUT() {
|
||||||
return "\x04"s;
|
return "\x04"s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CustomMessage::PLAYER_NAME() {
|
std::string CustomMessageManager::PLAYER_NAME() {
|
||||||
return "\x0F"s;
|
return "\x0F"s;
|
||||||
}
|
}
|
@ -36,7 +36,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef std::unordered_map<uint16_t, CustomMessageEntry> CustomMessageTable;
|
typedef std::unordered_map<uint16_t, CustomMessageEntry> CustomMessageTable;
|
||||||
|
|
||||||
class CustomMessage {
|
class CustomMessageManager {
|
||||||
private:
|
private:
|
||||||
std::unordered_map<std::string, char> textBoxSpecialCharacters;
|
std::unordered_map<std::string, char> textBoxSpecialCharacters;
|
||||||
std::unordered_map<std::string, char> colors;
|
std::unordered_map<std::string, char> colors;
|
||||||
@ -56,10 +56,10 @@ class CustomMessage {
|
|||||||
std::string PLAYER_NAME();
|
std::string PLAYER_NAME();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CustomMessage* Instance;
|
static CustomMessageManager* Instance;
|
||||||
|
|
||||||
CustomMessage();
|
CustomMessageManager();
|
||||||
~CustomMessage();
|
~CustomMessageManager();
|
||||||
|
|
||||||
bool CreateGetItemMessage(std::string tableID, GetItemID giid, ItemID iid, CustomMessageEntry messages);
|
bool CreateGetItemMessage(std::string tableID, GetItemID giid, ItemID iid, CustomMessageEntry messages);
|
||||||
bool CreateMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages);
|
bool CreateMessage(std::string tableID, uint16_t textID, CustomMessageEntry messages);
|
@ -14,7 +14,7 @@
|
|||||||
#include "3drando/rando_main.hpp"
|
#include "3drando/rando_main.hpp"
|
||||||
#include <soh/Enhancements/debugger/ImGuiHelpers.h>
|
#include <soh/Enhancements/debugger/ImGuiHelpers.h>
|
||||||
#include "Lib/ImGui/imgui_internal.h"
|
#include "Lib/ImGui/imgui_internal.h"
|
||||||
#include <soh/Enhancements/custom_message/CustomMessage.h>
|
#include <soh/Enhancements/custom_message/CustomMessageManager.h>
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
using namespace std::literals::string_literals;
|
using namespace std::literals::string_literals;
|
||||||
@ -1483,22 +1483,22 @@ void Randomizer::LoadHintLocations(const char* spoilerFileName) {
|
|||||||
ParseHintLocationsFile(spoilerFileName);
|
ParseHintLocationsFile(spoilerFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMessage::Instance->ClearMessageTable(Randomizer::hintMessageTableID);
|
CustomMessageManager::Instance->ClearMessageTable(Randomizer::hintMessageTableID);
|
||||||
CustomMessage::Instance->AddCustomMessageTable(Randomizer::hintMessageTableID);
|
CustomMessageManager::Instance->AddCustomMessageTable(Randomizer::hintMessageTableID);
|
||||||
|
|
||||||
CustomMessage::Instance->CreateMessage(
|
CustomMessageManager::Instance->CreateMessage(
|
||||||
Randomizer::hintMessageTableID, 0x7040,
|
Randomizer::hintMessageTableID, 0x7040,
|
||||||
{ TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, gSaveContext.childAltarText,
|
{ TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, gSaveContext.childAltarText,
|
||||||
gSaveContext.childAltarText, gSaveContext.childAltarText });
|
gSaveContext.childAltarText, gSaveContext.childAltarText });
|
||||||
CustomMessage::Instance->CreateMessage(
|
CustomMessageManager::Instance->CreateMessage(
|
||||||
Randomizer::hintMessageTableID, 0x7088,
|
Randomizer::hintMessageTableID, 0x7088,
|
||||||
{ TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, gSaveContext.adultAltarText,
|
{ TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, gSaveContext.adultAltarText,
|
||||||
gSaveContext.adultAltarText, gSaveContext.adultAltarText });
|
gSaveContext.adultAltarText, gSaveContext.adultAltarText });
|
||||||
CustomMessage::Instance->CreateMessage(
|
CustomMessageManager::Instance->CreateMessage(
|
||||||
Randomizer::hintMessageTableID, 0x70CC,
|
Randomizer::hintMessageTableID, 0x70CC,
|
||||||
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, gSaveContext.ganonHintText,
|
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, gSaveContext.ganonHintText,
|
||||||
gSaveContext.ganonHintText, gSaveContext.ganonHintText });
|
gSaveContext.ganonHintText, gSaveContext.ganonHintText });
|
||||||
CustomMessage::Instance->CreateMessage(
|
CustomMessageManager::Instance->CreateMessage(
|
||||||
Randomizer::hintMessageTableID, 0x70CD,
|
Randomizer::hintMessageTableID, 0x70CD,
|
||||||
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, gSaveContext.ganonText,
|
{ TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, gSaveContext.ganonText,
|
||||||
gSaveContext.ganonText, gSaveContext.ganonText });
|
gSaveContext.ganonText, gSaveContext.ganonText });
|
||||||
@ -1511,7 +1511,7 @@ void Randomizer::LoadHintLocations(const char* spoilerFileName) {
|
|||||||
for (auto hintLocation : gSaveContext.hintLocations) {
|
for (auto hintLocation : gSaveContext.hintLocations) {
|
||||||
if(hintLocation.check == RC_LINKS_POCKET) break;
|
if(hintLocation.check == RC_LINKS_POCKET) break;
|
||||||
this->hintLocations[hintLocation.check] = hintLocation.hintText;
|
this->hintLocations[hintLocation.check] = hintLocation.hintText;
|
||||||
CustomMessage::Instance->CreateMessage(
|
CustomMessageManager::Instance->CreateMessage(
|
||||||
Randomizer::hintMessageTableID, hintLocation.check, { TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, hintLocation.hintText, hintLocation.hintText, hintLocation.hintText });
|
Randomizer::hintMessageTableID, hintLocation.check, { TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM, hintLocation.hintText, hintLocation.hintText, hintLocation.hintText });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4750,7 +4750,7 @@ typedef struct {
|
|||||||
} GetItemMessage;
|
} GetItemMessage;
|
||||||
|
|
||||||
void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) {
|
void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) {
|
||||||
CustomMessage* customMessage = CustomMessage::Instance;
|
CustomMessageManager* customMessage = CustomMessageManager::Instance;
|
||||||
customMessage->AddCustomMessageTable(Randomizer::getItemMessageTableID);
|
customMessage->AddCustomMessageTable(Randomizer::getItemMessageTableID);
|
||||||
for (GetItemMessage messageEntry : messageEntries) {
|
for (GetItemMessage messageEntry : messageEntries) {
|
||||||
customMessage->CreateGetItemMessage(Randomizer::getItemMessageTableID, messageEntry.giid, messageEntry.iid,
|
customMessage->CreateGetItemMessage(Randomizer::getItemMessageTableID, messageEntry.giid, messageEntry.iid,
|
||||||
@ -4761,7 +4761,7 @@ void CreateGetItemMessages(std::vector<GetItemMessage> messageEntries) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateScrubMessages() {
|
void CreateScrubMessages() {
|
||||||
CustomMessage* customMessage = CustomMessage::Instance;
|
CustomMessageManager* customMessage = CustomMessageManager::Instance;
|
||||||
customMessage->AddCustomMessageTable(Randomizer::scrubMessageTableID);
|
customMessage->AddCustomMessageTable(Randomizer::scrubMessageTableID);
|
||||||
const std::vector<u8> prices = { 10, 40 };
|
const std::vector<u8> prices = { 10, 40 };
|
||||||
for (u8 price : prices) {
|
for (u8 price : prices) {
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include <Utils/StringHelper.h>
|
#include <Utils/StringHelper.h>
|
||||||
#include <soh/Enhancements/custom_message/CustomMessage.h>
|
#include <soh/Enhancements/custom_message/CustomMessageManager.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <SDL_scancode.h>
|
#include <SDL_scancode.h>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
OTRGlobals* OTRGlobals::Instance;
|
OTRGlobals* OTRGlobals::Instance;
|
||||||
SaveManager* SaveManager::Instance;
|
SaveManager* SaveManager::Instance;
|
||||||
CustomMessage* CustomMessage::Instance;
|
CustomMessageManager* CustomMessageManager::Instance;
|
||||||
|
|
||||||
OTRGlobals::OTRGlobals() {
|
OTRGlobals::OTRGlobals() {
|
||||||
context = Ship::GlobalCtx2::CreateInstance("Ship of Harkinian");
|
context = Ship::GlobalCtx2::CreateInstance("Ship of Harkinian");
|
||||||
@ -114,7 +114,7 @@ extern "C" void InitOTR() {
|
|||||||
#endif
|
#endif
|
||||||
OTRGlobals::Instance = new OTRGlobals();
|
OTRGlobals::Instance = new OTRGlobals();
|
||||||
SaveManager::Instance = new SaveManager();
|
SaveManager::Instance = new SaveManager();
|
||||||
CustomMessage::Instance = new CustomMessage();
|
CustomMessageManager::Instance = new CustomMessageManager();
|
||||||
auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version");
|
auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version");
|
||||||
|
|
||||||
if (!t->bHasLoadError)
|
if (!t->bHasLoadError)
|
||||||
@ -1420,7 +1420,7 @@ extern "C" CustomMessageEntry Randomizer_CopyScrubMessage(u16 scrubTextId) {
|
|||||||
price = 40;
|
price = 40;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return CustomMessage::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price);
|
return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBufferSize) {
|
extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBufferSize) {
|
||||||
@ -1496,22 +1496,22 @@ extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBuff
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CustomMessageEntry Randomizer_CopyAltarMessage() {
|
extern "C" CustomMessageEntry Randomizer_CopyAltarMessage() {
|
||||||
return (LINK_IS_ADULT) ? CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x7088)
|
return (LINK_IS_ADULT) ? CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x7088)
|
||||||
: CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x7040);
|
: CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x7040);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CustomMessageEntry Randomizer_CopyGanonText() {
|
extern "C" CustomMessageEntry Randomizer_CopyGanonText() {
|
||||||
return CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CD);
|
return CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CD);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CustomMessageEntry Randomizer_CopyGanonHintText() {
|
extern "C" CustomMessageEntry Randomizer_CopyGanonHintText() {
|
||||||
return CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CC);
|
return CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, 0x70CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CustomMessageEntry Randomizer_CopyHintFromCheck(RandomizerCheck check) {
|
extern "C" CustomMessageEntry Randomizer_CopyHintFromCheck(RandomizerCheck check) {
|
||||||
// we don't want to make a copy of the std::string returned from GetHintFromCheck
|
// we don't want to make a copy of the std::string returned from GetHintFromCheck
|
||||||
// so we're just going to let RVO take care of it
|
// so we're just going to let RVO take care of it
|
||||||
const CustomMessageEntry hintText = CustomMessage::Instance->RetrieveMessage(Randomizer::hintMessageTableID, check);
|
const CustomMessageEntry hintText = CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, check);
|
||||||
return hintText;
|
return hintText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1524,7 +1524,7 @@ extern "C" s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerChec
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CustomMessageEntry Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) {
|
extern "C" CustomMessageEntry Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) {
|
||||||
const CustomMessageEntry getItemText = CustomMessage::Instance->RetrieveMessage(Randomizer::getItemMessageTableID, giid);
|
const CustomMessageEntry getItemText = CustomMessageManager::Instance->RetrieveMessage(Randomizer::getItemMessageTableID, giid);
|
||||||
return getItemText;
|
return getItemText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1588,7 +1588,7 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) {
|
|||||||
} else {
|
} else {
|
||||||
textId = 0x00B5;
|
textId = 0x00B5;
|
||||||
}
|
}
|
||||||
messageEntry = CustomMessage::Instance->RetrieveMessage("BaseGameOverrides", textId);
|
messageEntry = CustomMessageManager::Instance->RetrieveMessage("BaseGameOverrides", textId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (messageEntry.textBoxType != -1) {
|
if (messageEntry.textBoxType != -1) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include <Text.h>
|
#include <Text.h>
|
||||||
#include <soh/Enhancements/custom_message/CustomMessage.h>
|
#include <soh/Enhancements/custom_message/CustomMessageManager.h>
|
||||||
|
|
||||||
extern "C" MessageTableEntry* sNesMessageEntryTablePtr;
|
extern "C" MessageTableEntry* sNesMessageEntryTablePtr;
|
||||||
extern "C" MessageTableEntry* sGerMessageEntryTablePtr;
|
extern "C" MessageTableEntry* sGerMessageEntryTablePtr;
|
||||||
@ -95,21 +95,21 @@ extern "C" void OTRMessage_Init()
|
|||||||
sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size();
|
sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMessage::Instance->AddCustomMessageTable(customMessageTableID);
|
CustomMessageManager::Instance->AddCustomMessageTable(customMessageTableID);
|
||||||
CustomMessage::Instance->CreateGetItemMessage(
|
CustomMessageManager::Instance->CreateGetItemMessage(
|
||||||
customMessageTableID, (GetItemID)0x00B4, ITEM_SKULL_TOKEN,
|
customMessageTableID, (GetItemID)0x00B4, ITEM_SKULL_TOKEN,
|
||||||
{
|
{
|
||||||
TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM,
|
TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM,
|
||||||
"You got a %rGold Skulltula Token%w!&You've collected %r\x19%w tokens&in total!\x0E\x3C",
|
"You got a %rGold Skulltula Token%w!&You've collected %r\x19%w tokens&in total!\x0E\x3C",
|
||||||
"Du erhälst ein %rGoldene&Skulltula-Symbol%w! Du hast&insgesamt %r\x19%w symbol gesammelt!\x0E\x3C",
|
"Du erhälst ein %rGoldene&Skulltula-Symbol%w! Du hast&insgesamt %r\x19%w symbol gesammelt!\x0E\x3C",
|
||||||
"Vous obtenez un %rSymbole de&Skulltula d'or%w! Vous avez&collecté %r\x19\%w symboles en tout!\x0E\x3C"
|
"Vous obtenez un %rSymbole de&Skulltula d'or%w! Vous avez&collecté %r\x19\%w symboles en tout!\x0E\x3C"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
CustomMessage::Instance->CreateGetItemMessage(
|
CustomMessageManager::Instance->CreateGetItemMessage(
|
||||||
customMessageTableID, (GetItemID)0x00B5, ITEM_SKULL_TOKEN,
|
customMessageTableID, (GetItemID)0x00B5, ITEM_SKULL_TOKEN,
|
||||||
{
|
{
|
||||||
TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM,
|
TEXTBOX_TYPE_BLUE, TEXTBOX_POS_BOTTOM,
|
||||||
"You got a %rGold Skulltula Token%w!&You've collected %r\x19%w tokens&in total!",
|
"You got a %rGold Skulltula Token%w!&You've collected %r\x19%w tokens&in total!",
|
||||||
"Du erhälst ein %rGoldene&Skulltula-Symbol%w! Du hast&insgesamt %r\x19%w symbol gesammelt!",
|
"Du erhälst ein %rGoldene&Skulltula-Symbol%w! Du hast&insgesamt %r\x19%w symbol gesammelt!",
|
||||||
"Vous obtenez un %rSymbole de&Skulltula d'or%w! Vous avez&collecté %r\x19\%w symboles en tout!" });
|
"Vous obtenez un %rSymbole de&Skulltula d'or%w! Vous avez&collecté %r\x19\%w symboles en tout!" });
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user