Skip to content

Commit 34f7407

Browse files
committed
Implement core theme
1 parent d024ebb commit 34f7407

13 files changed

+107
-1
lines changed

LICENSE.txt

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ https://www.apache.org/licenses/LICENSE-2.0.html
1414
Textures by Zughy are under CC BY-SA 4.0
1515
https://creativecommons.org/licenses/by-sa/4.0/
1616

17+
Textures by v-rob are under CC BY-SA 4.0
18+
https://creativecommons.org/licenses/by-sa/4.0/
19+
1720
Media files by DS are under CC BY-SA 4.0
1821
https://creativecommons.org/licenses/by-sa/4.0/
1922

@@ -78,6 +81,19 @@ kilbith:
7881
SmallJoker:
7982
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)
8083

84+
v-rob:
85+
textures/base/pack/ui_button.png
86+
textures/base/pack/ui_button_center.png
87+
textures/base/pack/ui_button_left.png
88+
textures/base/pack/ui_button_right.png
89+
textures/base/pack/ui_check.png
90+
textures/base/pack/ui_check_selected.png
91+
textures/base/pack/ui_radio.png
92+
textures/base/pack/ui_radio_selected.png
93+
textures/base/pack/ui_root.png
94+
textures/base/pack/ui_switch.png
95+
textures/base/pack/ui_switch_selected.png
96+
8197
DS:
8298
games/devtest/mods/soundstuff/textures/soundstuff_bigfoot.png
8399
games/devtest/mods/soundstuff/textures/soundstuff_jukebox.png

builtin/ui/theme.lua

+91-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,97 @@ function ui.get_prelude_theme()
3030
return prelude_theme
3131
end
3232

33-
local default_theme = prelude_theme
33+
local core_theme = ui.Style {
34+
-- Like any good theme should, we include the prelude theme first.
35+
prelude_theme,
36+
37+
ui.Style "root" {
38+
ui.Style "!.ui:blank" {
39+
box_image = "ui_root.png",
40+
box_middle = {2/16, 2/16, 2/16, 2/16},
41+
box_scale = 2,
42+
},
43+
ui.Style "@backdrop" {
44+
box_fill = "black#5",
45+
},
46+
},
47+
48+
ui.Style "button, toggle, option" {
49+
box_image = "ui_button.png",
50+
box_source = {0/6, 0, 1/6, 1},
51+
box_middle = {1/16, 1/16, 1/16, 2/16},
52+
box_scale = 2,
53+
54+
ui.Style "$hovered, $focused" {
55+
box_source = {1/6, 0, 2/6, 1},
56+
},
57+
ui.Style "$disabled" {
58+
box_source = {2/6, 0, 3/6, 1},
59+
},
60+
ui.Style "$pressed, $selected" {
61+
box_source = {3/6, 0, 4/6, 1},
62+
box_middle = {1/16, 2/16, 1/16, 1/16},
63+
},
64+
ui.Style "($hovered, $focused)$selected" {
65+
box_source = {4/6, 0, 5/6, 1},
66+
},
67+
ui.Style "$disabled$selected" {
68+
box_source = {5/6, 0, 6/6, 1},
69+
},
70+
71+
ui.Style ".ui:left" {
72+
box_image = "ui_button_left.png",
73+
},
74+
ui.Style ".ui:center" {
75+
box_image = "ui_button_center.png",
76+
},
77+
ui.Style ".ui:right" {
78+
box_image = "ui_button_right.png",
79+
},
80+
},
81+
82+
ui.Style "check, switch, radio" {
83+
icon_source = {0/4, 0, 1/4, 1},
84+
icon_scale = 2,
85+
86+
ui.Style "$hovered, $focused" {
87+
icon_source = {1/4, 0, 2/4, 1},
88+
},
89+
ui.Style "$pressed" {
90+
icon_source = {2/4, 0, 3/4, 1},
91+
},
92+
ui.Style "$disabled" {
93+
icon_source = {3/4, 0, 4/4, 1},
94+
},
95+
96+
ui.Style "check" {
97+
icon_image = "ui_check.png",
98+
},
99+
ui.Style "check$selected" {
100+
icon_image = "ui_check_selected.png",
101+
},
102+
103+
ui.Style "switch" {
104+
icon_image = "ui_switch.png",
105+
},
106+
ui.Style "switch$selected" {
107+
icon_image = "ui_switch_selected.png",
108+
},
109+
110+
ui.Style "radio" {
111+
icon_image = "ui_radio.png",
112+
},
113+
ui.Style "radio$selected" {
114+
icon_image = "ui_radio_selected.png",
115+
},
116+
},
117+
}
118+
119+
function ui.get_core_theme()
120+
return core_theme
121+
end
122+
123+
local default_theme = core_theme
34124

35125
function ui.get_default_theme()
36126
return default_theme

textures/base/pack/ui_button.png

816 Bytes
Loading
797 Bytes
Loading

textures/base/pack/ui_button_left.png

852 Bytes
Loading
845 Bytes
Loading

textures/base/pack/ui_check.png

764 Bytes
Loading
4.56 KB
Loading

textures/base/pack/ui_radio.png

917 Bytes
Loading
1003 Bytes
Loading

textures/base/pack/ui_root.png

619 Bytes
Loading

textures/base/pack/ui_switch.png

830 Bytes
Loading
841 Bytes
Loading

0 commit comments

Comments
 (0)