diff --git a/SQL/paradise_schema.sql b/SQL/paradise_schema.sql
index ed0845ed33f..6e227b211a5 100644
--- a/SQL/paradise_schema.sql
+++ b/SQL/paradise_schema.sql
@@ -275,6 +275,7 @@ CREATE TABLE `player` (
`show_ghostitem_attack` smallint(4) DEFAULT '1',
`lastchangelog` varchar(32) NOT NULL DEFAULT '0',
`windowflashing` smallint(4) DEFAULT '1',
+ `ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0',
`exp` mediumtext,
PRIMARY KEY (`id`),
UNIQUE KEY `ckey` (`ckey`)
diff --git a/SQL/paradise_schema_prefixed.sql b/SQL/paradise_schema_prefixed.sql
index 216082157d4..a7ad598a143 100644
--- a/SQL/paradise_schema_prefixed.sql
+++ b/SQL/paradise_schema_prefixed.sql
@@ -274,6 +274,7 @@ CREATE TABLE `SS13_player` (
`show_ghostitem_attack` smallint(4) DEFAULT '1',
`lastchangelog` varchar(32) NOT NULL DEFAULT '0',
`windowflashing` smallint(4) DEFAULT '1',
+ `ghost_anonsay` tinyint(1) NOT NULL DEFAULT '0',
`exp` mediumtext,
PRIMARY KEY (`id`),
UNIQUE KEY `ckey` (`ckey`)
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index 5408d6fcdfe..15af19c19e4 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -95,6 +95,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/UI_style_alpha = 255
var/windowflashing = TRUE
+ //ghostly preferences
+ var/ghost_anonsay = 0
//character preferences
var/real_name //our character's name
@@ -446,6 +448,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
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"]
"
+ dat += "Deadchat anonymity: [ghost_anonsay ? "Anonymous" : "Not Anonymous"]
"
dat += "
"
dat += "Special Role Settings"
@@ -1997,6 +2000,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if("ghost_radio")
toggles ^= CHAT_GHOSTRADIO
+ if("ghost_anonsay")
+ ghost_anonsay = !ghost_anonsay
+
if("save")
save_preferences(user)
save_character(user)
diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm
index c7716c33eed..a945af5ba2f 100644
--- a/code/modules/client/preference/preferences_mysql.dm
+++ b/code/modules/client/preference/preferences_mysql.dm
@@ -14,8 +14,9 @@
nanoui_fancy,
show_ghostitem_attack,
lastchangelog,
- exp,
- windowflashing
+ windowflashing,
+ ghost_anonsay,
+ exp
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -42,8 +43,9 @@
nanoui_fancy = text2num(query.item[11])
show_ghostitem_attack = text2num(query.item[12])
lastchangelog = query.item[13]
- exp = query.item[14]
- windowflashing = text2num(query.item[15])
+ windowflashing = text2num(query.item[14])
+ ghost_anonsay = text2num(query.item[15])
+ exp = query.item[16]
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -58,8 +60,9 @@
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
show_ghostitem_attack = sanitize_integer(show_ghostitem_attack, 0, 1, initial(show_ghostitem_attack))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
- exp = sanitize_text(exp, initial(exp))
windowflashing = sanitize_integer(windowflashing, 0, 1, initial(windowflashing))
+ ghost_anonsay = sanitize_integer(ghost_anonsay, 0, 1, initial(ghost_anonsay))
+ exp = sanitize_text(exp, initial(exp))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -85,7 +88,8 @@
nanoui_fancy='[nanoui_fancy]',
show_ghostitem_attack='[show_ghostitem_attack]',
lastchangelog='[lastchangelog]',
- windowflashing='[windowflashing]'
+ windowflashing='[windowflashing]',
+ ghost_anonsay='[ghost_anonsay]'
WHERE ckey='[C.ckey]'"}
)
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index db6ef63ad22..75ff52b6478 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -22,7 +22,6 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = 1
var/atom/movable/following = null
- var/anonsay = 0
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
@@ -596,15 +595,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//END TELEPORT HREF CODE
/mob/dead/observer/verb/toggle_anonsay()
+ set name = "Toggle Anonymous Dead-chat"
set category = "Ghost"
- set name = "Toggle Anonymous Chat"
set desc = "Toggles showing your key in dead chat."
-
- src.anonsay = !src.anonsay
- if(anonsay)
- to_chat(src, "Your key won't be shown when you speak in dead chat.")
- else
- to_chat(src, "Your key will be publicly visible again.")
+ client.prefs.ghost_anonsay = !client.prefs.ghost_anonsay
+ to_chat(src, "As a ghost, your key will [(client.prefs.ghost_anonsay) ? "no longer" : "now"] be shown when you speak in dead chat.")
+ client.prefs.save_preferences(src)
/mob/dead/observer/verb/toggle_ghostsee()
set name = "Toggle Ghost Vision"
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 9922fed8789..2e83e9b9a95 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -442,9 +442,9 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
if(istype(subject, /mob/dead/observer))
DM = subject
if(check_rights(R_ADMIN|R_MOD,0,M)) // What admins see
- lname = "[keyname][(DM && DM.anonsay) ? "*" : (DM ? "" : "^")] ([name])"
+ lname = "[keyname][(DM && DM.client && DM.client.prefs.ghost_anonsay) ? "*" : (DM ? "" : "^")] ([name])"
else
- if(DM && DM.anonsay) // If the person is actually observer they have the option to be anonymous
+ if(DM && DM.client && DM.client.prefs.ghost_anonsay) // If the person is actually observer they have the option to be anonymous
lname = "Ghost of [name]"
else if(DM) // Non-anons
lname = "[keyname] ([name])"
|