mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-01 09:18:00 +03:00
Merge branch 'NewLuaScripting' of https://github.com/MontyTRC89/TR5Main into NewLuaScripting
This commit is contained in:
commit
cf98c30910
3 changed files with 0 additions and 22 deletions
|
@ -18,12 +18,6 @@ extern unordered_map<string, AudioTrack> g_AudioTracks;
|
||||||
|
|
||||||
GameFlow::GameFlow(sol::state* lua) : LuaHandler{ lua }
|
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
|
// Settings type
|
||||||
m_lua->new_usertype<GameScriptSettings>("GameScriptSettings",
|
m_lua->new_usertype<GameScriptSettings>("GameScriptSettings",
|
||||||
"screenWidth", &GameScriptSettings::ScreenWidth,
|
"screenWidth", &GameScriptSettings::ScreenWidth,
|
||||||
|
@ -126,11 +120,6 @@ GameFlow::~GameFlow()
|
||||||
{
|
{
|
||||||
delete lev;
|
delete lev;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& lang : Strings)
|
|
||||||
{
|
|
||||||
delete lang;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameFlow::SetLanguageNames(sol::as_table_t<std::vector<std::string>> && src)
|
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()
|
bool GameFlow::LoadGameFlowScript()
|
||||||
{
|
{
|
||||||
// Load the enums file
|
// Load the enums file
|
||||||
|
|
|
@ -215,8 +215,6 @@ public:
|
||||||
char* Intro;
|
char* Intro;
|
||||||
|
|
||||||
// Selected language set
|
// Selected language set
|
||||||
LanguageScript* CurrentStrings;
|
|
||||||
std::vector<LanguageScript*> Strings;
|
|
||||||
std::vector<GameScriptLevel*> Levels;
|
std::vector<GameScriptLevel*> Levels;
|
||||||
|
|
||||||
GameFlow(sol::state* lua);
|
GameFlow(sol::state* lua);
|
||||||
|
|
|
@ -227,8 +227,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
g_GameFlow = new GameFlow(&luaState);
|
g_GameFlow = new GameFlow(&luaState);
|
||||||
g_GameFlow->LoadGameFlowScript();
|
g_GameFlow->LoadGameFlowScript();
|
||||||
|
|
||||||
LoadScript();
|
|
||||||
|
|
||||||
g_GameScript = new GameScript(&luaState);
|
g_GameScript = new GameScript(&luaState);
|
||||||
|
|
||||||
luaState.set_function("GetItemByID", &GameScript::GetItemById, g_GameScript);
|
luaState.set_function("GetItemByID", &GameScript::GetItemById, g_GameScript);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue