mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-03-23 02:22:49 +01:00
Render All Quick Buttons' Text
Helper Array Function also added
This commit is contained in:
parent
b876f089ce
commit
255e03dc90
1 changed files with 36 additions and 14 deletions
|
@ -240,6 +240,21 @@ style choice_button_text is default:
|
||||||
## The quick menu is displayed in-game to provide easy access to the out-of-game
|
## The quick menu is displayed in-game to provide easy access to the out-of-game
|
||||||
## menus.
|
## menus.
|
||||||
|
|
||||||
|
screen quick_button(filename, label, function):
|
||||||
|
button:
|
||||||
|
xmaximum 40
|
||||||
|
ymaximum 72
|
||||||
|
action function
|
||||||
|
fixed:
|
||||||
|
add filename xalign 0.5 yalign 0.5 zoom 1
|
||||||
|
text label xalign 0.5 yalign 0.5 xanchor 0.5 size 22 color "#000000EE"
|
||||||
|
|
||||||
|
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
|
||||||
|
# Reuse the same image 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])
|
||||||
|
|
||||||
screen quick_menu():
|
screen quick_menu():
|
||||||
|
|
||||||
## Ensure this appears on top of other screens.
|
## Ensure this appears on top of other screens.
|
||||||
|
@ -251,14 +266,16 @@ screen quick_menu():
|
||||||
ypos 0.977
|
ypos 0.977
|
||||||
grid 1 4:
|
grid 1 4:
|
||||||
style_prefix "quick"
|
style_prefix "quick"
|
||||||
xalign 0.0
|
xalign 0.010
|
||||||
yalign 0.0
|
yalign 0.010
|
||||||
#imagebutton auto "gui/button/uioptionbuttons/skip_%s.png" action Rollback()
|
|
||||||
imagebutton auto "gui/button/uioptionbuttons/skip_%s.png" action Skip() alternate Skip(fast=True, confirm=True)
|
|
||||||
imagebutton auto "gui/button/uioptionbuttons/save_%s.png" action ShowMenu('save')
|
|
||||||
imagebutton auto "gui/button/uioptionbuttons/auto_%s.png" action Preference("auto-forward", "toggle")
|
|
||||||
imagebutton auto "gui/button/uioptionbuttons/load_%s.png" action ShowMenu('load')
|
|
||||||
|
|
||||||
|
use quick_buttons("gui/button/uioptionbuttons/template_idle.png", \
|
||||||
|
[ \
|
||||||
|
[ "Skip", Skip() ], \
|
||||||
|
[ "Save", ShowMenu('save') ], \
|
||||||
|
[ "Auto", Preference("auto-forward", "toggle") ], \
|
||||||
|
[ "Load", ShowMenu('load') ] \
|
||||||
|
] )
|
||||||
|
|
||||||
screen score_menu():
|
screen score_menu():
|
||||||
zorder 100
|
zorder 100
|
||||||
|
@ -275,7 +292,6 @@ screen score_menu():
|
||||||
text "DEBUG SCORE CARD"
|
text "DEBUG SCORE CARD"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## This code ensures that the quick_menu screen is displayed in-game, whenever
|
## This code ensures that the quick_menu screen is displayed in-game, whenever
|
||||||
## the player has not explicitly hidden the interface.
|
## the player has not explicitly hidden the interface.
|
||||||
init python:
|
init python:
|
||||||
|
@ -297,7 +313,7 @@ style quick_button_text:
|
||||||
## Main and Game Menu Screens
|
## Main and Game Menu Screens
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
## Navigation screen ###########################################################
|
## Navigation screen ##########################################################
|
||||||
##
|
##
|
||||||
## This screen is included in the main and game menus, and provides navigation
|
## This screen is included in the main and game menus, and provides navigation
|
||||||
## to other menus, and to start the game.
|
## to other menus, and to start the game.
|
||||||
|
@ -1522,7 +1538,10 @@ style pref_vbox:
|
||||||
|
|
||||||
## Since a mouse may not be present, we replace the quick menu with a version
|
## Since a mouse may not be present, we replace the quick menu with a version
|
||||||
## that uses fewer and bigger buttons that are easier to touch.
|
## that uses fewer and bigger buttons that are easier to touch.
|
||||||
|
|
||||||
|
#redefine function
|
||||||
screen quick_button(filename, label, function):
|
screen quick_button(filename, label, function):
|
||||||
|
variant "small"
|
||||||
button:
|
button:
|
||||||
xmaximum 160
|
xmaximum 160
|
||||||
ymaximum 100
|
ymaximum 100
|
||||||
|
@ -1531,7 +1550,6 @@ screen quick_button(filename, label, function):
|
||||||
add filename xalign 0.5 yalign 0.5 zoom 1.75
|
add filename xalign 0.5 yalign 0.5 zoom 1.75
|
||||||
text label xalign 0.5 yalign 0.5 size 42 color "#000000EE"
|
text label xalign 0.5 yalign 0.5 size 42 color "#000000EE"
|
||||||
|
|
||||||
|
|
||||||
screen quick_menu():
|
screen quick_menu():
|
||||||
variant "small"
|
variant "small"
|
||||||
zorder 100
|
zorder 100
|
||||||
|
@ -1540,10 +1558,14 @@ screen quick_menu():
|
||||||
style_prefix "quick"
|
style_prefix "quick"
|
||||||
xalign 0.5
|
xalign 0.5
|
||||||
yalign 0.975
|
yalign 0.975
|
||||||
use quick_button("gui/button/uioptionbuttons/template_idle.png", "Back", Rollback())
|
|
||||||
use quick_button("gui/button/uioptionbuttons/template_idle.png", "Skip", Skip()) #alternate Skip(fast=True, confirm=True))
|
use quick_buttons("gui/button/uioptionbuttons/template_idle.png", \
|
||||||
use quick_button("gui/button/uioptionbuttons/template_idle.png", "Auto", Preference("auto-forward", "toggle"))
|
[ \
|
||||||
use quick_button("gui/button/uioptionbuttons/template_idle.png", "Menu", ShowMenu())
|
[ "Back", Rollback() ], \
|
||||||
|
[ "Skip", Skip() ], \
|
||||||
|
[ "Auto", Preference("auto-forward", "toggle") ], \
|
||||||
|
[ "Menu", ShowMenu() ] \
|
||||||
|
] )
|
||||||
|
|
||||||
style window:
|
style window:
|
||||||
variant "small"
|
variant "small"
|
||||||
|
|
Loading…
Reference in a new issue