summaryrefslogtreecommitdiff
path: root/mm/2s2h/DeveloperTools/SaveEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mm/2s2h/DeveloperTools/SaveEditor.cpp')
-rw-r--r--mm/2s2h/DeveloperTools/SaveEditor.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp
index 986603e6a..04e10ee4d 100644
--- a/mm/2s2h/DeveloperTools/SaveEditor.cpp
+++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp
@@ -2,6 +2,8 @@
#include "2s2h/BenGui/UIWidgets.hpp"
#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/Rando/Rando.h"
+#include "2s2h/CustomMessage/CustomMessage.h"
+#include "2s2h/CustomItem/CustomItem.h"
#include "interface/icon_item_dungeon_static/icon_item_dungeon_static.h"
#include "archives/icon_item_24_static/icon_item_24_static_yar.h"
@@ -833,9 +835,22 @@ void DrawItemsAndMasksTab() {
if (UIWidgets::Button(buttonLabel.c_str())) {
GameInteractor::Instance->events.emplace_back(GIEventGiveItem{
.showGetItemCutscene = !CVarGetInteger("gEnhancements.Cutscenes.SkipGetItemCutscenes", 0),
- .getItemText = randoStaticItem.name,
- .drawItem = [randoItemId]() { Rando::DrawItem(randoItemId); },
- .giveItem = [randoItemId]() { Rando::GiveItem(randoItemId); } });
+ .param = (int16_t)randoItemId,
+ .giveItem =
+ [](Actor* actor, PlayState* play) {
+ std::string message = "You received the {{item}}!";
+ CustomMessage::Replace(&message, "{{item}}",
+ Rando::StaticData::Items[(RandoItemId)CUSTOM_ITEM_PARAM].name);
+
+ if (CUSTOM_ITEM_FLAGS & CustomItem::GIVE_ITEM_CUTSCENE) {
+ CustomMessage::SetActiveCustomMessage(message, { .textboxType = 2 });
+ } else {
+ CustomMessage::StartTextbox(message + "\x1C\x02\x10", { .textboxType = 2 });
+ }
+ Rando::GiveItem((RandoItemId)CUSTOM_ITEM_PARAM);
+ },
+ .drawItem = [](Actor* actor,
+ PlayState* play) { Rando::DrawItem((RandoItemId)CUSTOM_ITEM_PARAM); } });
}
}
}