Add quick buttons & indent the script

This commit is contained in:
2022-03-06 07:31:53 +11:00
parent fa5e785547
commit a3939095d8
12 changed files with 1331 additions and 1285 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -2
View File
@@ -49,7 +49,7 @@ define gui.hover_muted_color = u'#7a003d'
## The colors used for dialogue and menu choice text.
define gui.text_color = '#ffffff'
define gui.interface_text_color = '#00000000'
define gui.interface_text_color = '#fff'
define gui.text_color_outline = '#000'
@@ -196,8 +196,10 @@ define gui.confirm_button_text_xalign = 0.5
define gui.page_button_borders = Borders(15, 6, 15, 6)
define gui.quick_button_borders = Borders(15, 6, 15, 0)
define gui.quick_button_text_color_outline = "#000"
define gui.quick_button_text_outlines = [ (absolute(1.0), gui.quick_button_text_color_outline, 0, 0) ]
define gui.quick_button_text_size = 21
define gui.quick_button_text_idle_color = gui.idle_small_color
define gui.quick_button_text_idle_color = "#fff"
define gui.quick_button_text_selected_color = gui.accent_color
## You can also add your own customizations, by adding properly-named variables.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

+41
View File
@@ -98,6 +98,8 @@ style frame:
screen say(who, what):
style_prefix "say"
use quick_menu
window:
id "window"
@@ -238,8 +240,47 @@ style choice_button_text is default:
## The quick menu is displayed in-game to provide easy access to the out-of-game
## menus.
screen quick_button(filename, label, function):
button:
xsize 71
ysize 71
action function
if 'Return' in label or 'Back' in label or 'Menu' in label:
activate_sound "audio/ui/uiBack.wav"
else:
activate_sound "audio/ui/uiClick.wav"
fixed:
add filename xalign 0.5 yalign 0.5 zoom 1
text label xalign 0.5 yalign 0.5 xanchor 0.5 size 22 style "quick_button_text"
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
# Reuse the same image string and keep things 'neat'.
screen quick_buttons(filename, label_functions):
for l_f in label_functions:
use quick_button(filename, l_f[0], l_f[1])
image pink_button = im.MatrixColor("gui/button/uioptionbuttons/template_idle.png", im.matrix.hue(50))
screen quick_menu():
## Ensure this appears on top of other screens.
zorder 100
if quick_menu:
window:
xpos 1.45
ypos 1.012
vbox:
style_prefix "quick"
spacing 1
use quick_buttons("pink_button",
[
[ "Skip", Skip() ],
[ "Auto", Preference("auto-forward", "toggle") ],
[ "Back", Rollback() ]
] )
screen quick_old_menu():
## Ensure this appears on top of other screens.
zorder 100
+1286 -1283
View File
File diff suppressed because it is too large Load Diff