Wardrobe 2.0 - Android+PC navigation split, Bug fix, Add remove colour for colour picker favs, small performance bump for colour picker icons

This commit is contained in:
LoafyLemon 2024-11-07 11:10:58 +00:00
parent 8cfff1febe
commit a267ebabba
8 changed files with 83 additions and 36 deletions

BIN
game/images/interface/wheelmenu/wheelmenu_frame_opaque.png (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
game/images/interface/wheelmenu/wheelmenu_frame_vertical.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -234,9 +234,14 @@ init python:
hbox = [] hbox = []
overlay = [] overlay = []
if renpy.android:
action = [Function(wardrobe.wheelmenu, self), self.build_button] action = [Function(wardrobe.wheelmenu, self), self.build_button]
unhovered = None unhovered = None
alternate = None alternate = None
else:
action = [Function(wardrobe.equip, self), self.build_button]
unhovered = None
alternate = [Function(wardrobe.wheelmenu, self), self.build_button]
if is_inadequate: if is_inadequate:
warnings.append("Character level too low") warnings.append("Character level too low")
@ -271,11 +276,6 @@ init python:
if is_inadequate: if is_inadequate:
style = "wardrobe_item_button_inadequate" style = "wardrobe_item_button_inadequate"
if is_equipped:
alternate = Function(wardrobe.jump_to_item, self, "color_picker")
else:
alternate = [Function(wardrobe.equip, self), Function(wardrobe.jump_to_item, self, "color_picker")]
return Button(child=child, focus_mask=None, xysize=(96, 96), action=action, tooltip=("\n".join(warnings)), unhovered=unhovered, style=style, selected=is_equipped, alternate=alternate) return Button(child=child, focus_mask=None, xysize=(96, 96), action=action, tooltip=("\n".join(warnings)), unhovered=unhovered, style=style, selected=is_equipped, alternate=alternate)
@functools.cache @functools.cache

View File

@ -165,7 +165,7 @@ init python:
tracking_object = self.tracking_object tracking_object = self.tracking_object
if (d := self.get_disk_cache(hash)): if (d := self.get_disk_cache(hash)):
return d return AlphaMask(Transform(d, xysize=(96, 96)), Transform("wheelmenu_button_opaque", xysize=(96, 96)))
matrix = SaturationMatrix(0.0) matrix = SaturationMatrix(0.0)
sprites = [i for i in self.build_image(hash, matrix=matrix) if not i[0] == "mask"] sprites = [i for i in self.build_image(hash, matrix=matrix) if not i[0] == "mask"]
@ -201,7 +201,7 @@ init python:
y = hmax-h y = hmax-h
d = Transform(Fixed(*[i[1] for i in sprites], fit_first=True), crop=(x, y, w, h), size=(256, 256), fit="contain", align=(0.5, 0.5)) d = Transform(Fixed(*[i[1] for i in sprites], fit_first=True), crop=(x, y, w, h), size=(256, 256), fit="contain", align=(0.5, 0.5))
return self.create_disk_cache(d, hash) return AlphaMask(Transform(self.create_disk_cache(d, hash), xysize=(96, 96)), Transform("wheelmenu_button_opaque", xysize=(96, 96)))
def clone(self): def clone(self):
"""Creates a clone of this cloth object. Since it requires a parent object it should be used internally only to avoid object depth issue.""" """Creates a clone of this cloth object. Since it requires a parent object it should be used internally only to avoid object depth issue."""

View File

@ -93,7 +93,7 @@ init python:
def build_icon(self, hash): def build_icon(self, hash):
sprite = self.build_image(self._hash) sprite = self.build_image(self._hash)
sprite = Transform(sprite, crop=(220, 0, 680, 1200), size=(96, 168), fit="contain", align=(0.5, 1.0), yoffset=-6) sprite = Transform(sprite, crop=(220, 0, 680, 1200), size=(96, 168), fit="contain", align=(0.5, 1.0), yoffset=-6)
return AlphaMask(Transform(sprite, xysize=(96, 168)), Transform("wheelmenu_button_opaque", xysize=(96, 168))) return AlphaMask(Transform(sprite, xysize=(96, 168)), Transform("wheelmenu_frame_opaque_vertical", xysize=(96, 168)))
@property @property
def icon(self): def icon(self):
@ -116,20 +116,25 @@ init python:
warnings.append("Outfit contains items from these mods:\n{size=-4}{color=#35aae2}"+ "\n".join(self.get_modname()) + "{/color}{/size}") warnings.append("Outfit contains items from these mods:\n{size=-4}{color=#35aae2}"+ "\n".join(self.get_modname()) + "{/color}{/size}")
hbox.append(Text("M", color="#00b200", style="wardrobe_button_text")) hbox.append(Text("M", color="#00b200", style="wardrobe_button_text"))
if renpy.android:
action = [Function(wardrobe.wheelmenu, self, "outfits"), self.build_button] action = [Function(wardrobe.wheelmenu, self, "outfits"), self.build_button]
alternate = None
unhovered = None unhovered = None
alternate = None
else:
action = [Function(wardrobe.equip, self), self.build_button]
unhovered = None
alternate = [Function(wardrobe.wheelmenu, self, "outfits"), self.build_button]
if has_schedule: if has_schedule:
for i in wardrobe.outfit_schedule: # NONLOCAL for i in wardrobe.outfit_schedule: # NONLOCAL
if self.schedule[i]: if self.schedule[i]:
vbox.append(Transform(f"interface/wardrobe/icons/outfits/{i}.webp", size=(16, 16), offset=(6, 6))) vbox.append(Transform(f"interface/wardrobe/icons/outfits/{i}.webp", size=(16, 16), offset=(3, 6)))
# if is_equipped: # if is_equipped:
# hbox.append(Transform("interface/topbar/icon_check.webp", align=(1.0, 1.0), offset=(-6, -6), size=(24, 24))) # hbox.append(Transform("interface/topbar/icon_check.webp", align=(1.0, 1.0), offset=(-6, -6), size=(24, 24)))
if vbox: if vbox:
hbox.append(VBox(*vbox)) hbox.append(VBox(*vbox, ypos=34))
if hbox: if hbox:
child = Fixed(child, HBox(*hbox), fit_first=True) child = Fixed(child, HBox(*hbox), fit_first=True)

View File

@ -497,6 +497,10 @@ init python in colorpicker:
def add_favorite(index, col): def add_favorite(index, col):
renpy.store.colorpicker.favorites[index] = col renpy.store.colorpicker.favorites[index] = col
@staticmethod
def remove_favorite(index):
ColorPicker.add_favorite(index, None)
def set_layer(item, layer): def set_layer(item, layer):
# Update scope # Update scope
scope = renpy.get_screen("wardrobe").scope scope = renpy.get_screen("wardrobe").scope

File diff suppressed because it is too large Load Diff