Don't use protected variable name

(cherry picked from commit 2f2a9b985b)
This commit is contained in:
Gouvernathor 2023-11-17 03:46:18 +01:00 committed by LoafyLemon
parent 93526daa17
commit 21c170e256

View File

@ -12,7 +12,7 @@ screen color_picker(color, alpha, title, pos_xy, color_default):
default hue = 0
default sat = 0
default val = 0
default _alpha = 0 # Avoid name conflict with 'alpha' screen variable in other active screens
default alpha_ = 0 # Avoid name conflict with 'alpha' screen variable in other active screens
default edit_mode = False
default preview_old = Solid(rgba)
$ preview_new = Solid(rgba)
@ -213,7 +213,7 @@ screen color_picker(color, alpha, title, pos_xy, color_default):
Transform(alpha_gradient_image, matrixcolor=ColorizeMatrix(rgba, rgba)))
bar:
xysize (255, 30)
value ScreenVariableValue("_alpha", range=1.0, action=Function(color_picker_update_rgba))
value ScreenVariableValue("alpha_", range=1.0, action=Function(color_picker_update_rgba))
base_bar icon_frame
thumb Image(gui.format("interface/color_picker/{}/cursor_v.webp"), xalign=0.5)
thumb_offset 0
@ -309,7 +309,7 @@ init -1 python:
scope["hue"] = 1 - h
scope["sat"] = s
scope["val"] = v
scope["_alpha"] = a / 255.0
scope["alpha_"] = a / 255.0
def color_picker_update_rgba():
scope = renpy.get_screen("color_picker").scope
@ -317,7 +317,7 @@ init -1 python:
r = int(r * 255)
g = int(g * 255)
b = int(b * 255)
a = int(scope["_alpha"] * 255)
a = int(scope["alpha_"] * 255)
scope["rgba"] = (r, g, b, a)
update_picking_color(scope["rgba"])
renpy.restart_interaction()