Implement Frame

This commit is contained in:
LoafyLemon 2024-05-24 15:19:34 +01:00
parent fe1cc62c5d
commit d293b0c973
6 changed files with 96 additions and 108 deletions

BIN
game/gui/creamy_pumpkin_pie/window_frame.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -2,9 +2,6 @@
# GUI images
#
image gui_fade:
Solid("#00000080")
image game_menu:
contains:
zoom 0.5

View File

@ -0,0 +1,82 @@
label modal_popup(title, entry, img=None, confirm="Okay"):
$ disable_game_menu()
play sound "sounds/pop01.ogg"
call screen modal_popup(title, entry, img, confirm)
$ enable_game_menu()
return
screen modal_popup(title, entry, img=None, confirm="Okay", xysize=(600, 350)):
modal True
layer "interface"
zorder 5
style_prefix "frame"
default img = img and renpy.loadable(img)
add "gui_fade_both" at gui_fade
frame:
at gui_modal_popup
xysize xysize
label title
vbox:
ypos 20
add img xalign 0.5
text entry
textbutton confirm align (1.0, 1.0) action Return(True)
transform gui_fade:
on show:
alpha 0.0
easein 1.0 alpha 1.0
on hide:
easeout 0.5 alpha 0.0
transform gui_modal_popup:
subpixel True
on show:
zoom 0.0
alpha 0.0
easein_back 0.5 zoom 1.0 alpha 1.0
on hide:
easeout_back 0.4 zoom 0.0 alpha 0.0
image gui_fade_both = Fixed(Frame(Image("gui/creamy_pumpkin_pie/fade_top.png", oversample=4)), Frame(Image("gui/creamy_pumpkin_pie/fade_bottom.png", oversample=4)))
style frame is empty:
align (0.5, 0.5)
fit_first True
xfill False
yfill False
padding (50, 10)
# background Frame(Image("gui/creamy_pumpkin_pie/window_bottom.png", oversample=4), 8, 8, 8, 75, tile=False)
background Frame(Image("gui/creamy_pumpkin_pie/window_frame.png", oversample=4), 50, 100, 50, 75, tile=False)
style frame_vbox:
xalign 0.5
first_spacing 0
yspacing 5
fit_first True
xfill False
yfill False
style frame_label:
xalign 0.5
yoffset -8
style frame_label_text is who:
size 24
color "#fff"
outlines [(2, "#000000", 1, 1)]
style frame_text is what:
color "#fff"
outlines [(1, "#000000", 1, 1)]
hinting "bytecode"
size 12

View File

@ -13,51 +13,28 @@ init offset = -1
screen confirm(message, yes_action=Return(True), no_action=Return(False)):
modal True
layer "interface"
zorder 5
style_prefix "frame"
zorder 200
style_prefix gui.theme()
add "gui_fade"
add "gui_fade_both" at gui_fade
frame:
padding (34, 34, 34, 34)
xalign 0.5
yalign 0.5
at gui_modal_popup
xysize (500, 250)
vbox:
spacing 25
ypos 20
if isinstance(message, str):
text "[message!t]":
xalign 0.5
text_align 0.5
else:
text message:
xalign 0.5
text_align 0.5
text message
hbox:
xalign 0.5
spacing 84
textbutton _("Yes") action yes_action
textbutton _("No") action no_action
## Right-click and escape answer "no".
key "game_menu" action no_action
style confirm_frame is gui_frame:
padding (34, 34, 34, 34)
xalign 0.5
yalign 0.5
style dark_confirm_frame is dark_gui_frame:
take confirm_frame
style light_confirm_frame is light_gui_frame:
take confirm_frame
# Skip indicator screen
#
# The skip_indicator screen is displayed to indicate that skipping is in

View File

@ -32,38 +32,3 @@ label give_reward(text=_("You found something!"), gift="interface/icons/box_blue
with d3
return
label modal_popup(title, entry, img=None, confirm="Ok"):
$ disable_game_menu()
play sound "sounds/pop01.ogg"
call screen modal_popup(title, entry, img, confirm)
$ enable_game_menu()
return
screen modal_popup(title, entry, img, confirm):
modal True
add "gui_fade"
frame:
style_prefix gui.theme()
xsize 518
align (0.5, 0.5)
padding (12 + 6, 6, 12 + 6, 12 + 6)
vbox:
spacing 12
first_spacing 0
fixed:
ysize 24
add gui.format("interface/achievements/{}/highlight.webp") xalign 0.5
add gui.format("interface/achievements/{}/spacer.webp") align (0.5, 1.0)
text title size 16 xalign 0.5 yalign 0.5
if img and renpy.loadable(img):
add img xalign 0.5
text entry size 12
textbutton confirm align (1.0, 1.0) action Return(True)

View File

@ -20,47 +20,11 @@ init python:
return tutorial_dict[entry][2]
label tutorial(entry):
if not tutorial_dict[entry][2] and settings.get('tutorials'):
if not tutorial_is_done(entry):
$ tutorial_dict[entry][2] = True
play sound "sounds/pop01.ogg"
$ renpy.music.set_volume(0.5, 3.0)
$ gui.in_context("tutorial.display", entry)
call screen modal_popup(tutorial_dict[entry][0], tutorial_dict[entry][1], f"interface/tutorials/{entry}.webp", "Okay")
$ renpy.music.set_volume(1.0, 3.0)
$ enable_game_menu()
return
label .display(entry):
call screen tutorial(entry)
return
screen tutorial(entry):
modal True
layer "interface"
zorder 5
add "gui_fade"
frame:
style_prefix gui.theme()
xsize 518
align (0.5, 0.5)
padding (12 + 6, 6, 12 + 6, 12 + 6)
vbox:
spacing 12
first_spacing 0
fixed:
ysize 24
add gui.format("interface/achievements/{}/highlight.webp") xalign 0.5
add gui.format("interface/achievements/{}/spacer.webp") align (0.5, 1.0)
text "Tutorial" size 10 yalign 0.5
text tutorial_dict[entry][0] size 16 xalign 0.5 yalign 0.5
$ formated = f"interface/tutorials/{entry}.webp"
if renpy.loadable(formated):
add formated xalign 0.5
text tutorial_dict[entry][1] size 12
textbutton "Ok" align (1.0, 1.0) action Return(True)
return