Clean up Mod Menu and other details

This commit is contained in:
Nutbuster 2021-07-05 04:38:13 +10:00
parent 400d305f23
commit cd780dfa36
3 changed files with 61 additions and 14 deletions

View File

@ -3,7 +3,9 @@
label chapter_2_new:
show template_sample at scenter
"Sample Text"
hide template_sample
play music 'audio/OST/Those Other Two Weirdos.ogg'
show anon neutral flip at aright with dissolve
A "Sample Text"
return

View File

@ -4,7 +4,10 @@ init python:
# All mod rpy files must have title of their mod (this shows up on a button)
# and finally the label that controls the flow of dialogue
mod_menu_access += [["Example Mod", "storyline_ex"]];
mod_menu_access += [{
'Name': "Example Mod Name",
'Label': "storyline_ex"
}];
image template_sample = Image("mods/template/img/sample.png")

View File

@ -263,7 +263,6 @@ screen quick_menu():
zorder 100
if quick_menu:
window:
background "gui/namebox.png"
xpos 1.45
ypos 0.977
vbox:
@ -299,6 +298,7 @@ screen score_menu():
init python:
config.overlay_screens.append("quick_menu")
default quick_menu = True
style quick_button is default
@ -382,7 +382,7 @@ screen main_menu_button(filename, label, function):
ymaximum 129
action function
fixed:
add filename xalign 0.5 yalign 0.5 zoom 1
add filename xalign 0.5 yalign 0.5 zoom 1 xanchor 0 xcenter 0.5 ycenter 0.5
text label xalign 0.5 yalign 0.5 xanchor 0.5
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
@ -471,34 +471,76 @@ style main_menu_title:
## Mod Menu screen ############################################################
##
## Handles jumping to the mods scripts
## Could be more lean but if this is going to one of last time I touch the UI,
## then fine by me
##
#similar to quick_button funcs
screen mod_menu_button(filename, label, function):
button:
xmaximum 600
ymaximum 129
action function
fixed:
add filename xalign 0.5 yalign 0.5 zoom 0.9
text label xalign 0.5 yalign 0.5 xanchor 0.5 size 34
# arr is [{
# 'Name': string (name that appears on the button)
# 'Label': string (jump label)
# }, { .. } ]
# Reuse the same image string and keep things 'neat'.
screen mod_menu_buttons(filename, arr):
for x in arr:
use mod_menu_button(filename, x['Name'], Start(x['Label']))
screen mod_menu():
tag menu
style_prefix "main_menu"
add gui.main_menu_background
frame:
xsize 420
yfill True
background "gui/overlay/main_menu.png"
#side_yfill True
vbox:
xpos 1940
yalign 0.03
if persistent.splashtype == 1:
add "gui/sneedgame.png"
else:
add "gui/snootgame.png"
viewport:
# this could be better but its ok for now
xpos 1885-540
xmaximum 540
ymaximum 0.8
ypos 200
yinitial 0
scrollbars "vertical"
mousewheel True
draggable True
pagekeys True
#side_yfill True
vbox:
spacing 10
xpos 1885
yalign 0.98
#xpos 1885
spacing 18
#yalign 0.98
use main_menu_button("gui/button/menubuttons/template_idle.png",
#buttons are messed up but that's ok
use mod_menu_button("gui/button/menubuttons/template_idle.png",
"Return", ShowMenu("main_menu"))
if len(mod_menu_access) is not 0:
for x in mod_menu_access:
use main_menu_button("gui/button/menubuttons/template_idle.png",
x[0], Start(x[1]) )
use mod_menu_buttons("gui/button/menubuttons/template_idle.png", mod_menu_access )
else:
use main_menu_button("gui/button/menubuttons/template_idle.png",
use mod_menu_button("gui/button/menubuttons/template_idle.png",
"You have no mods", None)
## Game Menu screen ############################################################
##
## This lays out the basic common structure of a game menu screen. It's called