diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 8a405d72..e9d829b6 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -229,119 +229,6 @@ var/global/floorIsLava = 0 feedback_add_details("admin_verb","SPP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/player_info/var/author // admin who authored the information -/datum/player_info/var/rank //rank of admin who made the notes -/datum/player_info/var/content // text content of the information -/datum/player_info/var/timestamp // Because this is bloody annoying - -#define PLAYER_NOTES_ENTRIES_PER_PAGE 50 -/datum/admins/proc/PlayerNotes() - set category = "Admin" - set name = "Player Notes" - if (!istype(src,/datum/admins)) - src = usr.client.holder -/* if (!istype(src,/datum/admins)) - usr << "Error: you are not an admin!" - return -*/ - if(!check_rights(R_ADMIN|R_MOD)) - return - - if(config.ban_legacy_system) - PlayerNotesPage(1) - else - show_notes_sql() - -/datum/admins/proc/PlayerNotesPage(page) - var/dat = "Player notes
" - var/savefile/S=new("data/player_notes.sav") - var/list/note_keys - S >> note_keys - if(!note_keys) - dat += "No notes found." - else - dat += "" - note_keys = sortList(note_keys) - - // Display the notes on the current page - var/number_pages = note_keys.len / PLAYER_NOTES_ENTRIES_PER_PAGE - // Emulate ceil(why does BYOND not have ceil) - if(number_pages != round(number_pages)) - number_pages = round(number_pages) + 1 - var/page_index = page - 1 - if(page_index < 0 || page_index >= number_pages) - return - - var/lower_bound = page_index * PLAYER_NOTES_ENTRIES_PER_PAGE + 1 - var/upper_bound = (page_index + 1) * PLAYER_NOTES_ENTRIES_PER_PAGE - upper_bound = min(upper_bound, note_keys.len) - for(var/index = lower_bound, index <= upper_bound, index++) - var/t = note_keys[index] - dat += "" - - dat += "
[t]

" - - // Display a footer to select different pages - for(var/index = 1, index <= number_pages, index++) - if(index == page) - dat += "" - dat += "[index] " - if(index == page) - dat += "" - - usr << browse(dat, "window=player_notes;size=400x400") - - -/datum/admins/proc/player_has_info(var/key as text) - var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav") - var/list/infos - info >> infos - if(!infos || !infos.len) return 0 - else return 1 - -/datum/admins/proc/show_player_info(var/key as text) - set category = "Admin" - set name = "Show Player Info" - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - usr << "Error: you are not an admin!" - return - - if(config.ban_legacy_system) - var/dat = "Info on [key]" - dat += "" - - var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav") - var/list/infos - info >> infos - if(!infos) - dat += "No information found on the given key.
" - else - var/update_file = 0 - var/i = 0 - for(var/datum/player_info/I in infos) - i += 1 - if(!I.timestamp) - I.timestamp = "Pre-4/3/2012" - update_file = 1 - if(!I.rank) - I.rank = "N/A" - update_file = 1 - dat += "[I.content] by [I.author] ([I.rank]) on [I.timestamp] " - if(I.author == usr.key || I.author == "Adminbot") - dat += "Remove" - dat += "

" - if(update_file) info << infos - - dat += "
" - dat += "Add Comment
" - - dat += "" - usr << browse(dat, "window=adminplayerinfo;size=480x480") - else - show_notes_sql(key) - /datum/admins/proc/access_news_network() //MARKER set category = "Fun" set name = "Access Newscaster Network" diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm index 56c6aa65..d2ac8d48 100644 --- a/code/modules/admin/player_notes.dm +++ b/code/modules/admin/player_notes.dm @@ -85,6 +85,121 @@ datum/admins/proc/notes_gethtml(var/ckey) //Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky. + +//Moved stuff here because well, this is the notes file >_< +/datum/player_info/var/author // admin who authored the information +/datum/player_info/var/rank //rank of admin who made the notes +/datum/player_info/var/content // text content of the information +/datum/player_info/var/timestamp // Because this is bloody annoying + +#define PLAYER_NOTES_ENTRIES_PER_PAGE 50 +/datum/admins/proc/PlayerNotes() + set category = "Admin" + set name = "Player Notes" + if (!istype(src,/datum/admins)) + src = usr.client.holder +/* if (!istype(src,/datum/admins)) + usr << "Error: you are not an admin!" + return +*/ + if(!check_rights(R_ADMIN|R_MOD)) + return + + if(config.ban_legacy_system) + PlayerNotesPage(1) + else + show_notes_sql() + +/datum/admins/proc/PlayerNotesPage(page) + var/dat = "Player notes
" + var/savefile/S=new("data/player_notes.sav") + var/list/note_keys + S >> note_keys + if(!note_keys) + dat += "No notes found." + else + dat += "" + note_keys = sortList(note_keys) + + // Display the notes on the current page + var/number_pages = note_keys.len / PLAYER_NOTES_ENTRIES_PER_PAGE + // Emulate ceil(why does BYOND not have ceil) + if(number_pages != round(number_pages)) + number_pages = round(number_pages) + 1 + var/page_index = page - 1 + if(page_index < 0 || page_index >= number_pages) + return + + var/lower_bound = page_index * PLAYER_NOTES_ENTRIES_PER_PAGE + 1 + var/upper_bound = (page_index + 1) * PLAYER_NOTES_ENTRIES_PER_PAGE + upper_bound = min(upper_bound, note_keys.len) + for(var/index = lower_bound, index <= upper_bound, index++) + var/t = note_keys[index] + dat += "" + + dat += "
[t]

