@@ -157,23 +157,26 @@ class ConfigureLevelFileDataPopup : public geode::Popup<LevelEditorLayer*, std::
157157
158158 auto keyValInput = TextInput::create (132 .f , key, keyLabel->getFont ());
159159
160+ keyValInput->setFilter (" !\" #$ % &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\ ]^_`abcdefghijklmnopqrstuvwxyz{|}~" );
161+ keyValInput->getInputNode ()->m_allowedChars = " !\" #$ % &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\ ]^_`abcdefghijklmnopqrstuvwxyz{|}~" ;
160162 keyValInput->setString (asd.dump ());
161- keyValInput->setCallback ([=](auto str) mutable { // INPUT CALLBACK
162-
163- keyInputErr->setString (" " );
164-
165- auto parse = matjson::parse (str);
166- if (parse.isOk ()) {
167- (*json.get ())[key] = parse.unwrapOrDefault ();
168- level::updateLevelByJson (json, editor->m_level );
163+ keyValInput->setCallback (
164+ [=](auto str) mutable { // INPUT CALLBACK
165+
166+ keyInputErr->setString (" " );
167+
168+ auto parse = matjson::parse (str);
169+ if (parse.isOk ()) {
170+ (*json.get ())[key] = parse.unwrapOrDefault ();
171+ level::updateLevelByJson (json, editor->m_level );
172+ }
173+ else {
174+ if (parse.err ()) keyInputErr->setString (
175+ (" parse err: " + parse.err ().value ().message ).c_str ()
176+ );
177+ };
169178 }
170- else {
171- if (parse.err ()) keyInputErr->setString (
172- (" parse err: " + parse.err ().value ().message ).c_str ()
173- );
174- };
175-
176- }); // INPUT CALLBACK
179+ ); // INPUT CALLBACK
177180
178181 auto bgSize = keyValInput->getBGSprite ()->getContentSize ();
179182 keyValInput->getBGSprite ()->setSpriteFrame (CCSprite::create (" groundSquare_18_001.png" )->displayFrame ());
@@ -259,4 +262,4 @@ class ConfigureLevelFileDataPopup : public geode::Popup<LevelEditorLayer*, std::
259262};
260263
261264// Setup Menu
262- #include < _MainLevelsEditorMenu.hpp>
265+ #include < _MainLevelsEditorMenu.hpp>
0 commit comments