mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-20 22:16:51 +00:00
## About The Pull Request Adds INVESTIGATE_DEATHS, an investigate category intended to better show causes of death.   Also makes suicide_act take a `mob/living` as an argument instead of a `mob`, and some minor style improvements since apparently I hate atomicity. ## Why It's Good For The Game Inspired by a mysterious death and dusting. More logging and leads for admins investigating deaths. Also fixes #59028 ## Changelog 🆑 Tattle admin: added investigate deaths to shed some more light on unusual demises, dustings, and gibbings /🆑 Co-authored-by: tattle <article.disaster@gmail.com>
62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
/atom/proc/investigate_log(message, subject)
|
|
if(!message || !subject)
|
|
return
|
|
var/F = file("[GLOB.log_directory]/[subject].html")
|
|
WRITE_FILE(F, "[time_stamp()] [REF(src)] ([x],[y],[z]) || [src] [message]<br>")
|
|
|
|
/client/proc/investigate_show()
|
|
set name = "Investigate"
|
|
set category = "Admin.Game"
|
|
if(!holder)
|
|
return
|
|
|
|
var/list/investigates = list(
|
|
INVESTIGATE_ACCESSCHANGES,
|
|
INVESTIGATE_ATMOS,
|
|
INVESTIGATE_BOTANY,
|
|
INVESTIGATE_CARGO,
|
|
INVESTIGATE_CRAFTING,
|
|
INVESTIGATE_DEATHS,
|
|
INVESTIGATE_ENGINE,
|
|
INVESTIGATE_EXPERIMENTOR,
|
|
INVESTIGATE_GRAVITY,
|
|
INVESTIGATE_HALLUCINATIONS,
|
|
INVESTIGATE_HYPERTORUS,
|
|
INVESTIGATE_PORTAL,
|
|
INVESTIGATE_PRESENTS,
|
|
INVESTIGATE_RADIATION,
|
|
INVESTIGATE_RECORDS,
|
|
INVESTIGATE_RESEARCH,
|
|
INVESTIGATE_WIRES,
|
|
)
|
|
|
|
var/list/logs_present = list("notes, memos, watchlist")
|
|
var/list/logs_missing = list("---")
|
|
|
|
for(var/subject in investigates)
|
|
var/temp_file = file("[GLOB.log_directory]/[subject].html")
|
|
if(fexists(temp_file))
|
|
logs_present += subject
|
|
else
|
|
logs_missing += "[subject] (empty)"
|
|
|
|
var/list/combined = sort_list(logs_present) + sort_list(logs_missing)
|
|
|
|
var/selected = tgui_input_list(src, "Investigate what?", "Investigation", combined)
|
|
if(isnull(selected))
|
|
return
|
|
if(!(selected in combined) || selected == "---")
|
|
return
|
|
|
|
selected = replacetext(selected, " (empty)", "")
|
|
|
|
if(selected == "notes, memos, watchlist" && check_rights(R_ADMIN))
|
|
browse_messages()
|
|
return
|
|
|
|
var/F = file("[GLOB.log_directory]/[selected].html")
|
|
if(!fexists(F))
|
|
to_chat(src, span_danger("No [selected] logfile was found."), confidential = TRUE)
|
|
return
|
|
src << browse(F,"window=investigate[selected];size=800x300")
|