Don't use protected variable name
This commit is contained in:
parent
d132436843
commit
2f2a9b985b
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user