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
190 case Context::ENTITY_SERVER_SCRIPT:190 case Context::ENTITY_SERVER_SCRIPT:
191 _type = Type::ENTITY_SERVER;191 _type = Type::ENTITY_SERVER;
192 break;192 break;
193 case Context::EDIT_FILTER_SCRIPT:
193 case Context::AGENT_SCRIPT:194 case Context::AGENT_SCRIPT:
194 _type = Type::AGENT;195 _type = Type::AGENT;
195 break;196 break;
@@ -236,6 +237,11 @@ ScriptEngine::ScriptEngine(Context context, const QString& scriptContents, const · 40 unmodified lines
236 }237 }
237}238}
238 239
240QString ScriptEngine::getTypeAsString() const {
241 auto value = QVariant::fromValue(_type).toString();
242 return value.isEmpty() ? "unknown" : value.toLower();
243}
244
239QString ScriptEngine::getContext() const {245QString ScriptEngine::getContext() const {
240 switch (_context) {246 switch (_context) {
241 case CLIENT_SCRIPT:247 case CLIENT_SCRIPT: