Skip to content

Commit

Permalink
[MIRROR] add verb for deleting crew records
Browse files Browse the repository at this point in the history
  • Loading branch information
MuckerMayhem authored and SuhEugene committed Nov 23, 2023
1 parent 08f8e39 commit 53439a9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
28 changes: 27 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ var/global/list/admin_verbs_admin = list(
/client/proc/cmd_admin_notarget,
/datum/admins/proc/setroundlength,
/datum/admins/proc/toggleroundendvote,
/datum/admins/proc/togglemoderequirementchecks
/datum/admins/proc/togglemoderequirementchecks,
/client/proc/delete_crew_record
)
var/global/list/admin_verbs_ban = list(
/client/proc/unban_panel,
Expand Down Expand Up @@ -904,3 +905,28 @@ var/global/list/admin_verbs_mod = list(
if(!S) return
T.add_spell(new S)
log_and_message_admins("gave [key_name(T)] the spell [S].")

/client/proc/delete_crew_record()
set category = "Admin"
set name = "Delete Crew Record"
set desc = "Delete a crew record from the global crew list."

var/list/entries = list()

for (var/datum/computer_file/report/crew_record/entry in GLOB.all_crew_records)
entries["[entry.get_name()], [entry.get_job()]"] = entry

if (!length(entries))
return

var/choice = input("Pick a record to delete:", "Delete Crew Record") as null | anything in entries

if (!choice)
return

var/check = alert("Are you sure you want to delete [choice]?", "Delete Record?", "Yes", "No")
var/datum/computer_file/report/crew_record/record = entries[choice]

if (check == "Yes")
GLOB.all_crew_records.Remove(record)
log_and_message_admins("has removed [record.get_name()], [record.get_job()]'s crew record.")
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,14 @@ GLOBAL_VAR_INIT(arrest_security_status, "Arrest")
// Used by character creation to create a record for new arrivals.
/proc/CreateModularRecord(mob/living/carbon/human/H)
var/datum/computer_file/report/crew_record/CR = new/datum/computer_file/report/crew_record()
GLOB.all_crew_records.Add(CR)
CR.load_from_mob(H)

//ensure we don't get duplicated records
for (var/datum/computer_file/report/crew_record/record as anything in GLOB.all_crew_records)
if ((CR.get_name() == record.get_name()))
qdel(record)

GLOB.all_crew_records.Add(CR)
return CR

// Gets crew records filtered by set of positions
Expand Down

0 comments on commit 53439a9

Please sign in to comment.