updated sol state invocations

This commit is contained in:
devZoGok
2023-09-03 09:05:06 +03:00
parent 799cada346
commit 8216c781c2
14 changed files with 43 additions and 22 deletions
+5 -8
View File
@@ -2,12 +2,11 @@
#include <stateManager.h>
#include <inputManager.h>
#include <solUtil.h>
#include <assetManager.h>
#include <root.h>
#include <solUtil.h>
#include "gameManager.h"
#include "guiAppState.h"
#include "defConfigs.h"
@@ -29,13 +28,11 @@ namespace battleship{
void GameManager::start(string gameDir) {
path = gameDir + "Assets/";
gameBase::SOL_LUA_STATE.script("PATH = \"" + path + "\";");
sol::state_view SOL_LUA_STATE = generateView();
SOL_LUA_STATE.script("PATH = \"" + path + "\";");
vector<string> files = configData::scripts;
files.emplace(files.begin(), "Scripts/main.lua");
for(string &f : files)
gameBase::SOL_LUA_STATE.script_file(path + f);
for(string f : configData::scripts)
SOL_LUA_STATE.script_file(path + f);
sol::table resTable = SOL_LUA_STATE["graphics"]["resolution"];
width = resTable["x"];