This commit is contained in:
Ghommie
2020-02-05 04:34:54 +01:00
146 changed files with 1190 additions and 1257 deletions
+4
View File
@@ -94,6 +94,10 @@
if (CONFIG_GET(flag/log_emote))
WRITE_LOG(GLOB.world_game_log, "EMOTE: [text]")
/proc/log_subtler(text)
if (CONFIG_GET(flag/log_emote))
WRITE_LOG(GLOB.world_game_log, "EMOTE (SUBTLER): [text]")
/proc/log_prayer(text)
if (CONFIG_GET(flag/log_prayer))
WRITE_LOG(GLOB.world_game_log, "PRAY: [text]")
+11 -5
View File
@@ -46,19 +46,25 @@
var/start = 1 + (text2ascii(color, 1) == 35)
var/len = length(color)
var/char = ""
// RRGGBB -> RGB but awful
var/convert_to_shorthand = desired_format == 3 && length_char(color) > 3
. = ""
for(var/i = start, i <= len, i += length(char))
var/i = start
while(i <= len)
char = color[i]
switch(text2ascii(char))
if(48 to 57) //numbers 0 to 9
if(48 to 57) //numbers 0 to 9
. += char
if(97 to 102) //letters a to f
if(97 to 102) //letters a to f
. += char
if(65 to 70) //letters A to F - translates to lowercase
if(65 to 70) //letters A to F
. += lowertext(char)
else
break
i += length(char)
if(convert_to_shorthand && i <= len) //skip next one
i += length(color[i])
if(length_char(.) != desired_format)
if(default)
@@ -73,4 +79,4 @@
var/list/HSL = rgb2hsl(hex2num(copytext(color, 2, 4)), hex2num(copytext(color, 4, 6)), hex2num(copytext(color, 6, 8)))
HSL[3] = min(HSL[3],0.4)
var/list/RGB = hsl2rgb(arglist(HSL))
return "#[num2hex(RGB[1],2)][num2hex(RGB[2],2)][num2hex(RGB[3],2)]"
return "#[num2hex(RGB[1],2)][num2hex(RGB[2],2)][num2hex(RGB[3],2)]"