diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 0fd0004fbf9..07771dbb680 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -278,6 +278,20 @@ 0.4,0.6,0.0,\ 0.2,0.2,0.6) +#define LIST_REPLACE_RENAME list("rebeccapurple" = "dark purple", "darkslategrey" = "dark grey", "darkolivegreen" = "dark green", "darkslateblue" = "dark blue",\ + "darkkhaki" = "khaki", "darkseagreen" = "light green", "midnightblue" = "blue", "lightgrey" = "light grey", "darkgrey" = "dark grey",\ + "steelblue" = "blue", "goldenrod" = "gold") + +#define LIST_GREYSCALE_REPLACE list("red" = "lightgrey", "blue" = "grey", "green" = "grey", "orange" = "lightgrey", "brown" = "grey",\ + "gold" = "lightgrey", "cyan" = "lightgrey", "navy" = "grey", "purple" = "grey", "pink"= "lightgrey") + +#define LIST_VULP_REPLACE list("pink" = "beige", "orange" = "goldenrod", "gold" = "goldenrod", "red" = "darkolivegreen", "brown" = "darkolivegreen",\ + "green" = "darkslategrey", "cyan" = "steelblue", "purple" = "darkslategrey", "navy" = "midnightblue") + +#define LIST_TAJ_REPLACE list("red" = "rebeccapurple", "brown" = "rebeccapurple", "purple" = "darkslateblue", "blue" = "darkslateblue",\ + "green" = "darkolivegreen", "orange" = "darkkhaki", "gold" = "darkkhaki", "cyan" = "darkseagreen", \ + "navy" = "midnightblue", "pink" = "lightgrey") + //Gun trigger guards #define TRIGGER_GUARD_ALLOW_ALL -1 diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index a8baf7ad2fb..b192045d29d 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -83,15 +83,43 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", /datum/wires/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state) var/data[0] + var/list/replace_colours = null + if(ishuman(user)) + var/mob/living/carbon/human/H = user + var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes) + if(eyes && H.disabilities & COLOURBLIND) + replace_colours = eyes.replace_colours + var/list/W[0] for(var/colour in wires) - W[++W.len] = list("colour" = capitalize(colour), "cut" = IsColourCut(colour), "index" = can_see_wire_index(user) ? GetWireName(GetIndex(colour)) : null, "attached" = IsAttached(colour)) + var/new_colour = colour + var/colour_name = colour + if(colour in replace_colours) + new_colour = replace_colours[colour] + if(new_colour in LIST_REPLACE_RENAME) + colour_name = LIST_REPLACE_RENAME[new_colour] + else + colour_name = new_colour + else + new_colour = colour + colour_name = new_colour + W[++W.len] = list("colour_name" = capitalize(colour_name), "seen_colour" = capitalize(new_colour),"colour" = capitalize(colour), "cut" = IsColourCut(colour), "index" = can_see_wire_index(user) ? GetWireName(GetIndex(colour)) : null, "attached" = IsAttached(colour)) if(W.len > 0) data["wires"] = W var/list/status = get_status() + if(replace_colours) + var/i + for(i=1, i<=status.len, i++) + for(var/colour in replace_colours) + var/new_colour = replace_colours[colour] + if(new_colour in LIST_REPLACE_RENAME) + new_colour = LIST_REPLACE_RENAME[new_colour] + if(findtext(status[i],colour)) + status[i] = replacetext(status[i],colour,new_colour) + break data["status_len"] = status.len data["status"] = status @@ -99,7 +127,7 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", /datum/wires/nano_host() return holder - + /datum/wires/proc/can_see_wire_index(mob/user) if(user.can_admin_interact()) return TRUE @@ -107,13 +135,12 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", var/obj/item/device/multitool/M = user.get_active_hand() if(M.shows_wire_information) return TRUE - + return FALSE /datum/wires/Topic(href, href_list) if(..()) return 1 - var/mob/L = usr if(CanUse(L) && href_list["action"]) var/obj/item/I = L.get_active_hand() @@ -212,7 +239,7 @@ var/const/POWER = 8 return index else CRASH("[colour] is not a key in wires.") - + /datum/wires/proc/GetWireName(index) return diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 62a44b99e88..d1d57418848 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -297,6 +297,7 @@ var/eye_colour = "#000000" var/list/colourmatrix = null var/list/colourblind_matrix = MATRIX_GREYSCALE //Special colourblindness parameters. By default, it's black-and-white. + var/list/replace_colours = LIST_GREYSCALE_REPLACE var/dependent_disabilities = null //Gets set by eye-dependent disabilities such as colourblindness so the eyes can transfer the disability during transplantation. var/dark_view = 2 //Default dark_view for Humans. var/weld_proof = null //If set, the eyes will not take damage during welding. eg. IPC optical sensors do not take damage when they weld things while all other eyes will. diff --git a/code/modules/surgery/organs/subtypes/tajaran.dm b/code/modules/surgery/organs/subtypes/tajaran.dm index 9a1e3fb5c5f..a1313934037 100644 --- a/code/modules/surgery/organs/subtypes/tajaran.dm +++ b/code/modules/surgery/organs/subtypes/tajaran.dm @@ -6,6 +6,7 @@ name = "tajaran eyeballs" species = "Tajaran" colourblind_matrix = MATRIX_TAJ_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + replace_colours = LIST_TAJ_REPLACE dark_view = 8 /obj/item/organ/internal/eyes/tajaran/farwa //Being the lesser form of Tajara, Farwas have an utterly incurable version of their colourblindness. @@ -13,3 +14,4 @@ species = "Farwa" colourmatrix = MATRIX_TAJ_CBLIND dark_view = 8 + replace_colours = LIST_TAJ_REPLACE diff --git a/code/modules/surgery/organs/subtypes/vulpkanin.dm b/code/modules/surgery/organs/subtypes/vulpkanin.dm index d68155c1113..be851c43486 100644 --- a/code/modules/surgery/organs/subtypes/vulpkanin.dm +++ b/code/modules/surgery/organs/subtypes/vulpkanin.dm @@ -6,7 +6,8 @@ /obj/item/organ/internal/eyes/vulpkanin name = "vulpkanin eyeballs" species = "Vulpkanin" - colourblind_matrix = MATRIX_VULP_CBLIND + colourblind_matrix = MATRIX_VULP_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + replace_colours = LIST_VULP_REPLACE dark_view = 8 /obj/item/organ/internal/eyes/vulpkanin/wolpin //Being the lesser form of Vulpkanin, Wolpins have an utterly incurable version of their colourblindness. @@ -14,3 +15,4 @@ species = "Wolpin" colourmatrix = MATRIX_VULP_CBLIND dark_view = 8 + replace_colours = LIST_VULP_REPLACE diff --git a/nano/templates/wires.tmpl b/nano/templates/wires.tmpl index a661fa3e851..2702d97d7dc 100644 --- a/nano/templates/wires.tmpl +++ b/nano/templates/wires.tmpl @@ -2,7 +2,7 @@
| {{:value.colour}} {{if value.index}}({{:value.index}}){{/if}} | +{{:value.colour_name}} {{if value.index}}({{:value.index}}){{/if}} | {{:helper.link(value.cut ? 'Mend' : 'Cut', null, {'action' : 'cut', 'wire' : value.colour})}} {{:helper.link('Pulse', null, {'action' : 'pulse', 'wire' : value.colour})}} |