Shuttle manifest update (#19345)

Adds some new fields to the shuttle manifest:
- Destination (Per shuttle)
- Heading (Per shuttle)
- Mission (Per shuttle)
- Departure Time (Per Shuttle)
- Return Time (Per Shuttle)
- Expedition/Mission Leader (One per shuttle)
- Shuttle Pilot (One per shuttle)

Also adds the shuttle manifest to Bridge Crew PDAs by default.

<img width="458" alt="image"
src="https://github.com/Aurorastation/Aurora.3/assets/26849270/802d9a8d-9c43-4883-a5a7-d23967616766">
This commit is contained in:
Sparky
2024-06-26 10:16:53 +00:00
committed by GitHub
parent ef018f8b30
commit 0666833d9a
12 changed files with 356 additions and 110 deletions
@@ -18,18 +18,38 @@
if(active_record)
data["active_record"] = list(
"name" = active_record.name,
"id" = active_record.id,
"shuttle" = active_record.shuttle,
"id" = active_record.id
"pilot" = active_record.pilot,
"lead" = active_record.lead
)
else
var/list/allshuttles = list()
var/list/allassignments = list()
for (var/datum/record/shuttle_manifest/m in SSrecords.shuttle_manifests)
allshuttles += list(list(
"name" = m.name,
"id" = m.id,
"shuttle" = m.shuttle,
"id" = m.id
"pilot" = m.pilot,
"lead" = m.lead
))
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(!a.departure_time)
a.departure_time = worldtime2text()
if(!a.return_time)
a.return_time = worldtime2text(world.time + 1 HOUR)
allassignments += list(list(
"shuttle" = a.shuttle,
"destination" = a.destination,
"heading" = a.heading,
"mission" = a.mission,
"departure_time" = a.departure_time,
"return_time" = a.return_time
))
data["shuttles"] = SSatlas.current_map.shuttle_manifests
data["shuttle_manifest"] = allshuttles
data["shuttle_assignments"] = allassignments
data["active_record"] = null
return data
@@ -89,7 +109,7 @@
var/names = list()
for(var/datum/record/general/r in SSrecords.records)
names += r.name
var/newname = sanitize(input(usr, "Please enter name.") as null|anything in names)
var/newname = sanitize(tgui_input_list(usr, "Please select name.", "Name select", names, active_record.name))
if(!computer.use_check_and_message(usr))
if(!newname)
return
@@ -97,15 +117,79 @@
if("editentrynamecustom")
. = TRUE
var/newname = sanitize(input("Please enter name.") as null|text)
var/newname = sanitize(tgui_input_text(usr, "Please enter name.", "Name entry", active_record.name))
if(!computer.use_check_and_message(usr))
if(!newname)
return
active_record.name = newname
if("editentryshuttle")
. = TRUE
var/newshuttle = sanitize(input("Please enter shuttle.") as null|anything in list("SCCV Canary", "SCCV Intrepid", "SCCV Spark"))
var/newshuttle = tgui_input_list(usr, "Please select shuttle.", "Shuttle select", SSatlas.current_map.shuttle_manifests, active_record.shuttle)
if(!computer.use_check_and_message(usr))
if(!newshuttle)
return
active_record.shuttle = newshuttle
if("editdestination")
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(a.shuttle == params["editdestination"])
var/new_dest = sanitize(tgui_input_text(usr, "Please enter destination.", "Destination entry", a.destination))
if(!computer.use_check_and_message(usr))
if(!new_dest)
return
a.destination = new_dest
if("editheading")
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(a.shuttle == params["editheading"])
var/new_head = floor(tgui_input_number(usr, "Please enter heading.", "Heading entry", a.heading, 359, 0))
if(new_head < 0 || new_head > 359 || !new_head)
new_head = 0
if(!computer.use_check_and_message(usr))
a.heading = new_head
if("editmission")
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(a.shuttle == params["editmission"])
var/new_mis = tgui_input_list(usr, "Please select mission.", "Mission select", SSatlas.current_map.shuttle_missions, a.mission)
if(!computer.use_check_and_message(usr))
if(!new_mis)
return
a.mission = new_mis
if("editdeparturetime")
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(a.shuttle == params["editdeparturetime"])
var/new_depart = sanitize(tgui_input_text(usr, "Please enter new departure time.", "Departure time entry", a.departure_time))
if(!computer.use_check_and_message(usr))
if(!new_depart)
return
a.departure_time = new_depart
if("editreturntime")
for(var/datum/record/shuttle_assignment/a in SSrecords.shuttle_assignments)
if(a.shuttle == params["editreturntime"])
var/new_return = sanitize(tgui_input_text(usr, "Please enter new return time.", "Return time entry", a.departure_time))
if(!computer.use_check_and_message(usr))
if(!new_return)
return
a.return_time = new_return
if("editlead")
for(var/datum/record/shuttle_manifest/m in SSrecords.shuttle_manifests)
if(m.id == text2num(params["editlead"]))
m.lead = !m.lead
if(m.lead)
for(var/datum/record/shuttle_manifest/other in SSrecords.shuttle_manifests) // There can be only one
if(other.shuttle == m.shuttle && other.lead && other != m)
other.lead = FALSE
if("editpilot")
for(var/datum/record/shuttle_manifest/m in SSrecords.shuttle_manifests)
if(m.id == text2num(params["editpilot"]))
m.pilot = !m.pilot
if(m.pilot)
for(var/datum/record/shuttle_manifest/other in SSrecords.shuttle_manifests)
if(other.shuttle == m.shuttle && other.pilot && other != m)
other.pilot = FALSE