-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makes it possible to view helmet cams of SOs/XOs/COs #5433
Conversation
var/co_text = "" | ||
var/xo_text = "" | ||
var/so_text = "" | ||
var/living_count = 0 | ||
var/almayer_count = 0 | ||
var/SSD_count = 0 | ||
var/helmetless_count = 0 | ||
|
||
for(var/X in command_marines) | ||
if(!X) | ||
continue //just to be safe | ||
var/mob_name = "unknown" | ||
var/mob_state = "" | ||
var/role = "unknown" | ||
var/area_name = "<b>???</b>" | ||
var/mob/living/carbon/human/H | ||
if(ishuman(X)) | ||
H = X | ||
mob_name = H.real_name | ||
var/area/A = get_area(H) | ||
var/turf/M_turf = get_turf(H) | ||
if(A) | ||
area_name = sanitize_area(A.name) | ||
|
||
if(H.job) | ||
role = H.job | ||
else if(istype(H.wear_id, /obj/item/card/id)) //decapitated marine is mindless, | ||
var/obj/item/card/id/ID = H.wear_id //we use their ID to get their role. | ||
if(ID.rank) | ||
role = ID.rank | ||
|
||
switch(H.stat) | ||
if(CONSCIOUS) | ||
mob_state = "Conscious" | ||
living_count++ | ||
if(UNCONSCIOUS) | ||
mob_state = "<b>Unconscious</b>" | ||
living_count++ | ||
else | ||
continue | ||
|
||
if(!is_ground_level(M_turf.z)) | ||
almayer_count++ | ||
continue | ||
|
||
if(!istype(H.head, /obj/item/clothing/head/helmet/marine)) | ||
helmetless_count++ | ||
continue | ||
|
||
if(!H.key || !H.client) | ||
SSD_count++ | ||
continue | ||
|
||
var/marine_infos = "<tr><td><A href='?src=\ref[src];operation=use_cam;cam_target=\ref[H]'>[mob_name]</a></td><td>[role]</td><td>[mob_state]</td><td>[area_name]</td></tr>" | ||
switch(role) | ||
if(JOB_CO) | ||
co_text += marine_infos | ||
if(JOB_XO) | ||
xo_text += marine_infos | ||
if(JOB_SO) | ||
so_text += marine_infos | ||
dat += "<b>Total: [length(command_marines)] Deployed</b><BR>" | ||
dat += "<b>Marines detected: [living_count] ([helmetless_count] no helmet, [SSD_count] SSD, [almayer_count] on Almayer)</b><BR>" | ||
dat += "<center><b>Search:</b> <input type='text' id='filter' value='' onkeyup='updateSearch();' style='width:300px;'></center>" | ||
dat += "<table id='marine_list' border='2px' style='width: 100%; border-collapse: collapse;' align='center'><tr>" | ||
dat += "<th>Name</th><th>Role</th><th>State</th><th>Location</th></tr>" | ||
dat += co_text + xo_text + so_text | ||
dat += "</table>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously all of this is copypasta, but i don't see why it couldn't be genericized. make it a proc that accepts a list of humans and returns a formatted html table, give it the squad marinelist in normal usage and the list you make above this for this usecase. the whole co/xo/so text thing can just be replaced by a parameter passed into the proc for a list of jobs
if(show_command_squad)
dat += format_list_of_marines(list(GLOB.marine_leaders[JOB_CO], GLOB.marine_leaders[JOB_XO]) + GLOB.marine_leaders[JOB_SO], list(JOB_CO, JOB_XO, JOB_SO))
else if(current_squad)
dat += format_list_of_marines(current_squad.marines_list, list(JOB_SQUAD_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MARINE))
/obj/structure/machinery/computer/groundside_operations/proc/format_list_of_marines(list/mob/living/carbon/human/marine_list, list/jobs_in_order)
var/list/job_order = list()
for(var/job in jobs_in_order)
job_order[job] = ""
var/misc_text = ""
var/living_count = 0
var/almayer_count = 0
var/SSD_count = 0
var/helmetless_count = 0
for(var/X in marine_list)
if(!X)
continue //just to be safe
var/mob_name = "unknown"
var/mob_state = ""
var/role = "unknown"
var/area_name = "<b>???</b>"
var/mob/living/carbon/human/H
if(ishuman(X))
H = X
mob_name = H.real_name
var/area/A = get_area(H)
var/turf/M_turf = get_turf(H)
if(A)
area_name = sanitize_area(A.name)
if(H.job)
role = H.job
else if(istype(H.wear_id, /obj/item/card/id)) //decapitated marine is mindless,
var/obj/item/card/id/ID = H.wear_id //we use their ID to get their role.
if(ID.rank)
role = ID.rank
switch(H.stat)
if(CONSCIOUS)
mob_state = "Conscious"
living_count++
if(UNCONSCIOUS)
mob_state = "<b>Unconscious</b>"
living_count++
else
continue
if(!is_ground_level(M_turf.z))
almayer_count++
continue
if(!istype(H.head, /obj/item/clothing/head/helmet/marine))
helmetless_count++
continue
if(!H.key || !H.client)
SSD_count++
continue
var/marine_infos = "<tr><td><A href='?src=\ref[src];operation=use_cam;cam_target=\ref[H]'>[mob_name]</a></td><td>[role]</td><td>[mob_state]</td><td>[area_name]</td></tr>"
if(role in job_order)
job_order[role] += marine_infos
else
misc_text += marine_infos
dat += "<b>Total: [length(command_marines)] Deployed</b><BR>"
dat += "<b>Marines detected: [living_count] ([helmetless_count] no helmet, [SSD_count] SSD, [almayer_count] on Almayer)</b><BR>"
dat += "<center><b>Search:</b> <input type='text' id='filter' value='' onkeyup='updateSearch();' style='width:300px;'></center>"
dat += "<table id='marine_list' border='2px' style='width: 100%; border-collapse: collapse;' align='center'><tr>"
dat += "<th>Name</th><th>Role</th><th>State</th><th>Location</th></tr>"
for(var/job in job_order)
dat += job_order[job]
dat += misc_text
dat += "</table>"
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
Let us click player icons on the tacmap to instantly overwatch that person (if they're part of the current overwatched squad) |
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
About the pull request
Going to rework the whole console at some point. Not proud of this code, give me some ideas
Explain why it's good for the game
Helmet cams good! This can already be done by assigning the CO/XO/SO to a squad
Testing Photographs and Procedure
Screenshots & Videos
Put screenshots and videos here with an empty line between the screenshots and the
<details>
tags.Changelog
🆑
add: CIC can now view helmet cameras of Command Staff. Literally 1984
/:cl: