diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index 133f6d10..84c502ba 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -1,9 +1,10 @@ #define MEMOFILE "data/memo.sav" //where the memos are saved +#define PLAYERMEMOFILE "data/pmemo.sav" //where the player memos are saved #define ENABLE_MEMOS 1 //using a define because screw making a config variable for it. This is more efficient and purty. //switch verb so we don't spam up the verb lists with like, 3 verbs for this feature. /client/proc/admin_memo(task in list("write","show","delete")) - set name = "Memo" + set name = "Admin Memo" set category = "Server" if(!ENABLE_MEMOS) return if(!check_rights(0)) return @@ -50,5 +51,62 @@ F.dir.Remove(ckey) src << "Removed Memo created by [ckey]." +//switch verb so we don't spam up the verb lists with like, 3 verbs for this feature. +/client/verb/memo_player() + set name = "Player Memo" + set category = "OOC" + if(!ENABLE_MEMOS) return + admin_memo_player_show() + +/client/proc/admin_memo_player(task in list("write","show","delete")) + set name = "Player Memo" + set category = "Server" + + if(!ENABLE_MEMOS) return + if(!check_rights(0)) return + switch(task) + if("write") admin_memo_player_write() + if("show") admin_memo_player_show() + if("delete") admin_memo_player_delete() + +//write a message +/client/proc/admin_memo_player_write() + var/savefile/F = new(PLAYERMEMOFILE) + if(F) + var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message + switch(memo) + if(null) + return + if("") + F.dir.Remove(ckey) + src << "Memo removed" + return + if( findtext(memo,"[memo]" + message_admins("[key] set an player memo:
[memo]") + +//show all memos +/client/proc/admin_memo_player_show() + if(ENABLE_MEMOS) + var/savefile/F = new(PLAYERMEMOFILE) + if(F) + for(var/ckey in F.dir) + src << "
Player Memo by [F[ckey]]
" + +//delete your own or somebody else's memo +/client/proc/admin_memo_player_delete() + var/savefile/F = new(PLAYERMEMOFILE) + if(F) + var/ckey + if(check_rights(R_SERVER,0)) //high ranking admins can delete other admin's memos + ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir + else + ckey = src.ckey + if(ckey) + F.dir.Remove(ckey) + src << "Removed Memo created by [ckey]." + #undef MEMOFILE +#undef PLAYERMEMOFILE #undef ENABLE_MEMOS \ No newline at end of file diff --git a/code/modules/admin/permissionverbs/permsission lists.dm b/code/modules/admin/permissionverbs/permsission lists.dm index 49001093..47cfc4d9 100644 --- a/code/modules/admin/permissionverbs/permsission lists.dm +++ b/code/modules/admin/permissionverbs/permsission lists.dm @@ -31,6 +31,7 @@ var/list/admin_verbs_admin = list( /client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcomm*/ /client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/ /client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/ + /client/proc/admin_memo_player, /client/proc/alertlevels, /client/proc/allow_character_respawn, /* Allows a ghost to respawn */ /client/proc/check_ai_laws, /*shows AI and borg laws*/ diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index c761ead0..693fb45d 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -151,6 +151,7 @@ host = key world.update_status() + admin_memo_player_show() if(holder) add_admin_verbs() admin_memo_show()