From eaf82cd423a6a2f95198c8e4e591edbb75dc6612 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Wed, 20 Jul 2016 02:44:34 -0400 Subject: [PATCH] Fixes Slow Action Buttons, Removes Verbs --- .../miniantags/abduction/abduction_gear.dm | 3 + code/modules/clothing/clothing.dm | 16 ++--- code/modules/clothing/glasses/glasses.dm | 50 +++++++-------- code/modules/clothing/head/misc.dm | 9 +-- code/modules/clothing/head/misc_special.dm | 40 ++++++------ code/modules/clothing/masks/gasmask.dm | 61 +++++++------------ code/modules/clothing/shoes/magboots.dm | 3 + code/modules/clothing/suits/armor.dm | 4 +- code/modules/clothing/suits/hood.dm | 11 ---- code/modules/clothing/suits/miscellaneous.dm | 3 + code/modules/customitems/item_defines.dm | 43 +++++-------- 11 files changed, 100 insertions(+), 143 deletions(-) diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index 71d0264f1f5..3e03b81ebeb 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -374,6 +374,9 @@ Congratulations! You are now trained for xenobiology research!"} to_chat(usr, "You switch the baton to [txt] mode.") update_icon() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/weapon/abductor_baton/update_icon() switch(mode) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 88555586661..22fa3e2376c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -463,6 +463,9 @@ BLIND // can't see anything flavour = "[copytext(adjust_flavour, 3, lentext(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button. to_chat(user, "You [flavour] \the [src].") suit_adjusted = 0 //Suit is no longer adjusted. + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() else var/flavour = "open" icon_state += "_open" @@ -471,6 +474,9 @@ BLIND // can't see anything flavour = "[adjust_flavour]" to_chat(user, "You [flavour] \the [src].") suit_adjusted = 1 //Suit's adjusted. + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() else if(user.canUnEquip(src)) //Checks to see if the item can be unequipped. If so, lets shred. Otherwise, struggle and fail. if(contents) //If the suit's got any storage capability... @@ -502,16 +508,6 @@ BLIND // can't see anything if(!(initial(flags_inv) & HIDETAIL) && (flags_inv & HIDETAIL)) //Otherwise, remove the HIDETAIL flag if it wasn't already in the flags_inv to start with. flags_inv &= ~HIDETAIL -/obj/item/clothing/suit/verb/openjacket(var/mob/user) //The verb you can use to adjust jackets. - set name = "Open/Close Jacket" - set category = "Object" - set src in usr - if(!isliving(usr)) - return - if(usr.stat) - return - adjustsuit(user) - /obj/item/clothing/suit/ui_action_click(mob/user) //This is what happens when you click the HUD action button to adjust your suit. if(!ignore_suitadjust) adjustsuit(user) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index ea1d78dad7d..f93ae41ef1a 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -281,10 +281,7 @@ /obj/item/clothing/glasses/sunglasses/yeah/attack_self() pun() -/obj/item/clothing/glasses/sunglasses/yeah/verb/pun() - set category = "Object" - set name = "YEAH!" - set src in usr +/obj/item/clothing/glasses/sunglasses/yeah/proc/pun() if(!punused)//one per round punused = 1 playsound(src.loc, 'sound/misc/yeah.ogg', 100, 0) @@ -340,31 +337,28 @@ /obj/item/clothing/glasses/welding/attack_self() toggle() +/obj/item/clothing/glasses/welding/proc/toggle() + if(up) + up = !up + flags |= GLASSESCOVERSEYES + flags_inv |= HIDEEYES + icon_state = initial(icon_state) + to_chat(usr, "You flip the [src] down to protect your eyes.") + flash_protect = 2 + tint = initial(tint) //better than istype + else + up = !up + flags &= ~HEADCOVERSEYES + flags_inv &= ~HIDEEYES + icon_state = "[initial(icon_state)]up" + to_chat(usr, "You push the [src] up out of your face.") + flash_protect = 0 + tint = 0 + usr.update_inv_glasses() -/obj/item/clothing/glasses/welding/verb/toggle() - set category = "Object" - set name = "Adjust welding goggles" - set src in usr - - if(usr.canmove && !usr.stat && !usr.restrained()) - if(src.up) - src.up = !src.up - src.flags |= GLASSESCOVERSEYES - flags_inv |= HIDEEYES - icon_state = initial(icon_state) - to_chat(usr, "You flip the [src] down to protect your eyes.") - flash_protect = 2 - tint = initial(tint) //better than istype - else - src.up = !src.up - src.flags &= ~HEADCOVERSEYES - flags_inv &= ~HIDEEYES - icon_state = "[initial(icon_state)]up" - to_chat(usr, "You push the [src] up out of your face.") - flash_protect = 0 - tint = 0 - - usr.update_inv_glasses() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm index f34eb62f340..f7253a82cdf 100644 --- a/code/modules/clothing/head/misc.dm +++ b/code/modules/clothing/head/misc.dm @@ -355,14 +355,7 @@ /obj/item/clothing/head/griffin/attack_self() caw() -/obj/item/clothing/head/griffin/verb/caw() - - set category = "Object" - set name = "Caw" - set src in usr - if(!istype(usr, /mob/living)) return - if(usr.stat) return - +/obj/item/clothing/head/griffin/proc/caw() if(cooldown < world.time - 20) // A cooldown, to stop people being jerks playsound(src.loc, "sound/misc/caw.ogg", 50, 1) cooldown = world.time diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 98466f94eeb..703f36cf1fd 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -50,26 +50,28 @@ toggle() /obj/item/clothing/head/welding/proc/toggle() - set src in usr + if(up) + up = !up + flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH) + flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) + icon_state = initial(icon_state) + to_chat(usr, "You flip the [src] down to protect your eyes.") + flash_protect = 2 + tint = 2 + else + up = !up + flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH) + flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) + icon_state = "[initial(icon_state)]up" + to_chat(usr, "You push the [src] up out of your face.") + flash_protect = 0 + tint = 0 + usr.update_inv_head() //so our mob-overlays update + + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() - if(usr.canmove && !usr.stat && !usr.restrained()) - if(src.up) - src.up = !src.up - src.flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH) - flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = initial(icon_state) - to_chat(usr, "You flip the [src] down to protect your eyes.") - flash_protect = 2 - tint = 2 - else - src.up = !src.up - src.flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH) - flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[initial(icon_state)]up" - to_chat(usr, "You push the [src] up out of your face.") - flash_protect = 0 - tint = 0 - usr.update_inv_head() //so our mob-overlays update /* diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index a21d78f99e0..72b4b6febb7 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -34,30 +34,28 @@ /obj/item/clothing/mask/gas/welding/attack_self() toggle() +/obj/item/clothing/mask/gas/welding/proc/toggle() + if(up) + up = !src.up + flags |= (MASKCOVERSEYES) + flags_inv |= (HIDEEYES) + icon_state = initial(icon_state) + to_chat(usr, "You flip the [src] down to protect your eyes.") + flash_protect = 2 + tint = 2 + else + up = !up + flags &= ~(MASKCOVERSEYES) + flags_inv &= ~(HIDEEYES) + icon_state = "[initial(icon_state)]up" + to_chat(usr, "You push the [src] up out of your face.") + flash_protect = 0 + tint = 0 + usr.update_inv_wear_mask() //so our mob-overlays update -/obj/item/clothing/mask/gas/welding/verb/toggle() - set category = "Object" - set name = "Adjust welding mask" - set src in usr - - if(usr.canmove && !usr.stat && !usr.restrained()) - if(src.up) - src.up = !src.up - src.flags |= (MASKCOVERSEYES) - flags_inv |= (HIDEEYES) - icon_state = initial(icon_state) - to_chat(usr, "You flip the [src] down to protect your eyes.") - flash_protect = 2 - tint = 2 - else - src.up = !src.up - src.flags &= ~(MASKCOVERSEYES) - flags_inv &= ~(HIDEEYES) - icon_state = "[initial(icon_state)]up" - to_chat(usr, "You push the [src] up out of your face.") - flash_protect = 0 - tint = 0 - usr.update_inv_wear_mask() //so our mob-overlays update + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() //Bane gas mask /obj/item/clothing/mask/banemask @@ -171,14 +169,7 @@ /obj/item/clothing/mask/gas/owl_mask/attack_self() hoot() -/obj/item/clothing/mask/gas/owl_mask/verb/hoot() - - set category = "Object" - set name = "Hoot" - set src in usr - if(!istype(usr, /mob/living)) return - if(usr.stat) return - +/obj/item/clothing/mask/gas/owl_mask/proc/hoot() if(cooldown < world.time - 35) // A cooldown, to stop people being jerks playsound(src.loc, "sound/misc/hoot.ogg", 50, 1) cooldown = world.time @@ -270,13 +261,7 @@ else return -/obj/item/clothing/mask/gas/sechailer/verb/halt() - set category = "Object" - set name = "HALT" - set src in usr - if(!istype(usr, /mob/living)) return - if(usr.stat) return - +/obj/item/clothing/mask/gas/sechailer/proc/halt() var/phrase = 0 //selects which phrase to use var/phrase_text = null var/phrase_sound = null diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 1c9a6260cc3..0f37d2133aa 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -22,6 +22,9 @@ to_chat(user, "You [magpulse ? "enable" : "disable"] the mag-pulse traction system.") user.update_inv_shoes() //so our mob-overlays update user.update_gravity(user.mob_has_gravity()) + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/clothing/shoes/magboots/negates_gravity() return flags & NOSLIP diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 6e7acf5c03d..8b5ea0d9af5 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -250,7 +250,6 @@ unacidable = 1 hit_reaction_chance = 50 - /obj/item/clothing/suit/armor/reactive/attack_self(mob/user) active = !(active) if(active) @@ -263,6 +262,9 @@ item_state = "reactiveoff" add_fingerprint(user) user.update_inv_wear_suit() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/clothing/suit/armor/reactive/emp_act(severity) active = 0 diff --git a/code/modules/clothing/suits/hood.dm b/code/modules/clothing/suits/hood.dm index 67ab432b9b4..0683394ce9f 100644 --- a/code/modules/clothing/suits/hood.dm +++ b/code/modules/clothing/suits/hood.dm @@ -7,7 +7,6 @@ /obj/item/clothing/suit/hooded/New() MakeHood() - verbs -= /obj/item/clothing/suit/verb/openjacket //you can't unbutton those, deal with it ..() /obj/item/clothing/suit/hooded/Destroy() @@ -47,16 +46,6 @@ ..() RemoveHood() -/obj/item/clothing/suit/hooded/verb/Hooderize(var/mob/user) - set name = "Adjust the hood" - set category = "Object" - set src in usr - if(!isliving(usr)) - return - if(usr.stat) - return - ToggleHood() - /obj/item/clothing/suit/hooded/proc/ToggleHood() if(!suit_adjusted) if(ishuman(loc)) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 8d1fe3bcace..028df02829e 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -800,6 +800,9 @@ icon_state = initial(icon_state) item_state = initial(item_state) usr.update_inv_wear_suit() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/clothing/suit/lordadmiral name = "Lord Admiral's Coat" diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index d09e325d9d3..c7b9b3abdb6 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -495,22 +495,21 @@ /obj/item/clothing/head/fluff/chronx/ui_action_click() adjust() -/obj/item/clothing/head/fluff/chronx/verb/adjust() - set name = "Transform Hood" - set category = "Object" - set src in usr - if(isliving(usr) && !usr.incapacitated()) - if(adjusted) - icon_state = initial(icon_state) - item_state = initial(item_state) - to_chat(usr, "You untransform \the [src].") - adjusted = 0 - else - icon_state += "_open" - item_state += "_open" - to_chat(usr, "You transform \the [src].") - adjusted = 1 - usr.update_inv_head() +/obj/item/clothing/head/fluff/chronx/proc/adjust() + if(adjusted) + icon_state = initial(icon_state) + item_state = initial(item_state) + to_chat(usr, "You untransform \the [src].") + adjusted = 0 + else + icon_state += "_open" + item_state += "_open" + to_chat(usr, "You transform \the [src].") + adjusted = 1 + usr.update_inv_head() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() /obj/item/clothing/suit/chaplain_hoodie/fluff/chronx //chronx100: Hughe O'Splash name = "Cthulhu's Robes" @@ -523,18 +522,6 @@ adjust_flavour = "untransform" ignore_suitadjust = 0 -/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/New() - ..() - verbs -= /obj/item/clothing/suit/verb/openjacket - -/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/verb/adjust() - set name = "Transform Robes" - set category = "Object" - set src in usr - if(!istype(usr, /mob/living)) - return - adjustsuit(usr) - /obj/item/clothing/shoes/black/fluff/chronx //chronx100: Hughe O'Splash name = "Cthulhu's Boots" desc = "Boots worn by the worshipers of Cthulhu. You see a name inscribed in blood on the inside: Hughe O'Splash"