diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm
index 94c476cb367..a3dd8375587 100644
--- a/code/__DEFINES/preferences.dm
+++ b/code/__DEFINES/preferences.dm
@@ -6,6 +6,7 @@
#define SOUND_STREAMING 16
#define SOUND_HEARTBEAT 32
#define SOUND_BUZZ 64
+#define MEMBER_PUBLIC 128
#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_STREAMING|SOUND_HEARTBEAT|SOUND_BUZZ)
diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm
index 1be69032cf1..70c63dfc789 100644
--- a/code/__HELPERS/sanitize_values.dm
+++ b/code/__HELPERS/sanitize_values.dm
@@ -44,3 +44,10 @@
if(65 to 70) . += ascii2text(ascii+32) //letters A to F - translates to lowercase
else return default
return .
+
+/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)]"
+
diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm
index 1ef5f60488e..251206bbdbf 100644
--- a/code/__HELPERS/type2type.dm
+++ b/code/__HELPERS/type2type.dm
@@ -354,6 +354,57 @@ proc/tg_text2list(text, glue=",", assocglue=";")
switch(ui_style)
if("Midnight") return 'icons/mob/screen1_Midnight.dmi'
else return 'icons/mob/screen1_White.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
/proc/num2septext(var/theNum, var/sigFig = 7,var/sep=",") // default sigFig (1,000,000)
var/finalNum = num2text(theNum, sigFig)
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index e04289a4479..cd2c6f2854a 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -1,5 +1,8 @@
-
var/global/normal_ooc_colour = "#002eb8"
+var/global/member_ooc_colour = "#035417"
+var/global/mentor_ooc_colour = "#0099cc"
+var/global/moderator_ooc_colour = "#184880"
+var/global/admin_ooc_colour = "#b82e00"
/client/verb/ooc(msg as text)
set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite
@@ -36,21 +39,29 @@ var/global/normal_ooc_colour = "#002eb8"
return
log_ooc("[mob.name]/[key] : [msg]")
-
+
var/display_colour = normal_ooc_colour
if(holder && !holder.fakekey)
- display_colour = "#0099cc" //light blue
+ display_colour = mentor_ooc_colour
if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0))
- display_colour = "#184880" //dark blue
+ display_colour = moderator_ooc_colour
else if(check_rights(R_ADMIN,0))
if(config.allow_admin_ooccolor)
display_colour = src.prefs.ooccolor
else
- display_colour = "#b82e00" //orange
-
+ display_colour = admin_ooc_colour
+
+ if(prefs.unlock_content)
+ if(display_colour == normal_ooc_colour)
+ if((prefs.toggles & MEMBER_PUBLIC))
+ display_colour = member_ooc_colour
+
for(var/client/C in clients)
if(C.prefs.toggles & CHAT_OOC)
var/display_name = src.key
+ if(prefs.unlock_content)
+ if(prefs.toggles & MEMBER_PUBLIC)
+ display_name = "[display_name]"
if(holder)
if(holder.fakekey)
if(C.holder)
@@ -72,9 +83,58 @@ var/global/normal_ooc_colour = "#002eb8"
/client/proc/set_ooc(newColor as color)
set name = "Set Player OOC Colour"
- set desc = "Set to yellow for eye burning goodness."
+ set desc = "Modifies the default player OOC color."
set category = "Server"
+
+ if(!check_rights(R_SERVER)) return
+
normal_ooc_colour = newColor
+ message_admins("[key_name_admin(usr)] has set the default player OOC color to [newColor]")
+ log_admin("[key_name(usr)] has set the default player OOC color to [newColor]")
+
+
+ feedback_add_details("admin_verb","SOOC")
+
+/client/proc/reset_ooc()
+ set name = "Reset Player OOC Color"
+ set desc = "Returns the default player OOC color to default."
+ set category = "Server"
+
+ if(!check_rights(R_SERVER)) return
+
+ normal_ooc_colour = initial(normal_ooc_colour)
+ message_admins("[key_name_admin(usr)] has reset the default player OOC color")
+ log_admin("[key_name(usr)] has reset the default player OOC color")
+
+ feedback_add_details("admin_verb","ROOC")
+
+/client/proc/colorooc()
+ set name = "Set Your OOC Color"
+ set desc = "Allows you to pick a custom OOC color."
+ set category = "Preferences"
+
+ if(!check_rights(R_ADMIN)) return
+
+ var/new_ooccolor = input(src, "Please select your OOC color.", "OOC color", prefs.ooccolor) as color|null
+ if(new_ooccolor)
+ prefs.ooccolor = new_ooccolor
+ prefs.save_preferences(src)
+ usr << "Your OOC color has been set to [new_ooccolor]."
+
+ feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
+/client/proc/resetcolorooc()
+ set name = "Reset Your OOC Color"
+ set desc = "Returns your OOC color to default."
+ set category = "Preferences"
+
+ if(!check_rights(R_ADMIN)) return
+
+ prefs.ooccolor = initial(prefs.ooccolor)
+ prefs.save_preferences(src)
+ usr << "Your OOC color has been reset."
+
+ feedback_add_details("admin_verb","ROC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/looc(msg as text)
set name = "LOOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 701f3d48396..cacb36a1ff8 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -16,7 +16,8 @@ var/list/admin_verbs_admin = list(
/datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/
/datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/
/datum/admins/proc/announce, /*priority announce something to all clients.*/
- /client/proc/colorooc, /*allows us to set a custom colour for everythign we say in ooc*/
+ /client/proc/colorooc, /*allows us to set a custom colour for everything we say in ooc*/
+ /client/proc/resetcolorooc, /*allows us to set a reset our ooc color*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/toggle_view_range, /*changes how far we can see*/
/datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/
@@ -128,7 +129,8 @@ var/list/admin_verbs_server = list(
/client/proc/delbook,
/client/proc/toggle_antagHUD_use,
/client/proc/toggle_antagHUD_restrictions,
- /client/proc/set_ooc
+ /client/proc/set_ooc,
+ /client/proc/reset_ooc
)
var/list/admin_verbs_debug = list(
/client/proc/cmd_admin_list_open_jobs,
@@ -346,17 +348,6 @@ var/list/admin_verbs_mentor = list(
feedback_add_details("admin_verb","S") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
-/client/proc/colorooc()
- set category = "Admin"
- set name = "Personal OOC Text Color"
- if(!holder) return
- var/new_ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color|null
- if(new_ooccolor)
- prefs.ooccolor = new_ooccolor
- prefs.save_preferences(src)
- feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- return
-
/client/proc/stealth()
set category = "Admin"
set name = "Stealth Mode"
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 1141e0e043d..1376f088aea 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -179,6 +179,12 @@
..() //redirect to hsrc.Topic()
+/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
+
/client/proc/handle_spam_prevention(var/message, var/mute_type)
if(config.automute_on && !holder && src.last_message == message)
src.last_message_count++
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index a2e2387eebc..338d57dd616 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -67,18 +67,20 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
return max(0, days - C.player_age)
return 0
-var/const/MAX_SAVE_SLOTS = 10
-
//used for alternate_option
#define GET_RANDOM_JOB 0
#define BE_CIVILIAN 1
#define RETURN_TO_LOBBY 2
+#define MAX_SAVE_SLOTS 10 // Save slots for regular players
+#define MAX_SAVE_SLOTS_MEMBER 10 // Save slots for BYOND members
+
datum/preferences
//doohickeys for savefiles
// var/path
var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used
// var/savefile_version = 0
+ var/max_save_slots = MAX_SAVE_SLOTS
//non-preference stuff
var/warns = 0
@@ -183,9 +185,17 @@ datum/preferences
// jukebox volume
var/volume = 100
+
+ // BYOND membership
+ var/unlock_content = 0
+
/datum/preferences/New(client/C)
b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
-
+ if(istype(C))
+ if(!IsGuestKey(C.key))
+ unlock_content = C.IsByondMember()
+ if(unlock_content)
+ max_save_slots = MAX_SAVE_SLOTS_MEMBER
var/loaded_preferences_successfully = load_preferences(C)
if(loaded_preferences_successfully)
if(load_character(C))
@@ -369,14 +379,23 @@ datum/preferences
dat += "Alpha (transparency): [UI_style_alpha]
"
dat += "Play admin midis: [(sound & SOUND_MIDI) ? "Yes" : "No"]
"
dat += "Play lobby music: [(sound & SOUND_LOBBY) ? "Yes" : "No"]
"
- dat += "Randomized Character Slot: [randomslot ? "Yes" : "No"]
"
+ dat += "Randomized character slot: [randomslot ? "Yes" : "No"]
"
dat += "Ghost ears: [(toggles & CHAT_GHOSTEARS) ? "Nearest Creatures" : "All Speech"]
"
dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "Nearest Creatures" : "All Emotes"]
"
dat += "Ghost radio: [(toggles & CHAT_GHOSTRADIO) ? "Nearest Speakers" : "All Chatter"]
"
-
-
if(config.allow_Metadata)
- dat += "OOC Notes: Edit
"
+ dat += "OOC notes: Edit
"
+
+ if(user.client)
+ if(user.client.holder)
+ dat += "Adminhelp sound: "
+ dat += "[(sound & SOUND_ADMINHELP)?"On":"Off"]
"
+
+ if(check_rights(R_ADMIN,0))
+ dat += "OOC: Change
"
+
+ if(unlock_content)
+ dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
"
dat += "