Action Button Update

- Refactors action button backend
   - Action buttons are no longer checked on Life(), items are responsible
     for adding/removing/updating them.
   - Item action buttons are no longer a static action_button_name define,
     items define actions_types, which is a list of paths.
   - Items can now have multiple action buttons.
     - This is handled by new arguments to ui_action_click, the first
       parameter is the user, the second is the path of the action datum
       that was invoked.
 - Refactored how internals function
   - You may now directly switch internals without breaking anything.
   - The internals icon has been updated to be more consistent.
 - Added action buttons for jetpacks
 - Added action buttons for oxygen tanks
 - Uses-based implants now qdel() themselves when they run out of uses.
   This is somewhat a buff to traitor implants, but it's such a minor
   change. The actual reasoning is so that the action buttons are properly
   removed.
 - Fixed a bug with the "Boo" spell which resulted in IsAvailable failing
   for certain ghosts.
 - You can now shift-click on movable HUD elements to reset them to the
   proper position (thank fucking christ)
This commit is contained in:
Tigercat2000
2016-07-18 13:23:01 -07:00
parent 00558bd109
commit 56a09db739
97 changed files with 1230 additions and 1022 deletions
+10 -3
View File
@@ -251,7 +251,9 @@ obj/item/weapon/gun/proc/newshot(params)
I.loc = src
update_icon()
update_gunlight(user)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src)
if(loc == user)
A.Grant(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(F && can_flashlight)
@@ -262,7 +264,8 @@ obj/item/weapon/gun/proc/newshot(params)
update_gunlight(user)
S.update_brightness(user)
update_icon()
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
@@ -296,6 +299,10 @@ obj/item/weapon/gun/proc/newshot(params)
else
set_light(0)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/weapon/gun/pickup(mob/user)
..()
if(azoom)
@@ -376,7 +383,7 @@ obj/item/weapon/gun/proc/newshot(params)
/datum/action/toggle_scope_zoom
name = "Toggle Scope"
check_flags = AB_CHECK_ALIVE|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
button_icon_state = "sniper_zoom"
var/obj/item/weapon/gun/gun = null
@@ -5,7 +5,7 @@
can_suppress = 1
burst_size = 3
fire_delay = 2
action_button_name = "Toggle Firemode"
actions_types = list(/datum/action/item_action/toggle_firemode)
/obj/item/weapon/gun/projectile/automatic/isHandgun()
return 0
@@ -58,6 +58,9 @@
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
update_icon()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/weapon/gun/projectile/automatic/can_shoot()
return get_ammo()
@@ -107,7 +110,7 @@
fire_delay = 2
can_suppress = 0
burst_size = 1
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/wt550/update_icon()
..()
@@ -129,7 +132,6 @@
origin_tech = "combat=5;materials=2;syndicate=8"
mag_type = /obj/item/ammo_box/magazine/m556
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
action_button_name = "Toggle Grenade Launcher"
can_suppress = 0
var/obj/item/weapon/gun/projectile/revolver/grenadelauncher/underbarrel
burst_size = 3
@@ -227,7 +229,7 @@
can_suppress = 0
burst_size = 1
fire_delay = 0
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/New()
..()
@@ -39,7 +39,7 @@
mag_type = /obj/item/ammo_box/magazine/m75
burst_size = 1
fire_delay = 0
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/gyropistol/isHandgun()
return 1
@@ -65,7 +65,7 @@
burst_size = 1
fire_delay = 0
select = 0
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/speargun/update_icon()
return
@@ -8,7 +8,7 @@
can_suppress = 1
burst_size = 1
fire_delay = 0
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/pistol/isHandgun()
return 1
@@ -64,4 +64,4 @@
can_suppress = 0
burst_size = 3
fire_delay = 2
action_button_name = "Toggle Firemode"
actions_types = list(/datum/action/item_action/toggle_firemode)
@@ -15,7 +15,7 @@
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
slot_flags = SLOT_BACK
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/update_icon()
if(magazine)
@@ -26,7 +26,7 @@
can_suppress = 0
burst_size = 1
fire_delay = 0
action_button_name = null
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/toy/pistol/update_icon()
..()