mirror of
https://github.com/edubart/otclient.git
synced 2025-12-14 04:49:45 +01:00
new layout system, new UI state/styles system
This commit is contained in:
30
modules/core_ui/ui.lua
Normal file
30
modules/core_ui/ui.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
UI = { }
|
||||
UI.root = getRootWidget()
|
||||
|
||||
function UI.loadAndDisplayLocked(otuiFile)
|
||||
local widget = loadUI(otuiFile, UI.root)
|
||||
UI.root:lockChild(widget)
|
||||
return widget
|
||||
end
|
||||
|
||||
function UI.loadAndDisplay(otuiFile)
|
||||
local widget = loadUI(otuiFile, UI.root)
|
||||
return widget
|
||||
end
|
||||
|
||||
function UI.display(widget)
|
||||
UI.root:addChild(widget)
|
||||
end
|
||||
|
||||
function UI.displayLocked(widget)
|
||||
UI.root:addChild(widget)
|
||||
UI.root:lockChild(widget)
|
||||
end
|
||||
|
||||
importStyles('styles/buttons.otui')
|
||||
importStyles('styles/labels.otui')
|
||||
importStyles('styles/panels.otui')
|
||||
importStyles('styles/separators.otui')
|
||||
importStyles('styles/lineedits.otui')
|
||||
importStyles('styles/windows.otui')
|
||||
importStyles('styles/listboxes.otui')
|
||||
Reference in New Issue
Block a user