fixes one of my first ever coding sins here (#18412)

* fixes one of my first ever coding sins here

make it explicit

naming

fix that ancient bug too

confirm

sane

.

.

move it up

better

keep it there

only color objects

.

properly reset on bad values

.

urg

.

* ,

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Kashargul
2025-09-22 01:05:16 +02:00
committed by GitHub
co-authored by Cameron Lennox
parent 054345cd87
commit b0a8bfaec6
13 changed files with 524 additions and 353 deletions
+9 -4
View File
@@ -508,8 +508,8 @@
if(!user)
return
if(!values)
values = list(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
if(values.len < 12)
values = DEFAULT_COLORMATRIX
if(length(values) < 12)
values.len = 12
var/list/output = list()
output += "<form><input type='hidden' name='src' value='[REF(src)]'>"
@@ -580,8 +580,13 @@
var/client/C = user
user = C.mob
else
return
return null
var/datum/browser/modal/color_matrix_picker/B = new(user, message, title, button1, button2, button3, stealfocus, timeout, values)
B.open()
B.wait()
return list("button" = B.selected_button, "matrix" = B.color_matrix)
if(B.selected_button == 3 || !B.selected_button)
return values
if((B.selected_button == 2) || !islist(B.color_matrix) || !ISINRANGE(length(B.color_matrix), 9, 20))
return list()
return B.color_matrix