Compare commits
10 Commits
9ee1de9fd0
...
88b2373832
Author | SHA1 | Date | |
---|---|---|---|
88b2373832 | |||
8092c3bbad | |||
0712f0e251 | |||
a9bf2a637e | |||
82018cfdad | |||
5252c7eae2 | |||
aeaeea5d2c | |||
97d992f969 | |||
5411e13261 | |||
8d297a7bd9 |
@ -230,7 +230,7 @@ init python:
|
||||
hbox = []
|
||||
overlay = []
|
||||
|
||||
action = [Return(["equip", self]), self.build_button]
|
||||
action = [Call("wardrobe_actions.equip", self, from_current=True), self.build_button]
|
||||
unhovered = None
|
||||
foreground = None
|
||||
hover_foreground = "#ffffff80"
|
||||
@ -323,11 +323,11 @@ init python:
|
||||
return Transform(img, maxsize=maxsize, matrixcolor=SepiaMatrix(c, desat=average)*OpacityMatrix(c.alpha))
|
||||
|
||||
except TypeError:
|
||||
print(f"Item doesn't support colors but was supplied with a list; Try removing numbered files in its directory:\n{self.__repr__()}")
|
||||
print(f"Item doesn't support colors but was supplied with a list; Try removing numbered files in its directory:\n{self!r}")
|
||||
d = At(Frame(Text("TypeErr", color="#ffff00"), tile=True), blink_repeat)
|
||||
return Transform(AlphaMask(d, img))
|
||||
except IndexError:
|
||||
print(f"Mismatched number of textures and colors; Try reducing number of supplied colours in item definition:\n{self.__repr__()}")
|
||||
print(f"Mismatched number of textures and colors; Try reducing number of supplied colours in item definition:\n{self!r}")
|
||||
d = At(Frame(Text("IndxErr", color="#ff0000"), tile=True), blink_repeat)
|
||||
return Transform(AlphaMask(d, img))
|
||||
|
||||
@ -341,34 +341,13 @@ init python:
|
||||
cp.start_replace(col)
|
||||
cp.default_replace(dcol)
|
||||
|
||||
renpy.show_screen("colorpickerscreen", self)
|
||||
renpy.dynamic(
|
||||
color_picker_n=n,
|
||||
color_picker_item=self,
|
||||
)
|
||||
|
||||
while True:
|
||||
try:
|
||||
action, value = ui.interact()
|
||||
except:
|
||||
print(f"{ui.interact()}")
|
||||
break
|
||||
call_screen_in_new_context("colorpickerscreen", self)
|
||||
|
||||
if action == "layer":
|
||||
n = value
|
||||
col = self.color[value]
|
||||
dcol = self.color_default[value]
|
||||
|
||||
cp.live_replace(col)
|
||||
cp.start_replace(col)
|
||||
cp.default_replace(dcol)
|
||||
elif action == "released":
|
||||
self.color[n] = value
|
||||
self.is_stale()
|
||||
elif action == "replace":
|
||||
self.color[n] = value
|
||||
cp.live_replace(value)
|
||||
self.is_stale()
|
||||
elif action == "finish":
|
||||
break
|
||||
|
||||
renpy.hide_screen("colorpickerscreen")
|
||||
elif isinstance(n, list):
|
||||
self.color = [Color( (tuple(x) if isinstance(x, list) else x) ) for x in n]
|
||||
self.is_stale()
|
||||
|
@ -130,25 +130,25 @@ init python:
|
||||
## One can manipulate the button actions using Button.action
|
||||
|
||||
if subcat == "delete":
|
||||
action = Return(["deloutfit", self])
|
||||
action = WardrobeDelOutfit(self)
|
||||
elif subcat == "load":
|
||||
action = Return(["equip", self])
|
||||
action = Call("wardrobe_actions.equip", self, from_current=True)
|
||||
elif subcat == "save":
|
||||
action = Return(["addoutfit", self])
|
||||
action = WardrobeAddOutfit(self)
|
||||
# elif subcat == "import": # Imports are taken care of outside the class.
|
||||
# action = Return(["import", self])
|
||||
# action = WardrobeImport(self)
|
||||
elif subcat == "export":
|
||||
action = Return(["export", self])
|
||||
action = WardrobeExport(self)
|
||||
elif subcat == "schedule":
|
||||
if not has_schedule and not is_inadequate:
|
||||
action = Return(["schedule", self])
|
||||
alternate = Return(["schedule", self])
|
||||
action = Call("wardrobe_actions.schedule", self, from_current=True)
|
||||
alternate = Call("wardrobe_actions.schedule", self, from_current=True)
|
||||
foreground = "#00000040"
|
||||
hover_foreground = "#80808040"
|
||||
selected_foreground = "#80808040"
|
||||
elif has_schedule:
|
||||
action = Return(["schedule", self])
|
||||
alternate = Return(["schedule", self])
|
||||
action = Call("wardrobe_actions.schedule", self, from_current=True)
|
||||
alternate = Call("wardrobe_actions.schedule", self, from_current=True)
|
||||
# elif is_inadequate:
|
||||
# foreground = "#b2000040"
|
||||
# hover_foreground = "#CD5C5C40"
|
||||
@ -286,4 +286,3 @@ init python:
|
||||
if self.has_type(arg):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -219,3 +219,10 @@ init python early:
|
||||
if match:
|
||||
return int(match.group(1))
|
||||
return float('inf') # Return a large number for non-numeric keys
|
||||
|
||||
def call_screen_in_new_context(sc_name, *args, **kwargs):
|
||||
"""
|
||||
Calls the `sc_name` screen in a new context, passing it *args and **kwargs.
|
||||
Returns the value returned by the screen, if any.
|
||||
"""
|
||||
return renpy.call_in_new_context("call_screen", sc_name, *args, **kwargs)
|
||||
|
@ -152,3 +152,8 @@ label end_of_content():
|
||||
nar "All stats have been maxed out. You can now use all of the wardrobe options."
|
||||
|
||||
return
|
||||
|
||||
label call_screen(sc_name, *args, **kwargs):
|
||||
# call call_screen("name", *args, **kwargs) <=> call screen name(*args, **kwargs)
|
||||
call screen expression sc_name pass (*args, **kwargs)
|
||||
return _return
|
||||
|
@ -144,7 +144,8 @@ init python:
|
||||
self.unfocus()
|
||||
self.apply()
|
||||
renpy.restart_interaction()
|
||||
return ["released", self.controller.live_color]
|
||||
__released(self.controller.live_color)
|
||||
raise renpy.IgnoreEvent
|
||||
|
||||
if ev.type == pygame.MOUSEMOTION and ev.buttons[0]:
|
||||
# Dragged
|
||||
@ -393,6 +394,33 @@ init python:
|
||||
|
||||
cp = ColorPicker()
|
||||
|
||||
class __Layer(Action):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
def __call__(self):
|
||||
global color_picker_n
|
||||
color_picker_n = self.value
|
||||
col = color_picker_item.color[color_picker_n]
|
||||
dcol = color_picker_item.color_default[color_picker_n]
|
||||
|
||||
cp.live_replace(col)
|
||||
cp.start_replace(col)
|
||||
cp.default_replace(dcol)
|
||||
|
||||
def __released(value):
|
||||
color_picker_item.color[color_picker_n] = value
|
||||
color_picker_item.is_stale()
|
||||
|
||||
class __Replace(Action):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
def __call__(self):
|
||||
color_picker_item.color[color_picker_n] = self.value
|
||||
cp.live_replace(self.value)
|
||||
color_picker_item.is_stale()
|
||||
|
||||
default colorpicker.history = []
|
||||
default colorpicker.favorites = [Color((167, 77, 42)), Color((237, 179, 14)), Color((89, 116, 194)), Color((216, 163, 10)), Color((58, 115, 75)), Color((205, 205, 206)), Color((251, 198, 10)), Color((51, 43, 54))] + ([Color((255, 255, 255))] * 22)
|
||||
|
||||
@ -426,8 +454,8 @@ screen colorpickerscreen(item=None):
|
||||
xysize (32, 32)
|
||||
background col
|
||||
foreground "cp_borders"
|
||||
action Return(["layer", i])
|
||||
alternate Return(["replace", col])
|
||||
action __Layer(i)
|
||||
alternate __Replace(col)
|
||||
text str(i+1) style "colorpicker_innertext"
|
||||
|
||||
hbox:
|
||||
@ -461,13 +489,13 @@ screen colorpickerscreen(item=None):
|
||||
button:
|
||||
xysize (32, 32)
|
||||
background cp.start_color
|
||||
action Return(["replace", cp.start_color])
|
||||
action __Replace(cp.start_color)
|
||||
text "Old" style "colorpicker_innertext" size 8
|
||||
frame:
|
||||
button:
|
||||
xysize (32, 32)
|
||||
background cp.default_color
|
||||
action Return(["replace", cp.default_color])
|
||||
action __Replace(cp.default_color)
|
||||
text "Org" style "colorpicker_innertext" size 8
|
||||
|
||||
label "Swatches"
|
||||
@ -481,7 +509,7 @@ screen colorpickerscreen(item=None):
|
||||
button:
|
||||
xysize (12, 12)
|
||||
background col
|
||||
action Return(["replace", col])
|
||||
action __Replace(col)
|
||||
alternate Function(cp.add_favorite, i, cp.live_color)
|
||||
|
||||
label "History"
|
||||
@ -495,7 +523,7 @@ screen colorpickerscreen(item=None):
|
||||
button:
|
||||
xysize (12, 12)
|
||||
background col
|
||||
action Return(["replace", col])
|
||||
action __Replace(col)
|
||||
|
||||
hbox:
|
||||
align (1.0, 1.0)
|
||||
@ -505,7 +533,7 @@ screen colorpickerscreen(item=None):
|
||||
action [Function(item.reset_color), Function(cp.live_replace, cp.default_color)]
|
||||
|
||||
textbutton "Finish":
|
||||
action Return(["finish", cp.live_color])
|
||||
action Return()
|
||||
keysym ["K_ESCAPE", "K_RETURN"]
|
||||
|
||||
if config.developer:
|
||||
|
@ -178,7 +178,7 @@ init -1 python:
|
||||
def build_button(rp):
|
||||
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))
|
||||
action = Return(["import", rp])
|
||||
action = WardrobeImport(rp)
|
||||
hover_foreground = "#ffffff80"
|
||||
|
||||
return Button(child=child, action=action, hover_foreground=hover_foreground, style=style)
|
||||
|
@ -70,4 +70,7 @@ init python:
|
||||
renpy.suspend_rollback(False)
|
||||
renpy.block_rollback()
|
||||
renpy.call_in_new_context(get_character_response(states.active_girl, what), arg)
|
||||
_skipping = False
|
||||
renpy.suspend_rollback(True)
|
||||
renpy.block_rollback()
|
||||
return
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user