mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
[NO GBP]DeIntegrates welder from omnitool & radial menu won't show already selected tool (#96443)
## About The Pull Request - See #96481 & https://github.com/tgstation/tgstation/pull/96214#issuecomment-4697205835. It's not worth the hastle but the revert was done in a bad way that removes code & qol stuff so i did it better here. - Radial menu won't show you the selected tool again thus reducing clutter ## Changelog 🆑 del: removes the welder from the engiborg omnitool. They are now separate entities again qol: The omnitool radial menu won't show the same selected tool again reducing clutter /🆑
This commit is contained in:
@@ -191,16 +191,8 @@
|
||||
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
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/examine(mob/user)
|
||||
. = ..()
|
||||
if(reference)
|
||||
var/obj/item/tool = get_proxy_attacker_for(src, usr)
|
||||
. += tool.examine(user)
|
||||
context[SCREENTIP_CONTEXT_RMB] = "Select Tool"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
/**
|
||||
* Sets the new internal tool to be used
|
||||
@@ -209,6 +201,8 @@
|
||||
* * obj/item/ref - typepath for the new internal omnitool
|
||||
*/
|
||||
/obj/item/borg/cyborg_omnitool/proc/set_internal_tool(obj/item/tool)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
|
||||
for(var/obj/item/internal_tool as anything in omni_toolkit)
|
||||
if(internal_tool == tool)
|
||||
reference = internal_tool
|
||||
@@ -247,6 +241,8 @@
|
||||
//the internal tool is considered part of the tool itself, so don't let it be dropped.
|
||||
tool.item_flags |= ABSTRACT
|
||||
ADD_TRAIT(tool, TRAIT_NODROP, INNATE_TRAIT)
|
||||
//assign the upgraded toolspeed, if any.
|
||||
tool.toolspeed = initial(tool.toolspeed) - upgraded * 0.3
|
||||
//store tool for future use
|
||||
atoms[reference] = tool
|
||||
|
||||
@@ -256,17 +252,19 @@
|
||||
//build the radial menu options
|
||||
var/list/radial_menu_options = list()
|
||||
var/list/tool_map = list()
|
||||
for(var/obj/item as anything in omni_toolkit)
|
||||
var/tool_name = initial(item.name)
|
||||
radial_menu_options[tool_name] = image(icon = initial(item.icon), icon_state = initial(item.icon_state))
|
||||
tool_map[tool_name] = item
|
||||
for(var/obj/item/tool as anything in omni_toolkit)
|
||||
if(initial(tool.tool_behaviour) == tool_behaviour)
|
||||
continue
|
||||
var/tool_name = initial(tool.name)
|
||||
radial_menu_options[tool_name] = image(icon = initial(tool.icon), icon_state = initial(tool.icon_state))
|
||||
tool_map[tool_name] = tool
|
||||
|
||||
//assign the new tool behaviour
|
||||
var/internal_tool_name = show_radial_menu(user, src, radial_menu_options, require_near = TRUE, tooltips = TRUE)
|
||||
if(!internal_tool_name)
|
||||
return
|
||||
|
||||
//set the reference & update icons
|
||||
//set the reference and update appearance
|
||||
set_internal_tool(tool_map[internal_tool_name])
|
||||
update_appearance(UPDATE_ICON_STATE)
|
||||
playsound(src, 'sound/items/tools/change_jaws.ogg', 50, TRUE)
|
||||
@@ -276,8 +274,7 @@
|
||||
if(!LAZYACCESS(modifiers, RIGHT_CLICK) || !iscyborg(usr))
|
||||
return ..()
|
||||
var/mob/living/silicon/robot/user = usr
|
||||
if (!(src in user.held_items))
|
||||
attack_self(user, modifiers)
|
||||
attack_self(user, modifiers)
|
||||
return ..()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/update_icon_state()
|
||||
@@ -301,7 +298,6 @@
|
||||
/obj/item/borg/cyborg_omnitool/medical
|
||||
name = "surgical omni-toolset"
|
||||
desc = "A set of surgical tools used by cyborgs to operate on various surgical operations."
|
||||
|
||||
omni_toolkit = list(
|
||||
/obj/item/surgical_drapes/cyborg,
|
||||
/obj/item/scalpel/cyborg,
|
||||
@@ -319,74 +315,26 @@
|
||||
desc = "A set of engineering tools used by cyborgs to conduct various engineering tasks."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
icon_state = "toolkit_engiborg"
|
||||
|
||||
omni_toolkit = list(
|
||||
/obj/item/wrench/cyborg,
|
||||
/obj/item/wirecutters/cyborg,
|
||||
/obj/item/screwdriver/cyborg,
|
||||
/obj/item/crowbar/cyborg,
|
||||
/obj/item/multitool/cyborg,
|
||||
/obj/item/weldingtool/largetank/cyborg,
|
||||
)
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/engineering/Initialize(mapload)
|
||||
/obj/item/borg/cyborg_omnitool/engineering/examine(mob/user)
|
||||
. = ..()
|
||||
RegisterSignal(src, COMSIG_SILICON_MODULE_ACTIVATION, PROC_REF(welder_toggle))
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/engineering/update_overlays()
|
||||
. = ..()
|
||||
if(tool_behaviour == TOOL_WELDER)
|
||||
var/obj/item/weldingtool/tool = atoms[/obj/item/weldingtool/largetank/cyborg]
|
||||
if(tool?.welding)
|
||||
. |= tool.update_overlays()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/engineering/attack_self(mob/user, modifiers)
|
||||
if(tool_behaviour == TOOL_WELDER && LAZYACCESS(modifiers, LEFT_CLICK))
|
||||
welder_toggle(src, null, user)
|
||||
|
||||
return NONE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/engineering/set_internal_tool(obj/item/tool)
|
||||
if(tool_behaviour == TOOL_WELDER)
|
||||
welder_toggle(src, FALSE)
|
||||
|
||||
return ..()
|
||||
|
||||
///Reflects internal welder icon onto the omnitool
|
||||
/obj/item/borg/cyborg_omnitool/engineering/proc/welder_update(source)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
update_appearance(UPDATE_OVERLAYS)
|
||||
|
||||
///Toggles welder on/off when module slot is selected/deselected
|
||||
/obj/item/borg/cyborg_omnitool/engineering/proc/welder_toggle(datum/omnitool, state, mob/self_user)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(tool_behaviour == TOOL_WELDER)
|
||||
var/obj/item/weldingtool/tool = get_proxy_attacker_for(src, usr)
|
||||
if(isnull(state))
|
||||
state = !tool.welding
|
||||
if(state == tool.welding)
|
||||
return
|
||||
|
||||
if(state)
|
||||
RegisterSignal(tool, COMSIG_ATOM_UPDATE_APPEARANCE, PROC_REF(welder_update), override = TRUE)
|
||||
if(self_user)
|
||||
tool.switched_on(self_user)
|
||||
else
|
||||
tool.switched_off()
|
||||
UnregisterSignal(tool, COMSIG_ATOM_UPDATE_APPEARANCE)
|
||||
if(tool_behaviour == TOOL_MULTITOOL)
|
||||
var/obj/item/multitool/tool = atoms[/obj/item/multitool/cyborg]
|
||||
if(tool?.buffer)
|
||||
. += span_notice("Multitool buffer contains [tool.buffer].")
|
||||
|
||||
/obj/item/borg/cyborg_omnitool/botany
|
||||
name = "botanical omni-toolset"
|
||||
desc = "A set of botanical tools used by cyborgs to do gardening."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
icon_state = "sili"
|
||||
|
||||
omni_toolkit = list(
|
||||
/obj/item/secateurs/cyborg,
|
||||
/obj/item/cultivator/cyborg,
|
||||
@@ -394,6 +342,5 @@
|
||||
/obj/item/shovel/spade/cyborg,
|
||||
)
|
||||
|
||||
|
||||
#undef PKBORG_DAMPEN_CYCLE_DELAY
|
||||
#undef POWER_RECHARGE_CYBORG_DRAIN_MULTIPLIER
|
||||
|
||||
@@ -485,6 +485,8 @@
|
||||
return
|
||||
for(var/obj/item/borg/cyborg_omnitool/engineering/omnitool in cyborg.model.modules)
|
||||
omnitool.set_upgraded(TRUE)
|
||||
for(var/obj/item/weldingtool/largetank/cyborg/welder in cyborg.model.modules)
|
||||
welder.toolspeed = initial(welder.toolspeed) - 0.3
|
||||
|
||||
/obj/item/borg/upgrade/engineering_omnitool/deactivate(mob/living/silicon/robot/cyborg, mob/living/user = usr)
|
||||
. = ..()
|
||||
@@ -492,6 +494,8 @@
|
||||
return
|
||||
for(var/obj/item/borg/cyborg_omnitool/engineering/omnitool in cyborg.model.modules)
|
||||
omnitool.set_upgraded(FALSE)
|
||||
for(var/obj/item/weldingtool/largetank/cyborg/welder in cyborg.model.modules)
|
||||
welder.toolspeed = initial(welder.toolspeed)
|
||||
|
||||
/obj/item/borg/upgrade/defib
|
||||
name = "medical cyborg defibrillator"
|
||||
|
||||
Reference in New Issue
Block a user