Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/main.cpp b/src/main.cpp
- index 3346ae4..cb2c83a 100644
- --- a/src/main.cpp
- +++ b/src/main.cpp
- @@ -500,7 +500,7 @@ static int l_LaunchSubScript(lua_State* L)
- LAssert(L, lua_isstring(L, i), "LaunchSubScript() argument %d: expected string, got %t", i, i);
- }
- for (int i = 4; i <= n; i++) {
- - LAssert(L, lua_isnil(L, i) || lua_isboolean(L, i) || lua_isnumber(L, i) || lua_isstring(L, i),
- + LAssert(L, lua_isnil(L, i) || lua_isboolean(L, i) || lua_isnumber(L, i) || lua_isstring(L, i),
- "LaunchSubScript() argument %d: only nil, boolean, number and string types can be passed to sub script", i);
- }
- int slot = pobwindow->subScriptList.size();
- @@ -948,7 +948,7 @@ int main(int argc, char **argv)
- RegisterGeneralLuaCallbacks(L);
- - int result = luaL_dofile(L, "src/Launch.lua");
- + int result = luaL_dofile(L, argv[1]);
- if (result != 0) {
- lua_error(L);
- }
- @@ -963,6 +963,12 @@ int main(int argc, char **argv)
- QFontDatabase::addApplicationFont("VeraMono.ttf");
- QFontDatabase::addApplicationFont("LiberationSans-Regular.ttf");
- QFontDatabase::addApplicationFont("LiberationSans-Bold.ttf");
- - return app.exec();
- + int out = app.exec();
- + pushCallback("OnExit");
- + result = lua_pcall(L, 1, 0, 0);
- + if (result != 0) {
- + lua_error(L);
- + }
- + return out;
- }
- diff --git a/src/pobwindow.cpp b/src/pobwindow.cpp
- index 9216b55..54b9419 100644
- --- a/src/pobwindow.cpp
- +++ b/src/pobwindow.cpp
- @@ -38,6 +38,27 @@ void pushMouseString(QMouseEvent *event) {
- bool pushKeyString(int keycode) {
- switch (keycode) {
- + case Qt::Key_F1:
- + lua_pushstring(L, "F1");
- + break;
- + case Qt::Key_F2:
- + lua_pushstring(L, "F2");
- + break;
- + case Qt::Key_F3:
- + lua_pushstring(L, "F3");
- + break;
- + case Qt::Key_F4:
- + lua_pushstring(L, "F4");
- + break;
- + case Qt::Key_F5:
- + lua_pushstring(L, "F5");
- + break;
- + case Qt::Key_F6:
- + lua_pushstring(L, "F6");
- + break;
- + case Qt::Key_Control:
- + lua_pushstring(L, "CTRL");
- + break;
- case Qt::Key_Escape:
- lua_pushstring(L, "ESCAPE");
- break;
- @@ -327,7 +348,7 @@ QOpenGLTexture& POBWindow::GetTexture(TextureIndex index)
- bool POBWindow::RetrieveLoadedTextures()
- {
- - textureLoader.collect_loaded_textures(tmpLoadedTextures);
- + textureLoader.collect_loaded_textures(tmpLoadedTextures);
- if (tmpLoadedTextures.empty()) {
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement