mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 16:44:33 +01:00
Merge pull request #10802 from Kyep/playtime_panel_redux
Updates player playtime report
This commit is contained in:
@@ -51,4 +51,6 @@
|
||||
#define EXP_TYPE_SECURITY "Security"
|
||||
#define EXP_TYPE_SILICON "Silicon"
|
||||
#define EXP_TYPE_SERVICE "Service"
|
||||
#define EXP_TYPE_WHITELIST "Whitelist"
|
||||
#define EXP_TYPE_WHITELIST "Whitelist"
|
||||
|
||||
#define EXP_DEPT_TYPE_LIST list(EXP_TYPE_SERVICE, EXP_TYPE_MEDICAL, EXP_TYPE_ENGINEERING, EXP_TYPE_SCIENCE, EXP_TYPE_SECURITY, EXP_TYPE_COMMAND, EXP_TYPE_SILICON, EXP_TYPE_SPECIAL)
|
||||
@@ -449,7 +449,7 @@ proc/pollCandidates(Question, be_special_type, antag_age_check = 0, poll_time =
|
||||
if(jobban_isbanned(G, roletext) || jobban_isbanned(G, "Syndicate"))
|
||||
continue
|
||||
if(config.use_exp_restrictions && min_hours)
|
||||
if(G.client.get_exp_living_num() < min_hours * 60)
|
||||
if(G.client.get_exp_type_num(EXP_TYPE_LIVING) < min_hours * 60)
|
||||
continue
|
||||
if(check_antaghud && cannotPossess(G))
|
||||
continue
|
||||
|
||||
+35
-30
@@ -47,7 +47,7 @@ var/global/list/role_playtime_requirements = list(
|
||||
to_chat(src, "<span class='warning'>Playtime tracking is not enabled.</span>")
|
||||
return
|
||||
|
||||
to_chat(src, "<span class='notice'>Your playtime is [get_exp_living()].</span>")
|
||||
to_chat(src, "<span class='notice'>Your [EXP_TYPE_CREW] playtime is [get_exp_type(EXP_TYPE_CREW)].</span>")
|
||||
|
||||
// Admin Verbs
|
||||
|
||||
@@ -57,36 +57,31 @@ var/global/list/role_playtime_requirements = list(
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_MENTOR))
|
||||
return
|
||||
var/msg = "<html><head><title>Playtime Report</title></head><body>"
|
||||
var/list/players_new = list()
|
||||
var/list/players_old = list()
|
||||
var/pline
|
||||
var/datum/job/theirjob
|
||||
var/jtext
|
||||
msg += "<TABLE border ='1'><TR><TH>Player</TH><TH>Job</TH><TH>Crew</TH>"
|
||||
for(var/thisdept in EXP_DEPT_TYPE_LIST)
|
||||
msg += "<TH>[thisdept]</TH>"
|
||||
msg += "</TR>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
jtext = "No Job"
|
||||
msg += "<TR>"
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
msg += "<TD>[key_name_admin(C.mob)]</TD>"
|
||||
else
|
||||
msg += "<TD>[key_name_mentor(C.mob)]</TD>"
|
||||
|
||||
jtext = "-"
|
||||
if(C.mob.mind && C.mob.mind.assigned_role)
|
||||
theirjob = job_master.GetJob(C.mob.mind.assigned_role)
|
||||
if(theirjob)
|
||||
jtext = theirjob.title
|
||||
if(config.use_exp_restrictions && theirjob.exp_requirements && theirjob.exp_type)
|
||||
jtext += "<span class='warning'>*</span>"
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
pline = "<LI> [key_name_admin(C.mob)]: [jtext]: <A href='?_src_=holder;getplaytimewindow=[C.mob.UID()]'>" + C.get_exp_living() + "</a></LI>"
|
||||
else
|
||||
pline = "<LI> [key_name_mentor(C.mob)]: [jtext]: <A href='?_src_=holder;getplaytimewindow=[C.mob.UID()]'>" + C.get_exp_living() + "</a></LI>"
|
||||
if(C.get_exp_living_num() > 1200)
|
||||
players_old += pline
|
||||
else
|
||||
players_new += pline
|
||||
if(players_new.len)
|
||||
msg += "<BR>Players under 20h:<BR><UL>"
|
||||
msg += players_new.Join()
|
||||
msg += "</UL>"
|
||||
if(players_old.len)
|
||||
msg += "<BR>Players over 20h:<BR><UL>"
|
||||
msg += players_old.Join()
|
||||
msg += "</UL>"
|
||||
msg += "</BODY></HTML>"
|
||||
msg += "<TD>[jtext]</TD>"
|
||||
|
||||
msg += "<TD><A href='?_src_=holder;getplaytimewindow=[C.mob.UID()]'>" + C.get_exp_type(EXP_TYPE_CREW) + "</a></TD>"
|
||||
msg += "[C.get_exp_dept_string()]"
|
||||
msg += "</TR>"
|
||||
|
||||
msg += "</TABLE></BODY></HTML>"
|
||||
src << browse(msg, "window=Player_playtime_check")
|
||||
|
||||
|
||||
@@ -200,14 +195,24 @@ var/global/list/role_playtime_requirements = list(
|
||||
return_text += "</LI></UL>"
|
||||
return return_text
|
||||
|
||||
/client/proc/get_exp_type(var/etype)
|
||||
return get_exp_format(get_exp_type_num(etype))
|
||||
|
||||
/client/proc/get_exp_living()
|
||||
return get_exp_format(get_exp_living_num())
|
||||
|
||||
/client/proc/get_exp_living_num()
|
||||
/client/proc/get_exp_type_num(var/etype)
|
||||
var/list/play_records = params2list(prefs.exp)
|
||||
var/exp_living = text2num(play_records[EXP_TYPE_LIVING])
|
||||
return exp_living
|
||||
return text2num(play_records[etype])
|
||||
|
||||
/client/proc/get_exp_dept_string()
|
||||
var/list/play_records = params2list(prefs.exp)
|
||||
var/list/result_text = list()
|
||||
for(var/thistype in EXP_DEPT_TYPE_LIST)
|
||||
var/thisvalue = text2num(play_records[thistype])
|
||||
if(thisvalue)
|
||||
result_text.Add("<TD>[get_exp_format(thisvalue)]</TD>")
|
||||
else
|
||||
result_text.Add("<TD>-</TD>")
|
||||
return result_text.Join("")
|
||||
|
||||
|
||||
/proc/get_exp_format(var/expnum)
|
||||
if(expnum > 60)
|
||||
|
||||
@@ -62,7 +62,7 @@ var/global/nologevent = 0
|
||||
if(M.client)
|
||||
body += " played by <b>[M.client]</b> "
|
||||
body += "\[<A href='?_src_=holder;editrights=rank;ckey=[M.ckey]'>[M.client.holder ? M.client.holder.rank : "Player"]</A>\] "
|
||||
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_living() + "</a>\]"
|
||||
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]</a>\]"
|
||||
|
||||
if(istype(M, /mob/new_player))
|
||||
body += " <B>Hasn't Entered Game</B> "
|
||||
|
||||
Reference in New Issue
Block a user