mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Return of Moderator II
Added MOD permissions that cover moderator verbs without admin ones. Ported our notes system. Fixed OOC not displayed for peasants.
This commit is contained in:
@@ -40,6 +40,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
if("everything","host","all") rights |= R_HOST
|
||||
if("sound","sounds") rights |= R_SOUNDS
|
||||
if("spawn","create") rights |= R_SPAWN
|
||||
if("mod") rights |= R_MOD
|
||||
|
||||
admin_ranks[rank] = rights
|
||||
previous_rights = rights
|
||||
|
||||
@@ -208,7 +208,22 @@ var/list/admin_verbs_hideable = list(
|
||||
/proc/possess,
|
||||
/proc/release
|
||||
)
|
||||
|
||||
var/list/admin_verbs_mod = list(
|
||||
/client/proc/check_antagonists, /*shows all antags*/
|
||||
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
|
||||
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
|
||||
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game.*/
|
||||
/client/proc/playernotes,
|
||||
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
|
||||
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
|
||||
/client/proc/hide_verbs, /*hides all our adminverbs*/
|
||||
/client/proc/hide_verbs,
|
||||
/client/proc/mod_panel,
|
||||
/client/proc/cmd_mod_say,
|
||||
/datum/admins/proc/show_player_info
|
||||
//client/proc/Report,
|
||||
//client/proc/display_admin_reports
|
||||
)
|
||||
/client/proc/add_admin_verbs()
|
||||
if(holder)
|
||||
verbs += admin_verbs_default
|
||||
@@ -224,6 +239,7 @@ var/list/admin_verbs_hideable = list(
|
||||
if(holder.rights & R_REJUVINATE) verbs += admin_verbs_rejuv
|
||||
if(holder.rights & R_SOUNDS) verbs += admin_verbs_sounds
|
||||
if(holder.rights & R_SPAWN) verbs += admin_verbs_spawn
|
||||
if(holder.rights & R_MOD) verbs -= admin_verbs_default; verbs += admin_verbs_mod
|
||||
|
||||
/client/proc/remove_admin_verbs()
|
||||
verbs.Remove(
|
||||
@@ -718,7 +734,6 @@ var/list/admin_verbs_hideable = list(
|
||||
M.update_body()
|
||||
M.check_dna(M)
|
||||
*/
|
||||
|
||||
/client/proc/playernotes()
|
||||
set name = "Show Player Info"
|
||||
set category = "Admin"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//This stuff was originally intended to be integrated into the ban-system I was working on
|
||||
//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
|
||||
//enjoy ~Carn
|
||||
|
||||
/*
|
||||
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
|
||||
|
||||
datum/admins/proc/notes_show(var/ckey)
|
||||
@@ -80,4 +80,75 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
notesfile.dir.Remove(ckey)
|
||||
return
|
||||
|
||||
#undef NOTESFILE
|
||||
#undef NOTESFILE
|
||||
*/
|
||||
|
||||
//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
|
||||
|
||||
/proc/notes_add(var/key, var/note, var/mob/usr)
|
||||
if (!key || !note)
|
||||
return
|
||||
|
||||
//Loading list of notes for this key
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos) infos = list()
|
||||
|
||||
//Overly complex timestamp creation
|
||||
var/modifyer = "th"
|
||||
switch(time2text(world.timeofday, "DD"))
|
||||
if("01","21","31")
|
||||
modifyer = "st"
|
||||
if("02","22",)
|
||||
modifyer = "nd"
|
||||
if("03","23")
|
||||
modifyer = "rd"
|
||||
var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
|
||||
if(copytext(day_string,1,2) == "0")
|
||||
day_string = copytext(day_string,2)
|
||||
var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
|
||||
var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
|
||||
|
||||
var/datum/player_info/P = new
|
||||
if (usr)
|
||||
P.author = usr.key
|
||||
P.rank = usr.client.holder.rank
|
||||
else
|
||||
P.author = "Adminbot"
|
||||
P.rank = "Friendly Robot"
|
||||
P.content = note
|
||||
P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
|
||||
|
||||
infos += P
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
|
||||
log_admin("[key_name(usr)] has edited [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
//Updating list of keys with notes on them
|
||||
var/savefile/note_list = new("data/player_notes.sav")
|
||||
var/list/note_keys
|
||||
note_list >> note_keys
|
||||
if(!note_keys) note_keys = list()
|
||||
if(!note_keys.Find(key)) note_keys += key
|
||||
note_list << note_keys
|
||||
del note_list
|
||||
|
||||
|
||||
/proc/notes_del(var/key, var/index)
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos || infos.len < index) return
|
||||
|
||||
var/datum/player_info/item = infos[index]
|
||||
infos.Remove(item)
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
|
||||
//M.client = null
|
||||
del(M.client)
|
||||
|
||||
/*
|
||||
//Player Notes
|
||||
else if(href_list["notes"])
|
||||
var/ckey = href_list["ckey"]
|
||||
@@ -704,7 +704,7 @@
|
||||
if("remove")
|
||||
notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"]))
|
||||
notes_show(ckey)
|
||||
|
||||
*/
|
||||
else if(href_list["removejobban"])
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
@@ -2414,4 +2414,33 @@
|
||||
|
||||
else if(href_list["ac_set_signature"])
|
||||
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
|
||||
src.access_news_network()
|
||||
src.access_news_network()
|
||||
|
||||
// player info stuff
|
||||
|
||||
if(href_list["add_player_info"])
|
||||
var/key = href_list["add_player_info"]
|
||||
var/add = input("Add Player Info") as null|text
|
||||
if(!add) return
|
||||
|
||||
notes_add(key,add,usr)
|
||||
show_player_info(key)
|
||||
|
||||
if(href_list["remove_player_info"])
|
||||
var/key = href_list["remove_player_info"]
|
||||
var/index = text2num(href_list["remove_index"])
|
||||
|
||||
notes_del(key, index)
|
||||
show_player_info(key)
|
||||
|
||||
if(href_list["notes"])
|
||||
var/ckey = href_list["ckey"]
|
||||
if(!ckey)
|
||||
var/mob/M = locate(href_list["mob"])
|
||||
if(ismob(M))
|
||||
ckey = M.ckey
|
||||
|
||||
switch(href_list["notes"])
|
||||
if("show")
|
||||
show_player_info(ckey)
|
||||
return
|
||||
Reference in New Issue
Block a user