mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
!quit function
This commit is contained in:
@@ -82,6 +82,8 @@ ValueType TPTScriptInterface::testType(std::string word)
|
||||
return TypeFunction;
|
||||
else if(word == "bubble")
|
||||
return TypeFunction;
|
||||
else if(word == "quit")
|
||||
return TypeFunction;
|
||||
//Basic type
|
||||
parseNumber:
|
||||
for(i = 0; i < word.length(); i++)
|
||||
@@ -129,6 +131,8 @@ AnyType TPTScriptInterface::eval(std::deque<std::string> * words)
|
||||
return tptS_reset(words);
|
||||
else if(word == "bubble")
|
||||
return tptS_bubble(words);
|
||||
else if(word == "quit")
|
||||
return tptS_quit(words);
|
||||
break;
|
||||
case TypeNumber:
|
||||
return NumberType(atoi(rawWord));
|
||||
@@ -467,6 +471,13 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<std::string> * words)
|
||||
return NumberType(0);
|
||||
}
|
||||
|
||||
AnyType TPTScriptInterface::tptS_quit(std::deque<std::string> * words)
|
||||
{
|
||||
ui::Engine::Ref().Exit();
|
||||
|
||||
return NumberType(0);
|
||||
}
|
||||
|
||||
TPTScriptInterface::~TPTScriptInterface() {
|
||||
}
|
||||
|
||||
|
@@ -20,6 +20,7 @@ protected:
|
||||
AnyType tptS_load(std::deque<std::string> * words);
|
||||
AnyType tptS_reset(std::deque<std::string> * words);
|
||||
AnyType tptS_bubble(std::deque<std::string> * words);
|
||||
AnyType tptS_quit(std::deque<std::string> * words);
|
||||
ValueType testType(std::string word);
|
||||
public:
|
||||
TPTScriptInterface(GameController * c, GameModel * m);
|
||||
|
Reference in New Issue
Block a user