Improve styling and implement confirm popup
This commit is contained in:
parent
676a90f519
commit
e9cadcdc89
@ -5,7 +5,7 @@ label modal_popup(title, entry, img=None, confirm="Okay"):
|
|||||||
$ enable_game_menu()
|
$ enable_game_menu()
|
||||||
return
|
return
|
||||||
|
|
||||||
screen modal_popup(title, entry, img=None, confirm="Okay", xysize=(600, 350)):
|
screen modal_popup(title, entry, img=None, confirm="Okay"):
|
||||||
modal True
|
modal True
|
||||||
layer "interface"
|
layer "interface"
|
||||||
zorder 5
|
zorder 5
|
||||||
@ -17,17 +17,15 @@ screen modal_popup(title, entry, img=None, confirm="Okay", xysize=(600, 350)):
|
|||||||
|
|
||||||
frame:
|
frame:
|
||||||
at gui_modal_popup
|
at gui_modal_popup
|
||||||
xysize xysize
|
|
||||||
label title
|
label title
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
ypos 20
|
|
||||||
|
|
||||||
add img xalign 0.5
|
add img xalign 0.5
|
||||||
|
|
||||||
text entry
|
text entry
|
||||||
|
|
||||||
textbutton confirm align (1.0, 1.0) action Return(True)
|
textbutton confirm action Return(True)
|
||||||
|
|
||||||
transform gui_fade:
|
transform gui_fade:
|
||||||
|
|
||||||
@ -51,6 +49,8 @@ image gui_fade_both = Fixed(Frame(Image("gui/creamy_pumpkin_pie/fade_top.png", o
|
|||||||
|
|
||||||
style frame is empty:
|
style frame is empty:
|
||||||
align (0.5, 0.5)
|
align (0.5, 0.5)
|
||||||
|
yminimum 200
|
||||||
|
maximum (600, 450)
|
||||||
fit_first True
|
fit_first True
|
||||||
xfill False
|
xfill False
|
||||||
yfill False
|
yfill False
|
||||||
@ -61,6 +61,7 @@ style frame_vbox:
|
|||||||
xalign 0.5
|
xalign 0.5
|
||||||
first_spacing 0
|
first_spacing 0
|
||||||
yspacing 5
|
yspacing 5
|
||||||
|
ypos 30
|
||||||
fit_first True
|
fit_first True
|
||||||
xfill False
|
xfill False
|
||||||
yfill False
|
yfill False
|
||||||
@ -75,12 +76,20 @@ style frame_label_text is who:
|
|||||||
outlines [(2, "#000000", 1, 1)]
|
outlines [(2, "#000000", 1, 1)]
|
||||||
|
|
||||||
style frame_text is what:
|
style frame_text is what:
|
||||||
|
xalign 0.5
|
||||||
|
xoffset 0
|
||||||
|
ypos 0
|
||||||
|
xsize None
|
||||||
color "#fff"
|
color "#fff"
|
||||||
outlines [(1, "#000000", 1, 1)]
|
outlines [(1, "#000000", 1, 1)]
|
||||||
hinting "bytecode"
|
hinting "bytecode"
|
||||||
size 12
|
size 16
|
||||||
|
xmaximum 500
|
||||||
|
|
||||||
style frame_button is button:
|
style frame_button is button:
|
||||||
hover_background Frame(Image("gui/creamy_pumpkin_pie/choice_alt.png", oversample=4), 0, 4, 0, 4, tile=False)
|
hover_background Frame(Image("gui/creamy_pumpkin_pie/choice_alt.png", oversample=4), 0, 4, 0, 4, tile=False)
|
||||||
|
xpadding 25
|
||||||
|
align (0.5, 1.0)
|
||||||
|
|
||||||
style frame_button_text is choice_text:
|
style frame_button_text is choice_text:
|
||||||
align (0.5, 0.5)
|
align (0.5, 0.5)
|
@ -15,17 +15,14 @@ screen confirm(message, yes_action=Return(True), no_action=Return(False)):
|
|||||||
modal True
|
modal True
|
||||||
layer "interface"
|
layer "interface"
|
||||||
zorder 5
|
zorder 5
|
||||||
style_prefix "frame"
|
style_prefix "confirm"
|
||||||
|
|
||||||
add "gui_fade_both" at gui_fade
|
add "gui_fade_both" at gui_fade
|
||||||
|
|
||||||
frame:
|
frame:
|
||||||
at gui_modal_popup
|
at gui_modal_popup
|
||||||
xysize (500, 250)
|
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
ypos 20
|
|
||||||
|
|
||||||
text message
|
text message
|
||||||
|
|
||||||
hbox:
|
hbox:
|
||||||
@ -35,6 +32,17 @@ screen confirm(message, yes_action=Return(True), no_action=Return(False)):
|
|||||||
## Right-click and escape answer "no".
|
## Right-click and escape answer "no".
|
||||||
key "game_menu" action no_action
|
key "game_menu" action no_action
|
||||||
|
|
||||||
|
style confirm_frame is frame
|
||||||
|
style confirm_vbox is frame_vbox
|
||||||
|
style confirm_hbox:
|
||||||
|
fit_first True
|
||||||
|
align (0.5, 1.0)
|
||||||
|
spacing 25
|
||||||
|
style confirm_button is frame_button
|
||||||
|
style confirm_button_text is frame_button_text
|
||||||
|
style confirm_text is frame_text:
|
||||||
|
size 20
|
||||||
|
|
||||||
# Skip indicator screen
|
# Skip indicator screen
|
||||||
#
|
#
|
||||||
# The skip_indicator screen is displayed to indicate that skipping is in
|
# The skip_indicator screen is displayed to indicate that skipping is in
|
||||||
|
Loading…
Reference in New Issue
Block a user