diff --git a/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png new file mode 100644 index 00000000..c5bdc730 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a18e47c10e28c00836ca0077c707410ad60c031b4f54bad67328da5fd005c146 +size 44005 diff --git a/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_outline.png b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_outline.png new file mode 100644 index 00000000..9ab6b611 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_outline.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f4f6e967fa0865038c937cd6fddc0152993998e6a52cebcb16bdc3b2f9bf6a3 +size 152 diff --git a/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch.png b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch.png new file mode 100644 index 00000000..a4a2f3a9 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbca296e3ee044c8517c92e46a23d2d769834446a961915b915f41c5fa57c324 +size 106710 diff --git a/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_circular.png b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_circular.png new file mode 100644 index 00000000..99cd93ea --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_circular.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa97812b4a0583e8e81da0a7bd1633f70b717d18f9c232b4f67045338beffb79 +size 54007 diff --git a/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_empty.png b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_empty.png new file mode 100644 index 00000000..c878cd17 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_empty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2470246a2cae0180bcd81bddeaf31c21c1df3cb78d71f88c392cf560e6ead34a +size 83711 diff --git a/game/scripts/utility/image_crop.rpy b/game/scripts/utility/image_crop.rpy index 46c2c6e3..206ad7ae 100644 --- a/game/scripts/utility/image_crop.rpy +++ b/game/scripts/utility/image_crop.rpy @@ -34,10 +34,10 @@ init python: def crop_whitespace_surface(displayable): surf = renpy.render_to_surface(displayable, width=1010, height=1200) size = surf.get_size() - box = tuple(surf.get_bounding_rect()) + box = (int(i) for i in surf.get_bounding_rect()) if size[0] != 1010: ratio = size[0]/1010 - box = tuple(v//ratio for v in box) + box = tuple(int(v//ratio) for v in box) return box def crop_image_zoom(path, xsize, ysize, grayscale=False): diff --git a/game/scripts/wardrobe/color_picker.rpy b/game/scripts/wardrobe/color_picker.rpy index bb0a0fbd..55c547a3 100644 --- a/game/scripts/wardrobe/color_picker.rpy +++ b/game/scripts/wardrobe/color_picker.rpy @@ -45,16 +45,68 @@ init python in colorpicker: } """, vertex_300=""" - v_tex_coord = a_tex_coord; + v_tex_coord = vec2(a_tex_coord.x, 1.0 - a_tex_coord.y); """, fragment_300=""" vec2 uv = v_tex_coord; - vec4 pixel = mix(vec4(hsv2rgb(vec3(uv.y, 1.0, 1.0)), 1.0), gl_FragColor, smoothstep(0.0, 1.0, gl_FragColor.x)); + vec4 pixel = mix(vec4(hsv2rgb(vec3(uv.x, 1.0, 1.0)), 1.0), gl_FragColor, smoothstep(0.0, 1.0, gl_FragColor.x)); // Gamma correction gl_FragColor = pow(pixel, vec4(1.0/2.2)); """ ) + renpy.register_shader("color_picker.saturation", + variables=""" + uniform vec3 u_color; + varying vec2 v_tex_coord; + attribute vec2 a_tex_coord; + """, + fragment_functions=""" + vec3 hsv2rgb(vec3 c) { + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + } + """, + vertex_300=""" + v_tex_coord = vec2(a_tex_coord.x, 1.0 - a_tex_coord.y); + """, + fragment_300=""" + float hue = u_color.r; // hue value from 0 to 1 + float saturation = v_tex_coord.x; // saturation value from 0 to 1 (horizontal) + float value = 1; // static for ease of use + vec4 pixel = vec4(hsv2rgb(vec3(hue, saturation, value)), 1.0); + gl_FragColor = pixel; + //gl_FragColor = pow(pixel, vec4(1.0/2.2)); // Gamma correction + """ + ) + + renpy.register_shader("color_picker.value", + variables=""" + uniform vec3 u_color; + varying vec2 v_tex_coord; + attribute vec2 a_tex_coord; + """, + fragment_functions=""" + vec3 hsv2rgb(vec3 c) { + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + } + """, + vertex_300=""" + v_tex_coord = vec2(a_tex_coord.x, 1.0 - a_tex_coord.y); + """, + fragment_300=""" + float hue = u_color.r; // hue value from 0 to 1 + float saturation = u_color.g; // saturation value from 0 to 1 (from previous slider) + float value = v_tex_coord.x; // value (brightness) from 0 to 1 (horizontal) + vec4 pixel = vec4(hsv2rgb(vec3(hue, saturation, value)), 1.0); + gl_FragColor = pixel; + //gl_FragColor = pow(pixel, vec4(1.0/2.2)); // Gamma correction + """ + ) + renpy.register_shader("color_picker.alpha", variables=""" uniform vec3 u_color; @@ -63,23 +115,18 @@ init python in colorpicker: attribute vec4 a_position; """, vertex_300=""" - direction = a_position.x / u_model_size.x; + direction = 1.0 - a_position.x / u_model_size.x; """, fragment_functions=""" - float pattern(vec2 uv, float size) { - vec2 pos = floor(uv / size); - return mod(pos.x + pos.y, 2.0); + vec3 hsv2rgb(vec3 c) { + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } """, fragment_300=""" - const float size = 8.0; - float c = pattern(gl_FragCoord.xy, size); - vec4 checkerboard = vec4(c, c, c, 1.0); - - vec4 gradient = vec4(u_color, 1.0); - gradient = mix(gradient, vec4(0.0, 0.0, 0.0, 0.0), direction); - - gl_FragColor = mix(gradient, checkerboard, direction); + vec4 gradient = vec4(hsv2rgb(vec3(u_color.r, u_color.g, u_color.b)), 1.0); + gl_FragColor = mix(gradient, vec4(0.0, 0.0, 0.0, 0.0), direction); """ ) @@ -144,7 +191,7 @@ init python in colorpicker: self.update() self.unfocus() self.apply() - set_color(None, None, self.controller.live_color) + set_color(value=self.controller.live_color) return if ev.type == pygame.MOUSEMOTION and ev.buttons[0]: @@ -154,22 +201,22 @@ init python in colorpicker: return class ColorPickerHue(ColorPickerBase): - cursor = renpy.displayable("cph_cursor") + cursor = renpy.displayable("cpa_cursor") def __init__(self, controller, **kwargs): super(ColorPickerHue, self).__init__(controller, **kwargs) def update(self): - _, y = self.pos - _, h = self.size + x, _ = self.pos + w, _ = self.size - self.controller.hue = max(min(float(y) / h, 1.0), 0.0) + self.controller.hue = max(min(float(x) / w, 1.0), 0.0) self.controller.update() def place_cursor(self, x, y): w, h = self.size - x = 0 - y = max(min(y, h), 0) + x = max(min(x, w), 0) + y = 0 self.pos = (x, y) renpy.redraw(self, 0) @@ -195,37 +242,42 @@ init python in colorpicker: rv = renpy.Render(width, height) rv.blit(sr, (0, 0)) - rv.blit(cr, (0, -3)) + rv.blit(cr, (0, 0)) return rv - class ColorPickerSatVal(ColorPickerBase): - cursor = renpy.displayable("cpsv_cursor") + class ColorPickerSaturation(ColorPickerBase): + cursor = renpy.displayable("cpa_cursor") def __init__(self, controller, **kwargs): - super(ColorPickerSatVal, self).__init__(controller, **kwargs) + super(ColorPickerSaturation, self).__init__(controller, **kwargs) def update(self): - x, y = self.pos - w, h = self.size + x, _ = self.pos + w, _ = self.size self.controller.saturation = max(min(float(x) / w, 1.0), 0.0) - self.controller.value = 1 - max(min(float(y) / h, 1.0), 0.0) self.controller.update() + def place_cursor(self, x, y): + w, h = self.size + x = max(min(x, w), 0) + y = 0 + + self.pos = (x, y) + renpy.redraw(self, 0) + def render(self, width, height, st, at): self.size = (width, height) - # Gradient map + # Hue Slider + sr = renpy.Render(width, height) + slider = renpy.render(self.canvas, width, height, st ,at) - gr = renpy.Render(width, height) - gr.mesh = True - gr.add_shader("color_picker.gradient") - gr.add_uniform("u_hue", self.controller.hue) - - canvas = renpy.render(self.canvas, width, height, st ,at) - - gr.blit(canvas, (0, 0)) + sr.mesh = True + sr.add_shader("color_picker.saturation") + sr.add_uniform("u_color", (self.controller.hue, self.controller.saturation, self.controller.value)) + sr.blit(slider, (0, 0)) # Cursor @@ -236,8 +288,102 @@ init python in colorpicker: # Main rv = renpy.Render(width, height) - rv.blit(gr, (0, 0)) - rv.blit(cr, (-7, -8)) + rv.blit(sr, (0, 0)) + rv.blit(cr, (0, 0)) + + return rv + + class ColorPickerValue(ColorPickerBase): + cursor = renpy.displayable("cpa_cursor") + + def __init__(self, controller, **kwargs): + super(ColorPickerValue, self).__init__(controller, **kwargs) + + def update(self): + x, _ = self.pos + w, _ = self.size + + self.controller.value = max(min(float(x) / w, 1.0), 0.0) + self.controller.update() + + def place_cursor(self, x, y): + w, h = self.size + x = max(min(x, w), 0) + y = 0 + + self.pos = (x, y) + renpy.redraw(self, 0) + + def render(self, width, height, st, at): + self.size = (width, height) + + # Hue Slider + sr = renpy.Render(width, height) + slider = renpy.render(self.canvas, width, height, st ,at) + + sr.mesh = True + sr.add_shader("color_picker.value") + sr.add_uniform("u_color", (self.controller.hue, self.controller.saturation, self.controller.value)) + sr.blit(slider, (0, 0)) + + # Cursor + + cr = renpy.Render(width, height) + cursor = renpy.render(self.cursor, width, height, st, at) + cr.blit(cursor, self.pos) + + # Main + + rv = renpy.Render(width, height) + rv.blit(sr, (0, 0)) + rv.blit(cr, (0, 0)) + + return rv + + class ColorPickerAlpha(ColorPickerBase): + cursor = renpy.displayable("cpa_cursor") + + def __init__(self, controller, **kwargs): + super(ColorPickerAlpha, self).__init__(controller, **kwargs) + + def update(self): + x, _ = self.pos + w, _ = self.size + + self.controller.alpha = max(min(float(x) / w, 1.0), 0.0) + self.controller.update() + + def place_cursor(self, x, y): + w, h = self.size + x = max(min(x, w), 0) + y = 0 + + self.pos = (x, y) + renpy.redraw(self, 0) + + def render(self, width, height, st, at): + self.size = (width, height) + + # Alpha Slider + sr = renpy.Render(width, height) + slider = renpy.render(self.canvas, width, height, st ,at) + + sr.mesh = True + sr.add_shader("color_picker.alpha") + sr.add_uniform("u_color", (self.controller.hue, self.controller.saturation, self.controller.value)) + sr.blit(slider, (0, 0)) + + # Cursor + + cr = renpy.Render(width, height) + cursor = renpy.render(self.cursor, width, height, st, at) + cr.blit(cursor, self.pos) + + # Main + + rv = renpy.Render(width, height) + rv.blit(sr, (0, 0)) + rv.blit(cr, (0, 0)) return rv @@ -276,53 +422,6 @@ init python in colorpicker: def event(self, ev, x, y, st): return - class ColorPickerAlpha(ColorPickerBase): - cursor = renpy.displayable("cpa_cursor") - - def __init__(self, controller, **kwargs): - super(ColorPickerAlpha, self).__init__(controller, **kwargs) - - def update(self): - x, _ = self.pos - w, _ = self.size - - self.controller.alpha = 1.0 - max(min(float(x) / w, 1.0), 0.0) - self.controller.update() - - def place_cursor(self, x, y): - w, h = self.size - x = max(min(x, w), 0) - y = 0 - - self.pos = (x, y) - renpy.redraw(self, 0) - - def render(self, width, height, st, at): - self.size = (width, height) - - # Alpha Slider - sr = renpy.Render(width, height) - slider = renpy.render(self.canvas, width, height, st ,at) - - sr.mesh = True - sr.add_shader("color_picker.alpha") - sr.add_uniform("u_color", self.controller.live_color.rgb) - sr.blit(slider, (0, 0)) - - # Cursor - - cr = renpy.Render(width, height) - cursor = renpy.render(self.cursor, width, height, st, at) - cr.blit(cursor, self.pos) - - # Main - - rv = renpy.Render(width, height) - rv.blit(sr, (0, 0)) - rv.blit(cr, (0, 0)) - - return rv - class ColorPicker(renpy.store.NoRollback): def __init__(self, start_color=renpy.store.Color("#fff"), default_color=renpy.store.Color("#fff")): @@ -334,16 +433,19 @@ init python in colorpicker: self.alpha = start_color.alpha self.cph = ColorPickerHue(self) - self.cpsv = ColorPickerSatVal(self) + # self.cpsv = ColorPickerSatVal(self) + self.cps = ColorPickerSaturation(self) + self.cpv = ColorPickerValue(self) self.cpp = ColorPickerPreview(self) self.cpa = ColorPickerAlpha(self) self.focus = None h, s, v = start_color.hsv a = start_color.alpha - self.cph.pos = (0, 255 * h) - self.cpsv.pos = (255 * s, 255 * (1- v)) - self.cpa.pos = (255 * (1 - a), 0) + self.cph.pos = (255 * h, 0) + self.cps.pos = (255 * s, 0) + self.cpv.pos = (255 * v, 0) + self.cpa.pos = (255 * a, 0) def update(self): hsv = (self.hue, self.saturation, self.value) @@ -352,8 +454,10 @@ init python in colorpicker: self.redraw() def redraw(self): - renpy.redraw(self.cpsv, 0) + # renpy.redraw(self.cpsv, 0) renpy.redraw(self.cph, 0) + renpy.redraw(self.cps, 0) + renpy.redraw(self.cpv, 0) renpy.redraw(self.cpp, 0) renpy.redraw(self.cpa, 0) @@ -367,9 +471,10 @@ init python in colorpicker: self.alpha = a self.live_color = color - self.cph.pos = (0, 255 * h) - self.cpsv.pos = (255 * s, 255 * (1- v)) - self.cpa.pos = (255 * (1 - a), 0) + self.cph.pos = (255 * h, 0) + self.cps.pos = (255 * s, 0) + self.cpv.pos = (255 * v, 0) + self.cpa.pos = (255 * a, 0) self.redraw() @@ -385,7 +490,7 @@ init python in colorpicker: def add_history(col): renpy.store.colorpicker.history.append(col) - if len(renpy.store.colorpicker.history) > 10: + if len(renpy.store.colorpicker.history) > 8: del renpy.store.colorpicker.history[0] @staticmethod @@ -408,7 +513,7 @@ init python in colorpicker: renpy.restart_interaction() - def set_color(item, layer, value): + def set_color(item=None, layer=None, value=None): # Acquire params from scope if necessary scope = renpy.get_screen("wardrobe").scope if not item: @@ -416,16 +521,46 @@ init python in colorpicker: if not layer: layer = scope["selected_layer"] + # Update colorpicker + cp.live_replace(value) + # Update item item.color[layer] = value item.is_stale() renpy.restart_interaction() + def generate_colors(col, num_layers, scheme="analogous"): + h, s, v = col.hsv + + colors = [col] + + for i in range(1, num_layers): + if scheme == "analogous": + # Analogous: Colors next to each other on the color wheel + comp_hue = (h + i*0.05) % 1.0 # 0.05 can be adjusted based on how far apart you want your colors + elif scheme == "triadic": + # Triadic: Colors that are equidistant from each other on the color wheel + comp_hue = (h + i*0.33) % 1.0 # 0.33 is 120 degrees, so this will create triadic colors + elif scheme == "split-complementary": + # Split-Complementary: Complement of primary color and two adjacent colors on the wheel + if i == 1: + comp_hue = (h + 0.5) % 1.0 # This is the complement + else: + comp_hue = (h + 0.47) % 1.0 # These are the two adjacent colors, you can adjust this value to make them closer or further apart + else: + raise ValueError("Invalid scheme. Expected one of: 'analogous', 'triadic', 'split-complementary'") + + comp = renpy.store.Color(hsv=(comp_hue, s, v)) + colors.append(comp) + + return colors + + cp = ColorPicker() 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) +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))] + ([None] * 48) # screen colorpickerscreen(item=None): # zorder 30 @@ -558,42 +693,42 @@ default colorpicker.favorites = [Color((167, 77, 42)), Color((237, 179, 14)), Co # keysym ["ctrl_K_c"] # #alternate_keysym ["ctrl_K_v"] -screen colorpicker(character): - default selected_layer = 0 - default selected_item = None +# screen colorpicker(character): +# default selected_layer = 0 +# default selected_item = None - hbox: - # Item list - vpgrid: - cols 1 - ysize 450 - yspacing 5 - scrollbars "vertical" - mousewheel True - for state in character.states.values(): - $ item = state[0] +# hbox: +# # Item list +# vpgrid: +# cols 1 +# ysize 450 +# yspacing 5 +# scrollbars "vertical" +# mousewheel True +# for state in character.states.values(): +# $ item = state[0] - if item and item.color: - button: - add AlphaMask(Transform(item.icon, xysize=(48, 48)), Transform("wheelmenu_button_opaque", xysize=(48, 48))) - action Function(wardrobe.change_item, item) selected (selected_item == item) - if selected_item: - vbox: - label _("Layers") xalign 0.0 +# if item and item.color: +# button: +# add AlphaMask(Transform(item.icon, xysize=(48, 48)), Transform("wheelmenu_button_opaque", xysize=(48, 48))) +# action Function(wardrobe.change_item, item) selected (selected_item == item) +# if selected_item: +# vbox: +# label _("Layers") xalign 0.0 - hbox: - spacing 4 - for n, col in enumerate(selected_item.color): - button: - xysize (32, 32) - background col - selected_foreground "#ffffff80" - action Function(colorpicker.set_layer, item, n) - selected (n == selected_layer) - # alternate Return(["replace", col]) - text str(n+1) +# hbox: +# spacing 4 +# for n, col in enumerate(selected_item.color): +# button: +# xysize (32, 32) +# background col +# selected_foreground "#ffffff80" +# action Function(colorpicker.set_layer, item, n) +# selected (n == selected_layer) +# # alternate Return(["replace", col]) +# text str(n+1) - add colorpicker.cp.cpsv xysize (255, 255) +# add colorpicker.cp.cpsv xysize (255, 255) style colorpickerdev_text: size 12 diff --git a/game/scripts/wardrobe/wardrobe.rpy b/game/scripts/wardrobe/wardrobe.rpy index 18d225f3..82842d38 100644 --- a/game/scripts/wardrobe/wardrobe.rpy +++ b/game/scripts/wardrobe/wardrobe.rpy @@ -254,7 +254,7 @@ screen wardrobe(): hbox: for subcategory in character.wardrobe[selected_category]: button: - label subcategory + text subcategory action Function(wardrobe.change_subcategory, subcategory) selected (selected_subcategory == subcategory) add "frame_spacer" xsize 500 xalign 0.5 @@ -288,31 +288,116 @@ screen wardrobe(): button: add AlphaMask(Transform(item.icon, xysize=(48, 48)), Transform("wheelmenu_button_opaque", xysize=(48, 48))) action Function(wardrobe.change_item, item) selected (selected_item == item) + style "wardrobe_item_small_button" if selected_item: $ is_blacklisted = selected_item.type.startswith(tuple(selected_item.blacklist_unequip)) $ is_allowed = selected_item.type.startswith(("makeup", "tattoo")) + $ accents = colorpicker.generate_colors(selected_item.color[0], len(selected_item.color)) vbox: - label _("Layers") xalign 0.0 + label _("Colour Picker") xalign 0.5 + + add "frame_spacer" xalign 0.5 xsize 420 hbox: - spacing 4 - for n, col in enumerate(selected_item.color): - button: - xysize (32, 32) - background col - selected_foreground "#ffffff80" - action Function(colorpicker.set_layer, selected_item, n) - selected (n == selected_layer) - # alternate Return(["replace", col]) - text str(n+1) + xfill True + text _("Layers") xalign 0 + frame: + style "empty" + xalign 1.0 + xysize (255, 32) + hbox: + for n, col in enumerate(selected_item.color): + button: + xysize (32, 32) + style "wardrobe_swatch" + background Transform(Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_circular.png", oversample=4), xysize=(32, 32), matrixcolor=SepiaMatrix(col, desat=(0.3333, 0.3333, 0.3333))) + action Function(colorpicker.set_layer, selected_item, n) + selected (n == selected_layer) + + add "frame_spacer" xalign 0.5 xsize 420 hbox: - add colorpicker.cp.cpsv xysize (255, 255) - add colorpicker.cp.cph xysize (30, 255) + xfill True + text _("Hue") xalign 0 + frame: + xysize (255, 32) + xalign 1.0 + style "empty" + add AlphaMask(colorpicker.cp.cph, Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png", oversample=4)) + + add "frame_spacer" xalign 0.5 xsize 420 + + hbox: + xfill True + text _("Saturation") xalign 0 + frame: + xysize (255, 32) + xalign 1.0 + style "empty" + add AlphaMask(colorpicker.cp.cps, Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png", oversample=4)) + + add "frame_spacer" xalign 0.5 xsize 420 + + hbox: + xfill True + text _("Value") xalign 0 + frame: + xysize (255, 32) + xalign 1.0 + style "empty" + add AlphaMask(colorpicker.cp.cpv, Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png", oversample=4)) + + add "frame_spacer" xalign 0.5 xsize 420 if not is_blacklisted and (is_allowed or wardrobe.allow_opacity): - add colorpicker.cp.cpa xysize (255, 30) + hbox: + xfill True + text _("Alpha") xalign 0 + frame: + xysize (255, 32) + xalign 1.0 + style "empty" + add AlphaMask(colorpicker.cp.cpa, Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_bar.png", oversample=4)) + + add "frame_spacer" xalign 0.5 xsize 420 + + hbox: + xfill True + text _("History") xalign 0 + frame: + xysize (255, 32) + xalign 1.0 + style "empty" + + hbox: + for col in colorpicker.history: + button: + xysize (32, 32) + style "wardrobe_swatch" + background Transform(Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_circular.png", oversample=4), xysize=(32, 32), matrixcolor=SepiaMatrix(col, desat=(0.3333, 0.3333, 0.3333))) + action Function(colorpicker.set_color, value=col) + selected (col == colorpicker.cp.live_color) + + label _("Swatches") xalign 0.5 + add "frame_spacer" xalign 0.5 xsize 420 + + grid 14 4: + for i, col in enumerate(colorpicker.favorites): + button: + xysize (32, 32) + style "wardrobe_swatch" + background (Transform(Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch.png", oversample=4), xysize=(32, 32), matrixcolor=SepiaMatrix(col, desat=(0.3333, 0.3333, 0.3333))) if col else Transform(Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_swatch_empty.png", oversample=4), xysize=(32, 32))) + action (Function(colorpicker.set_color, value=col) if col else NullAction()) + alternate Function(colorpicker.cp.add_favorite, i, colorpicker.cp.live_color) + selected (col == colorpicker.cp.live_color) + + label _("Layer Adjustments") xalign 0.5 + add "frame_spacer" xalign 0.5 xsize 420 + + textbutton _("Reset current layer") action [Function(selected_item.reset_color, selected_layer), Function(colorpicker.cp.live_replace, selected_item.color_default[selected_layer]), renpy.restart_interaction] style "wardrobe_button" + textbutton _("Reset all layers") action [selected_item.reset_color, Function(colorpicker.cp.live_replace, selected_item.color_default[selected_layer]), renpy.restart_interaction] style "wardrobe_button" + textbutton _("Auto generate accents") action [Function(selected_item.set_color, accents), renpy.restart_interaction] style "wardrobe_button" elif selected_section == "settings": textbutton _("Special Music") action Function(wardrobe.toggle_setting, "music") selected wardrobe.music style "wardrobe_checkbox_button" @@ -327,8 +412,8 @@ screen wardrobe(): vbox: align (0.5, 1.0) - textbutton "Return" action wardrobe.exit keysym "game_menu" textbutton "Strip" action wardrobe.strip + textbutton "Return" action wardrobe.exit keysym "K_ESCAPE" style wardrobe_item_button is empty: background Transform("wheelmenu_button", xysize=(96,96)) @@ -336,14 +421,24 @@ style wardrobe_item_button is empty: selected_foreground Transform("interface/topbar/icon_check.webp", align=(1.0, 1.0), size=(24, 24)) hover_sound "sounds/qubodup-hover1.ogg" activate_sound "sounds/qubodup-click2.ogg" - # anchor (0.5, 0.5) style wardrobe_item_button_inadequate is empty: background Transform("wheelmenu_button", xysize=(96,96)) hover_background At(Transform("wheelmenu_button_opaque", xysize=(96,96), matrixcolor=TintMatrix("#ff0000")), wheelmenu_hover_anim) hover_sound "sounds/qubodup-hover1.ogg" activate_sound "sounds/qubodup-click2.ogg" - # anchor (0.5, 0.5) + +style wardrobe_item_small_button is wardrobe_item_button: + background Transform("wheelmenu_button", xysize=(48,48)) + hover_background At(Transform("wheelmenu_button_opaque", xysize=(48,48)), wheelmenu_hover_anim) + selected_foreground Transform("interface/topbar/icon_check.webp", align=(1.0, 1.0), size=(24, 24)) + +style wardrobe_outline: + padding (2, 2) + foreground Frame(Image("gui/creamy_pumpkin_pie/colorpicker/colorpicker_outline.png"), 2, 0, 2, 0, tile=False) + +style wardrobe_swatch: + selected_foreground Transform("interface/topbar/icon_check.webp", align=(1.0, 1.0), size=(12, 12)) style wardrobe_frame is empty: xsize 540 @@ -358,7 +453,9 @@ style wardrobe_button_text is frame_button_text: style wardrobe_label: xpadding 5 ypadding 2 -style wardrobe_label_text is wardrobe_button_text +style wardrobe_label_text is wardrobe_button_text: + size 32 +style wardrobe_text is wardrobe_button_text style wardrobe_viewport: fit_first True xsize 500