mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
Allows borgs to right-click their stored omnitools to pull out a specific tool (#91459)
## About The Pull Request If you right-click a borg omnitool while its in the module storage, you'll get a radial and pull out the selected tool instead of having to use it in-hand again. ## Why It's Good For The Game Basic QOL, should make engineering borgs' lives just a tiny bit easier. ## Changelog 🆑 qol: Cyborgs can right-click their stored omnitools to pull out a specific tool instead of having to use it in-hand after selecting it to do so. /🆑
This commit is contained in:
@@ -177,6 +177,10 @@
|
||||
//is the toolset upgraded or not
|
||||
var/upgraded = FALSE
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/Initialize(mapload)
|
||||
. = ..()
|
||||
register_context()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/Destroy(force)
|
||||
for(var/obj/item/tool_path as anything in atoms)
|
||||
var/obj/item/tool = atoms[tool_path]
|
||||
@@ -186,6 +190,15 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
||||
. = ..()
|
||||
if (!issilicon(user))
|
||||
return
|
||||
var/mob/living/silicon/robot/as_cyborg = user
|
||||
if (!(src in as_cyborg.held_items))
|
||||
context[SCREENTIP_CONTEXT_RMB] = "Select Tool"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
/**
|
||||
* Sets the new internal tool to be used
|
||||
* Arguments
|
||||
@@ -253,6 +266,15 @@
|
||||
update_appearance(UPDATE_ICON_STATE)
|
||||
playsound(src, 'sound/items/tools/change_jaws.ogg', 50, TRUE)
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/Click(location, control, params)
|
||||
var/list/modifiers = params2list(params)
|
||||
if(!LAZYACCESS(modifiers, RIGHT_CLICK) || !iscyborg(usr))
|
||||
return ..()
|
||||
var/mob/living/silicon/robot/user = usr
|
||||
if (!(src in user.held_items))
|
||||
attack_self(user)
|
||||
return ..()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/update_icon_state()
|
||||
if (reference)
|
||||
icon_state = reference.icon_state
|
||||
|
||||
Reference in New Issue
Block a user