Skip to content

Commit

Permalink
I think doing it like that is better
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeStepYT committed Nov 24, 2024
1 parent 198b956 commit 8f0d9a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/CCKeyboardDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ class $modify(MyHookLol, CCKeyboardDispatcher) {
else if (key == KEY_Escape)
blockKeys = false;
}
// else if (down && key == KEY_G) {
// CCArray* objs = new CCArray();
// objs->addObject(DialogObject::create("Scratch", "fart\nUh oh", 25, 1, false, ccc3(0, 255, 255)));
// objs->addObject(DialogObject::create("The funny\nmonkley", "stinky!", 26, 1, false, ccc3(0, 155, 155)));
// objs->addObject(DialogObject::create("Glungus", "poopy!", 28, 1, false, ccc3(0, 155, 155)));
// objs->addObject(DialogObject::create("Ned", "funny poopy!", 6, 1, false, ccc3(0, 155, 155)));
// objs->addObject(DialogObject::create("Smongus", "Sorry you had to... read this.", 21, 1, false, ccc3(0, 155, 155)));
// auto layer = DialogLayer::createWithObjects(objs, 2);
// }
return CCKeyboardDispatcher::dispatchKeyboardMSG(key, down, idk);
}
};
8 changes: 5 additions & 3 deletions src/DialogLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include "DialogLayer.h"
#include "FLAlertLayer.h"

bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, int p2) {
bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objectsOriginal, int p2) {
CCArray* objects = CCArray::create();
objects->addObjectsFromArray(objectsOriginal);
if (!DialogLayer::init(dialogObject, objectsOriginal, p2)) return false;

m_fields->dialogObject = dialogObject;
std::string character;
char const* title;
Expand All @@ -12,7 +16,6 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
title = character.c_str();
}
else {
log::info("{}", objects);
character = static_cast<DialogObject*>(objects->objectAtIndex(0))->m_character;
title = character.c_str();
for (size_t i = 0; i < objects->count(); i++) {
Expand All @@ -23,7 +26,6 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
text = fmt::format("{}\n\n\n\n{}", text, static_cast<DialogObject*>(objects->objectAtIndex(i))->m_text);
}
}
if (!DialogLayer::init(dialogObject, objects, p2)) return false;
auto unmodifiedAlert = FLAlertLayer::create(title, text, "OK");
auto alert = static_cast<DeltaruneAlertLayer*>(unmodifiedAlert);

Expand Down

0 comments on commit 8f0d9a1

Please sign in to comment.