Skip to content

Commit 8f0d9a1

Browse files
committed
I think doing it like that is better
1 parent 198b956 commit 8f0d9a1

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/CCKeyboardDispatcher.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ class $modify(MyHookLol, CCKeyboardDispatcher) {
4949
else if (key == KEY_Escape)
5050
blockKeys = false;
5151
}
52-
// else if (down && key == KEY_G) {
53-
// CCArray* objs = new CCArray();
54-
// objs->addObject(DialogObject::create("Scratch", "fart\nUh oh", 25, 1, false, ccc3(0, 255, 255)));
55-
// objs->addObject(DialogObject::create("The funny\nmonkley", "stinky!", 26, 1, false, ccc3(0, 155, 155)));
56-
// objs->addObject(DialogObject::create("Glungus", "poopy!", 28, 1, false, ccc3(0, 155, 155)));
57-
// objs->addObject(DialogObject::create("Ned", "funny poopy!", 6, 1, false, ccc3(0, 155, 155)));
58-
// objs->addObject(DialogObject::create("Smongus", "Sorry you had to... read this.", 21, 1, false, ccc3(0, 155, 155)));
59-
// auto layer = DialogLayer::createWithObjects(objs, 2);
60-
// }
6152
return CCKeyboardDispatcher::dispatchKeyboardMSG(key, down, idk);
6253
}
6354
};

src/DialogLayer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#include "DialogLayer.h"
22
#include "FLAlertLayer.h"
33

4-
bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, int p2) {
4+
bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objectsOriginal, int p2) {
5+
CCArray* objects = CCArray::create();
6+
objects->addObjectsFromArray(objectsOriginal);
7+
if (!DialogLayer::init(dialogObject, objectsOriginal, p2)) return false;
8+
59
m_fields->dialogObject = dialogObject;
610
std::string character;
711
char const* title;
@@ -12,7 +16,6 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
1216
title = character.c_str();
1317
}
1418
else {
15-
log::info("{}", objects);
1619
character = static_cast<DialogObject*>(objects->objectAtIndex(0))->m_character;
1720
title = character.c_str();
1821
for (size_t i = 0; i < objects->count(); i++) {
@@ -23,7 +26,6 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
2326
text = fmt::format("{}\n\n\n\n{}", text, static_cast<DialogObject*>(objects->objectAtIndex(i))->m_text);
2427
}
2528
}
26-
if (!DialogLayer::init(dialogObject, objects, p2)) return false;
2729
auto unmodifiedAlert = FLAlertLayer::create(title, text, "OK");
2830
auto alert = static_cast<DeltaruneAlertLayer*>(unmodifiedAlert);
2931

0 commit comments

Comments
 (0)