You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/graphics/gui/luaConsole.h

50 lines
1.3 KiB
C

/******************************************************************************
* File - luaConsole.h
* Author - Joey Pollack
* Date - 2021/09/17 (y/m/d)
* Mod Date - 2021/09/17 (y/m/d)
* Description - GUI window for the LUA console
******************************************************************************/
#ifndef LUA_CONSOLE_H_
#define LUA_CONSOLE_H_
#include <utils/opRes.h>
#include <string>
#include <vector>
namespace lunarium
{
const int LUA_CON_BUFFER_SIZE = 64;
class LuaConsole
{
public:
static LuaConsole& GetInstance();
static void FreeInstance();
OpRes Initialize();
void Show();
void SetShow(bool show);
bool IsShown() const;
const std::vector<std::string>* GetCommandHistory() const;
std::string GetLastCommand();
bool GetNewCommand(std::string& command); // returns true if there is a new and false if not
private:
static LuaConsole* mpInstance;
bool mbShow;
char mBuffer[LUA_CON_BUFFER_SIZE];
std::vector<std::string> mCommandHistory;
bool mbNewCommand;
private:
LuaConsole();
LuaConsole(const LuaConsole&) = delete;
const LuaConsole& operator=(const LuaConsole&) = delete;
};
}
#endif // LUA_CONSOLE_H_