22#include " FLAlertLayer.h"
33
44bool DeltaruneDialogLayer::init (DialogObject* dialogObject, CCArray* objects, int p2) {
5- if (!DialogLayer::init (dialogObject, objects, p2)) return false ;
65 m_fields->dialogObject = dialogObject;
76 std::string character;
87 char const * title;
@@ -13,15 +12,18 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
1312 title = character.c_str ();
1413 }
1514 else {
15+ log::info (" {}" , objects);
1616 character = static_cast <DialogObject*>(objects->objectAtIndex (0 ))->m_character ;
1717 title = character.c_str ();
18- for (int i = 0 ; i < objects->count (); i++) {
19- if (text == " " )
18+ for (size_t i = 0 ; i < objects->count (); i++) {
19+ if (text. length () == 0 ) {
2020 text = static_cast <DialogObject*>(objects->objectAtIndex (i))->m_text ;
21+ }
2122 else
2223 text = fmt::format (" {}\n\n\n\n {}" , text, static_cast <DialogObject*>(objects->objectAtIndex (i))->m_text );
2324 }
2425 }
26+ if (!DialogLayer::init (dialogObject, objects, p2)) return false ;
2527 auto unmodifiedAlert = FLAlertLayer::create (title, text, " OK" );
2628 auto alert = static_cast <DeltaruneAlertLayer*>(unmodifiedAlert);
2729
@@ -65,7 +67,6 @@ bool DeltaruneDialogLayer::init(DialogObject* dialogObject, CCArray* objects, in
6567 return true ;
6668}
6769void DeltaruneDialogLayer::displayNextObject () {
68- DialogLayer::displayNextObject ();
6970 this ->setVisible (false );
7071}
7172void DeltaruneDialogLayer::displayDialogObject (DialogObject* obj) {
0 commit comments