Rebuild wardrobe (6) show the wardrobe screen under confirm

This commit is contained in:
Gouvernathor 2023-11-21 22:51:57 +01:00
parent 0712f0e251
commit 8092c3bbad

View File

@ -311,8 +311,21 @@ init python:
# renpy.restart_interaction()
class __Return(Action):
def __call__(self):
if not wardrobe_autosave:
if not char_active.create_outfit(temp=True).exists():
renpy.notify("Advice: if you want to keep an outfit, save it.")
if wardrobe_suppress_warnings:
return True
layout.yesno_screen("Exit without saving?\n{size=-6}Unsaved changes will be lost.{/size}", yes=Return(True), no=NullAction())
return
return False
label wardrobe_actions:
# TODO: check all variables created in these labels
label .category(category):
if not current_category == category:
if wardrobe_check_category(category):
@ -545,8 +558,8 @@ screen wardrobe(xx, yy):
add "gui_fade"
if renpy.mobile:
use close_button_background
use close_button
use close_button_background(action=__Return())
use close_button(action=__Return())
fixed:
use wardrobe_menu(xx, yy)
@ -596,31 +609,26 @@ label wardrobe_menu():
call screen wardrobe(662, 50)
if not wardrobe_autosave:
if not char_active.create_outfit(temp=True).exists():
$ renpy.notify("Advice: If you want to keep an outfit, save it.")
if _return:
if not (wardrobe_suppress_warnings or renpy.confirm("Exit without saving?\n{size=-6}Unsaved changes will be lost.{/size}")):
jump .cancel_close
$ char_active.equip(char_outfit)
$ char_active.equip(char_outfit)
if wardrobe_global_color:
python hide:
for cloth in char_outfit.group:
for outfit in char_active.outfits:
rebuild = False
if wardrobe_global_color:
python hide:
for cloth in char_outfit.group:
for outfit in char_active.outfits:
rebuild = False
for i in outfit.group:
if (i.id, i.type) != (cloth.id, cloth.type):
continue
for i in outfit.group:
if (i.id, i.type) != (cloth.id, cloth.type):
continue
i.set_color(cloth.color)
i.is_stale()
rebuild = True
i.set_color(cloth.color)
i.is_stale()
rebuild = True
if rebuild:
outfit.is_stale()
if rebuild:
outfit.is_stale()
$ char_active.wear("all")
play audio "sounds/door2.ogg"
@ -907,12 +915,12 @@ screen wardrobe_schedule_menuitem(item):
default mpos = renpy.get_mouse_pos()
use invisible_button(action=Return(), alternate=Show("wardrobe_schedule_menuitem", item=item))
use invisible_button(action=__Return(), alternate=Show("wardrobe_schedule_menuitem", item=item))
window:
style "empty"
pos mpos
#use invisible_button(action=NullAction(), alternate=Return())
#use invisible_button(action=NullAction(), alternate=__Return())
frame:
style "empty"