From ede4192a60ef12163013566011c57edbdfb2bcbb Mon Sep 17 00:00:00 2001 From: Cheridan Date: Thu, 22 Aug 2013 16:07:10 -0500 Subject: [PATCH] Removes the "Remove All Notes" options from Player Notes. Ckeys are cleared from the list automatically when the last of their notes are erased. --- code/modules/admin/player_notes.dm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm index 6d31be44fa0..c906cd1b778 100644 --- a/code/modules/admin/player_notes.dm +++ b/code/modules/admin/player_notes.dm @@ -12,7 +12,7 @@ datum/admins/proc/notes_gethtml(var/ckey) var/savefile/notesfile = new(NOTESFILE) if(!notesfile) return "Error: Cannot access [NOTESFILE]" if(ckey) - . = "Notes for [ckey]: \[+\] \[-\]
" + . = "Notes for [ckey]: \[+\]
" notesfile.cd = "/[ckey]" var/index = 1 while( !notesfile.eof ) @@ -21,7 +21,7 @@ datum/admins/proc/notes_gethtml(var/ckey) . += "[note] \[-\]
" index++ else - . = "All Notes: \[+\] \[-\]
" + . = "All Notes: \[+\]
" notesfile.cd = "/" for(var/dir in notesfile.dir) . += "[dir]
" @@ -83,17 +83,13 @@ datum/admins/proc/notes_gethtml(var/ckey) for( var/note in noteslist ) notesfile << note - message_admins("[key_name(usr)] removed a note '[admin_msg]' from [ckey]") log_admin("[key_name(usr)] removed a note '[admin_msg]' from [ckey]") - else - notesfile.cd = "/" - if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes") + if(noteslist.len == 0) + notesfile.cd = "/" notesfile.dir.Remove(ckey) - - message_admins("[key_name(usr)] removed all notes from [ckey]") - log_admin("[key_name(usr)] removed all notes from [ckey]") + message_admins("[ckey] has no notes and was removed from the notes list.") return #undef NOTESFILE \ No newline at end of file