From fa2cbd7137a62bb23bb9daf67b0e9190e51b1aea Mon Sep 17 00:00:00 2001 From: nutbuster Date: Sat, 17 Jul 2021 14:43:15 +1000 Subject: [PATCH] Re touch up doc and placeholder textbuttons --- game/src/cg_gallery.rpy | 46 +++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/game/src/cg_gallery.rpy b/game/src/cg_gallery.rpy index 81258f2..120cd85 100644 --- a/game/src/cg_gallery.rpy +++ b/game/src/cg_gallery.rpy @@ -26,8 +26,7 @@ init python: return im.FactorScale(fname, scale, scale, False) # Reads /images/cgs dir for all image files - # Populates g:Gallery and galleryItems - # Appends extra spaces at the end + # Populates galleryItems # () -> None def loadGallery(): @@ -72,12 +71,11 @@ Basically Gallery Object has terrible defaults, so I just wrote my own stuff screen cg_gallery(__yoffset = 0): style_prefix "game_menu" - if main_menu: - add gui.game_menu_background -#add gui.main_menu_background - else: - add gui.game_menu_background + key "game_menu" action ShowMenu("main_menu") + + add gui.main_menu_background + add gui.game_menu_background python: items = len(galleryItems) @@ -88,22 +86,21 @@ screen cg_gallery(__yoffset = 0): tag menu frame: style "game_menu_outer_frame" - if main_menu: - key "game_menu" action ShowMenu("main_menu") + viewport: yinitial __yoffset - xalign 0.5 scrollbars "vertical" mousewheel True draggable True pagekeys True - add Color("#000") + xpos 440 grid GALLERY_COLS galleryRows: for item in galleryItems: - $ item_counter += 1 - $ yoffset = item_counter / 3 * PREFERRED_HEIGHT * 1.15 - $ yoffset = int( yoffset + (PREFERRED_HEIGHT * 1.15)) + python: + item_counter += 1 + yoffset = item_counter / 3 * PREFERRED_HEIGHT * 1.15 + yoffset = int( yoffset + (PREFERRED_HEIGHT * 1.15)) # should properly fix with actual margin difference but good enough or the actual position use flag_button(item, yoffset) @@ -111,12 +108,29 @@ screen cg_gallery(__yoffset = 0): for i in range(0, extraSpaces): null height 20 + vbox: + style_prefix "navigation" + xpos gui.notMM_navigation_xpos + yalign 0.5 + + spacing gui.navigation_spacing + + textbutton _("CG") + textbutton _("NotForKids!") + textbutton _("Animations") + textbutton _("Return") action Return() + + if _in_replay: + textbutton _("End Replay") action EndReplay(confirm=True) + elif not main_menu: + textbutton _("Main Menu") action MainMenu() + label "Gallery" """ -if/else for buttons +if/else flow control & extra parameters for Buttons """ screen flag_button(item, yoffset): python: @@ -136,7 +150,7 @@ screen flag_button(item, yoffset): add NOT_UNLOCKED_COVER """ -view_image, loads the image in fullscreen with viewport control +view_image, Loads the image in fullscreen with viewport control. """ screen view_image(fn, origin): tag menu