Adds tool information, multiple surgeries to the surgical computer. (#27755)

* draws the owl

* Add tgui code

* improve docs

* Update code/modules/surgery/surgery.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* tgui bundle

* clean up

* Prettier run

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Luc
2025-01-12 10:21:46 +00:00
committed by GitHub
co-authored by Burzah
parent 956ecf3109
commit 11b71b3f94
6 changed files with 50 additions and 20 deletions
+4 -3
View File
@@ -66,12 +66,13 @@
QDEL_LIST_CONTENTS(branches_init)
return ..()
/datum/surgery_step/proxy/get_step_information(datum/surgery/surgery)
/datum/surgery_step/proxy/get_step_information(datum/surgery/surgery, with_tools = FALSE)
var/datum/surgery_step/cur = surgery.get_surgery_next_step()
var/step_names = list()
for(var/datum/surgery/surg in branches_init)
step_names += surg.get_surgery_step()
step_names += cur // put this one on the end
var/datum/surgery_step/surg_step = surg.get_surgery_step()
step_names += surg_step.get_step_information(surgery, with_tools)
step_names += cur.get_step_information(surgery, with_tools) // put this one on the end
return english_list(step_names, "Nothing...? If you see this, tell a coder.", ", or ")
+20 -3
View File
@@ -488,10 +488,27 @@
/**
* Get the action that will be performed during this surgery step, in context of the surgery it is a part of.
*
* * surgery - A surgery in progress.
* Arguments:
* * surgery - The main surgery this is being invoked by.
* * with_tools - Whether to include the tool necessary for the step at the end of the step information.
* *
*/
/datum/surgery_step/proc/get_step_information(datum/surgery/surgery)
return name
/datum/surgery_step/proc/get_step_information(datum/surgery/surgery, with_tools = FALSE)
if(!with_tools)
return name
var/list/tools = list()
for(var/tool in allowed_tools)
// only list main surgery tools. you can figure out the improvised version by trying (or reading the wiki lul)
if(tool in GLOB.surgery_tool_behaviors)
tools |= tool
if(!length(tools))
// if nothing else, just pick the first in the list.
var/atom/tool = allowed_tools[1]
tools |= tool.name
return "[name] ([english_list(tools, and_text="or")])"
/**
* Spread some nasty germs to an organ.