Rebuild wardrobe (5) switch to the new call screen system

fix a mistake in 8d297a7 on the way
This commit is contained in:
Gouvernathor 2023-11-19 23:57:14 +01:00
parent 5252c7eae2
commit 82018cfdad
4 changed files with 57 additions and 360 deletions

View File

@ -230,7 +230,7 @@ init python:
hbox = [] hbox = []
overlay = [] overlay = []
action = [Return(["equip", self]), self.build_button] action = [Call("wardrobe_actions.equip", self, from_current=True), self.build_button]
unhovered = None unhovered = None
foreground = None foreground = None
hover_foreground = "#ffffff80" hover_foreground = "#ffffff80"

View File

@ -130,25 +130,25 @@ init python:
## One can manipulate the button actions using Button.action ## One can manipulate the button actions using Button.action
if subcat == "delete": if subcat == "delete":
action = Return(["deloutfit", self]) action = WardrobeDelOutfit(self)
elif subcat == "load": elif subcat == "load":
action = Return(["equip", self]) action = Call("wardrobe_actions.equip", self, from_current=True)
elif subcat == "save": elif subcat == "save":
action = Return(["addoutfit", self]) action = WardrobeAddOutfit(self)
# elif subcat == "import": # Imports are taken care of outside the class. # elif subcat == "import": # Imports are taken care of outside the class.
# action = Return(["import", self]) # action = WardrobeImport(self)
elif subcat == "export": elif subcat == "export":
action = Return(["export", self]) action = WardrobeExport(self)
elif subcat == "schedule": elif subcat == "schedule":
if not has_schedule and not is_inadequate: if not has_schedule and not is_inadequate:
action = Return(["schedule", self]) action = Call("wardrobe_actions.schedule", self, from_current=True)
alternate = Return(["schedule", self]) alternate = Call("wardrobe_actions.schedule", self, from_current=True)
foreground = "#00000040" foreground = "#00000040"
hover_foreground = "#80808040" hover_foreground = "#80808040"
selected_foreground = "#80808040" selected_foreground = "#80808040"
elif has_schedule: elif has_schedule:
action = Return(["schedule", self]) action = Call("wardrobe_actions.schedule", self, from_current=True)
alternate = Return(["schedule", self]) alternate = Call("wardrobe_actions.schedule", self, from_current=True)
# elif is_inadequate: # elif is_inadequate:
# foreground = "#b2000040" # foreground = "#b2000040"
# hover_foreground = "#CD5C5C40" # hover_foreground = "#CD5C5C40"
@ -286,4 +286,3 @@ init python:
if self.has_type(arg): if self.has_type(arg):
return True return True
return False return False

View File

@ -178,7 +178,7 @@ init -1 python:
def build_button(rp): def build_button(rp):
style = "wardrobe_button" style = "wardrobe_button"
child = Fixed(Transform(rp, xsize=96, fit="contain", yalign=1.0, yoffset=-6), Frame(gui.format("interface/frames/{}/iconframe.webp"), 6, 6), xysize=(96, 168)) child = Fixed(Transform(rp, xsize=96, fit="contain", yalign=1.0, yoffset=-6), Frame(gui.format("interface/frames/{}/iconframe.webp"), 6, 6), xysize=(96, 168))
action = Return(["import", rp]) action = WardrobeImport(rp)
hover_foreground = "#ffffff80" hover_foreground = "#ffffff80"
return Button(child=child, action=action, hover_foreground=hover_foreground, style=style) return Button(child=child, action=action, hover_foreground=hover_foreground, style=style)

File diff suppressed because it is too large Load Diff