From e99bde9c55bc82274b0642f217dd4262e387be25 Mon Sep 17 00:00:00 2001 From: "VivianFoxfoot@gmail.com" Date: Mon, 9 Apr 2012 14:33:11 +0000 Subject: [PATCH] Re-adds metadata support. Adds ghost sight as its own verb to see all emotes in the world. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3419 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/configuration.dm | 4 ++ code/modules/mob/living/carbon/human/emote.dm | 8 ++-- code/modules/mob/mob.dm | 41 ++++++++++++++++++- code/modules/mob/new_player/preferences.dm | 29 +++++++++++++ code/modules/mob/new_player/savefile.dm | 10 +++++ tgstation.dme | 1 + 6 files changed, 89 insertions(+), 4 deletions(-) diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index 2fc67fe9c3e..d1fc6c29bd2 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -33,6 +33,7 @@ var/traitor_scaling = 0 //if amount of traitors scales based on amount of players var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other var/Tensioner_Active = 0 // If the tensioner is running. + var/allow_Metadata = 0 // Metadata is suported. var/list/mode_names = list() var/list/modes = list() // allowed modes @@ -230,6 +231,9 @@ if ("feature_object_spell_system") config.feature_object_spell_system = 1 + if ("allow_metadata") + config.allow_Metadata = 1 + if ("traitor_scaling") config.traitor_scaling = 1 diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 5c6da539353..b8b6f25bbf5 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -467,15 +467,17 @@ if (message) log_emote("[name]/[key] : [message]") -/* Hearing gasp and such every five seconds is not good emotes were not global for a reason. + //Hearing gasp and such every five seconds is not good emotes were not global for a reason. + // Maybe some people are okay with that. + for(var/mob/M in world) if (!M.client) continue //skip monkeys and leavers if (istype(M, /mob/new_player)) continue - if(M.stat == 2 && M.client.ghost_ears && !(M in viewers(src,null))) + if(M.stat == 2 && M.client.ghost_sight && !(M in viewers(src,null))) M.show_message(message) -*/ + if (m_type & 1) for (var/mob/O in viewers(src, null)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4b6f4665d60..1241496b092 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -489,6 +489,19 @@ else usr << "\blue Now you hear speech only from nearest creatures." +/client/var/ghost_sight = 1 +/client/verb/toggle_ghost_sight() + set name = "Ghost sight" + set category = "OOC" + set desc = "Hear emotes from everywhere" + ghost_sight = !ghost_sight + if (ghost_sight) + usr << "\blue Now you hear all emotes in the world" + else + usr << "\blue Now you hear emotes only from nearest creatures." + + + /mob/verb/observe() set name = "Observe" set category = "OOC" @@ -1145,4 +1158,30 @@ note dizziness decrements automatically in the mob's Life() proc. for(var/file in args) src << browse_rsc(file) return 1 - return 0 \ No newline at end of file + return 0 + + + + + +/mob/living/verb/Examine_OOC() + set name = "Examine Meta-Info (OOC)" + set category = "OOC" + set src in view() + + + if(config.allow_Metadata) + usr << "[src]'s Metainfo:" + + if(src.storedpreferences) + usr << "[src]'s OOC Notes: [src.storedpreferences.metadata]" + + + else + usr << "[src] does not have any stored infomation!" + + + else + usr << "OOC Metadata is not supported by this server!" + + return \ No newline at end of file diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 9df82c6f570..ba290f2207e 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -58,6 +58,7 @@ datum/preferences midis = 1 //Toggle ghost ears ghost_ears = 1 + ghost_sight = 1 //Saved changlog filesize to detect if there was a change lastchangelog = 0 @@ -113,6 +114,9 @@ datum/preferences job_engsec_med = 0 job_engsec_low = 0 + // OOC Metadata: + metadata = "" + New() hair_style = new/datum/sprite_accessory/hair/short @@ -139,6 +143,10 @@ datum/preferences dat += "UI Style: [UI == UI_NEW ? "New" : "Old"]
" dat += "Play admin midis: [midis == 1 ? "Yes" : "No"]
" dat += "Ghost ears: [ghost_ears == 0 ? "Nearest Creatures" : "All Speech"]
" + dat += "Ghost sight: [ghost_sight == 0 ? "Nearest Creatures" : "All Emotes"]
" + + if(config.allow_Metadata) + dat += "OOC Notes/ERP Preferences: Edit
" if((user.client) && (user.client.holder) && (user.client.holder.rank) && (user.client.holder.level >= 5)) dat += "
OOC
" @@ -419,6 +427,23 @@ datum/preferences if("random") age = rand (20, 45) + if(link_tags["OOC"]) + var/tempnote = "" + tempnote = input(user, "Please enter your OOC/ERP Notes!:", "OOC notes" , metadata) as text + var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9") + + for(var/c in bad_characters) + tempnote = dd_replacetext(tempnote, c, "") + + if(length(tempnote) >= 255) + alert("That name is too long. (255 character max, please)") + return + + metadata = tempnote + return + + + if(link_tags["b_type"]) switch(link_tags["b_type"]) @@ -563,6 +588,9 @@ datum/preferences if(link_tags["ghost_ears"]) ghost_ears = !ghost_ears + if(link_tags["ghost_sight"]) + ghost_sight = !ghost_sight + if(link_tags["underwear"]) switch(link_tags["underwear"]) if("inputmale") @@ -705,6 +733,7 @@ datum/preferences C.be_pai = be_special & BE_PAI if(isnull(src.ghost_ears)) src.ghost_ears = 1 //There were problems where the default was null before someone saved their profile. C.ghost_ears = src.ghost_ears + C.ghost_sight = src.ghost_sight #undef UI_OLD diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 33635246d48..d65dc0d1309 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -57,9 +57,12 @@ datum/preferences/proc/savefile_save(mob/user) F["UI"] << src.UI F["midis"] << src.midis F["ghost_ears"] << src.ghost_ears + F["ghost_sight"] << src.ghost_sight F["ooccolor"] << src.ooccolor F["lastchangelog"] << src.lastchangelog + F["OOC_Notes"] << src.metadata + return 1 // loads the savefile corresponding to the mob's ckey @@ -108,6 +111,8 @@ datum/preferences/proc/savefile_load(mob/user) F["midis"] >> src.midis F["ghost_ears"] >> src.ghost_ears if(isnull(ghost_ears)) ghost_ears = 1 //Hotfix + F["ghost_sight"] >> src.ghost_sight + if(isnull(ghost_sight)) ghost_sight = 1 //Hotfix F["ooccolor"] >> src.ooccolor F["lastchangelog"] >> src.lastchangelog F["UI"] >> src.UI @@ -125,6 +130,11 @@ datum/preferences/proc/savefile_load(mob/user) F["job_engsec_med"] >> src.job_engsec_med F["job_engsec_low"] >> src.job_engsec_low + F[OOC_Notes"] >> src.metadata + + if(isnull(metadata)) + metadata = "" + //NOTE: Conversion things go inside this if statement //When updating the save file remember to add 1 to BOTH the savefile constants //Also take the old conversion things that no longer apply out of this if diff --git a/tgstation.dme b/tgstation.dme index 1c37fc35f81..02f7fe8b510 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -178,6 +178,7 @@ #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" +#define FILE_DIR "maps/backup" #define FILE_DIR "sound" #define FILE_DIR "sound/AI" #define FILE_DIR "sound/ambience"