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