From fcea247c439ea6efa7651a2f0dbe85f41af6575e Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 18 May 2020 10:08:34 -0700 Subject: [PATCH] Move custom script parser to its own function scriptclass::load() is a large enough function as it is, we don't need any more trouble by shoving the custom script parser in there as well. --- desktop_version/src/Script.cpp | 296 ++++++++++++++++++++++++++++++++ desktop_version/src/Script.h | 2 + desktop_version/src/Scripts.cpp | 293 +------------------------------ 3 files changed, 299 insertions(+), 292 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 58e920a2..0f94995a 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3578,3 +3578,299 @@ void scriptclass::hardreset() scriptname = "null"; running = false; } + +void scriptclass::loadcustom(std::string t) +{ + //this magic function breaks down the custom script and turns into real scripting! + std::string cscriptname=""; + for(size_t i=0; i=7) cscriptname+=t[i]; + } + + int scriptstart=-1; + int scriptend=-1; + std::string tstring; + + for(size_t i=0; i 0) { + tstring=tstring[tstring.size()-1]; + } else { + tstring=""; + } + if(tstring==":"){ + scriptend=i; + } + } + } + if(scriptstart>-1){ + if(scriptend==-1){ + scriptend=customscript.size(); + } + + //Ok, we've got the relavent script segment, we do a pass to assess it, then run it! + int customcutscenemode=0; + for(int i=scriptstart; i=0 && ti<=50){ + for(int ti2=0; ti2=0 && ti<=50){ + for(int ti2=0; ti2 commands; std::vector words; diff --git a/desktop_version/src/Scripts.cpp b/desktop_version/src/Scripts.cpp index 562cf1ab..6b6f3041 100644 --- a/desktop_version/src/Scripts.cpp +++ b/desktop_version/src/Scripts.cpp @@ -21,298 +21,7 @@ void scriptclass::load(std::string t) } if (customstring == "custom_"){ - //this magic function breaks down the custom script and turns into real scripting! - std::string cscriptname=""; - for(size_t i=0; i=7) cscriptname+=t[i]; - } - - int scriptstart=-1; - int scriptend=-1; - std::string tstring; - - for(size_t i=0; i 0) { - tstring=tstring[tstring.size()-1]; - } else { - tstring=""; - } - if(tstring==":"){ - scriptend=i; - } - } - } - if(scriptstart>-1){ - if(scriptend==-1){ - scriptend=customscript.size(); - } - - //Ok, we've got the relavent script segment, we do a pass to assess it, then run it! - int customcutscenemode=0; - for(int i=scriptstart; i=0 && ti<=50){ - for(int ti2=0; ti2=0 && ti<=50){ - for(int ti2=0; ti2