From 80d287abca3104e8558994c59354103bc1d1147b Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sun, 16 May 2021 03:10:35 +0100 Subject: [PATCH] index magic moment --- code/modules/client/preferences.dm | 34 ++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index bc62879d46..610e4716a4 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -542,16 +542,40 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(S && matrixed_sections) // if it has nothing initialize it to white if(length(marking_list) == 2) - marking_list += list(list("#FFFFFF","#FFFFFF","#FFFFFF")) // just assume its 3 colours if it isnt it doesnt matter we just wont use the other values + var/first = "#FFFFFF" + var/second = "#FFFFFF" + var/third = "#FFFFFF" + if(features["mcolor"]) + first = "#[features["mcolor"]]" + if(features["mcolor2"]) + second = "#[features["mcolor2"]]" + if(features["mcolor3"]) + third = "#[features["mcolor3"]]" + marking_list += list(list(first, second, third)) // just assume its 3 colours if it isnt it doesnt matter we just wont use the other values + // index magic + var/primary_index = 1 + var/secondary_index = 2 + var/tertiary_index = 3 + switch(matrixed_sections) + if(MATRIX_GREEN) + primary_index = 2 + if(MATRIX_BLUE) + primary_index = 3 + if(MATRIX_RED_BLUE) + secondary_index = 2 + if(MATRIX_GREEN_BLUE) + primary_index = 2 + secondary_index = 3 + // we know it has one matrixed section at minimum - color_marking_dat += "   " + color_marking_dat += "   " // if it has a second section, add it if(matrixed_sections == MATRIX_RED_BLUE || matrixed_sections == MATRIX_GREEN_BLUE || matrixed_sections == MATRIX_RED_GREEN || matrixed_sections == MATRIX_ALL) - color_marking_dat += "   " + color_marking_dat += "   " number_colors = 2 // if it has a third section, add it if(matrixed_sections == MATRIX_ALL) - color_marking_dat += "   " + color_marking_dat += "   " number_colors = 3 color_marking_dat += " Change
" dat += "[marking_list[2]] - [actual_name] ˄ ˅ X [color_marking_dat]" @@ -2487,8 +2511,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) color_number = 2 if(MATRIX_BLUE) color_number = 3 - if(MATRIX_GREEN_BLUE) - color_number = 2 else if(color_number == 2) switch(matrixed_sections) if(MATRIX_RED_BLUE)