Skip to content

Commit edae891

Browse files
committed
Implement core theme
1 parent 9469664 commit edae891

13 files changed

+136
-2
lines changed

LICENSE.txt

+14-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ http://creativecommons.org/licenses/by-sa/3.0/
1111
textures/base/pack/refresh.png is under the Apache 2 license
1212
https://www.apache.org/licenses/LICENSE-2.0.html
1313

14-
Textures by Zughy are under CC BY-SA 4.0
14+
Textures by Zughy and v-rob are under CC BY-SA 4.0
1515
https://creativecommons.org/licenses/by-sa/4.0/
1616

1717
Media files by DS are under CC BY-SA 4.0
@@ -82,6 +82,19 @@ SmallJoker:
8282
textures/base/pack/cdb_clear.png
8383
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)
8484

85+
v-rob:
86+
textures/base/pack/ui_button_bg.png
87+
textures/base/pack/ui_button_center_bg.png
88+
textures/base/pack/ui_button_left_bg.png
89+
textures/base/pack/ui_button_right_bg.png
90+
textures/base/pack/ui_check_fg.png
91+
textures/base/pack/ui_check_selected_fg.png
92+
textures/base/pack/ui_radio_fg.png
93+
textures/base/pack/ui_radio_selected_fg.png
94+
textures/base/pack/ui_root_bg.png
95+
textures/base/pack/ui_switch_fg.png
96+
textures/base/pack/ui_switch_selected_fg.png
97+
8598
DS:
8699
games/devtest/mods/soundstuff/textures/soundstuff_bigfoot.png
87100
games/devtest/mods/soundstuff/textures/soundstuff_jukebox.png

builtin/ui/theme.lua

+122-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,128 @@ function ui.get_prelude_theme()
5151
return prelude_theme
5252
end
5353

54-
local default_theme = prelude_theme
54+
local core_theme = ui.Style{
55+
-- Like any good theme should, we include the prelude theme first.
56+
prelude_theme,
57+
58+
ui.Style{
59+
sel = "root",
60+
61+
ui.Style{
62+
sel = "!.ui:blank",
63+
64+
padding = {4, 4, 4, 4},
65+
66+
bg_image = "ui_root_bg.png",
67+
bg_middle = {2/16, 2/16, 2/16, 2/16},
68+
bg_middle_scale = 2,
69+
},
70+
ui.Style{
71+
sel = "@backdrop",
72+
73+
bg_fill = "black#5",
74+
},
75+
},
76+
77+
ui.Style{
78+
sel = "button, toggle, option",
79+
80+
padding = {2, 2, 2, 4},
81+
82+
bg_image = "ui_button_bg.png",
83+
bg_source = {0/6, 0, 1/6, 1},
84+
bg_middle = {1/16, 2/16, 1/16, 2/16},
85+
bg_middle_scale = 2,
86+
87+
ui.Style{
88+
sel = "$hovered, $focused",
89+
bg_source = {1/6, 0, 2/6, 1},
90+
},
91+
ui.Style{
92+
sel = "$disabled",
93+
bg_source = {2/6, 0, 3/6, 1},
94+
},
95+
ui.Style{
96+
sel = "$pressed, $selected",
97+
padding = {2, 4, 2, 2},
98+
bg_source = {3/6, 0, 4/6, 1},
99+
},
100+
ui.Style{
101+
sel = "($hovered, $focused)$selected",
102+
bg_source = {4/6, 0, 5/6, 1},
103+
},
104+
ui.Style{
105+
sel = "$disabled$selected",
106+
bg_source = {5/6, 0, 6/6, 1},
107+
},
108+
109+
ui.Style{
110+
sel = ".ui:left",
111+
bg_image = "ui_button_left_bg.png",
112+
},
113+
ui.Style{
114+
sel = ".ui:center",
115+
bg_image = "ui_button_center_bg.png",
116+
},
117+
ui.Style{
118+
sel = ".ui:right",
119+
bg_image = "ui_button_right_bg.png",
120+
},
121+
},
122+
123+
ui.Style{
124+
sel = "check, switch, radio",
125+
126+
fg_source = {0/4, 0, 1/4, 1},
127+
fg_scale = 2,
128+
129+
ui.Style{
130+
sel = "$hovered, $focused",
131+
fg_source = {1/4, 0, 2/4, 1},
132+
},
133+
ui.Style{
134+
sel = "$pressed",
135+
fg_source = {2/4, 0, 3/4, 1},
136+
},
137+
ui.Style{
138+
sel = "$disabled",
139+
fg_source = {3/4, 0, 4/4, 1},
140+
},
141+
142+
ui.Style{
143+
sel = "check",
144+
fg_image = "ui_check_fg.png",
145+
},
146+
ui.Style{
147+
sel = "check$selected",
148+
fg_image = "ui_check_selected_fg.png",
149+
},
150+
151+
ui.Style{
152+
sel = "switch",
153+
fg_image = "ui_switch_fg.png",
154+
},
155+
ui.Style{
156+
sel = "switch$selected",
157+
fg_image = "ui_switch_selected_fg.png",
158+
},
159+
160+
ui.Style{
161+
sel = "radio",
162+
fg_image = "ui_radio_fg.png",
163+
},
164+
ui.Style{
165+
sel = "radio$selected",
166+
fg_image = "ui_radio_selected_fg.png",
167+
},
168+
},
169+
}
170+
171+
function ui.get_core_theme()
172+
return core_theme
173+
end
174+
175+
local default_theme = core_theme
55176

56177
function ui.get_default_theme()
57178
return default_theme

textures/base/pack/ui_button_bg.png

816 Bytes
Loading
797 Bytes
Loading
852 Bytes
Loading
845 Bytes
Loading

textures/base/pack/ui_check_fg.png

764 Bytes
Loading
4.56 KB
Loading

textures/base/pack/ui_radio_fg.png

917 Bytes
Loading
1003 Bytes
Loading

textures/base/pack/ui_root_bg.png

619 Bytes
Loading

textures/base/pack/ui_switch_fg.png

830 Bytes
Loading
841 Bytes
Loading

0 commit comments

Comments
 (0)