Skip to content
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

Feat: add radial menu for toolsets augments #720

Merged
merged 8 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions code/modules/augment/active/polytool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
icon_state = "multitool"
allowed_organs = list(BP_AUGMENT_R_HAND, BP_AUGMENT_L_HAND)
var/list/items = list()
var/list/images = list()
var/list/paths = list() //We may lose them
augment_flags = AUGMENTATION_MECHANIC

Expand All @@ -13,6 +14,10 @@
var/obj/item/I = new path (src)
I.canremove = FALSE
items += I
for(var/obj/item/i in items)
var/image/j = image(icon = i.icon, icon_state = i.item_state)
j.name = i
images[i] = j
AmShegars marked this conversation as resolved.
Show resolved Hide resolved
/obj/item/organ/internal/augment/active/polytool/Destroy()
QDEL_NULL_LIST(items)
. = ..()
Expand Down Expand Up @@ -50,7 +55,8 @@
else
to_chat(owner, SPAN_WARNING("You must drop [I] before tool can be extend."))
else
var/obj/item = input(owner, "Select item for deploy") as null|anything in src
var/obj/item
item = show_radial_menu(owner, owner, images , radius = 48, require_near = TRUE)
AmShegars marked this conversation as resolved.
Show resolved Hide resolved
if(!item || !(src in owner.internal_organs))
return
if(owner.equip_to_slot_if_possible(item, slot))
Expand All @@ -60,4 +66,4 @@
owner.visible_message(
SPAN_WARNING("[owner] extends \his [item.name] from [limb]."),
SPAN_NOTICE("You extend your [item.name] from [limb].")
)
)
2 changes: 2 additions & 0 deletions code/modules/augment/active/tool/engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
name = "digital welder"
desc = "A precise, high quality welding tool."
icon_state = "welder_finger"
var/aug_state = "welder"
AmShegars marked this conversation as resolved.
Show resolved Hide resolved
icon = 'icons/obj/augment_tools.dmi'


Expand Down Expand Up @@ -73,4 +74,5 @@
name = "digital multitool"
desc = "A multitool inside of a multitool. Doubletool?"
icon_state = "multitool_finger"
item_state = "multitool"
icon = 'icons/obj/augment_tools.dmi'
32 changes: 24 additions & 8 deletions code/modules/augment/active/tool/surgical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@
desc = "Part of Zeng-Hu Pharmaceutical's line of biomedical augmentations, this device contains the full set of tools any surgeon would ever need."
icon_state = "multitool_medical"
paths = list(
/obj/item/bonesetter,
/obj/item/cautery,
/obj/item/circular_saw,
/obj/item/hemostat,
/obj/item/retractor,
/obj/item/scalpel,
/obj/item/surgicaldrill
)
/obj/item/bonesetter/finger,
/obj/item/cautery/finger,
/obj/item/circular_saw/finger,
/obj/item/hemostat/finger,
/obj/item/retractor/finger,
/obj/item/scalpel/finger,
/obj/item/surgicaldrill/finger
)
// Если вы вдруг захотите сделать инструменты в этом наборе особенными - воспользуйтесь тем что ниже. Эти обьекты были созданы
//лишь для прописания item_state, дабы show_radial_menu работало адекватно
/obj/item/bonesetter/finger
item_state = "bone setter"
/obj/item/cautery/finger
item_state = "cautery"
/obj/item/circular_saw/finger
item_state = "saw3"
/obj/item/hemostat/finger
item_state = "hemostat"
/obj/item/retractor/finger
item_state = "retractor"
/obj/item/scalpel/finger
item_state = "scalpel"
/obj/item/surgicaldrill/finger
item_state = "drill"
Binary file modified icons/obj/augment_tools.dmi
Binary file not shown.
Loading