mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Create Lua frontend UI code
This commit is contained in:
parent
abfb319e9b
commit
9cc73f16f0
13 changed files with 1646 additions and 1 deletions
36
builtin/ui/theme.lua
Normal file
36
builtin/ui/theme.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
-- Luanti
|
||||
-- SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
-- Copyright (C) 2023 v-rob, Vincent Robinson <robinsonvincent89@gmail.com>
|
||||
|
||||
local prelude_theme = ui.Style {
|
||||
ui.Style "root" {
|
||||
pos = {1/2},
|
||||
anchor = {1/2},
|
||||
span = {0},
|
||||
|
||||
ui.Style "@backdrop" {
|
||||
display = "hidden",
|
||||
clip = "both",
|
||||
},
|
||||
ui.Style "@backdrop$focused" {
|
||||
display = "visible",
|
||||
},
|
||||
},
|
||||
ui.Style "image" {
|
||||
icon_scale = 0,
|
||||
},
|
||||
}
|
||||
|
||||
function ui.get_prelude_theme()
|
||||
return prelude_theme
|
||||
end
|
||||
|
||||
local default_theme = prelude_theme
|
||||
|
||||
function ui.get_default_theme()
|
||||
return default_theme
|
||||
end
|
||||
|
||||
function ui.set_default_theme(theme)
|
||||
default_theme = ui._req(theme, ui.Style)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue