Compare commits

..

1 Commits

Author SHA1 Message Date
Christian Kaiser 60fd1b681f
Merge dd38e238ed into cef92c1a38 2025-08-01 03:36:36 +00:00
1 changed files with 2 additions and 9 deletions

View File

@ -127,13 +127,12 @@ struct Dialog {
int showRef = LUA_REFNIL;
lua_State* L = nullptr;
Dialog(const ui::Window::Type windowType, const std::string& title, bool sizeable)
Dialog(const ui::Window::Type windowType, const std::string& title)
: window(windowType, title)
, grid(2, false)
, currentGrid(&grid)
{
window.addChild(&grid);
window.setSizeable(sizeable);
all_dialogs.push_back(this);
}
@ -366,7 +365,6 @@ int Dialog_new(lua_State* L)
// Get the title and the type of window (with or without title bar)
ui::Window::Type windowType = ui::Window::WithTitleBar;
std::string title = "Script";
bool sizeable = true;
if (lua_isstring(L, 1)) {
title = lua_tostring(L, 1);
}
@ -380,14 +378,9 @@ int Dialog_new(lua_State* L)
if (type != LUA_TNIL && lua_toboolean(L, -1))
windowType = ui::Window::WithoutTitleBar;
lua_pop(L, 1);
type = lua_getfield(L, 1, "resizeable");
if (type != LUA_TNIL && !lua_toboolean(L, -1))
sizeable = false;
lua_pop(L, 1);
}
auto dlg = push_new<Dialog>(L, windowType, title, sizeable);
auto dlg = push_new<Dialog>(L, windowType, title);
// The uservalue of the dialog userdata will contain a table that
// stores all the callbacks to handle events. As these callbacks can