" + + // Display a footer to select different pages + for(var/index = 1, index <= number_pages, index++) + if(index == page) + dat += "" + dat += "[index] " + if(index == page) + dat += "" + + usr << browse(dat, "window=player_notes;size=400x400") + + +/datum/admins/proc/player_has_info(var/key as text) + var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav") + var/list/infos + info >> infos + if(!infos || !infos.len) return 0 + else return 1 + +/datum/admins/proc/show_player_info(var/key as text) + set category = "Admin" + set name = "Show Player Info" + if (!istype(src,/datum/admins)) + src = usr.client.holder + if (!istype(src,/datum/admins)) + usr << "Error: you are not an admin!" + return + + if(config.ban_legacy_system) + var/dat = "Info on [key]" + dat += "" + + var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav") + var/list/infos + info >> infos + if(!infos) + dat += "No information found on the given key.
" + else + var/update_file = 0 + var/i = 0 + for(var/datum/player_info/I in infos) + i += 1 + if(!I.timestamp) + I.timestamp = "Pre-4/3/2012" + update_file = 1 + if(!I.rank) + I.rank = "N/A" + update_file = 1 + dat += "[I.content] by [I.author] ([I.rank]) on [I.timestamp] " + if(I.author == usr.key || I.author == "Adminbot") + dat += "Remove" + dat += "

" + if(update_file) info << infos + + dat += "
" + dat += "Add Comment
" + + dat += "" + usr << browse(dat, "window=adminplayerinfo;size=480x480") + else + show_notes_sql(key) + /proc/notes_add(var/key, var/note, var/mob/usr) if (!key || !note) return @@ -169,4 +284,4 @@ datum/admins/proc/notes_gethtml(var/ckey) for(var/datum/player_info/I in infos) dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A" - return dat + return dat \ No newline at end of file diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 02519121..33e78ef4 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -30,10 +30,12 @@ stafftype = "EVENT" msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) + + if (!msg) //We don't want to log empty messages + return + log_admin("DSAY: [key_name(src)] : [msg]") - if (!msg) - return var/rendered = "DEAD: [stafftype]([src.holder.fakekey ? pick("BADMIN", "hornigranny", "TLF", "scaredforshadows", "KSI", "Silnazi", "HerpEs", "BJ69", "SpoofedEdd", "Uhangay", "Wario90900", "Regarity", "MissPhareon", "LastFish", "unMportant", "Deurpyn", "Fatbeaver") : src.key]) says, \"[msg]\"" @@ -44,12 +46,14 @@ if(!M.client) continue - if(M.client && M.client.holder && (M.client.prefs.toggles & CHAT_DEAD)) // show the message to admins who have deadchat toggled on - if((M.client.holder.rights & R_DUTYOFF) && !(M.client.holder.rights & (R_ADMIN|R_MOD|R_DEV|R_FUN))) - continue - M.show_message(rendered, 2) + if(!(M.client.prefs.toggles & CHAT_DEAD)) + continue - else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // show the message to regular ghosts who have deadchat toggled on + if(M.client.holder && (M.client.holder.rights & (R_ADMIN|R_MOD|R_DEV|R_FUN))) // show the message to admins who have deadchat toggled on + M.show_message(rendered, 2) + continue + + if(M.stat == DEAD) // show the message to regular ghosts who have deadchat toggled on M.show_message(rendered, 2) feedback_add_details("admin_verb","D") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 281933fb..1840efa4 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -100,8 +100,14 @@ if(istype(M, /mob/new_player)) continue - if(M.client && M.client.holder && (M.client.holder.rights & R_ADMIN|R_MOD) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to admins/mods - M << message + if(!M.client) + continue - else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on - M.show_message(message, 2) + if(M.client.prefs.toggles & CHAT_DEAD) + + if(M.client.holder && M.client.holder.rights & (R_ADMIN|R_MOD)) // Show the emote to admins/mods + M << message + continue + + if(M.stat == DEAD) // Show the emote to regular ghosts + M.show_message(message, 2) diff --git a/icons/misc/buildmode.dmi b/icons/misc/buildmode.dmi index a885e76d..40252b5c 100644 Binary files a/icons/misc/buildmode.dmi and b/icons/misc/buildmode.dmi differ