diff --git a/game/screens.rpy b/game/screens.rpy index 73481e3..b273b86 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -316,6 +316,7 @@ screen navigation(): textbutton _("Save") action ShowMenu("save") textbutton _("Load") action ShowMenu("load") textbutton _("Options") action ShowMenu("preferences") + textbutton _("Gallery") action ShowMenu("cg_gallery") textbutton _("Help And About") action ShowMenu("helpandabout") @@ -382,6 +383,8 @@ screen main_menu(): imagebutton auto "gui/button/menubuttons/startbutton_%s.png" action Start() imagebutton auto "gui/button/menubuttons/loadbutton_%s.png" action ShowMenu("load") imagebutton auto "gui/button/menubuttons/optionsbutton_%s.png" action ShowMenu("preferences") + #TODO: gallery btn needs asset + imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu("cg_gallery") imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu("helpandabout") imagebutton auto "gui/button/menubuttons/quitbutton_%s.png" action Quit(confirm=not main_menu) diff --git a/game/src/__init__.py b/game/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/game/src/cg_gallery.rpy b/game/src/cg_gallery.rpy new file mode 100644 index 0000000..aaa6b61 --- /dev/null +++ b/game/src/cg_gallery.rpy @@ -0,0 +1,52 @@ +init python: + g = Gallery() + + gallery_cols = 3 + gallery_items = [] + not_unlocked_cover = "a04" #TODO (needs asset) + + def cg(fname, unlocked = False): + normalized_fname = fname if unlocked else not_unlocked_cover + return im.FactorScale("images/cgs/" + normalized_fname+ ".png", 0.225, 0.225) + + def add_gallery_item(image_name, unlocked = False): + g.button(image_name) + g.image(image_name) + + if unlocked: + g.unlock(image_name) + else: + g.condition("persistent." + image_name) + + gallery_items.append({ + "item": image_name, + "cg": cg(image_name, unlocked) + }) + + # LIST FILES TO ADD HERE + add_gallery_item("a02") + add_gallery_item("a04", True) + add_gallery_item("a10", True) + + add_gallery_item("a11", True) + add_gallery_item("a12", True) + add_gallery_item("a13", True) + + # SAFE GUARD + if len(gallery_items) % gallery_cols != 0: + raise Exception("Invalid gallery!") + +## CG Gallery screen ######################################################## +## A screen that shows the image gallery +screen cg_gallery(): + tag menu + use game_menu(_("Gallery"), scroll="viewport"): + + fixed: + $ gallery_rows = len(gallery_items) / gallery_cols + grid gallery_cols gallery_rows: + + spacing gui.slot_spacing + + for item in gallery_items: + add g.make_button(item["item"], item["cg"], xalign = 0.5, yalign = 0.5)