summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Leggett <chris@leggett.dev>2022-07-13 23:35:45 -0400
committerChristopher Leggett <chris@leggett.dev>2022-07-13 23:35:45 -0400
commitd9277530a2d0fb2308bd00a617efbf728b6bfa70 (patch)
treeeb5474ea654f63c09adaa598354d52796f288564
parent14a87f83b3f93051fec0b2d7009f61bd5b4c736a (diff)
Refactors custom message code to its own file
-rw-r--r--soh/soh/Enhancements/randomizer/custom_messages.cpp39
-rw-r--r--soh/soh/Enhancements/randomizer/custom_messages.h19
-rw-r--r--soh/soh/Enhancements/randomizer/randomizer.cpp11
3 files changed, 58 insertions, 11 deletions
diff --git a/soh/soh/Enhancements/randomizer/custom_messages.cpp b/soh/soh/Enhancements/randomizer/custom_messages.cpp
new file mode 100644
index 000000000..389ae0e9e
--- /dev/null
+++ b/soh/soh/Enhancements/randomizer/custom_messages.cpp
@@ -0,0 +1,39 @@
+#include "custom_messages.h"
+#include <variables.h>
+
+using namespace std::literals::string_literals;
+
+std::string Randomizer::GetCustomGetItemMessage(GetItemID giid) {
+ if (!gSaveContext.n64ddFlag) {
+ return "Not Randomized.";
+ }
+
+ switch (giid) {
+ default:
+ 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.";
+ }
+ }
+}
+
+std::string MESSAGE_END() {
+ return "\x02"s;
+}
+
+std::string ITEM_OBTAINED(uint8_t x) {
+ return "\x08\x13"s + char(x);
+}
+
+std::string NEWLINE() {
+ return "\x02"s;
+}
+
+std::string COLOR(uint8_t x) {
+ return "\x05"s + char(x);
+} \ No newline at end of file
diff --git a/soh/soh/Enhancements/randomizer/custom_messages.h b/soh/soh/Enhancements/randomizer/custom_messages.h
new file mode 100644
index 000000000..5e208f7e7
--- /dev/null
+++ b/soh/soh/Enhancements/randomizer/custom_messages.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <string>
+#include "../../../include/z64item.h"
+#include "randomizer.h"
+
+#define QM_WHITE 0x00
+#define QM_RED 0x41
+#define QM_GREEN 0x42
+#define QM_BLUE 0x43
+#define QM_LBLUE 0x44
+#define QM_PINK 0x45
+#define QM_YELLOW 0x46
+#define QM_BLACK 0x47
+
+std::string MESSAGE_END();
+std::string ITEM_OBTAINED(uint8_t x);
+std::string NEWLINE();
+std::string COLOR(uint8_t x); \ No newline at end of file
diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp
index 50f90ee5e..43e278ab5 100644
--- a/soh/soh/Enhancements/randomizer/randomizer.cpp
+++ b/soh/soh/Enhancements/randomizer/randomizer.cpp
@@ -2419,17 +2419,6 @@ GetItemID Randomizer::GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomiz
return GetItemFromGet(this->itemLocations[randomizerCheck], ogId);
}
-std::string Randomizer::GetCustomGetItemMessage(GetItemID giid) {
- if (!gSaveContext.n64ddFlag) {
- return "Not Randomized.";
- }
-
- switch (giid) {
- default:
- "There is no custom message for this item.";
- }
-}
-
RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) {
if (!gSaveContext.n64ddFlag) {
return RC_UNKNOWN_CHECK;