Skip to content

Commit

Permalink
buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Apr 30, 2024
1 parent c55f50d commit b12c615
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions code/datums/components/attachment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/datum/callback/on_toggle
var/datum/callback/on_preattack
var/list/datum/action/actions
var/datum/action/attachment_action

/datum/component/attachment/Initialize(
slot = ATTACHMENT_SLOT_RAIL,
Expand Down Expand Up @@ -44,8 +45,8 @@
for(var/signal in signals)
RegisterSignal(parent, signal, signals[signal])

var/datum/action/attachment_action = new /datum/action/attachment(parent)
actions += attachment_action
attachment_action = new /datum/action/attachment(parent)
actions += list(attachment_action)

/datum/component/attachment/Destroy(force, silent)
REMOVE_TRAIT(parent, TRAIT_ATTACHABLE, "attachable")
Expand Down Expand Up @@ -84,6 +85,8 @@
parent.forceMove(holder)
if(length(actions))
holder.actions += actions
for(var/datum/action/attachment_action in actions)
attachment_action.Grant(user)

return TRUE

Expand All @@ -97,6 +100,8 @@
return FALSE

if(length(actions))
for(var/datum/action/attachment_action in actions)
attachment_action.Remove(user)
holder.actions -= actions

if(user.can_put_in_hand(parent))
Expand Down Expand Up @@ -125,6 +130,3 @@
/datum/action/attachment
check_flags = AB_CHECK_HANDS_BLOCKED|AB_CHECK_CONSCIOUS
button_icon_state = null

/datum/action/attachment/New(target)
name = target.name
2 changes: 2 additions & 0 deletions code/datums/components/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
return TRUE

/*
/datum/crafting_recipe/energy_bayonet
name = "Plasma Bayonet"
result = /obj/item/attachment/e_bayonet
Expand All @@ -41,6 +42,7 @@
tools = list(
TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_MULTITOOL
)
*/

/datum/crafting_recipe/IED
name = "IED"
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/attachments/bipod.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
/obj/item/attachment/bipod
name = "bipod"
desc = "A bipod that can be attached to a weapon to improve stability."
Expand Down Expand Up @@ -45,3 +46,4 @@
gun.w_class = initial(gun.w_class)
gun.wield_delay = initial(gun.unfolded_wield_delay)
gun.wield_slowdown = initial(gun.unfolded_slowdown)
*/

0 comments on commit b12c615

Please sign in to comment.