Make the wardrobe variables dynamic

This commit is contained in:
Gouvernathor 2023-11-19 01:10:50 +01:00
parent 902cf9b4d9
commit 9ee1de9fd0

View File

@ -236,34 +236,42 @@ screen wardrobe(xx, yy):
use wardrobe_menuitem(20, 50)
label wardrobe_menu():
$ renpy.dynamic(
char_active = get_character_object(states.active_girl),
char_outfit = get_character_outfit(states.active_girl, type="last"),
)
$ char_outfit.save()
$ renpy.dynamic(
wardrobe_subcategories = char_active.wardrobe,
)
python:
char_active = get_character_object(states.active_girl)
char_outfit = get_character_outfit(states.active_girl, type="last")
char_outfit.save()
wardrobe_subcategories = char_active.wardrobe
if renpy.android:
wardrobe_subcategories.update( { "outfits": { k:char_active.outfits for k in {"load", "save", "delete", "schedule"} } } )
wardrobe_subcategories.update(outfits=dict.fromkeys(("load", "save", "delete", "schedule"), char_active.outfits))
else:
wardrobe_subcategories.update( { "outfits": { k:char_active.outfits for k in {"load", "save", "delete", "schedule", "import", "export"} } } )
wardrobe_subcategories.update(outfits=dict.fromkeys(("load", "save", "delete", "schedule", "import", "export"), char_active.outfits))
$ renpy.dynamic(
# Defaults
current_category = "head"
category_items = set_wardrobe_categories(current_category)
current_subcategory = list(category_items.keys())[0] if category_items else ""
current_item = char_active.get_equipped_wardrobe_item(category_items, current_subcategory)
last_track = renpy.music.get_playing()
rebuild_wardrobe_icons(category_items, current_subcategory)
current_category = "head",
category_items = set_wardrobe_categories(current_category),
)
$ renpy.dynamic(
current_subcategory = next(iter(category_items), ""),
)
$ renpy.dynamic(
current_item = char_active.get_equipped_wardrobe_item(category_items, current_subcategory),
last_track = renpy.music.get_playing(),
)
$ rebuild_wardrobe_icons(category_items, current_subcategory)
if wardrobe_music:
play music "music/Spring_In_My_Step.ogg" fadein 1 if_changed
show screen wardrobe(662, 50)
label .after_init:
if not renpy.get_screen("wardrobe"):
show screen wardrobe(662, 50)
$ renpy.hide(get_character_tag(states.active_girl))
$ renpy.config.skipping = None
$ _game_menu_screen = None