diff --git a/code/__defines/action.dm b/code/__defines/action.dm index 0c6b3cf89a..3f9b8a5e41 100644 --- a/code/__defines/action.dm +++ b/code/__defines/action.dm @@ -1,10 +1,4 @@ #define AB_CHECK_RESTRAINED 1 #define AB_CHECK_STUNNED 2 #define AB_CHECK_LYING 4 -#define AB_CHECK_ALIVE 8 -#define AB_CHECK_INSIDE 16 - -#define AB_ITEM 1 -#define AB_SPELL 2 -#define AB_INNATE 3 -#define AB_GENERIC 4 +#define AB_CHECK_CONSCIOUS 8 diff --git a/code/_onclick/hud/action/action.dm b/code/_onclick/hud/action/action.dm index d2b0902abb..7e0c3ece55 100644 --- a/code/_onclick/hud/action/action.dm +++ b/code/_onclick/hud/action/action.dm @@ -1,20 +1,19 @@ - /datum/action var/name = "Generic Action" - var/action_type = AB_ITEM - var/procname = null var/atom/movable/target = null var/check_flags = 0 var/processing = 0 - var/active = 0 var/obj/screen/movable/action_button/button = null var/button_icon = 'icons/mob/actions.dmi' var/button_icon_state = "default" var/background_icon_state = "bg_default" var/mob/living/owner -/datum/action/New(var/Target) +/datum/action/New(Target) target = Target + button = new + button.linked_action = src + button.name = name /datum/action/Destroy() if(owner) @@ -23,64 +22,34 @@ QDEL_NULL(button) return ..() -/datum/action/proc/Grant(mob/living/T) +/datum/action/proc/Grant(mob/living/L) if(owner) - if(owner == T) + if(owner == L) return Remove(owner) - owner = T - owner.actions.Add(src) - owner.update_action_buttons() - return + owner = L + L.actions += src + if(L.client) + L.client.screen += button + L.update_action_buttons(TRUE) -/datum/action/proc/Remove(mob/living/T) - if(button) - if(T.client) - T.client.screen -= button - QDEL_NULL(button) - T.actions.Remove(src) - T.update_action_buttons() +/datum/action/proc/Remove(mob/living/L) + if(L.client) + L.client.screen -= button + button.moved = FALSE + L.actions -= src + L.update_action_buttons(TRUE) owner = null - return /datum/action/proc/Trigger() - if(!Checks()) - return - switch(action_type) - if(AB_ITEM) - if(target) - var/obj/item/item = target - item.ui_action_click() - //if(AB_SPELL) - // if(target) - // var/obj/effect/proc_holder/spell = target - // spell.Click() - if(AB_INNATE) - if(!active) - Activate() - else - Deactivate() - if(AB_GENERIC) - if(target && procname) - call(target,procname)(usr) - return - -/datum/action/proc/Activate() - return - -/datum/action/proc/Deactivate() - return + if(!IsAvailable()) + return 0 + return 1 /datum/action/process() return -/datum/action/proc/CheckRemoval(mob/living/user) // 1 if action is no longer valid for this mob and should be removed - return 0 - /datum/action/proc/IsAvailable() - return Checks() - -/datum/action/proc/Checks()// returns 1 if all checks pass if(!owner) return 0 if(check_flags & AB_CHECK_RESTRAINED) @@ -92,110 +61,96 @@ if(check_flags & AB_CHECK_LYING) if(owner.lying) return 0 - if(check_flags & AB_CHECK_ALIVE) + if(check_flags & AB_CHECK_CONSCIOUS) if(owner.stat) return 0 - if(check_flags & AB_CHECK_INSIDE) - if(!(target in owner)) - return 0 return 1 -/datum/action/proc/UpdateName() - return name +/datum/action/proc/UpdateButtonIcon() + if(button) + button.icon = button_icon + button.icon_state = background_icon_state -//This is the proc used to update all the action buttons. Properly defined in /mob/living/ -/mob/proc/update_action_buttons() - return + ApplyIcon(button) -/mob/living/update_action_buttons() - if(!hud_used) return - if(!client) return + if(!IsAvailable()) + button.color = rgb(128, 0, 0, 128) + else + button.color = rgb(255, 255, 255, 255) + return 1 - if(hud_used.hud_shown != 1) //Hud toggled to minimal - return - - client.screen -= hud_used.hide_actions_toggle - for(var/datum/action/A in actions) - if(A.button) - client.screen -= A.button - - if(hud_used.action_buttons_hidden) - if(!hud_used.hide_actions_toggle) - hud_used.hide_actions_toggle = new(hud_used) - hud_used.hide_actions_toggle.UpdateIcon() - - if(!hud_used.hide_actions_toggle.moved) - hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1) - //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1) - - client.screen += hud_used.hide_actions_toggle - return - - var/button_number = 0 - for(var/datum/action/A in actions) - button_number++ - if(A.button == null) - var/obj/screen/movable/action_button/N = new(hud_used) - N.owner = A - A.button = N - - var/obj/screen/movable/action_button/B = A.button - - B.UpdateIcon() - - B.name = A.UpdateName() - - client.screen += B - - if(!B.moved) - B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number) - //hud_used.SetButtonCoords(B,button_number) - - if(button_number > 0) - if(!hud_used.hide_actions_toggle) - hud_used.hide_actions_toggle = new(hud_used) - hud_used.hide_actions_toggle.InitialiseIcon(src) - if(!hud_used.hide_actions_toggle.moved) - hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1) - //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1) - client.screen += hud_used.hide_actions_toggle - -#define AB_WEST_OFFSET 4 -#define AB_NORTH_OFFSET 26 -#define AB_MAX_COLUMNS 10 - -/datum/hud/proc/ButtonNumberToScreenCoords(var/number) // TODO : Make this zero-indexed for readabilty - var/row = round((number-1)/AB_MAX_COLUMNS) - var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1 - var/coord_col = "+[col-1]" - var/coord_col_offset = AB_WEST_OFFSET+2*col - var/coord_row = "[-1 - row]" - var/coord_row_offset = AB_NORTH_OFFSET - return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]" - -/datum/hud/proc/SetButtonCoords(var/obj/screen/button,var/number) - var/row = round((number-1)/AB_MAX_COLUMNS) - var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1 - var/x_offset = 32*(col-1) + AB_WEST_OFFSET + 2*col - var/y_offset = -32*(row+1) + AB_NORTH_OFFSET - - var/matrix/M = matrix() - M.Translate(x_offset,y_offset) - button.transform = M +/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button) + current_button.cut_overlays() + if(button_icon && button_icon_state) + var/image/img + img = image(button_icon, current_button, button_icon_state) + img.pixel_x = 0 + img.pixel_y = 0 + current_button.add_overlay(img) //Presets for item actions /datum/action/item_action - check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_ALIVE|AB_CHECK_INSIDE + check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS -/datum/action/item_action/CheckRemoval(mob/living/user) - return !(target in user) +/datum/action/item_action/New(Target) + . = ..() + var/obj/item/I = target + I.actions += src + +/datum/action/item_action/Destroy() + var/obj/item/I = target + I.actions -= src + return ..() + +/datum/action/item_action/Trigger() + if(!..()) + return 0 + if(target) + var/obj/item/I = target + I.ui_action_click(owner, src.type) + return 1 + +/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button) + current_button.cut_overlays() + if(target) + var/mutable_appearance/ma = new(target.appearance) + ma.plane = FLOAT_PLANE + ma.layer = FLOAT_LAYER + ma.pixel_x = 0 + ma.pixel_y = 0 + current_button.add_overlay(ma) /datum/action/item_action/hands_free - check_flags = AB_CHECK_ALIVE|AB_CHECK_INSIDE + check_flags = AB_CHECK_CONSCIOUS -#undef AB_WEST_OFFSET -#undef AB_NORTH_OFFSET -#undef AB_MAX_COLUMNS /datum/action/innate - action_type = AB_INNATE + check_flags = 0 + var/active = 0 + +/datum/action/innate/Trigger() + if(!..()) + return 0 + if(!active) + Activate() + else + Deactivate() + return 1 + +/datum/action/innate/proc/Activate() + return + +/datum/action/innate/proc/Deactivate() + return + +//Preset for action that call specific procs (consider innate). +/datum/action/generic + check_flags = 0 + var/procname + +/datum/action/generic/Trigger() + if(!..()) + return 0 + if(target && procname) + call(target, procname)(usr) + return 1 diff --git a/code/_onclick/hud/action/action_screen_objects.dm b/code/_onclick/hud/action/action_screen_objects.dm index eb5242d0a2..f4b10fc001 100644 --- a/code/_onclick/hud/action/action_screen_objects.dm +++ b/code/_onclick/hud/action/action_screen_objects.dm @@ -1,41 +1,18 @@ /obj/screen/movable/action_button - var/datum/action/owner - screen_loc = "WEST,NORTH" + var/datum/action/linked_action + screen_loc = null /obj/screen/movable/action_button/Click(location,control,params) var/list/modifiers = params2list(params) if(modifiers["shift"]) moved = FALSE - owner?.owner?.update_action_buttons() + usr.update_action_buttons() return 1 if(!usr.checkClickCooldown()) return - owner.Trigger() + linked_action.Trigger() return 1 - -/obj/screen/movable/action_button/proc/UpdateIcon() - if(!owner) - return - icon = owner.button_icon - icon_state = owner.background_icon_state - - cut_overlays() - var/image/img - if(owner.action_type == AB_ITEM && owner.target) - var/obj/item/I = owner.target - img = image(I.icon, src , I.icon_state) - else if(owner.button_icon && owner.button_icon_state) - img = image(owner.button_icon,src,owner.button_icon_state) - img.pixel_x = 0 - img.pixel_y = 0 - add_overlay(img) - - if(!owner.IsAvailable()) - color = rgb(128,0,0,128) - else - color = rgb(255,255,255,255) - //Hide/Show Action Buttons ... Button /obj/screen/movable/action_button/hide_toggle name = "Hide Buttons" @@ -60,10 +37,96 @@ else icon_state = "bg_default" UpdateIcon() + +/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon() + cut_overlays() + var/image/img = image(icon, src, hidden ? "show" : "hide") + add_overlay(img) + +/obj/screen/movable/action_button/MouseEntered(location, control, params) + openToolTip(usr, src, params, title = name, content = desc) + +/obj/screen/movable/action_button/MouseExited(location, control, params) + closeToolTip(usr) + +//used to update the buttons icon. +/mob/proc/update_action_buttons_icon() return -/obj/screen/movable/action_button/hide_toggle/UpdateIcon() - cut_overlays() - var/image/img = image(icon,src,hidden?"show":"hide") - add_overlay(img) +/mob/living/update_action_buttons_icon() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + +//This is the proc used to update all the action buttons. Properly defined in /mob/living/ +/mob/proc/update_action_buttons(reload_screen) return + +/mob/living/update_action_buttons(reload_screen) + if(!hud_used || !client) + return + + if(!hud_used.hud_shown) //Hud toggled to minimal + return + + var/button_number = 0 + + if(hud_used.action_buttons_hidden) + for(var/datum/action/A in actions) + A.button.screen_loc = null + if(reload_screen) + client.screen += A.button + else + for(var/datum/action/A in actions) + button_number++ + A.UpdateButtonIcon() + var/obj/screen/movable/action_button/B = A.button + if(!B.moved) + B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number) + else + B.screen_loc = B.moved + if(reload_screen) + client.screen += B + + if(!button_number) + hud_used.hide_actions_toggle?.screen_loc = null + return + + // not exactly sure how this happens but it does + if(hud_used.hide_actions_toggle) + if(!hud_used.hide_actions_toggle.moved) + hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1) + else + hud_used.hide_actions_toggle.screen_loc = hud_used.hide_actions_toggle.moved + if(reload_screen) + client.screen += hud_used.hide_actions_toggle + +#define AB_WEST_OFFSET 4 +#define AB_NORTH_OFFSET 26 +#define AB_MAX_COLUMNS 10 + +/datum/hud/proc/ButtonNumberToScreenCoords(var/number) // TODO : Make this zero-indexed for readabilty + var/row = round((number-1)/AB_MAX_COLUMNS) + var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1 + + var/coord_col = "+[col-1]" + var/coord_col_offset = AB_WEST_OFFSET+2*col + + var/coord_row = "[-1 - row]" + var/coord_row_offset = AB_NORTH_OFFSET + + return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]" + +/datum/hud/proc/SetButtonCoords(var/obj/screen/button,var/number) + var/row = round((number-1)/AB_MAX_COLUMNS) + var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1 + var/x_offset = 32*(col-1) + AB_WEST_OFFSET + 2*col + var/y_offset = -32*(row+1) + AB_NORTH_OFFSET + + var/matrix/M = matrix() + M.Translate(x_offset,y_offset) + button.transform = M + +#undef AB_WEST_OFFSET +#undef AB_NORTH_OFFSET +#undef AB_MAX_COLUMNS diff --git a/code/_onclick/hud/action/types/item.dm b/code/_onclick/hud/action/types/item.dm new file mode 100644 index 0000000000..df2d770aec --- /dev/null +++ b/code/_onclick/hud/action/types/item.dm @@ -0,0 +1,161 @@ +// Generic Classes +/datum/action/item_action/activate + +/datum/action/item_action/activate/New(Target, name) + . = ..() + src.name = name + button.name = name + +// Specific names +/datum/action/item_action/toggle_grippers + name = "Toggle Grippers" + +/datum/action/item_action/toggle_talons + name = "Toggle Talons" + +/datum/action/item_action/toggle_goggles + name = "Toggle Goggles" + +/datum/action/item_action/toggle_shield_projector + name = "Toggle Shield Projector" + +/datum/action/item_action/toggle_tesla_armor + name = "Toggle Tesla Armor" + +/datum/action/item_action/remove_replace_paddles + name = "Remove/Replace Paddles" + +/datum/action/item_action/toggle_flashlight + name = "Toggle Flashlight" + +/datum/action/item_action/toggle_shield + name = "Toggle Shield" + +/datum/action/item_action/toggle_heatsink + name = "Toggle Heatsink" + +/datum/action/item_action/remove_replace_handset + name = "Remove/Replace Handset" + +/datum/action/item_action/command + name = "Command" + +/datum/action/item_action/toggle_jetpack + name = "Toggle Jetpack" + +/datum/action/item_action/toggle_cataloguer + name = "Toggle Cataloguer" + +/datum/action/item_action/toggle_eyepatch + name = "Toggle Eyepatch" + +/datum/action/item_action/hands_free/change_scanning_pattern + name = "Change Scanning Pattern" + +/datum/action/item_action/toggle_hud + name = "Toggle HUD" + +/datum/action/item_action/toggle_mode + name = "Toggle Mode" + +/datum/action/item_action/flip_welding_goggles + name = "Flip Welding Goggles" + +/datum/action/item_action/toggle_monocle + name = "Toggle Monocle" + +/datum/action/item_action/adjust_orange_goggles + name = "Adjust Orange Goggles" + +/datum/action/item_action/ar_console_crew + name = "AR Console (Crew Monitor)" + +/datum/action/item_action/ar_console_security_alerts + name = "AR Console (Security Alerts)" + +/datum/action/item_action/ar_console_station_alerts + name = "AR Console (Station Alerts)" + +/datum/action/item_action/ar_console_all_alerts + name = "AR Console (All Alerts)" + +/datum/action/item_action/toggle_head_light + name = "Toggle Head-light" + +/datum/action/item_action/toggle_visor + name = "Toggle Visor" + +/datum/action/item_action/flip_welding_mask + name = "Flip Welding Mask" + +/datum/action/item_action/adjust_breath_mask + name = "Adjust Breath Mask" + +/datum/action/item_action/toggle_feeding_port + name = "Toggle Feeding Port" + +/datum/action/item_action/halt + name = "HALT!" + +/datum/action/item_action/hands_free/redraw_design + name = "Redraw Design" + +/datum/action/item_action/toggle_magboots + name = "Toggle Magboots" + +/datum/action/item_action/toggle_magclaws + name = "Toggle Magclaws" + +/datum/action/item_action/activate_jump_boots + name = "Activate Jump Boots" + +/datum/action/item_action/toggle_helmet_light + name = "Toggle Helmet Light" + +/datum/action/item_action/hardsuit_interface + name = "Hardsuit Interface" + +/datum/action/item_action/toggle_helmet + name = "Toggle Helmet" + +/datum/action/item_action/toggle_knight_headgear + name = "Toggle Knight Headgear" + +/datum/action/item_action/toggle_hood + name = "Toggle Hood" + +/datum/action/item_action/adjust_cloak + name = "Adjust Cloak" + +/datum/action/item_action/adjust_poncho + name = "Adjust Poncho" + +/datum/action/item_action/pull_on_gaiter + name = "Pull On Gaiter" + +/datum/action/item_action/toggle_uv_light + name = "Toggle UV Light" + +/datum/action/item_action/toggle_light + name = "Toggle Light" + +/datum/action/item_action/use_scope + name = "Use Scope" + +/datum/action/item_action/aim_down_sights + name = "Aim Down Sights" + +/datum/action/item_action/toggle_gunlight + name = "Toggle Gun-light" + +/datum/action/item_action/toggle_internal_generator + name = "Toggle Internal Generator" + +/datum/action/item_action/toggle_stock + name = "Toggle Stock" + +/datum/action/item_action/toggle_pom_pom + name = "Toggle Pom-Pom" + +/datum/action/item_action/toggle_mlembulance + name = "Toggle Mlembulance Mode" diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 123d94a7d8..7ba7bba1e1 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -207,6 +207,7 @@ var/list/global_huds = list( /datum/hud/Destroy() . = ..() QDEL_NULL_LIST(minihuds) + QDEL_NULL(hide_actions_toggle) grab_intent = null hurt_intent = null disarm_intent = null @@ -322,10 +323,12 @@ var/list/global_huds = list( return 0 mymob.create_mob_hud(src) + hide_actions_toggle = new() + hide_actions_toggle.InitialiseIcon(mymob) persistant_inventory_update() mymob.reload_fullscreen() // Reload any fullscreen overlays this mob has. - mymob.update_action_buttons() + mymob.update_action_buttons(TRUE) reorganize_alerts() /mob/proc/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) @@ -404,10 +407,11 @@ var/list/global_huds = list( hud_used?.action_intent.screen_loc = ui_acti //Restore intent selection to the original position client.screen += zone_sel //This one is a special snowflake + client.screen += hud_used.hide_actions_toggle hud_used.hidden_inventory_update() hud_used.persistant_inventory_update() - update_action_buttons() + update_action_buttons(TRUE) hud_used.reorganize_alerts() return TRUE @@ -467,7 +471,7 @@ var/list/global_huds = list( hud_used.hidden_inventory_update() hud_used.persistant_inventory_update() - update_action_buttons() + update_action_buttons(TRUE) /mob/proc/add_click_catcher() client.screen += client.void diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index d3d19857a7..53e64c8b24 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -28,7 +28,7 @@ return screen_loc = position - moved = TRUE + moved = screen_loc /// Takes mouse parmas as input, returns a string representing the appropriate mouse position /obj/screen/movable/proc/mouse_params_to_position(params) diff --git a/code/game/gamemodes/changeling/powers/armor.dm b/code/game/gamemodes/changeling/powers/armor.dm index 9354d053cd..55b55ada48 100644 --- a/code/game/gamemodes/changeling/powers/armor.dm +++ b/code/game/gamemodes/changeling/powers/armor.dm @@ -67,7 +67,7 @@ desc = "A suction cupped mass of flesh, shaped like a foot." name = "fleshy grippers" icon_state = "lingspacesuit" - action_button_name = "Toggle Grippers" + actions_types = list(/datum/action/item_action/toggle_grippers) canremove = FALSE /obj/item/clothing/shoes/magboots/changeling/set_slowdown() @@ -124,7 +124,7 @@ desc = "A tough, hard mass of chitin, with long talons for digging into terrain." name = "chitinous talons" icon_state = "lingarmor" - action_button_name = "Toggle Talons" + actions_types = list(/datum/action/item_action/toggle_talons) /obj/item/clothing/gloves/combat/changeling //Combined insulated/fireproof gloves name = "chitinous gauntlets" diff --git a/code/game/gamemodes/technomancer/devices/shield_armor.dm b/code/game/gamemodes/technomancer/devices/shield_armor.dm index bbf394240c..c991f6e164 100644 --- a/code/game/gamemodes/technomancer/devices/shield_armor.dm +++ b/code/game/gamemodes/technomancer/devices/shield_armor.dm @@ -18,7 +18,7 @@ blood_overlay_type = "armor" slowdown = 0 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) - action_button_name = "Toggle Shield Projector" + actions_types = list(/datum/action/item_action/toggle_shield_projector) var/active = 0 var/damage_to_energy_multiplier = 50.0 //Determines how much energy to charge for blocking, e.g. 20 damage attack = 750 energy cost var/datum/effect/effect/system/spark_spread/spark_system = null @@ -78,7 +78,7 @@ to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src].")) update_icon() user.update_inv_wear_suit() - user.update_action_buttons() + user.update_action_buttons_icon() /obj/item/clothing/suit/armor/shield/update_icon() icon_state = "shield_armor_[active]" diff --git a/code/game/gamemodes/technomancer/devices/tesla_armor.dm b/code/game/gamemodes/technomancer/devices/tesla_armor.dm index 0a7d606b80..01a65b5a66 100644 --- a/code/game/gamemodes/technomancer/devices/tesla_armor.dm +++ b/code/game/gamemodes/technomancer/devices/tesla_armor.dm @@ -14,7 +14,7 @@ blood_overlay_type = "armor" slowdown = 0.5 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) - action_button_name = "Toggle Tesla Armor" + actions_types = list(/datum/action/item_action/toggle_tesla_armor) var/active = 1 //Determines if the armor will zap or block var/ready = 1 //Determines if the next attack will be blocked, as well if a strong lightning bolt is sent out at the attacker. var/ready_icon_state = "tesla_armor_1" //also wip @@ -57,7 +57,7 @@ to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src].")) update_icon() user.update_inv_wear_suit() - user.update_action_buttons() + user.update_action_buttons_icon() /obj/item/clothing/suit/armor/tesla/update_icon() if(active && ready) @@ -72,7 +72,7 @@ if(ishuman(loc)) var/mob/living/carbon/human/H = loc H.update_inv_wear_suit(0) - H.update_action_buttons() + H.update_action_buttons_icon() ..() /obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(mob/target, power) diff --git a/code/game/gamemodes/technomancer/equipment.dm b/code/game/gamemodes/technomancer/equipment.dm index fbb83f2ce8..eb1002c31d 100644 --- a/code/game/gamemodes/technomancer/equipment.dm +++ b/code/game/gamemodes/technomancer/equipment.dm @@ -160,7 +160,7 @@ capabilities. The lens appear to be multiple optical matrices layered together, allowing the wearer to see almost anything \ across physical barriers." icon_state = "uzenwa_sissra_1" - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) origin_tech = list(TECH_MAGNET = 6, TECH_ENGINEERING = 6) toggleable = 1 vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS diff --git a/code/game/gamemodes/technomancer/equipment_ch.dm b/code/game/gamemodes/technomancer/equipment_ch.dm index 44ca342e4a..0596329f45 100644 --- a/code/game/gamemodes/technomancer/equipment_ch.dm +++ b/code/game/gamemodes/technomancer/equipment_ch.dm @@ -2,8 +2,8 @@ name = "The Monocoole" desc = "One heck of a stylish monocle. This one lets you see a little farther..." icon_state = "monocle" - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) origin_tech = list(TECH_MAGNET = 6, TECH_ENGINEERING = 6) toggleable = 1 vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS - prescription = 1 // So two versions of these aren't needed. \ No newline at end of file + prescription = 1 // So two versions of these aren't needed. diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 3370bcdd0e..0ce8eaf590 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -62,10 +62,14 @@ // /datum/action/innate/mecha - check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_ALIVE + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS button_icon = 'icons/effects/actions_mecha.dmi' var/obj/mecha/chassis +/datum/action/innate/mecha/Destroy() + chassis = null + return ..() + /datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M) if(M) chassis = M @@ -78,7 +82,7 @@ /datum/action/innate/mecha/mech_toggle_lights/Activate() button_icon_state = "mech_lights_[chassis.lights ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.lights() @@ -89,7 +93,7 @@ /datum/action/innate/mecha/mech_toggle_internals/Activate() button_icon_state = "mech_internals_[chassis.use_internal_tank ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.internal_tank() @@ -118,7 +122,7 @@ /datum/action/innate/mecha/strafe/Activate() button_icon_state = "mech_strafe_[chassis.strafing ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.strafing() @@ -129,7 +133,7 @@ /datum/action/innate/mecha/mech_defence_mode/Activate() button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.defence_mode() @@ -140,7 +144,7 @@ /datum/action/innate/mecha/mech_overload_mode/Activate() button_icon_state = "mech_overload_[chassis.overload ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.overload() @@ -151,7 +155,7 @@ /datum/action/innate/mecha/mech_smoke/Activate() //button_icon_state = "mech_smoke_[chassis.smoke ? "off" : "on"]" - //button.UpdateIcon() //Dual colors notneeded ATM + //UpdateButtonIcon() //Dual colors notneeded ATM chassis.smoke() @@ -162,7 +166,7 @@ /datum/action/innate/mecha/mech_zoom/Activate() button_icon_state = "mech_zoom_[chassis.zoom ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.zoom() @@ -173,7 +177,7 @@ /datum/action/innate/mecha/mech_toggle_thrusters/Activate() button_icon_state = "mech_thrusters_[chassis.thrusters ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.thrusters() @@ -198,7 +202,7 @@ chassis.occupant_message("You select [chassis.selected]") send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list()) button_icon_state = "mech_cycle_equip_on" - button.UpdateIcon() + UpdateButtonIcon() return var/number = 0 for(var/A in available_equipment) @@ -213,7 +217,7 @@ chassis.occupant_message("You switch to [chassis.selected]") button_icon_state = "mech_cycle_equip_on" send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list()) - button.UpdateIcon() + UpdateButtonIcon() return @@ -228,7 +232,7 @@ button_icon_state = "mech_damtype_[chassis.damtype]" playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1) - button.UpdateIcon() + UpdateButtonIcon() chassis.query_damtype() @@ -239,7 +243,7 @@ /datum/action/innate/mecha/mech_toggle_phasing/Activate() button_icon_state = "mech_phasing_[chassis.phasing ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.phasing() @@ -250,7 +254,7 @@ /datum/action/innate/mecha/mech_toggle_cloaking/Activate() button_icon_state = "mech_phasing_[chassis.cloaked ? "off" : "on"]" - button.UpdateIcon() + UpdateButtonIcon() chassis.toggle_cloaking() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6c5a0f6fcf..6a98e24c73 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -35,10 +35,8 @@ var/max_pressure_protection // Set this variable if the item protects its wearer against high pressures below an upper bound. Keep at null to disable protection. var/min_pressure_protection // Set this variable if the item protects its wearer against low pressures above a lower bound. Keep at null to disable protection. 0 represents protection against hard vacuum. - - var/datum/action/item_action/action = null - var/action_button_name //It is also the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. If it's not set, there'll be no button. - var/action_button_is_hands_free = 0 //If 1, bypass the restrained, lying, and stunned checks action buttons normally test for + var/list/actions = list() //list of /datum/action's that this item has. + var/list/actions_types = list() //list of paths of action datums to give to the item on New(). //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc. //It should be used purely for appearance. For gameplay effects caused by items covering body parts, use body_parts_covered. @@ -115,6 +113,8 @@ /obj/item/Initialize(mapload) //CHOMPedit I stg I'm going to overwrite these many uncommented edits. . = ..() + for(var/path in actions_types) + new path(src) if(islist(origin_tech)) origin_tech = typelist(NAMEOF(src, origin_tech), origin_tech) if(embed_chance < 0) @@ -137,6 +137,8 @@ m.update_inv_r_hand() m.update_inv_l_hand() src.loc = null + for(var/X in actions) + qdel(X) return ..() // Check if target is reasonable for us to operate on. @@ -336,6 +338,9 @@ if(zoom) zoom() //binoculars, scope, etc appearance_flags &= ~NO_CLIENT_COLOR + for(var/X in actions) + var/datum/action/A = X + A.Remove(user) // called just as an item is picked up (loc is not yet changed) /obj/item/proc/pickup(mob/user) @@ -361,6 +366,10 @@ // for items that can be placed in multiple slots // note this isn't called during the initial dressing of a player /obj/item/proc/equipped(var/mob/user, var/slot) + for(var/X in actions) + var/datum/action/A = X + if(item_action_slot_check(slot, user)) //some items only give their actions buttons when in a specific slot. + A.Grant(user) hud_layerise() user.position_hud_item(src,slot) if(user.client) user.client.screen |= src @@ -375,6 +384,12 @@ playsound(src, pickup_sound, 20, preference = /datum/preference/toggle/pickup_sounds) return +//sometimes we only want to grant the item's action if it's equipped in a specific slot. +/obj/item/proc/item_action_slot_check(slot, mob/user) + if(slot == SLOT_BACK || slot == LEGS) //these aren't true slots, so avoid granting actions there + return FALSE + return TRUE + // As above but for items being equipped to an active module on a robot. /obj/item/proc/equipped_robot(var/mob/user) return @@ -538,11 +553,11 @@ var/list/global/slot_flags_enumeration = list( return -//This proc is executed when someone clicks the on-screen UI button. To make the UI button show, set the 'icon_action_button' to the icon_state of the image of the button in screen1_action.dmi +//This proc is executed when someone clicks the on-screen UI button. //The default action is attack_self(). //Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob. -/obj/item/proc/ui_action_click() - attack_self(usr) +/obj/item/proc/ui_action_click(mob/user, actiontype) + attack_self(user) //RETURN VALUES //handle_shield should return a positive value to indicate that the attack is blocked and should be prevented. diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 8f13edf8f1..8753fb49c1 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -15,7 +15,7 @@ w_class = ITEMSIZE_LARGE unacidable = TRUE origin_tech = list(TECH_BIO = 4, TECH_POWER = 2) - action_button_name = "Remove/Replace Paddles" + actions_types = list(/datum/action/item_action/remove_replace_paddles) var/obj/item/shockpaddles/linked/paddles var/obj/item/cell/bcell = null @@ -64,7 +64,7 @@ else add_overlay("[initial(icon_state)]-nocell") -/obj/item/defib_kit/ui_action_click() +/obj/item/defib_kit/ui_action_click(mob/user, actiontype) toggle_paddles() /obj/item/defib_kit/attack_hand(mob/user) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 937046a9ce..f78e3e9966 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -19,7 +19,7 @@ w_class = ITEMSIZE_SMALL slot_flags = SLOT_BELT matter = list(MAT_STEEL = 50,MAT_GLASS = 20) - action_button_name = "Toggle Flashlight" + actions_types = list(/datum/action/item_action/toggle_flashlight) light_system = MOVABLE_LIGHT_DIRECTIONAL light_range = 4 //luminosity when on @@ -102,7 +102,7 @@ STOP_PROCESSING(SSobj, src) playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3) // VOREStation Edit update_brightness() - user.update_action_buttons() + user.update_action_buttons_icon() return 1 /obj/item/flashlight/emp_act(severity) @@ -358,7 +358,7 @@ light_color = LIGHT_COLOR_FLARE icon_state = "flare" item_state = "flare" - action_button_name = null //just pull it manually, neckbeard. + actions_types = list() //just pull it manually, neckbeard. var/fuel = 0 var/on_damage = 7 var/produce_heat = 1500 diff --git a/code/game/objects/items/devices/personal_shield_generator_vr.dm b/code/game/objects/items/devices/personal_shield_generator_vr.dm index d46d68eab6..1bb0e01042 100644 --- a/code/game/objects/items/devices/personal_shield_generator_vr.dm +++ b/code/game/objects/items/devices/personal_shield_generator_vr.dm @@ -26,7 +26,7 @@ w_class = ITEMSIZE_HUGE //It's a giant shield generator!!! unacidable = TRUE origin_tech = list(TECH_MATERIAL = 6, TECH_COMBAT = 8, TECH_POWER = 6, TECH_DATA = 4) //These are limited AND high tech. Breaking one of them down is massive. - action_button_name = "Toggle Shield" + actions_types = list(/datum/action/item_action/toggle_shield) var/obj/item/gun/energy/gun/generator/active_weapon var/obj/item/cell/device/bcell = null var/upgraded = 0 // If the PSG has been upgraded by some method or not. Only used for the mining belt ATM. @@ -138,7 +138,7 @@ bcell.emp_act(severity) ..() -/obj/item/personal_shield_generator/ui_action_click() +/obj/item/personal_shield_generator/ui_action_click(mob/user, actiontype) toggle_shield() /obj/item/personal_shield_generator/attack_hand(mob/user) diff --git a/code/game/objects/items/devices/radio/radiopack.dm b/code/game/objects/items/devices/radio/radiopack.dm index d47612e788..0dd91f0c87 100644 --- a/code/game/objects/items/devices/radio/radiopack.dm +++ b/code/game/objects/items/devices/radio/radiopack.dm @@ -10,7 +10,7 @@ throwforce = 6 preserve_item = 1 w_class = ITEMSIZE_LARGE - action_button_name = "Remove/Replace Handset" + actions_types = list(/datum/action/item_action/remove_replace_handset) var/obj/item/radio/bluespacehandset/linked/handset = /obj/item/radio/bluespacehandset/linked @@ -23,7 +23,7 @@ . = ..() QDEL_NULL(handset) -/obj/item/bluespaceradio/ui_action_click() +/obj/item/bluespaceradio/ui_action_click(mob/user, actiontype) toggle_handset() /obj/item/bluespaceradio/attack_hand(var/mob/user) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 57115dc6de..f49036b0d2 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -12,7 +12,7 @@ throwforce = 10.0 throw_speed = 1 throw_range = 4 - action_button_name = "Toggle Heatsink" + actions_types = list(/datum/action/item_action/toggle_heatsink) matter = list(MAT_STEEL = 15000, MAT_GLASS = 3500) origin_tech = list(TECH_MAGNET = 2, TECH_MATERIAL = 2) @@ -28,8 +28,8 @@ //TODO: make it heat up the surroundings when not in space -/obj/item/suit_cooling_unit/ui_action_click() - toggle(usr) +/obj/item/suit_cooling_unit/ui_action_click(mob/user, actiontype) + toggle(user) /obj/item/suit_cooling_unit/Initialize() . = ..() diff --git a/code/game/objects/items/weapons/capture_crystal.dm b/code/game/objects/items/weapons/capture_crystal.dm index 549026e40a..54c2a3251b 100644 --- a/code/game/objects/items/weapons/capture_crystal.dm +++ b/code/game/objects/items/weapons/capture_crystal.dm @@ -7,7 +7,7 @@ pickup_sound = 'sound/items/pickup/ring.ogg' throwforce = 0 force = 0 - action_button_name = "Command" + actions_types = list(/datum/action/item_action/command) w_class = ITEMSIZE_SMALL //CHOMPEdit var/active = FALSE //Is it set up? @@ -54,7 +54,7 @@ . += span_deptradio("\[Mechanical Vore Preferences\]") //Command! This lets the owner toggle hostile on AI controlled mobs, or send a silent command message to your bound mob, wherever they may be. -/obj/item/capture_crystal/ui_action_click() +/obj/item/capture_crystal/ui_action_click(mob/user, actiontype) if(!ismob(loc)) return var/mob/living/M = src.loc @@ -73,7 +73,7 @@ to_chat(M, span_notice("\The [bound_mob] is now [AI.hostile ? "hostile" : "passive"].")) log_admin("[key_name_admin(M)] set [bound_mob] to [AI.hostile].") else if(bound_mob.client) - var/transmit_msg = tgui_input_text(usr, "What is your command?", "Command") + var/transmit_msg = tgui_input_text(user, "What is your command?", "Command") if(length(transmit_msg) >= MAX_MESSAGE_LEN) to_chat(M, span_danger("Your message was TOO LONG!:[transmit_msg]")) return diff --git a/code/game/objects/items/weapons/shields_vr.dm b/code/game/objects/items/weapons/shields_vr.dm index 978042b50b..f1eb816f67 100644 --- a/code/game/objects/items/weapons/shields_vr.dm +++ b/code/game/objects/items/weapons/shields_vr.dm @@ -64,7 +64,7 @@ set_light(0) light_applied = 0 update_icon(user) - user.update_action_buttons() + user.update_action_buttons_icon() playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3) /obj/item/shield/riot/explorer/update_icon() diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index 2400985b05..42b67842e4 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -17,7 +17,7 @@ var/on = 0.0 var/stabilization_on = 0 var/volume_rate = 500 //Needed for borg jetpack transfer - action_button_name = "Toggle Jetpack" + actions_types = list(/datum/action/item_action/toggle_jetpack) /obj/item/tank/jetpack/New() ..() @@ -55,7 +55,7 @@ if (ismob(usr)) var/mob/M = usr M.update_inv_back() - M.update_action_buttons() + M.update_action_buttons_icon() to_chat(usr, "You toggle the thrusters [on? "on":"off"].") @@ -81,7 +81,7 @@ fuel.remove(num) return 1 -/obj/item/tank/jetpack/ui_action_click() +/obj/item/tank/jetpack/ui_action_click(mob/user, actiontype) toggle() /obj/item/tank/jetpack/void diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm index 56a674ff80..766fd2e939 100644 --- a/code/modules/catalogue/cataloguer.dm +++ b/code/modules/catalogue/cataloguer.dm @@ -326,7 +326,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) Alt+click to highlight scannable objects around you." icon = 'icons/obj/device_vr.dmi' icon_state = "compact" - action_button_name = "Toggle Cataloguer" + actions_types = list(/datum/action/item_action/toggle_cataloguer) var/deployed = TRUE scan_range = 1 toolspeed = 1.2 @@ -346,7 +346,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) else icon_state = initial(icon_state) -/obj/item/cataloguer/compact/ui_action_click() +/obj/item/cataloguer/compact/ui_action_click(mob/user, actiontype) toggle() /obj/item/cataloguer/compact/verb/toggle() @@ -368,7 +368,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) if (ismob(usr)) var/mob/M = usr - M.update_action_buttons() + M.update_action_buttons_icon() /obj/item/cataloguer/compact/afterattack(atom/target, mob/user, proximity_flag) if(!deployed) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index ceee681e72..dd6ce9c347 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -485,7 +485,8 @@ update_light() update_icon(user) - user.update_action_buttons() + spawn(10) // FIXME: Remove when SSoverlays stops queueing overlay changes + user.update_action_buttons_icon() /obj/item/clothing/head/attack_ai(var/mob/user) if(!mob_wear_hat(user)) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 3af787763e..5ed049694c 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -71,7 +71,7 @@ BLIND // can't see anything tint = initial(tint) enables_planes = away_planes away_planes = null - user.update_action_buttons() + user.update_action_buttons_icon() user.recalculate_vis() /obj/item/clothing/glasses/attack_self(mob/user) @@ -91,7 +91,7 @@ BLIND // can't see anything desc = "Used for seeing walls, floors, and stuff through anything." icon_state = "meson" item_state_slots = list(slot_r_hand_str = "meson", slot_l_hand_str = "meson") - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) toggleable = 1 vision_flags = SEE_TURFS @@ -111,7 +111,7 @@ BLIND // can't see anything icon_state = "aviator_eng" off_state = "aviator" item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses") - action_button_name = "Toggle HUD" + actions_types = list(/datum/action/item_action/toggle_hud) activation_sound = 'sound/effects/pop.ogg' /obj/item/clothing/glasses/meson/aviator/prescription @@ -124,7 +124,7 @@ BLIND // can't see anything desc = "Modified aviator glasses with a toggled health HUD." icon_state = "aviator_med" off_state = "aviator" - action_button_name = "Toggle Mode" + actions_types = list(/datum/action/item_action/toggle_mode) toggleable = 1 activation_sound = 'sound/effects/pop.ogg' @@ -139,7 +139,7 @@ BLIND // can't see anything icon_state = "purple" item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses") toggleable = 1 - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) item_flags = AIRTIGHT /obj/item/clothing/glasses/science/New() @@ -162,7 +162,7 @@ BLIND // can't see anything origin_tech = list(TECH_MAGNET = 2) darkness_view = 7 toggleable = 1 - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) off_state = "denight" flash_protection = FLASH_PROTECTION_REDUCED enables_planes = list(VIS_FULLBRIGHT) @@ -238,7 +238,7 @@ BLIND // can't see anything item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses") origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 3) toggleable = 1 - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) vision_flags = SEE_OBJS enables_planes = list(VIS_FULLBRIGHT) @@ -258,7 +258,7 @@ BLIND // can't see anything origin_tech = list(TECH_MAGNET = 2, TECH_BLUESPACE = 1) darkness_view = 5 toggleable = 1 - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) off_state = "denight" vision_flags = SEE_OBJS | SEE_TURFS flash_protection = FLASH_PROTECTION_REDUCED @@ -375,7 +375,7 @@ BLIND // can't see anything desc = "Protects the eyes from welders, approved by the mad scientist association." icon_state = "welding-g" item_state_slots = list(slot_r_hand_str = "welding-g", slot_l_hand_str = "welding-g") - action_button_name = "Flip Welding Goggles" + actions_types = list(/datum/action/item_action/flip_welding_goggles) matter = list(MAT_STEEL = 1500, MAT_GLASS = 1000) item_flags = AIRTIGHT var/up = 0 @@ -408,7 +408,7 @@ BLIND // can't see anything tint = TINT_NONE to_chat(usr, "You push \the [src] up out of your face.") update_clothing_icon() - usr.update_action_buttons() + usr.update_action_buttons_icon() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" @@ -481,7 +481,7 @@ BLIND // can't see anything desc = "Modified aviator glasses that can be switch between HUD and flash protection modes." icon_state = "aviator_sec" off_state = "aviator" - action_button_name = "Toggle Mode" + actions_types = list(/datum/action/item_action/toggle_mode) var/on = 1 toggleable = 1 activation_sound = 'sound/effects/pop.ogg' @@ -503,7 +503,7 @@ BLIND // can't see anything user << activation_sound user.recalculate_vis() user.update_inv_glasses() - user.update_action_buttons() + user.update_action_buttons_icon() /obj/item/clothing/glasses/sunglasses/sechud/aviator/update_icon() if(on) @@ -529,7 +529,7 @@ BLIND // can't see anything item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses") origin_tech = list(TECH_MAGNET = 3) toggleable = 1 - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) vision_flags = SEE_MOBS enables_planes = list(VIS_FULLBRIGHT, VIS_CLOAKED) flash_protection = FLASH_PROTECTION_REDUCED @@ -562,7 +562,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/thermal/plain toggleable = 0 activation_sound = null - action_button_name = null + actions_types = list() /obj/item/clothing/glasses/thermal/plain/monocle name = "thermonocle" @@ -570,7 +570,7 @@ BLIND // can't see anything icon_state = "thermoncle" item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses") toggleable = 1 - action_button_name = "Toggle Monocle" + actions_types = list(/datum/action/item_action/toggle_monocle) flags = null //doesn't protect eyes because it's a monocle, duh body_parts_covered = 0 @@ -582,7 +582,7 @@ BLIND // can't see anything item_state_slots = list(slot_r_hand_str = "blindfold", slot_l_hand_str = "blindfold") body_parts_covered = 0 toggleable = 1 - action_button_name = "Toggle Eyepatch" + actions_types = list(/datum/action/item_action/toggle_eyepatch) /obj/item/clothing/glasses/thermal/plain/jensen name = "optical thermal implants" @@ -595,7 +595,7 @@ BLIND // can't see anything desc = "Teshari designed lightweight goggles." icon_state = "orange-g" item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses") - action_button_name = "Adjust Orange Goggles" + actions_types = list(/datum/action/item_action/adjust_orange_goggles) var/up = 0 item_flags = AIRTIGHT body_parts_covered = EYES @@ -623,4 +623,4 @@ BLIND // can't see anything icon_state = "[initial(icon_state)]up" to_chat(usr, "You push \the [src] up from in front of your eyes.") update_clothing_icon() - usr.update_action_buttons() + usr.update_action_buttons_icon() diff --git a/code/modules/clothing/glasses/glasses_vr.dm b/code/modules/clothing/glasses/glasses_vr.dm index 20660ff1e0..58d7c4ce3e 100644 --- a/code/modules/clothing/glasses/glasses_vr.dm +++ b/code/modules/clothing/glasses/glasses_vr.dm @@ -68,7 +68,7 @@ icon_override = 'icons/inventory/eyes/mob_vr.dmi' icon_state = "medgravpatch" item_state_slots = list(slot_r_hand_str = "blindfold", slot_l_hand_str = "blindfold") - action_button_name = "Toggle Eyepatch" + actions_types = list(/datum/action/item_action/toggle_eyepatch) off_state = "eyepatch" enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH,VIS_FULLBRIGHT,VIS_MESONS) @@ -82,8 +82,7 @@ flash_protection = FLASH_PROTECTION_MODERATE item_flags = AIRTIGHT body_parts_covered = EYES - action_button_name = "Change scanning pattern" - action_button_is_hands_free = TRUE + actions_types = list(/datum/action/item_action/hands_free/change_scanning_pattern) var/static/list/tac_sec_vis_anim = list() /obj/item/clothing/glasses/sunglasses/sechud/tactical_sec_vis/Initialize(mapload) @@ -107,7 +106,7 @@ if(src && choice && !user.incapacitated() && in_range(user,src)) icon_state = options[choice] user.update_inv_glasses() - user.update_action_buttons() + user.update_action_buttons_icon() to_chat(user, span_notice("Your [src] now displays [choice] .")) return 1 diff --git a/code/modules/clothing/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm index 54c4c70eb2..2bad04d4bc 100644 --- a/code/modules/clothing/glasses/hud_vr.dm +++ b/code/modules/clothing/glasses/hud_vr.dm @@ -141,7 +141,7 @@ away_planes = null to_chat(usr, span_notice("You enabled the Augmented Reality HUD of your [src.name].")) ar_toggled = !ar_toggled - usr.update_action_buttons() + usr.update_action_buttons_icon() usr.recalculate_vis() @@ -167,7 +167,7 @@ These have been upgraded with medical records access and virus database integration. \ They can also read data from active suit sensors using the crew monitoring system." mode = "med" - action_button_name = "AR Console (Crew Monitor)" + actions_types = list(/datum/action/item_action/ar_console_crew) tgarscreen_path = /datum/tgui_module/crew_monitor/glasses enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_AUGMENTED) @@ -183,7 +183,7 @@ They also have access to security alerts such as camera and motion sensor alarms." mode = "sec" flash_protection = FLASH_PROTECTION_MODERATE //weld protection is a little too widespread - action_button_name = "AR Console (Security Alerts)" + actions_types = list(/datum/action/item_action/ar_console_security_alerts) tgarscreen_path = /datum/tgui_module/alarm_monitor/security/glasses enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED,VIS_AUGMENTED) @@ -199,7 +199,7 @@ and can also display a list of atmospheric, fire, and power alarms." mode = "eng" flash_protection = FLASH_PROTECTION_MAJOR - action_button_name = "AR Console (Station Alerts)" + actions_types = list(/datum/action/item_action/ar_console_station_alerts) tgarscreen_path = /datum/tgui_module/alarm_monitor/engineering/glasses /obj/item/clothing/glasses/omnihud/eng/ar_interact(var/mob/living/carbon/human/user) @@ -249,7 +249,7 @@ item_state = initial(item_state) usr.update_inv_glasses() to_chat(usr, "You activate the retinal projector on the [src].") - usr.update_action_buttons() + usr.update_action_buttons_icon() /obj/item/clothing/glasses/omnihud/all name = "\improper AR-B glasses" @@ -259,7 +259,7 @@ mode = "best" flash_protection = FLASH_PROTECTION_MAJOR enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED,VIS_AUGMENTED) - action_button_name = "AR Console (All Alerts)" + actions_types = list(/datum/action/item_action/ar_console_all_alerts) tgarscreen_path = /datum/tgui_module/alarm_monitor/all/glasses /obj/item/clothing/glasses/omnihud/all/ar_interact(var/mob/living/carbon/human/user) diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index 308672b3b7..02bb0f5313 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -19,7 +19,7 @@ armor = list(melee = 30, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20) flags_inv = 0 siemens_coefficient = 0.9 - action_button_name = "Toggle Head-light" + actions_types = list(/datum/action/item_action/toggle_head_light) w_class = ITEMSIZE_NORMAL ear_protection = 1 drop_sound = 'sound/items/drop/helm.ogg' diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 966ae01cf2..4106d577af 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -66,7 +66,7 @@ armor = list(melee = 80, bullet = 10, laser = 10, energy = 10, bomb = 0, bio = 0, rad = 0) siemens_coefficient = 0.7 valid_accessory_slots = null - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/helmet/riot/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -113,7 +113,7 @@ siemens_coefficient = 0.6 light_range = 6 light_overlay = "helmet_light_dual_green" - action_button_name = "Toggle Head-light" + actions_types = list(/datum/action/item_action/toggle_head_light) min_cold_protection_temperature = T0C - 20 cold_protection = HEAD diff --git a/code/modules/clothing/head/helmet_vr.dm b/code/modules/clothing/head/helmet_vr.dm index 53e9c581af..b02024594c 100644 --- a/code/modules/clothing/head/helmet_vr.dm +++ b/code/modules/clothing/head/helmet_vr.dm @@ -28,7 +28,7 @@ icon = 'icons/inventory/head/item_vr.dmi' icon_override = 'icons/inventory/head/mob_vr.dmi' -// Armor Versions Here +// Armor Versions Here /obj/item/clothing/head/helmet/combat/crusader name = "crusader helmet" desc = "ye olde armored helmet" @@ -47,10 +47,10 @@ armor = list(melee = 80, bullet = 50, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0) tint = TINT_HEAVY siemens_coefficient = 2 - + var/base_state var/up = FALSE - + /obj/item/clothing/head/helmet/combat/bedevere/attack_self() toggle() @@ -83,8 +83,8 @@ if (ismob(src.loc)) //should allow masks to update when it is opened/closed var/mob/M = src.loc M.update_inv_wear_mask() - usr.update_action_buttons() - + usr.update_action_buttons_icon() + // Costume Versions Here /obj/item/clothing/head/helmet/combat/crusader_costume name = "crusader costume helmet" @@ -104,10 +104,10 @@ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) tint = TINT_HEAVY siemens_coefficient = 1 - + var/base_state var/up = FALSE - + /obj/item/clothing/head/helmet/combat/bedevere_costume/attack_self() toggle() @@ -140,4 +140,4 @@ if (ismob(src.loc)) //should allow masks to update when it is opened/closed var/mob/M = src.loc M.update_inv_wear_mask() - usr.update_action_buttons() \ No newline at end of file + usr.update_action_buttons_icon() diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 29e455e393..1b4afb4d09 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -23,7 +23,7 @@ armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) flags_inv = (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) body_parts_covered = HEAD|FACE|EYES - action_button_name = "Flip Welding Mask" + actions_types = list(/datum/action/item_action/flip_welding_mask) siemens_coefficient = 0.9 w_class = ITEMSIZE_NORMAL var/base_state @@ -65,7 +65,7 @@ if (ismob(src.loc)) //should allow masks to update when it is opened/closed var/mob/M = src.loc M.update_inv_wear_mask() - usr.update_action_buttons() + usr.update_action_buttons_icon() /obj/item/clothing/head/welding/demon name = "demonic welding helmet" diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index 590cba4dd1..b035fb5a4f 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -188,7 +188,7 @@ name = "pilot helmet" desc = "Standard pilot gear. Protects the head from impacts. This one has a retractable visor" icon_state = "pilot_helmet2" - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/pilot/alt/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -197,4 +197,4 @@ else src.icon_state = initial(icon_state) to_chat(user, "You lower the visor on the pilot helmet.") - update_clothing_icon() //so our mob-overlays update \ No newline at end of file + update_clothing_icon() //so our mob-overlays update diff --git a/code/modules/clothing/head/pilot_helmet_vr.dm b/code/modules/clothing/head/pilot_helmet_vr.dm index ab4b2335c8..8aa36238a8 100644 --- a/code/modules/clothing/head/pilot_helmet_vr.dm +++ b/code/modules/clothing/head/pilot_helmet_vr.dm @@ -15,7 +15,7 @@ sprite_sheets = list( SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi' ) - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/pilot_vr/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -34,7 +34,7 @@ sprite_sheets = list( SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi' ) - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/pilot_vr/alt/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -55,7 +55,7 @@ sprite_sheets = list( SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi' ) - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/pilot_vr/talon/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -77,7 +77,7 @@ sprite_sheets = list( SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi' ) - action_button_name = "Toggle Visor" + actions_types = list(/datum/action/item_action/toggle_visor) /obj/item/clothing/head/pilot_vr/mbill/attack_self(mob/user as mob) if(src.icon_state == initial(icon_state)) @@ -86,4 +86,4 @@ else src.icon_state = initial(icon_state) to_chat(user, "You lower the visor on the pilot helmet.") - update_clothing_icon() //so our mob-overlays update \ No newline at end of file + update_clothing_icon() //so our mob-overlays update diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index c9e5baaf2c..4c4781b8a8 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -9,7 +9,7 @@ gas_transfer_coefficient = 0.10 permeability_coefficient = 0.50 var/hanging = 0 - action_button_name = "Adjust Breath Mask" + actions_types = list(/datum/action/item_action/adjust_breath_mask) pickup_sound = 'sound/items/pickup/component.ogg' drop_sound = 'sound/items/drop/component.ogg' diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 90acb425cd..59541aebc2 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -90,7 +90,7 @@ species_restricted = list(SPECIES_VOX) filtered_gases = list("oxygen", "nitrous_oxide") var/mask_open = FALSE // Controls if the Vox can eat through this mask - action_button_name = "Toggle Feeding Port" + actions_types = list(/datum/action/item_action/toggle_feeding_port) /obj/item/clothing/mask/gas/swat/vox/proc/feeding_port(mob/user) if(user.canmove && !user.stat) diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm index 3a23830512..b3d265b86c 100644 --- a/code/modules/clothing/masks/hailer.dm +++ b/code/modules/clothing/masks/hailer.dm @@ -4,7 +4,7 @@ description_info = "This mask has a hailer attached, you can activate it on the button or use the Halt! verb, for switching phrases you can alt+click it or change it using the change phrase verb." icon_state = "halfgas" armor = list(melee = 10, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 55, rad = 0) - action_button_name = "HALT!" + actions_types = list(/datum/action/item_action/halt) body_parts_covered = FACE var/obj/item/hailer/hailer var/cooldown = 0 @@ -53,7 +53,7 @@ phrase = 12 -/obj/item/clothing/mask/gas/sechailer/ui_action_click() +/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, actiontype) halt() /obj/item/clothing/mask/gas/sechailer/AltClick(mob/user) diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 22b32e40f9..c821aeeca2 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -320,8 +320,7 @@ w_class = ITEMSIZE_SMALL body_parts_covered = FACE icon_state = "papermask" - action_button_name = "Redraw Design" - action_button_is_hands_free = TRUE + actions_types = list(/datum/action/item_action/hands_free/redraw_design) var/list/papermask_designs = list() /obj/item/clothing/mask/paper/Initialize(mapload) @@ -374,7 +373,7 @@ if(src && choice && !user.incapacitated() && in_range(user,src)) icon_state = options[choice] user.update_inv_wear_mask() - user.update_action_buttons() + user.update_action_buttons_icon() to_chat(user, span_notice("Your paper mask now is now [choice].")) return 1 @@ -384,8 +383,7 @@ w_class = ITEMSIZE_SMALL body_parts_covered = FACE icon_state = "joy" - action_button_name = "Redraw Design" - action_button_is_hands_free = TRUE + actions_types = list(/datum/action/item_action/hands_free/redraw_design) var/static/list/joymask_designs = list() @@ -410,7 +408,7 @@ if(src && choice && !user.incapacitated() && in_range(user,src)) icon_state = options[choice] user.update_inv_wear_mask() - user.update_action_buttons() + user.update_action_buttons_icon() to_chat(user, span_notice("Your [src] now displays a [choice] emotion.")) return 1 diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 2b5f7f4e92..f7729dd89d 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -13,7 +13,7 @@ preserve_item = 1 var/magpulse = 0 var/icon_base = "magboots" - action_button_name = "Toggle Magboots" + actions_types = list(/datum/action/item_action/toggle_magboots) var/obj/item/clothing/shoes/shoes = null //Undershoes var/mob/living/carbon/human/wearer = null //For shoe procs step_volume_mod = 1.3 @@ -42,7 +42,7 @@ playsound(src, 'sound/effects/magnetclamp.ogg', 20) to_chat(user, "You enable the mag-pulse traction system.") user.update_inv_shoes() //so our mob-overlays update - user.update_action_buttons() + user.update_action_buttons_icon() /obj/item/clothing/shoes/magboots/mob_can_equip(mob/user, slot, disable_warning = FALSE) var/mob/living/carbon/human/H = user @@ -93,7 +93,7 @@ species_restricted = list(SPECIES_VOX) armor = list (melee = 40, bullet = 10, laser = 10, energy = 20, bomb = 20, bio = 10, rad = 20) //values of workboots and heavy duty engineering gloves, it's the only option that will ever be taken so may as well give the turkeys some protection //ChompEdit - action_button_name = "Toggle the magclaws" + actions_types = list(/datum/action/item_action/toggle_magclaws) /obj/item/clothing/shoes/magboots/vox/attack_self(mob/user) if(src.magpulse) @@ -114,7 +114,7 @@ magpulse = 1 canremove = FALSE //kinda hard to take off magclaws when you are gripping them tightly. to_chat(user, "You dig your claws deeply into the flooring, bracing yourself.") - user.update_action_buttons() + user.update_action_buttons_icon() //In case they somehow come off while enabled. /obj/item/clothing/shoes/magboots/vox/dropped(mob/user as mob) diff --git a/code/modules/clothing/shoes/miscellaneous_vr.dm b/code/modules/clothing/shoes/miscellaneous_vr.dm index 1485517ff9..9d9bd1dcc2 100644 --- a/code/modules/clothing/shoes/miscellaneous_vr.dm +++ b/code/modules/clothing/shoes/miscellaneous_vr.dm @@ -14,7 +14,7 @@ icon = 'icons/inventory/feet/item_vr.dmi' icon_override = 'icons/inventory/feet/mob_vr.dmi' // resistance_flags = FIRE_PROOF - action_button_name = "Activate Jump Boots" + actions_types = list(/datum/action/item_action/activate_jump_boots) permeability_coefficient = 0.05 var/jumpdistance = 5 //-1 from to see the actual distance, e.g 4 goes over 3 tiles var/jumpspeed = 3 @@ -22,7 +22,7 @@ var/recharging_time = 0 //time until next dash // var/jumping = FALSE //are we mid-jump? We have no throw_at callback, so we have to check user.throwing. -/obj/item/clothing/shoes/bhop/ui_action_click() +/obj/item/clothing/shoes/bhop/ui_action_click(mob/unused_user, actiontype) var/mob/living/user = loc if(!isliving(user)) return diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index e66d2fede1..7be37f9ba8 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -15,7 +15,7 @@ req_one_access = list() req_access = list() w_class = ITEMSIZE_HUGE - action_button_name = "Toggle Heatsink" + actions_types = list(/datum/action/item_action/toggle_heatsink) // These values are passed on to all component pieces. armor = list(melee = 40, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 20) @@ -99,7 +99,7 @@ var/datum/mini_hud/rig/minihud // Action button - action_button_name = "Hardsuit Interface" + actions_types = list(/datum/action/item_action/hardsuit_interface) /obj/item/rig/New() ..() @@ -408,9 +408,6 @@ else update_airtight(piece, 1) // Seal -/obj/item/rig/ui_action_click() - toggle_cooling(usr) - /obj/item/rig/proc/toggle_cooling(var/mob/user) if(cooling_on) turn_cooling_off(user) diff --git a/code/modules/clothing/spacesuits/rig/rig_verbs.dm b/code/modules/clothing/spacesuits/rig/rig_verbs.dm index f58ce78060..9eb0724b0e 100644 --- a/code/modules/clothing/spacesuits/rig/rig_verbs.dm +++ b/code/modules/clothing/spacesuits/rig/rig_verbs.dm @@ -10,9 +10,9 @@ tgui_interact(usr) // So the UI button clicks come here -/obj/item/rig/ui_action_click() - if(usr == wearer && (wearer.back == src || wearer.belt == src)) - tgui_interact(usr) +/obj/item/rig/ui_action_click(mob/user, actiontype) + if(user == wearer && (wearer.back == src || wearer.belt == src)) + tgui_interact(user) /obj/item/rig/verb/toggle_vision() diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index 28f29067ed..455d613c53 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -28,7 +28,7 @@ var/obj/machinery/camera/camera var/list/camera_networks - action_button_name = "Toggle Helmet Light" + actions_types = list(/datum/action/item_action/toggle_helmet_light) light_overlay = "helmet_light" light_range = 4 diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 537dc8173c..5a059b5346 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -32,7 +32,7 @@ max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE min_pressure_protection = 0 * ONE_ATMOSPHERE max_pressure_protection = 10 * ONE_ATMOSPHERE - action_button_name = "Toggle Helmet" + actions_types = list(/datum/action/item_action/toggle_helmet) species_restricted = list("Human", SPECIES_SKRELL, "Promethean") sprite_sheets = VR_SPECIES_SPRITE_SHEETS_SUIT_MOB sprite_sheets_obj = VR_SPECIES_SPRITE_SHEETS_SUIT_ITEM diff --git a/code/modules/clothing/suits/aliens/teshari.dm b/code/modules/clothing/suits/aliens/teshari.dm index 56c9db472d..c247265fa7 100644 --- a/code/modules/clothing/suits/aliens/teshari.dm +++ b/code/modules/clothing/suits/aliens/teshari.dm @@ -266,7 +266,7 @@ item_state_slots = list(slot_r_hand_str = "tesh_hcloak_bo", slot_l_hand_str = "tesh_hcloak_bo") body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS flags_inv = HIDEHOLSTER|HIDETIE - action_button_name = "Toggle Cloak Hood" + actions_types = list(/datum/action/item_action/toggle_hood) hoodtype = /obj/item/clothing/head/tesh_hood allowed = list (/obj/item/pen, /obj/item/paper, /obj/item/flashlight,/obj/item/tank/emergency/oxygen, /obj/item/storage/fancy/cigarettes, /obj/item/storage/box/matches, /obj/item/reagent_containers/food/drinks/flask) diff --git a/code/modules/clothing/suits/aliens/teshari_ch.dm b/code/modules/clothing/suits/aliens/teshari_ch.dm index 74db71f5f3..5c565e2598 100644 --- a/code/modules/clothing/suits/aliens/teshari_ch.dm +++ b/code/modules/clothing/suits/aliens/teshari_ch.dm @@ -24,7 +24,7 @@ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS flags_inv = HIDEHOLSTER|HIDETIE //hooded = 1 Variable no longer exists, hood is now handled by code/modules/clothing/suit/storage/hooded.dm - action_button_name = "Toggle Cloak Hood" + actions_types = list(/datum/action/item_action/toggle_hood) hoodtype = /obj/item/clothing/head/tesh_hood allowed = list (/obj/item/pen, /obj/item/paper, /obj/item/flashlight,/obj/item/tank/emergency/oxygen, /obj/item/storage/fancy/cigarettes, /obj/item/storage/box/matches, /obj/item/reagent_containers/food/drinks/flask) diff --git a/code/modules/clothing/suits/aliens/teshari_yw.dm b/code/modules/clothing/suits/aliens/teshari_yw.dm index 659897a229..6246eb8796 100644 --- a/code/modules/clothing/suits/aliens/teshari_yw.dm +++ b/code/modules/clothing/suits/aliens/teshari_yw.dm @@ -25,7 +25,7 @@ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS flags_inv = HIDEHOLSTER|HIDETIE //hooded = 1 Variable no longer exists, hood is now handled by code/modules/clothing/suit/storage/hooded.dm - action_button_name = "Toggle Cloak Hood" + actions_types = list(/datum/action/item_action/toggle_hood) hoodtype = /obj/item/clothing/head/tesh_hood allowed = list (/obj/item/pen, /obj/item/paper, /obj/item/flashlight,/obj/item/tank/emergency/oxygen, /obj/item/storage/fancy/cigarettes, /obj/item/storage/box/matches, /obj/item/reagent_containers/food/drinks/flask) diff --git a/code/modules/clothing/suits/hooded.dm b/code/modules/clothing/suits/hooded.dm index 984629cee4..aa7d1bf8fb 100644 --- a/code/modules/clothing/suits/hooded.dm +++ b/code/modules/clothing/suits/hooded.dm @@ -7,7 +7,7 @@ var/hoodtype = null //so the chaplain hoodie or other hoodies can override this var/hood_up = FALSE var/toggleicon - action_button_name = "Toggle Hood" + actions_types = list(/datum/action/item_action/toggle_hood) /obj/item/clothing/suit/storage/hooded/New() toggleicon = "[initial(icon_state)]" @@ -23,7 +23,7 @@ var/obj/item/clothing/head/hood/H = new hoodtype(src) hood = H -/obj/item/clothing/suit/storage/hooded/ui_action_click() +/obj/item/clothing/suit/storage/hooded/ui_action_click(mob/user, actiontype) ToggleHood() /obj/item/clothing/suit/storage/hooded/equipped(mob/user, slot) @@ -74,7 +74,7 @@ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS flags_inv = HIDEJUMPSUIT|HIDETIE|HIDEHOLSTER cold_protection = UPPER_TORSO|LOWER_TORSO|ARMS - action_button_name = "Toggle Hood" + actions_types = list(/datum/action/item_action/toggle_hood) /obj/item/clothing/suit/storage/hooded/costume/siffet name = "siffet costume" diff --git a/code/modules/clothing/suits/hooded_vr.dm b/code/modules/clothing/suits/hooded_vr.dm index aaf729045a..57cc631404 100644 --- a/code/modules/clothing/suits/hooded_vr.dm +++ b/code/modules/clothing/suits/hooded_vr.dm @@ -22,7 +22,7 @@ hoodtype = /obj/item/clothing/head/hood/galahad armor = list(melee = 80, bullet = 50, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0) siemens_coefficient = 2 - action_button_name = "Toggle Knight Headgear" + actions_types = list(/datum/action/item_action/toggle_knight_headgear) /obj/item/clothing/suit/storage/hooded/knight/galahad name = "crusader's armor" @@ -53,7 +53,7 @@ icon = 'icons/obj/clothing/knights_vr.dmi' icon_override = 'icons/obj/clothing/knights_vr.dmi' hoodtype = /obj/item/clothing/head/hood/galahad_costume - action_button_name = "Toggle Knight Headgear" + actions_types = list(/datum/action/item_action/toggle_knight_headgear) /obj/item/clothing/suit/storage/hooded/knight_costume/galahad icon_state = "galahad" @@ -84,7 +84,7 @@ body_parts_covered = UPPER_TORSO|LOWER_TORSO flags_inv = HIDETIE|HIDEHOLSTER cold_protection = UPPER_TORSO|LOWER_TORSO - action_button_name = "Toggle Hood" + actions_types = list(/datum/action/item_action/toggle_hood) /obj/item/clothing/suit/storage/hooded/foodcostume/hotdog //Belly filler uniform :^). name = "hotdog costume" diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index e0a185ee0f..f7e7dcd876 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -577,7 +577,7 @@ item_flags = FLEXIBLEMATERIAL var/breath_masked = FALSE var/obj/item/clothing/mask/breath/breathmask - action_button_name = "Pull On Gaiter" + actions_types = list(/datum/action/item_action/pull_on_gaiter) /obj/item/clothing/accessory/gaiter/update_clothing_icon() . = ..() diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index f61a25ead4..86428047e9 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -733,7 +733,7 @@ desc = "The latest fashion innovations by the Nanotrasen Uniform & Fashion Department have provided the brilliant invention of slicing a regular cloak in half! All the ponce, half the cost!" icon_state = "roughcloak" item_state = "roughcloak" - action_button_name = "Adjust Cloak" + actions_types = list(/datum/action/item_action/adjust_cloak) /obj/item/clothing/accessory/poncho/roles/cloak/half/update_clothing_icon() . = ..() @@ -1004,7 +1004,7 @@ desc = "Aim for the Heart, Ramon." icon_state = "neo_ranger" item_state = "neo_ranger" - action_button_name = "Adjust Poncho" + actions_types = list(/datum/action/item_action/adjust_poncho) /obj/item/clothing/accessory/poncho/roles/neo_ranger/update_clothing_icon() . = ..() diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index 6e487d6d96..28afb25655 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -5,7 +5,7 @@ slot_flags = SLOT_BELT w_class = ITEMSIZE_SMALL item_state = "electronic" - action_button_name = "Toggle UV light" + actions_types = list(/datum/action/item_action/toggle_uv_light) matter = list(MAT_STEEL = 150) origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm index d3ebf9ba4d..087171bbd8 100644 --- a/code/modules/integrated_electronics/core/assemblies/clothing.dm +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -76,7 +76,8 @@ // Clothing assemblies can be triggered by clicking on the HUD. This allows that to occur. action_circuit = new(src.IC) IC.force_add_circuit(action_circuit) - action_button_name = "Activate [name]" + + new /datum/action/item_action/activate(src, name) /obj/item/clothing/Destroy() if(IC) @@ -177,4 +178,4 @@ /obj/item/clothing/suit/circuitry/Initialize() setup_integrated_circuit(/obj/item/electronic_assembly/clothing/large) - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/mining/kinetic_crusher.dm b/code/modules/mining/kinetic_crusher.dm index 5028c6fbe8..06ab146ec6 100644 --- a/code/modules/mining/kinetic_crusher.dm +++ b/code/modules/mining/kinetic_crusher.dm @@ -27,8 +27,7 @@ sharp = TRUE edge = TRUE // sharpness = SHARP_EDGED - action_button_name = "Toggle Light" - // actions_types = list(/datum/action/item_action/toggle_light) + actions_types = list(/datum/action/item_action/toggle_light) // var/list/trophies = list() var/charged = TRUE var/charge_time = 15 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index f5bd6b5a80..f42f4eea9b 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -208,12 +208,6 @@ var/list/slot_equipment_priority = list( \ /mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE, idrop = TRUE) return u_equip(I, force, null, TRUE, idrop) -///sometimes we only want to grant the item's action if it's equipped in a specific slot. -/obj/item/proc/item_action_slot_check(slot, mob/user) - if(slot == SLOT_BACK || slot == LEGS) //these aren't true slots, so avoid granting actions there - return FALSE - return TRUE - ///Get the item on the mob in the storage slot identified by the id passed in /mob/proc/get_item_by_slot(slot_id) return null diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index dc71898c62..823d69f9aa 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -465,7 +465,7 @@ throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = handcuffed) else clear_alert("handcuffed") - update_action_buttons() //some of our action buttons might be unusable when we're handcuffed. + update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed. update_inv_handcuffed() // Clears blood overlays diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 92239e537b..25ae7e3f50 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -222,7 +222,6 @@ This saves us from having to call add_fingerprint() any time something is put in else return 0 - update_action_buttons() return 1 @@ -369,9 +368,6 @@ This saves us from having to call add_fingerprint() any time something is put in W.hud_layerise() - if(W.action_button_name) - update_action_buttons() - if(W.zoom) W.zoom() diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 9cfa3582b2..d6a81795eb 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -1,5 +1,6 @@ /mob/living/death(gibbed) clear_fullscreens() + update_action_buttons_icon() if(ai_holder) ai_holder.go_sleep() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index f008f5beba..c968c0a8a0 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -75,8 +75,6 @@ handle_disabilities() // eye, ear, brain damages handle_statuses() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc - handle_actions() - update_canmove() handle_regular_hud_updates() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 9f365a02bb..802dd3f42b 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -529,22 +529,6 @@ /mob/living/proc/reagent_permeability() return 1 -/mob/living/proc/handle_actions() - //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent - for(var/datum/action/A in actions) - if(A.CheckRemoval(src)) - A.Remove(src) - for(var/obj/item/I in src) - if(I.action_button_name) - if(!I.action) - if(I.action_button_is_hands_free) - I.action = new/datum/action/item_action/hands_free - else - I.action = new/datum/action/item_action - I.action.name = I.action_button_name - I.action.target = I - I.action.Grant(src) - return // Returns a number to determine if something is harder or easier to hit than normal. /mob/living/proc/get_evasion() diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index fb84b78204..45e5c935f8 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -21,6 +21,9 @@ /mob/living/silicon/robot/proc/uneq_active() if(isnull(module_active)) return + var/obj/item/I = module_active + for(var/datum/action/A as anything in I.actions) + A.Remove(src) if(module_state_1 == module_active) if(istype(module_state_1,/obj/item/borg/sight)) sight_mode &= ~module_state_1:sight_mode @@ -64,6 +67,9 @@ if (client) client.screen -= module_state_1 contents -= module_state_1 + var/obj/item/I = module_state_1 + for(var/datum/action/A as anything in I.actions) + A.Remove(src) module_state_1:loc = module module_state_1 = null inv1.icon_state = "inv1" @@ -72,6 +78,9 @@ sight_mode &= ~module_state_2:sight_mode if (client) client.screen -= module_state_2 + var/obj/item/I = module_state_2 + for(var/datum/action/A as anything in I.actions) + A.Remove(src) contents -= module_state_2 module_state_2:loc = module module_state_2 = null @@ -81,6 +90,9 @@ sight_mode &= ~module_state_3:sight_mode if (client) client.screen -= module_state_3 + var/obj/item/I = module_state_3 + for(var/datum/action/A as anything in I.actions) + A.Remove(src) contents -= module_state_3 module_state_3:loc = module module_state_3 = null @@ -278,6 +290,9 @@ pounce.desc = initial(pounce.desc) pounce.bluespace = initial(pounce.bluespace) */ //ChompEDIT END + if(O) + for(var/datum/action/A as anything in O.actions) + A.Grant(src) /mob/living/silicon/robot/put_in_hands(var/obj/item/W) // No hands. W.forceMove(get_turf(src)) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 9798b72a7b..b74cd4a207 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -10,7 +10,6 @@ //Status updates, death etc. clamp_values() handle_regular_status_updates() - handle_actions() handle_instability() // For some reason borg Life() doesn't call ..() handle_modifiers() diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 8a877f0118..0901f23265 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -329,7 +329,7 @@ origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 5, TECH_POWER = 4) projectile_type = /obj/item/projectile/beam/sniper slot_flags = SLOT_BACK - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) //Begin CHOMPstation Edit for making this thing not trash //battery_lock = 0 charge_cost = 360 @@ -341,7 +341,7 @@ one_handed_penalty = 60 // The weapon itself is heavy, and the long barrel makes it hard to hold steady with just one hand. //End CHOMP Edit. -/obj/item/gun/energy/sniperrifle/ui_action_click() +/obj/item/gun/energy/sniperrifle/ui_action_click(mob/user, actiontype) scope() /obj/item/gun/energy/sniperrifle/verb/scope() @@ -439,7 +439,7 @@ origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 4, TECH_POWER = 3) projectile_type = /obj/item/projectile/beam/sniper slot_flags = SLOT_BACK - action_button_name = "Aim Down Sights" + actions_types = list(/datum/action/item_action/aim_down_sights) charge_cost = 2400 fire_delay = 20 force = 8 @@ -449,7 +449,7 @@ charge_meter = FALSE var/scope_multiplier = 1.5 -/obj/item/gun/energy/monorifle/ui_action_click() +/obj/item/gun/energy/monorifle/ui_action_click(mob/user, actiontype) sights() /obj/item/gun/energy/monorifle/verb/sights() diff --git a/code/modules/projectiles/guns/energy/protector_vr.dm b/code/modules/projectiles/guns/energy/protector_vr.dm index d06e2cbec4..a2ef013b07 100644 --- a/code/modules/projectiles/guns/energy/protector_vr.dm +++ b/code/modules/projectiles/guns/energy/protector_vr.dm @@ -29,7 +29,7 @@ light_state = "prot_light" flight_x_offset = 0 flight_y_offset = 0 - action_button_name = "Toggle gun-light" + actions_types = list(/datum/action/item_action/toggle_gunlight) var/gun_light_icon = TRUE var/gun_light_on = FALSE var/brightness_on = 5 diff --git a/code/modules/projectiles/guns/energy/pump.dm b/code/modules/projectiles/guns/energy/pump.dm index c2e3e0d124..f413b6f386 100644 --- a/code/modules/projectiles/guns/energy/pump.dm +++ b/code/modules/projectiles/guns/energy/pump.dm @@ -177,7 +177,7 @@ item_state = "lsniper" item_state_slots = list(slot_r_hand_str = "lsniper", slot_l_hand_str = "lsniper") wielded_item_state = "lsniper-wielded" - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) w_class = ITEMSIZE_LARGE item_icons = list(slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi') accuracy = -15 //better than most snipers but still has penalty @@ -192,7 +192,7 @@ list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/beam/phaser, modifystate="riflestun", charge_cost = 200), ) -/obj/item/gun/energy/locked/frontier/rifle/ui_action_click() +/obj/item/gun/energy/locked/frontier/rifle/ui_action_click(mob/user, actiontype) scope() /obj/item/gun/energy/locked/frontier/rifle/verb/scope() diff --git a/code/modules/projectiles/guns/energy/pump_ch.dm b/code/modules/projectiles/guns/energy/pump_ch.dm index 30b728d95e..de07fd77c2 100644 --- a/code/modules/projectiles/guns/energy/pump_ch.dm +++ b/code/modules/projectiles/guns/energy/pump_ch.dm @@ -249,7 +249,7 @@ item_state = "sniper" item_state_slots = list(slot_r_hand_str = "lsniper", slot_l_hand_str = "lsniper") wielded_item_state = "lsniper-wielded" - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) w_class = ITEMSIZE_LARGE item_icons = list(slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi') accuracy = -15 //better than most snipers but still has penalty diff --git a/code/modules/projectiles/guns/magnetic/bore.dm b/code/modules/projectiles/guns/magnetic/bore.dm index 5d655cf4ee..7a451b5aad 100644 --- a/code/modules/projectiles/guns/magnetic/bore.dm +++ b/code/modules/projectiles/guns/magnetic/bore.dm @@ -173,7 +173,7 @@ power_cost = 100 ammo_material = MAT_PHORON - action_button_name = "Toggle internal generator" + actions_types = list(/datum/action/item_action/toggle_internal_generator) var/generator_state = GEN_OFF var/datum/looping_sound/small_motor/soundloop @@ -204,8 +204,8 @@ QDEL_NULL(soundloop) . = ..() -/obj/item/gun/magnetic/matfed/phoronbore/ui_action_click() - toggle_generator(usr) +/obj/item/gun/magnetic/matfed/phoronbore/ui_action_click(mob/user, actiontype) + toggle_generator(user) /obj/item/gun/magnetic/matfed/phoronbore/process() if(generator_state && !mat_storage) diff --git a/code/modules/projectiles/guns/projectile/boltaction.dm b/code/modules/projectiles/guns/projectile/boltaction.dm index 2979aae35a..bcd74a99ef 100644 --- a/code/modules/projectiles/guns/projectile/boltaction.dm +++ b/code/modules/projectiles/guns/projectile/boltaction.dm @@ -141,7 +141,7 @@ action_sound = 'sound/weapons/riflebolt.ogg' pump_animation = "scoped-boltaction-cycling" -/obj/item/gun/projectile/shotgun/pump/rifle/ui_action_click() +/obj/item/gun/projectile/shotgun/pump/rifle/ui_action_click(mob/user, actiontype) scope() /obj/item/gun/projectile/shotgun/pump/rifle/verb/scope() diff --git a/code/modules/projectiles/guns/projectile/shotgun_vr.dm b/code/modules/projectiles/guns/projectile/shotgun_vr.dm index ebc499054f..8ee2e7d049 100644 --- a/code/modules/projectiles/guns/projectile/shotgun_vr.dm +++ b/code/modules/projectiles/guns/projectile/shotgun_vr.dm @@ -37,7 +37,7 @@ projectile_type = /obj/item/projectile/bullet/shotgun one_handed_penalty = 30 //You madman, one-handing a 12g shotgun. recoil = 5 //Unfold the damn stock you fool! - action_button_name = "Toggle stock" + actions_types = list(/datum/action/item_action/toggle_stock) var/stock = FALSE @@ -69,7 +69,7 @@ H.update_inv_r_hand() playsound(src, 'sound/weapons/targeton.ogg', 50, 1) - user.update_action_buttons() + user.update_action_buttons_icon() /obj/item/gun/projectile/shotgun/compact/verb/verb_toggle_stock(mob/user as mob) set category = "Object" @@ -94,7 +94,7 @@ else to_chat(usr, span_notice("You cannot do this in your current state.")) -/obj/item/gun/projectile/shotgun/compact/ui_action_click() +/obj/item/gun/projectile/shotgun/compact/ui_action_click(mob/unused_user, actiontype) var/mob/living/user = loc if(!isliving(user)) return diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index 582155b9ce..6869b4b410 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -9,7 +9,7 @@ w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. force = 10 slot_flags = SLOT_BACK - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 2, TECH_ILLEGAL = 8) caliber = "14.5mm" recoil = 5 //extra kickback @@ -63,7 +63,7 @@ return ..() -/obj/item/gun/projectile/heavysniper/ui_action_click() +/obj/item/gun/projectile/heavysniper/ui_action_click(mob/user, actiontype) scope() /obj/item/gun/projectile/heavysniper/verb/scope() @@ -84,7 +84,7 @@ w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. force = 10 slot_flags = SLOT_BACK // Needs a sprite. - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 2, TECH_ILLEGAL = 8) caliber = "7.62mm" load_method = MAGAZINE @@ -102,7 +102,7 @@ else icon_state = "SVD-empty" -/obj/item/gun/projectile/SVD/ui_action_click() +/obj/item/gun/projectile/SVD/ui_action_click(mob/user, actiontype) scope() /obj/item/gun/projectile/SVD/verb/scope() diff --git a/code/modules/projectiles/guns/projectile/zz_ballistics_ch.dm b/code/modules/projectiles/guns/projectile/zz_ballistics_ch.dm index 0ee90aabb6..5579760b87 100644 --- a/code/modules/projectiles/guns/projectile/zz_ballistics_ch.dm +++ b/code/modules/projectiles/guns/projectile/zz_ballistics_ch.dm @@ -272,7 +272,7 @@ auto_loading_type = CLOSED_BOLT muzzle_velocity = 810 w_class = ITEMSIZE_HUGE - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = -30 scoped_accuracy = 50 one_handed_penalty = 70 @@ -529,7 +529,7 @@ name = "Scoped Mosin Nagant" icon_state = "scopedmosin" desc = "A reproduction of some old russian bolt-action rifle from some backwater rimworld. Smells strongly of cosmoline. The inscriptions on it are in pan-slavic. This one has a scope attached to it. Chambered in 7.62x54mmR." - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = -15 scoped_accuracy = 50 one_handed_penalty = 70 @@ -594,7 +594,7 @@ projectile_type = /obj/item/projectile/bullet/rifle/a338 load_method = MAGAZINE muzzle_velocity = 936 - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = -30 scoped_accuracy = 50 w_class = ITEMSIZE_HUGE @@ -631,7 +631,7 @@ projectile_type = /obj/item/projectile/bullet/rifle/a145 //the old round type was ass load_method = MAGAZINE muzzle_velocity = 825 - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = -60 scoped_accuracy = 15 w_class = ITEMSIZE_HUGE diff --git a/code/modules/vore/fluffstuff/custom_clothes_vr.dm b/code/modules/vore/fluffstuff/custom_clothes_vr.dm index b2eb6bd68d..5c90cefa94 100644 --- a/code/modules/vore/fluffstuff/custom_clothes_vr.dm +++ b/code/modules/vore/fluffstuff/custom_clothes_vr.dm @@ -68,7 +68,7 @@ icon_override = 'icons/vore/custom_clothes_vr.dmi' item_state = "coatroiz_mob" -/obj/item/clothing/suit/storage/hooded/wintercoat/roiz/ui_action_click() +/obj/item/clothing/suit/storage/hooded/wintercoat/roiz/ui_action_click(mob/user, actiontype) ToggleHood_roiz() /obj/item/clothing/suit/storage/hooded/wintercoat/roiz/equipped(mob/user, slot) @@ -783,7 +783,7 @@ light_overlay = null light_system = MOVABLE_LIGHT - action_button_name = "Toggle pom-pom" + actions_types = list(/datum/action/item_action/toggle_pom_pom) /obj/item/clothing/head/fluff/pompom/digest_act(var/atom/movable/item_storage = null) return FALSE @@ -1131,7 +1131,7 @@ No. With a teleporter? Just *no*. - Hawk, YW if (ismob(loc)) //should allow masks to update when it is opened/closed var/mob/M = loc M.update_inv_wear_mask() - usr.update_action_buttons() + usr.update_action_buttons_icon() //Vorrarkul: Theodora Lindt /obj/item/clothing/suit/chococoat @@ -1543,7 +1543,7 @@ Departamental Swimsuits, for general use icon_override = 'icons/vore/custom_clothes_vr.dmi' item_state = "kilanocoat_mob" -/obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/ui_action_click() +/obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/ui_action_click(mob/user, actiontype) ToggleHood_kilano() /obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/equipped(mob/user, slot) @@ -2354,7 +2354,7 @@ Departamental Swimsuits, for general use icon_override = 'icons/vore/custom_onmob_vr.dmi' item_state = "mechahood_mob" -/obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/ui_action_click() +/obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/ui_action_click(mob/user, actiontype) ToggleHood_mechacoat() /obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/equipped(mob/user, slot) @@ -2412,7 +2412,7 @@ Departamental Swimsuits, for general use icon_override = 'icons/vore/custom_onmob_vr.dmi' item_state = "evelynhood_mob" -/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ui_action_click() +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ui_action_click(mob/user, actiontype) ToggleHood_evelyn() /obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/equipped(mob/user, slot) @@ -2601,7 +2601,7 @@ Departamental Swimsuits, for general use if (ismob(loc)) //should allow masks to update when it is opened/closed var/mob/M = loc M.update_inv_wear_mask() - usr.update_action_buttons() + usr.update_action_buttons_icon() /obj/item/clothing/suit/storage/toggle/labcoat/fluff/zeracloak name = "Grand Purple Cloak" diff --git a/code/modules/vore/fluffstuff/custom_clothes_yw.dm b/code/modules/vore/fluffstuff/custom_clothes_yw.dm index ad0bae9d6f..2060f4e311 100644 --- a/code/modules/vore/fluffstuff/custom_clothes_yw.dm +++ b/code/modules/vore/fluffstuff/custom_clothes_yw.dm @@ -907,7 +907,7 @@ var/hoodtype = null //so the chaplain hoodie or other hoodies can override this var/suittoggled = 0 var/hooded = 0 - action_button_name = "Toggle Hood" + actions_types = list(/datum/action/item_action/toggle_hood) icon = 'icons/vore/custom_clothes_yw.dmi' icon_override = 'icons/vore/custom_onmob_yw.dmi' @@ -1659,7 +1659,7 @@ icon_state = "avigoggles_i" item_state = "avigoggles" icon_override = 'icons/vore/custom_clothes_yw.dmi' - action_button_name = "Flip Aviation Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) item_flags = AIRTIGHT var/up = 0 @@ -1703,7 +1703,7 @@ item_state = "kbraid_outfit_s" body_parts_covered = UPPER_TORSO|ARMS|FEET hoodtype = /obj/item/clothing/head/hood/kbraid_hood - action_button_name = "Toggle Headphones" + actions_types = list(/datum/action/item_action/toggle_hood) /obj/item/clothing/head/hood/kbraid_hood name = "Earphones" diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index d67f4ec4d1..24f2def7d8 100644 --- a/code/modules/vore/fluffstuff/custom_items_vr.dm +++ b/code/modules/vore/fluffstuff/custom_items_vr.dm @@ -686,7 +686,7 @@ slowdown = 0 taurtype = /datum/sprite_accessory/tail/taur/feline/tempest no_message = "These saddlebags seem to be fitted for someone else, and keep slipping off!" - action_button_name = "Toggle Mlembulance Mode" + actions_types = list(/datum/action/item_action/toggle_mlembulance) var/ambulance = FALSE var/datum/looping_sound/ambulance/soundloop var/ambulance_state = FALSE @@ -700,7 +700,7 @@ QDEL_NULL(soundloop) return ..() -/obj/item/storage/backpack/saddlebag/tempest/ui_action_click() +/obj/item/storage/backpack/saddlebag/tempest/ui_action_click(mob/user, actiontype) ambulance = !(ambulance) if(ambulance) START_PROCESSING(SSobj, src) diff --git a/maps/southern_cross/submaps/gateway/snowfield.dm b/maps/southern_cross/submaps/gateway/snowfield.dm index 709f63aa22..b7ea707d65 100644 --- a/maps/southern_cross/submaps/gateway/snowfield.dm +++ b/maps/southern_cross/submaps/gateway/snowfield.dm @@ -457,7 +457,7 @@ load_method = MAGAZINE muzzle_velocity = 880 w_class = ITEMSIZE_HUGE - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = 10 scoped_accuracy = 20 one_handed_penalty = 65 @@ -480,7 +480,7 @@ icon_state = "rocket" item_state = "rocket" w_class = ITEMSIZE_HUGE //CHOMP Edit. - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) scoped_accuracy = 20 one_handed_penalty = 150 //Good luck shooting one handed. throw_speed = 2 diff --git a/maps/southern_cross/submaps/gateway/snowfield_ch.dm b/maps/southern_cross/submaps/gateway/snowfield_ch.dm index beeb66a83d..25669602ce 100644 --- a/maps/southern_cross/submaps/gateway/snowfield_ch.dm +++ b/maps/southern_cross/submaps/gateway/snowfield_ch.dm @@ -457,7 +457,7 @@ load_method = MAGAZINE muzzle_velocity = 880 w_class = ITEMSIZE_HUGE - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = 10 scoped_accuracy = 20 one_handed_penalty = 65 @@ -480,7 +480,7 @@ icon_state = "rocket" item_state = "rocket" w_class = ITEMSIZE_HUGE //CHOMP Edit. - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) scoped_accuracy = 20 one_handed_penalty = 150 //Good luck shooting one handed. throw_speed = 2 diff --git a/maps/southern_sun/submaps/gateway/snowfield.dm b/maps/southern_sun/submaps/gateway/snowfield.dm index 709f63aa22..b7ea707d65 100644 --- a/maps/southern_sun/submaps/gateway/snowfield.dm +++ b/maps/southern_sun/submaps/gateway/snowfield.dm @@ -457,7 +457,7 @@ load_method = MAGAZINE muzzle_velocity = 880 w_class = ITEMSIZE_HUGE - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = 10 scoped_accuracy = 20 one_handed_penalty = 65 @@ -480,7 +480,7 @@ icon_state = "rocket" item_state = "rocket" w_class = ITEMSIZE_HUGE //CHOMP Edit. - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) scoped_accuracy = 20 one_handed_penalty = 150 //Good luck shooting one handed. throw_speed = 2 diff --git a/maps/southern_sun/submaps/gateway/snowfield_ch.dm b/maps/southern_sun/submaps/gateway/snowfield_ch.dm index beeb66a83d..25669602ce 100644 --- a/maps/southern_sun/submaps/gateway/snowfield_ch.dm +++ b/maps/southern_sun/submaps/gateway/snowfield_ch.dm @@ -457,7 +457,7 @@ load_method = MAGAZINE muzzle_velocity = 880 w_class = ITEMSIZE_HUGE - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) accuracy = 10 scoped_accuracy = 20 one_handed_penalty = 65 @@ -480,7 +480,7 @@ icon_state = "rocket" item_state = "rocket" w_class = ITEMSIZE_HUGE //CHOMP Edit. - action_button_name = "Use Scope" + actions_types = list(/datum/action/item_action/use_scope) scoped_accuracy = 20 one_handed_penalty = 150 //Good luck shooting one handed. throw_speed = 2 diff --git a/modular_chomp/code/modules/clothing/glasses/glasses.dm b/modular_chomp/code/modules/clothing/glasses/glasses.dm index 22bb4de6fc..e683646325 100644 --- a/modular_chomp/code/modules/clothing/glasses/glasses.dm +++ b/modular_chomp/code/modules/clothing/glasses/glasses.dm @@ -16,7 +16,7 @@ icon_override = 'modular_chomp/icons/inventory/eyes/mob.dmi' icon_state = "darksight" - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) toggleable = 1 see_invisible = INVISIBILITY_SHADEKIN @@ -27,7 +27,7 @@ desc = "Used for seeing walls, floors, and stuff through anything." icon_state = "meson" item_state_slots = list(slot_r_hand_str = "meson", slot_l_hand_str = "meson") - action_button_name = "Toggle Goggles" + actions_types = list(/datum/action/item_action/toggle_goggles) origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) toggleable = 1 vision_flags = SEE_TURFS diff --git a/modular_chomp/code/modules/clothing/masks/hailer.dm b/modular_chomp/code/modules/clothing/masks/hailer.dm index bb1042d0a6..d66a4caa31 100644 --- a/modular_chomp/code/modules/clothing/masks/hailer.dm +++ b/modular_chomp/code/modules/clothing/masks/hailer.dm @@ -4,7 +4,7 @@ description_info = "This mask has a hailer attached, you can activate it on the button or use the Halt! verb, for switching phrases you can alt+click it or change it using the change phrase verb." icon_state = "halfgas" armor = list(melee = 10, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 55, rad = 0) - action_button_name = "HALT!" + actions_types = list(/datum/action/item_action/halt) body_parts_covered = FACE var/obj/item/hailer/hailer var/cooldown = 0 diff --git a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph_abilities.dm b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph_abilities.dm index 1a4c074193..40d6ff3155 100644 --- a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph_abilities.dm +++ b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph_abilities.dm @@ -51,7 +51,7 @@ /datum/action/innate/xeno_ch - check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_ALIVE + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS button_icon = 'modular_chomp/icons/mob/xeno_screen.dmi' var/mob/living/simple_mob/xeno_ch/parent_xeno diff --git a/vorestation.dme b/vorestation.dme index 9c87b65fd2..218b8c7024 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -291,6 +291,7 @@ #include "code\_onclick\hud\spell_screen_objects.dm" #include "code\_onclick\hud\action\action.dm" #include "code\_onclick\hud\action\action_screen_objects.dm" +#include "code\_onclick\hud\action\types\item.dm" #include "code\ATMOSPHERICS\_atmos_setup.dm" #include "code\ATMOSPHERICS\_atmospherics_helpers.dm" #include "code\ATMOSPHERICS\atmospherics.dm"