Merge branch 'NewLuaScripting' of https://github.com/MontyTRC89/TR5Main into NewLuaScripting

This commit is contained in:
MontyTRC89 2021-06-26 07:37:02 +02:00
commit cf98c30910
3 changed files with 0 additions and 22 deletions

View file

@ -18,12 +18,6 @@ extern unordered_map<string, AudioTrack> g_AudioTracks;
GameFlow::GameFlow(sol::state* lua) : LuaHandler{ lua }
{
//Hardcode in English - old strings for now; will be removed shortly
LanguageScript* lang = new LanguageScript("English");
Strings.push_back(lang);
m_lua = lua;
// Settings type
m_lua->new_usertype<GameScriptSettings>("GameScriptSettings",
"screenWidth", &GameScriptSettings::ScreenWidth,
@ -126,11 +120,6 @@ GameFlow::~GameFlow()
{
delete lev;
}
for (auto& lang : Strings)
{
delete lang;
}
}
void GameFlow::SetLanguageNames(sol::as_table_t<std::vector<std::string>> && src)
@ -171,13 +160,6 @@ void GameFlow::SetAudioTracks(sol::as_table_t<std::vector<GameScriptAudioTrack>>
}
}
bool __cdecl LoadScript()
{
g_GameFlow->CurrentStrings = g_GameFlow->Strings[0];
return true;
}
bool GameFlow::LoadGameFlowScript()
{
// Load the enums file

View file

@ -215,8 +215,6 @@ public:
char* Intro;
// Selected language set
LanguageScript* CurrentStrings;
std::vector<LanguageScript*> Strings;
std::vector<GameScriptLevel*> Levels;
GameFlow(sol::state* lua);

View file

@ -227,8 +227,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
g_GameFlow = new GameFlow(&luaState);
g_GameFlow->LoadGameFlowScript();
LoadScript();
g_GameScript = new GameScript(&luaState);
luaState.set_function("GetItemByID", &GameScript::GetItemById, g_GameScript);