History

modkit core changes initial commit whitespace corrections + warnings updated cmake plugin rework with focus on JS API integration example cleanup edit_filter scope separate-out edit_filter wantsScope stuff -plugin metadata split scriptengines out separately cleanup __url/__filename sets additional cleanup fix typo; consolidate ScriptInitializerMixin inits add more example API protoypes cleanup pass; fix entity_server / agent init fix whitespace remove technically unnessary plugin filtering +EDIT_FILTER_SCRIPT; cleanup reorder public/slot/private use std::count_if formatting better debug output; cleanup fix msvc compiler warning cleanup eradicate QtScript references from API Example updated header comments Updated KasenAPIExample

kasenvr committed 7 years ago

Commit e9e96071 parent de53b9b21 files · +302 −62Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 21 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+6−0
@@ -190,6 +190,7 @@ ScriptEngine::ScriptEngine(Context context, const QString& scriptContents, const · 189 unmodified lines
190190 case Context::ENTITY_SERVER_SCRIPT:
191191 _type = Type::ENTITY_SERVER;
192192 break;
193+ case Context::EDIT_FILTER_SCRIPT:
193194 case Context::AGENT_SCRIPT:
194195 _type = Type::AGENT;
195196 break;
@@ -236,6 +237,11 @@ ScriptEngine::ScriptEngine(Context context, const QString& scriptContents, const · 40 unmodified lines
236237 }
237238 }
238239
240+QString ScriptEngine::getTypeAsString() const {
241+ auto value = QVariant::fromValue(_type).toString();
242+ return value.isEmpty() ? "unknown" : value.toLower();
243+}
244+
239245 QString ScriptEngine::getContext() const {
240246 switch (_context) {
241247 case CLIENT_SCRIPT: