mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 11:31:38 +00:00
Fixes regaining color sight after darkvision (#11448)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
var/client_color = "" //Any client.color-valid value
|
||||
var/priority = 1
|
||||
var/override = FALSE //If set to override we will stop multiplying the moment we get here. NOTE: Priority remains, if your override is on position 4, the other 3 will still have a say.
|
||||
|
||||
var/disability = FALSE
|
||||
|
||||
/mob
|
||||
var/list/client_colors = list()
|
||||
@@ -22,9 +22,10 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/proc/add_client_color(color_type)
|
||||
/mob/proc/add_client_color(color_type, set_disability = FALSE)
|
||||
if(!has_client_color(color_type))
|
||||
var/datum/client_color/CC = new color_type()
|
||||
CC.disability = set_disability
|
||||
client_colors |= CC
|
||||
sortTim(client_colors, /proc/cmp_clientcolor_priority)
|
||||
update_client_color()
|
||||
@@ -35,7 +36,7 @@
|
||||
color_type - a typepath (subtyped from /datum/client_color)
|
||||
returns true if instance was found, false otherwise
|
||||
*/
|
||||
/mob/proc/remove_client_color(color_type)
|
||||
/mob/proc/remove_client_color(color_type, remove_disability = FALSE)
|
||||
if(!ispath(/datum/client_color))
|
||||
return FALSE
|
||||
|
||||
@@ -43,6 +44,8 @@
|
||||
for(var/cc in client_colors)
|
||||
var/datum/client_color/CC = cc
|
||||
if(CC.type == color_type)
|
||||
if(CC.disability && !remove_disability)
|
||||
continue
|
||||
result = TRUE
|
||||
client_colors -= CC
|
||||
qdel(CC)
|
||||
|
||||
@@ -26,28 +26,28 @@
|
||||
desc = "You have difficulty perceiving green."
|
||||
|
||||
/datum/character_disabilities/deuteranomaly/apply_self(var/mob/living/carbon/human/H)
|
||||
H.add_client_color(/datum/client_color/deuteranopia)
|
||||
H.add_client_color(/datum/client_color/deuteranopia, TRUE)
|
||||
|
||||
/datum/character_disabilities/protanopia
|
||||
name = "Protanopia"
|
||||
desc = "You have difficulty perceiving red."
|
||||
|
||||
/datum/character_disabilities/protanopia/apply_self(var/mob/living/carbon/human/H)
|
||||
H.add_client_color(/datum/client_color/protanopia)
|
||||
H.add_client_color(/datum/client_color/protanopia, TRUE)
|
||||
|
||||
/datum/character_disabilities/tritanopia
|
||||
name = "Tritanopia"
|
||||
desc = "You have difficulty perceiving green and yellow."
|
||||
|
||||
/datum/character_disabilities/tritanopia/apply_self(var/mob/living/carbon/human/H)
|
||||
H.add_client_color(/datum/client_color/tritanopia)
|
||||
H.add_client_color(/datum/client_color/tritanopia, TRUE)
|
||||
|
||||
/datum/character_disabilities/total_colorblind
|
||||
name = "Total Colorblindness"
|
||||
desc = "You cannot see color, only black, white, and shades of gray."
|
||||
|
||||
/datum/character_disabilities/total_colorblind/apply_self(var/mob/living/carbon/human/H)
|
||||
H.add_client_color(/datum/client_color/monochrome)
|
||||
H.add_client_color(/datum/client_color/monochrome, TRUE)
|
||||
|
||||
/datum/character_disabilities/mute
|
||||
name = "Muteness"
|
||||
|
||||
Reference in New Issue
Block a user