V-Gears 0
Free Final Fantasy VII engine.
ScriptManagerCommands.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include "ConfigCmdHandler.h"
17#include "Console.h"
18
27void CmdScriptRunString(const Ogre::StringVector& params){
28 if(params.size() < 2){
29 Console::getSingleton().AddTextToOutput(
30 "Usage: /script_run_string <string>"
31 );
32 return;
33 }
34 ScriptManager::getSingleton().RunString(params[1]);
35}
36
45void CmdScriptRunFile(const Ogre::StringVector& params){
46 if(params.size() < 2){
47 Console::getSingleton().AddTextToOutput(
48 "Usage: /script_run_file <file name>"
49 );
50 return;
51 }
52 ScriptManager::getSingleton().RunFile(params[1]);
53}
54
56 ConfigCmdHandler::getSingleton().AddCommand(
57 "script_run_string", "Run script string", "", CmdScriptRunString, NULL
58 );
59 ConfigCmdHandler::getSingleton().AddCommand(
60 "script_run_file", "Run script file", "", CmdScriptRunFile, NULL
61 );
62}
void CmdScriptRunFile(const Ogre::StringVector &params)
Runs a script string.
Definition: ScriptManagerCommands.h:45
void CmdScriptRunString(const Ogre::StringVector &params)
Runs a script string.
Definition: ScriptManagerCommands.h:27
void InitCmd()
Initializes command bindings.
Definition: ScriptManagerCommands.h:55