diff --git a/code/__DEFINES.dm b/code/__DEFINES.dm
index 242b17f8ef3..399f4ade816 100644
--- a/code/__DEFINES.dm
+++ b/code/__DEFINES.dm
@@ -402,8 +402,9 @@ var/list/TAGGERLOCATIONS = list("Disposals",
#define CHAT_GHOSTSIGHT 128
#define CHAT_PRAYER 256
#define CHAT_RADIO 512
+#define MEMBER_PUBLIC 1024
-#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO)
+#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|MEMBER_PUBLIC)
#define BE_TRAITOR 1
#define BE_OPERATIVE 2
diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm
index dfcc7d314b0..c065fec9b81 100644
--- a/code/__HELPERS/sanitize_values.dm
+++ b/code/__HELPERS/sanitize_values.dm
@@ -54,4 +54,10 @@
if(default) return default
return crunch + repeat_string(desired_format, "0")
- return crunch + .
\ No newline at end of file
+ return crunch + .
+
+/proc/sanitize_ooccolor(color)
+ 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)]"
\ No newline at end of file
diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm
index c7045f207c1..21dc90509a4 100644
--- a/code/__HELPERS/type2type.dm
+++ b/code/__HELPERS/type2type.dm
@@ -243,4 +243,55 @@ proc/tg_list2text(list/list, glue=",")
switch(ui_style)
if("Retro") return 'icons/mob/screen_retro.dmi'
if("Plasmafire") return 'icons/mob/screen_plasmafire.dmi'
- else return 'icons/mob/screen_midnight.dmi'
\ No newline at end of file
+ else return 'icons/mob/screen_midnight.dmi'
+
+//colour formats
+/proc/rgb2hsl(red, green, blue)
+ red /= 255;green /= 255;blue /= 255;
+ var/max = max(red,green,blue)
+ var/min = min(red,green,blue)
+ var/range = max-min
+
+ var/hue=0;var/saturation=0;var/lightness=0;
+ lightness = (max + min)/2
+ if(range != 0)
+ if(lightness < 0.5) saturation = range/(max+min)
+ else saturation = range/(2-max-min)
+
+ var/dred = ((max-red)/(6*max)) + 0.5
+ var/dgreen = ((max-green)/(6*max)) + 0.5
+ var/dblue = ((max-blue)/(6*max)) + 0.5
+
+ if(max==red) hue = dblue - dgreen
+ else if(max==green) hue = dred - dblue + (1/3)
+ else hue = dgreen - dred + (2/3)
+ if(hue < 0) hue++
+ else if(hue > 1) hue--
+
+ return list(hue, saturation, lightness)
+
+/proc/hsl2rgb(hue, saturation, lightness)
+ var/red;var/green;var/blue;
+ if(saturation == 0)
+ red = lightness * 255
+ green = red
+ blue = red
+ else
+ var/a;var/b;
+ if(lightness < 0.5) b = lightness*(1+saturation)
+ else b = (lightness+saturation) - (saturation*lightness)
+ a = 2*lightness - b
+
+ red = round(255 * hue2rgb(a, b, hue+(1/3)))
+ green = round(255 * hue2rgb(a, b, hue))
+ blue = round(255 * hue2rgb(a, b, hue-(1/3)))
+
+ return list(red, green, blue)
+
+/proc/hue2rgb(a, b, hue)
+ if(hue < 0) hue++
+ else if(hue > 1) hue--
+ if(6*hue < 1) return (a+(b-a)*6*hue)
+ if(2*hue < 1) return b
+ if(3*hue < 2) return (a+(b-a)*((2/3)-hue)*6)
+ return a
\ No newline at end of file
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index f64a36c9c05..7ebf272cf4d 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -37,8 +37,11 @@
return
log_ooc("[mob.name]/[key] : [msg]")
-
- var/keyname = unlock_content ? "[key]" : key
+
+ var/keyname = key
+ if(prefs.unlock_content)
+ if(prefs.toggles & MEMBER_PUBLIC)
+ keyname = "
[keyname]"
for(var/client/C in clients)
if(C.prefs.toggles & CHAT_OOC)
@@ -65,13 +68,12 @@ var/global/normal_ooc_colour = "#002eb8"
set name = "OOC Text Color"
set category = "Preferences"
- if(!unlock_content && !(holder && (holder.rights & R_ADMIN)))
- src << "You must be a byond member or admin with +ADMIN rights to access this feature. Sorry"
- return
+ if(!holder || !(holder.rights & R_ADMIN))
+ if(!is_content_unlocked()) return
var/new_ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color|null
if(new_ooccolor)
- prefs.ooccolor = new_ooccolor
+ prefs.ooccolor = sanitize_ooccolor(new_ooccolor)
prefs.save_preferences()
feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
\ No newline at end of file
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index a35fb151745..910f7530bb2 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -26,7 +26,7 @@
/client/proc/massmodify_variables(var/atom/O, var/var_name = "", var/method = 0)
if(!check_rights(R_VAREDIT)) return
- var/list/locked = list("vars", "key", "ckey", "client")
+ var/list/locked = list("vars", "key", "ckey", "client", "unlock_content")
for(var/p in forbidden_varedit_object_types)
if( istype(O,p) )
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index da36e048340..5ffda7985a6 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -130,7 +130,7 @@ var/list/forbidden_varedit_object_types = list(
if(!istype(L,/list)) src << "Not a List."
- var/list/locked = list("vars", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo")
+ var/list/locked = list("vars", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content")
var/list/ckey_edit = list("key", "ckey")
var/list/icon_edit = list("icon", "icon_state", "overlays", "underlays")
var/list/names = sortList(L)
@@ -274,7 +274,7 @@ var/list/forbidden_varedit_object_types = list(
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
if(!check_rights(R_VAREDIT)) return
- var/list/locked = list("vars", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "mutantrace")
+ var/list/locked = list("vars", "client", "virus", "cuffed", "last_eaten", "mutantrace")
var/list/ckey_edit = list("key", "ckey")
var/list/icon_edit = list("icon", "icon_state", "overlays", "underlays")
diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm
index b88ee8fadd3..3ef743c60b8 100644
--- a/code/modules/client/client defines.dm
+++ b/code/modules/client/client defines.dm
@@ -17,8 +17,6 @@
var/adminobs = null
var/area = null
- var/unlock_content = 0 //byond-member content
-
///////////////
//SOUND STUFF//
///////////////
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 3056a000378..adef2c387cc 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -87,8 +87,6 @@
if(byond_version < MIN_CLIENT_VERSION) //Out of date client.
return null
- unlock_content = IsByondMember()
-
clients += src
directory[ckey] = src
@@ -269,4 +267,10 @@
'icons/stamp_icons/large_stamp-cap.png',
'icons/stamp_icons/large_stamp-qm.png',
'icons/stamp_icons/large_stamp-law.png'
- )
\ No newline at end of file
+ )
+
+/client/proc/is_content_unlocked()
+ if(!prefs.unlock_content)
+ src << "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Click Here to find out more."
+ return 0
+ return 1
\ No newline at end of file
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index b9fd5d3e4a3..cab7dd9c4ae 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -35,6 +35,7 @@ datum/preferences
var/be_special = 0 //Special role selection
var/UI_style = "Midnight"
var/toggles = TOGGLES_DEFAULT
+ var/ghost_form = "ghost"
//character preferences
var/real_name //our character's name
@@ -76,6 +77,8 @@ datum/preferences
// OOC Metadata:
var/metadata = ""
+
+ var/unlock_content = 0
/datum/preferences/New(client/C)
b_type = random_blood_type()
@@ -83,7 +86,8 @@ datum/preferences
if(istype(C))
if(!IsGuestKey(C.key))
load_path(C.ckey)
- if(C.unlock_content)
+ unlock_content = C.IsByondMember()
+ if(unlock_content)
max_save_slots = 8
var/loaded_preferences_successfully = load_preferences()
if(loaded_preferences_successfully)
@@ -203,12 +207,16 @@ datum/preferences
if(user.client)
if(user.client.holder)
- dat += "Adminhelp Sound: "
+ dat += "Adminhelp Sound: "
dat += "[(toggles & SOUND_ADMINHELP)?"On":"Off"]
"
- if(user.client.unlock_content || (user.client.holder && (user.client.holder.rights & R_ADMIN)))
- dat += "
OOC
"
- dat += " Change
"
+ if(unlock_content || (user.client.holder && (user.client.holder.rights & R_ADMIN)))
+ dat += "OOC: Change
"
+
+ if(unlock_content)
+ dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
"
+ dat += "Ghost Form: [ghost_form]
"
+
dat += "