[MIRROR] Allows admins to pick colours in VV (#4698)

* added colour picking to VV (#58173)

Co-authored-by: Thunder12345 <stewart@ critar.demon.co.uk>

* Allows admins to pick colours in VV

Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com>
Co-authored-by: Thunder12345 <stewart@ critar.demon.co.uk>
This commit is contained in:
SkyratBot
2021-04-06 13:44:00 +01:00
committed by GitHub
co-authored by Thunder12345 Thunder12345
parent d21165c7d0
commit 1048fc554f
4 changed files with 12 additions and 2 deletions
+1
View File
@@ -1,6 +1,7 @@
#define VV_NUM "Number"
#define VV_TEXT "Text"
#define VV_MESSAGE "Mutiline Text"
#define VV_COLOR "Color"
#define VV_ICON "Icon"
#define VV_ATOM_REFERENCE "Atom Reference"
#define VV_DATUM_REFERENCE "Datum Reference"
+1 -2
View File
@@ -95,5 +95,4 @@
/// Makes sure the input color is text with a # at the start followed by 6 hexadecimal characters. Examples: "#ff1234", "#A38321", COLOR_GREEN_GRAY
/proc/sanitize_ooccolor(color)
var/static/regex/color_regex = regex(@"^#[0-9a-fA-F]{6}$")
return findtext(color, color_regex) ? color : GLOB.normal_ooc_colour
return findtext(color, GLOB.is_color) ? color : GLOB.normal_ooc_colour
+1
View File
@@ -5,6 +5,7 @@ GLOBAL_DATUM_INIT(is_website, /regex, regex("http|www.|\[a-z0-9_-]+.(com|org|net
GLOBAL_DATUM_INIT(is_email, /regex, regex("\[a-z0-9_-]+@\[a-z0-9_-]+.\[a-z0-9_-]+", "i"))
GLOBAL_DATUM_INIT(is_alphanumeric, /regex, regex("\[a-z0-9]+", "i"))
GLOBAL_DATUM_INIT(is_punctuation, /regex, regex("\[.!?]+", "i"))
GLOBAL_DATUM_INIT(is_color, /regex, regex("^#\[0-9a-fA-F]{6}$"))
//finds text strings recognized as links on discord. Mainly used to stop embedding.
GLOBAL_DATUM_INIT(has_discord_embeddable_links, /regex, regex("(https?://\[^\\s|<\]{2,})"))
@@ -11,6 +11,8 @@
else if(istext(var_value))
if(findtext(var_value, "\n"))
. = VV_MESSAGE
else if(findtext(var_value, GLOB.is_color))
. = VV_COLOR
else
. = VV_TEXT
@@ -54,6 +56,7 @@
VV_TEXT,
VV_MESSAGE,
VV_ICON,
VV_COLOR,
VV_ATOM_REFERENCE,
VV_DATUM_REFERENCE,
VV_MOB_REFERENCE,
@@ -269,3 +272,9 @@
while(!D)
.["type"] = D.type
.["value"] = D
if(VV_COLOR)
.["value"] = input("Enter new color:", "Color", current_value) as color|null
if(.["value"] == null)
.["class"] = null
return