diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 28ccea08cd..5f0e321763 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -256,7 +256,7 @@ Thus, the two variables affect pump operation are set in New(): deconstruct() //CHOMPEdit Start - Adds TGStation keybinds to save our engineers some time. -/obj/machinery/atmospherics/binary/pump/AltClick(mob/user) +/obj/machinery/atmospherics/binary/pump/click_alt(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) to_chat(user, span_notice("You set the [name] to max output")) @@ -265,7 +265,7 @@ Thus, the two variables affect pump operation are set in New(): else to_chat(user, span_warning("Access denied.")) -/obj/machinery/atmospherics/binary/pump/CtrlClick(mob/user) +/obj/machinery/atmospherics/binary/pump/click_ctrl(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) update_use_power(!use_power) @@ -301,4 +301,3 @@ Thus, the two variables affect pump operation are set in New(): icon_state = "off" else icon_state = "[use_power ? "on" : "off"]" - diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 658c18fbcf..f3f7123151 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -303,7 +303,7 @@ return null //CHOMPEdit Start - Keybinds for EVEEERYTHING -/obj/machinery/atmospherics/omni/CtrlClick(mob/user) +/obj/machinery/atmospherics/omni/click_ctrl(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) update_use_power(!use_power) diff --git a/code/ATMOSPHERICS/components/shutoff.dm b/code/ATMOSPHERICS/components/shutoff.dm index 7534b1d32a..2271a5d58a 100644 --- a/code/ATMOSPHERICS/components/shutoff.dm +++ b/code/ATMOSPHERICS/components/shutoff.dm @@ -39,7 +39,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves) return TRUE // Alt+Click now toggles the open/close function, when the autoseal is disabled -/obj/machinery/atmospherics/valve/shutoff/AltClick(var/mob/user) +/obj/machinery/atmospherics/valve/shutoff/click_alt(var/mob/user) if(isliving(user)) if(close_on_leaks) to_chat(user, "You try to manually [open ? "close" : "open"] the valve, but it [open ? "opens" : "closes"] automatically again.") diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 5a1e62e2af..2365938daa 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -248,7 +248,7 @@ return list(node1_connect, node2_connect, node3_connect) //CHOMPEdit Start - Keybinds for EVEEERYTHING -/obj/machinery/atmospherics/trinary/CtrlClick(mob/user) +/obj/machinery/atmospherics/trinary/click_ctrl(mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) update_use_power(!use_power) diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index 9e4b819e7d..59ca73c9b4 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -200,7 +200,7 @@ "You hear a ratchet.") deconstruct() -/obj/machinery/atmospherics/unary/outlet_injector/CtrlClick(mob/user) +/obj/machinery/atmospherics/unary/outlet_injector/click_ctrl(mob/user) if (volume_rate == ATMOS_DEFAULT_VOLUME_PUMP + 500 || use_power == USE_POWER_OFF) return ..() diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 16c88e04aa..ad2f14f94b 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -116,7 +116,7 @@ return FALSE //CHOMPEdit Start - Keybinds for EVEEERYTHING* (* = not everything)) -/obj/machinery/atmospherics/unary/CtrlClick(mob/user) +/obj/machinery/atmospherics/unary/click_ctrl(mob/user) if((power_rating != null) && !(pipe_state in list("scrubber", "uvent", "injector"))) //TODO: Add compatibility with air alarm. When not disabled, overrides air alarm state and doesn't tell the air alarm that. Injectors have their own, different bind for enabling. user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(allowed(user)) diff --git a/code/__defines/_click.dm b/code/__defines/_click.dm index 3bc9c08734..bfa93508d4 100644 --- a/code/__defines/_click.dm +++ b/code/__defines/_click.dm @@ -5,6 +5,8 @@ #define RIGHT_CLICK "right" #define MIDDLE_CLICK "middle" #define LEFT_CLICK "left" +#define BUTTON4 "xbutton1" +#define BUTTON5 "xbutton2" ///Mouse button that was just clicked/released ///if(modifiers[BUTTON] == LEFT_CLICK) diff --git a/code/__defines/click.dm b/code/__defines/click.dm index 88e018dc65..975a3d1ec9 100644 --- a/code/__defines/click.dm +++ b/code/__defines/click.dm @@ -1 +1,9 @@ #define TK_MAXRANGE 15 + +/// Action has succeeded, preventing further alt click interaction +#define CLICK_ACTION_SUCCESS (1<<0) +/// Action failed, preventing further alt click interaction +#define CLICK_ACTION_BLOCKING (1<<1) +/// Either return state +#define CLICK_ACTION_ANY (CLICK_ACTION_SUCCESS | CLICK_ACTION_BLOCKING) +/// Use NONE for continue interaction diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index b3a8c89c44..0fb30a9796 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -225,25 +225,6 @@ #define COMSIG_ENTER_AREA "enter_area" ///from base of area/Exited(): (/area) #define COMSIG_EXIT_AREA "exit_area" -///from base of client/Click(): (atom/target, atom/location, control, params, mob/user) -#define COMSIG_CLIENT_CLICK "atom_client_click" -///from base of atom/Click(): (location, control, params, mob/user) -#define COMSIG_CLICK "atom_click" -///from base of atom/ShiftClick(): (/mob) -#define COMSIG_CLICK_SHIFT "shift_click" - #define COMPONENT_ALLOW_EXAMINATE (1<<0) //Allows the user to examinate regardless of client.eye. -///from base of atom/CtrlClickOn(): (/mob) -#define COMSIG_CLICK_CTRL "ctrl_click" -///from base of atom/AltClick(): (/mob) -#define COMSIG_CLICK_ALT "alt_click" - #define COMPONENT_CANCEL_CLICK_ALT (1<<0) -///from base of atom/CtrlShiftClick(/mob) -#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" -///from base of atom/MouseDrop(): (/atom/over, /mob/user) -#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto" - #define COMPONENT_NO_MOUSEDROP (1<<0) -///from base of atom/MouseDrop_T: (/atom/from, /mob/user) -#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto" ///from base of atom/MouseDrop_T: do_after(mob/user, delay, atom/target, needhand, progress, incapacitation_flags, ignore_movement, max_distance, exclusive) #define COMSIG_DO_AFTER_BEGAN "do_after_began" @@ -332,13 +313,6 @@ #define COMSIG_MOB_DEATH "mob_death" ///from base of mob/set_stat(): (new_stat) #define COMSIG_MOB_STATCHANGE "mob_statchange" -///from base of mob/clickon(): (atom/A, params) -#define COMSIG_MOB_CLICKON "mob_clickon" -///from base of mob/MiddleClickOn(): (atom/A) -#define COMSIG_MOB_MIDDLECLICKON "mob_middleclickon" -///from base of mob/AltClickOn(): (atom/A) -#define COMSIG_MOB_ALTCLICKON "mob_altclickon" - #define COMSIG_MOB_CANCEL_CLICKON (1<<0) ///from base of /obj/item/dice/proc/rollDice(mob/user as mob, var/silent = 0). Has the arguments of 'src, silent, result' #define COMSIG_MOB_ROLLED_DICE "mob_rolled_dice" //can give a return value if we want it to make the dice roll a specific number! diff --git a/code/__defines/dcs/signals/signals_atom/signals_atom_mouse.dm b/code/__defines/dcs/signals/signals_atom/signals_atom_mouse.dm new file mode 100644 index 0000000000..5462ee3863 --- /dev/null +++ b/code/__defines/dcs/signals/signals_atom/signals_atom_mouse.dm @@ -0,0 +1,32 @@ +// mouse signals. Format: +// When the signal is called: (signal arguments) +// All signals send the source datum of the signal as the first argument + +///from base of client/Click(): (atom/target, atom/location, control, params, mob/user) +#define COMSIG_CLIENT_CLICK "atom_client_click" +///from base of atom/Click(): (atom/location, control, params, mob/user) +#define COMSIG_CLICK "atom_click" +///from base of atom/ShiftClick(): (/mob) +#define COMSIG_CLICK_SHIFT "shift_click" +// #define COMSIG_MOB_CANCEL_CLICKON (1<<0) //shared with other forms of click, this is so you're aware it exists here too. +///from base of atom/ShiftClick() +#define COMSIG_SHIFT_CLICKED_ON "shift_clicked_on" +///from base of atom/click_ctrlOn(): (/mob) +#define COMSIG_CLICK_CTRL "ctrl_click" +///from base of atom/click_alt(): (/mob) +#define COMSIG_CLICK_ALT "alt_click" +///from base of atom/base_click_alt_secondary(): (/mob) +#define COMSIG_CLICK_ALT_SECONDARY "click_alt_secondary" + #define COMPONENT_CANCEL_CLICK_ALT_SECONDARY (1<<0) +///from base of atom/click_ctrl_shift(/mob) +#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" +///from base of atom/MouseDrop(): (/atom/over, /mob/user) +#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto" + #define COMPONENT_CANCEL_MOUSEDROP_ONTO (1<<0) +///from base of atom/handle_mouse_drop_receive: (/atom/from, /mob/user) +#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto" + #define COMPONENT_CANCEL_MOUSEDROPPED_ONTO (1<<0) +///from base of mob/MouseWheelOn(): (/atom, delta_x, delta_y, params) +#define COMSIG_MOUSE_SCROLL_ON "mousescroll_on" +/// From /atom/movable/screen/click(): (atom/target, atom/location, control, params, mob/user) +#define COMSIG_SCREEN_ELEMENT_CLICK "screen_element_click" diff --git a/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm b/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm index 175b1152c9..716372a131 100644 --- a/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm @@ -21,3 +21,17 @@ ///from /datum/species/handle_fire. Called when the human is set on fire and burning clothes and stuff #define COMSIG_HUMAN_BURNING "human_burning" + +///from base of mob/clickon(): (atom/A, list/modifiers) +#define COMSIG_MOB_CLICKON "mob_clickon" +///from base of mob/MiddleClickOn(): (atom/A) +#define COMSIG_MOB_MIDDLECLICKON "mob_middleclickon" +///from base of mob/AltClickOn(): (atom/A) +#define COMSIG_MOB_ALTCLICKON "mob_altclickon" + #define COMSIG_MOB_CANCEL_CLICKON (1<<0) +///From base of /mob/base_click_ctrl: (atom/A) +#define COMSIG_MOB_CTRL_CLICKED "mob_ctrl_clicked" +///From base of /mob/base_click_ctrl_shift: (atom/A) +#define COMSIG_MOB_CTRL_SHIFT_CLICKED "mob_ctrl_shift_clicked" +///from base of mob/alt_click_on_secodary(): (atom/A) +#define COMSIG_MOB_ALTCLICKON_SECONDARY "mob_altclickon_secondary" diff --git a/code/__defines/traits/declarations.dm b/code/__defines/traits/declarations.dm index 4e55946f42..b5fc538779 100644 --- a/code/__defines/traits/declarations.dm +++ b/code/__defines/traits/declarations.dm @@ -13,7 +13,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Climbable trait, given and taken by the climbable element when added or removed. Exists to be easily checked via HAS_TRAIT(). #define TRAIT_CLIMBABLE "trait_climbable" -/// Prevents the affected object from opening a loot window via alt click. See atom/AltClick() +/// Prevents the affected object from opening a loot window via alt click. See atom/click_alt() #define TRAIT_ALT_CLICK_BLOCKER "no_alt_click" /// Unlucky trait. Given by the 'unlucky' trait in character select. Checked by various things to cause unlucky interactions. diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index b260912f07..dbe74fb839 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -100,8 +100,8 @@ return ..() -/mob/living/silicon/ai/CtrlClickOn(var/atom/A) - if(!control_disabled && A.AICtrlClick(src)) +/mob/living/silicon/ai/CtrlClickOn(atom/A) + if(!control_disabled && A.ctrl_click_ai(src)) return ..() @@ -120,7 +120,7 @@ I have no idea why it was in atoms.dm instead of respective files. */ -/atom/proc/AICtrlShiftClick() +/atom/proc/AIclick_ctrl_shift() return /atom/proc/AIShiftClick() @@ -131,26 +131,26 @@ user_toggle_open(user) return 1 -/atom/proc/AICtrlClick(mob/user) +/atom/proc/ctrl_click_ai(mob/user) return -/obj/machinery/door/airlock/AICtrlClick(mob/user) // Bolts doors +/obj/machinery/door/airlock/ctrl_click_ai(mob/user) // Bolts doors add_fingerprint(user) toggle_bolt(user) return 1 -/obj/machinery/power/apc/AICtrlClick(mob/user) // turns off/on APCs. +/obj/machinery/power/apc/ctrl_click_ai(mob/user) // turns off/on APCs. add_fingerprint(user) toggle_breaker() return 1 -/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets +/obj/machinery/turretid/ctrl_click_ai() //turns off/on Turrets enabled = !enabled updateTurrets() return TRUE /atom/proc/AIAltClick(var/atom/A) - return AltClick(A) + return click_alt(A) /obj/machinery/door/airlock/AIAltClick(mob/user) // Electrifies doors. add_fingerprint(user) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 0dc059491d..62565cebb0 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -25,6 +25,10 @@ if(src) usr.DblClickOn(src, params) +/atom/MouseWheel(delta_x,delta_y,location,control,params) + if(src) + usr.MouseWheelOn(src, delta_x, delta_y, params) + /* Standard mob ClickOn() Handles exceptions: Buildmode, middle click, modified clicks, mech actions @@ -38,37 +42,49 @@ * item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent * mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed */ -/mob/proc/ClickOn(var/atom/A, var/params) - if(!checkClickCooldown()) // Hard check, before anything else, to avoid crashing +/mob/proc/ClickOn(atom/A, params) + if(world.time <= next_click) return - - setClickCooldown(1) + next_click = world.time + 1 if(client && client.buildmode) build_click(src, client.buildmode, params, A) return var/list/modifiers = params2list(params) - if(modifiers["shift"] && modifiers["ctrl"]) - CtrlShiftClickOn(A) - return 1 - if(modifiers["shift"] && modifiers["middle"]) - ShiftMiddleClickOn(A) - return 1 - if(modifiers["middle"]) - MiddleClickOn(A) - return 1 - if(modifiers["shift"]) - ShiftClickOn(A) - return 0 - if(modifiers["alt"]) // alt and alt-gr (rightalt) - AltClickOn(A) - return 1 - if(modifiers["ctrl"]) - CtrlClickOn(A) - return 1 - if(stat || paralysis || stunned) //CHOMPedit, removed weakened to allow item use while crawling + if(LAZYACCESS(modifiers, BUTTON4) || LAZYACCESS(modifiers, BUTTON5)) + return + + if(LAZYACCESS(modifiers, SHIFT_CLICK)) + if(LAZYACCESS(modifiers, MIDDLE_CLICK)) + ShiftMiddleClickOn(A) + return + if(LAZYACCESS(modifiers, CTRL_CLICK)) + CtrlShiftClickOn(A) + return + if (LAZYACCESS(modifiers, ALT_CLICK)) + alt_shift_click_on(A) + return + ShiftClickOn(A) + return + if(LAZYACCESS(modifiers, MIDDLE_CLICK)) + if(LAZYACCESS(modifiers, CTRL_CLICK)) + CtrlMiddleClickOn(A) + else + MiddleClickOn(A, params) + return + if(LAZYACCESS(modifiers, ALT_CLICK)) // alt and alt-gr (rightalt) + if(LAZYACCESS(modifiers, RIGHT_CLICK)) + AltClickSecondaryOn(A) + else + AltClickOn(A) + return + if(LAZYACCESS(modifiers, CTRL_CLICK)) + CtrlClickOn(A) + return + + if(stat || paralysis || stunned) return face_atom(A) // change direction to face what you clicked on @@ -173,7 +189,7 @@ return TRUE // Default behavior: ignore double clicks, the second click that makes the doubleclick call already calls for a normal click -/mob/proc/DblClickOn(var/atom/A, var/params) +/mob/proc/DblClickOn(atom/A, var/params) return /* @@ -237,107 +253,33 @@ Middle click Only used for swapping hands */ -/mob/proc/MiddleClickOn(var/atom/A) +/mob/proc/MiddleClickOn(atom/A) swap_hand() return -// In case of use break glass -/* -/atom/proc/MiddleClick(var/mob/M as mob) - return -*/ - -/* - Shift middle click - Used for pointing. -*/ - -/mob/proc/ShiftMiddleClickOn(atom/A) - pointed(A) - return - /* Shift click For most mobs, examine. This is overridden in ai.dm */ -/mob/proc/ShiftClickOn(var/atom/A) +/mob/proc/ShiftClickOn(atom/A) A.ShiftClick(src) return -/atom/proc/ShiftClick(var/mob/user) + +/atom/proc/ShiftClick(mob/user) + SEND_SIGNAL(src, COMSIG_SHIFT_CLICKED_ON, user) + var/shiftclick_flags = SEND_SIGNAL(user, COMSIG_CLICK_SHIFT, src) + if(shiftclick_flags & COMSIG_MOB_CANCEL_CLICKON) + return if(user.client && !user.is_remote_viewing()) user.examinate(src) return -/* - Ctrl click - For most objects, pull -*/ -/mob/proc/CtrlClickOn(var/atom/A) - A.CtrlClick(src) - return -/atom/proc/CtrlClick(var/mob/user) - return +/mob/proc/TurfAdjacent(turf/tile) + return tile.Adjacent(src) -/atom/movable/CtrlClick(var/mob/user) - if(Adjacent(user)) - user.start_pulling(src) - -/turf/CtrlClick(var/mob/user) - user.stop_pulling() - -/* - Alt click - Unused except for AI -*/ -/mob/proc/AltClickOn(var/atom/A) - A.AltClick(src) - return - -/** - * Alt click on an atom. - * Performs alt-click actions before attempting to open a loot window. - * Returns TRUE if successful, FALSE if not. - */ -/atom/proc/AltClick(var/mob/user) - // if(!user.can_interact_with(src)) - // return FALSE - - if(SEND_SIGNAL(src, COMSIG_CLICK_ALT, user) & COMPONENT_CANCEL_CLICK_ALT) - return TRUE - - if(HAS_TRAIT(src, TRAIT_ALT_CLICK_BLOCKER) && !isobserver(user)) - return TRUE - - var/turf/tile = get_turf(src) - if(isnull(tile)) - return FALSE - - if(!isturf(loc) && !isturf(src)) - return FALSE - - if(!user.TurfAdjacent(tile)) - return FALSE - - var/datum/lootpanel/panel = user.client?.loot_panel - if(isnull(panel)) - return FALSE - - panel.open(tile) - return TRUE - -/mob/proc/TurfAdjacent(var/turf/T) - return T.AdjacentQuick(src) - -/* - Control+Shift click - Unused except for AI -*/ -/mob/proc/CtrlShiftClickOn(var/atom/A) - A.CtrlShiftClick(src) - return - -/atom/proc/CtrlShiftClick(var/mob/user) +/mob/proc/ShiftMiddleClickOn(atom/A) + src.pointed(A) return /* @@ -401,15 +343,19 @@ /atom/movable/screen/click_catcher/Click(location, control, params) var/list/modifiers = params2list(params) - if(modifiers["middle"] && istype(usr, /mob/living/carbon)) + if(LAZYACCESS(modifiers, MIDDLE_CLICK) && istype(usr, /mob/living/carbon)) var/mob/living/carbon/C = usr C.swap_hand() else var/list/P = params2list(params) var/turf/T = screen_loc2turf(P["screen-loc"], get_turf(usr)) if(T) - if(modifiers["shift"]) + if(LAZYACCESS(modifiers, SHIFT_CLICK)) usr.face_atom(T) return 1 T.Click(location, control, params) return 1 + +/// MouseWheelOn +/mob/proc/MouseWheelOn(atom/A, delta_x, delta_y, params) + SEND_SIGNAL(src, COMSIG_MOUSE_SCROLL_ON, A, delta_x, delta_y, params) diff --git a/code/_onclick/click_alt.dm b/code/_onclick/click_alt.dm new file mode 100644 index 0000000000..3aa84bed1f --- /dev/null +++ b/code/_onclick/click_alt.dm @@ -0,0 +1,175 @@ +///Main proc for primary alt click +/mob/proc/AltClickOn(atom/target) + base_click_alt(target) + +/** + * ### Base proc for alt click interaction left click. Returns if the click was intercepted & handled + * + * If you wish to add custom `click_alt` behavior for a single type, use that proc. + */ +/mob/proc/base_click_alt(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + // Check if they've hooked in to prevent src from alt clicking anything + if(SEND_SIGNAL(src, COMSIG_MOB_ALTCLICKON, target) & COMSIG_MOB_CANCEL_CLICKON) + return TRUE + + // If it has a signal handler that returns a click action, done. + if(SEND_SIGNAL(target, COMSIG_CLICK_ALT, src) & CLICK_ACTION_ANY) + return TRUE + + // If it has a custom click_alt that returns success/block, done. + return target.click_alt(src) & CLICK_ACTION_ANY + /* //NYI Start + if(can_perform_action(target, (target.interaction_flags_click | SILENT_ADJACENCY))) + return target.click_alt(src) & CLICK_ACTION_ANY + + return FALSE + */ //NYI Start + +/mob/living/base_click_alt(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + . = ..() + if(.) + return + + return try_open_loot_panel_on(target) + +/** + * ## Custom alt click interaction + * Override this to change default alt click behavior. Return `CLICK_ACTION_SUCCESS`, `CLICK_ACTION_BLOCKING` or `NONE`. + * + * ### Guard clauses + * Consider adding `interaction_flags_click` before adding unique guard clauses. + * + * ### Return flags + * Forgetting your return will cause the default alt click behavior to occur thereafter. + * + * The difference between NONE and BLOCKING can get hazy, but I like to keep NONE limited to guard clauses and "never" cases. + * + * A good usage for BLOCKING over NONE is when it's situational for the item and there's some feedback indicating this. + * + * ### Examples: + * User is a ghost, alt clicks on item with special disk eject: NONE + * + * Machine broken, no feedback: NONE + * + * Alt click a pipe to max output but its already max: BLOCKING + * + * Alt click a gun that normally works, but is out of ammo: BLOCKING + * + * User unauthorized, machine beeps: BLOCKING + * + * @param {mob} user - The person doing the alt clicking. + */ + +/atom/proc/click_alt(mob/user) + SHOULD_CALL_PARENT(FALSE) + // if(!user.can_interact_with(src)) + // return FALSE + + if(SEND_SIGNAL(src, COMSIG_CLICK_ALT, user) & COMSIG_MOB_CANCEL_CLICKON) + return TRUE + + if(HAS_TRAIT(src, TRAIT_ALT_CLICK_BLOCKER) && !isobserver(user)) + return TRUE + + var/turf/tile = get_turf(src) + if(isnull(tile)) + return FALSE + + if(!isturf(loc) && !isturf(src)) + return FALSE + + if(!user.TurfAdjacent(tile)) + return FALSE + + var/datum/lootpanel/panel = user.client?.loot_panel + if(isnull(panel)) + return FALSE + + panel.open(tile) + return TRUE + + +///Main proc for secondary alt click +/mob/proc/AltClickSecondaryOn(atom/target) + base_click_alt_secondary(target) + +/** + * ### Base proc for alt click interaction right click. + * + * If you wish to add custom `click_alt_secondary` behavior for a single type, use that proc. + */ +/mob/proc/base_click_alt_secondary(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + //Hook on the mob to intercept the click + if(SEND_SIGNAL(src, COMSIG_MOB_ALTCLICKON_SECONDARY, target) & COMSIG_MOB_CANCEL_CLICKON) + return + + //Hook on the atom to intercept the click + if(SEND_SIGNAL(target, COMSIG_CLICK_ALT_SECONDARY, src) & COMPONENT_CANCEL_CLICK_ALT_SECONDARY) + return + + // If it has a custom click_alt_secondary then do that + target.click_alt_secondary(src) + /* //NYI + if(can_perform_action(target, target.interaction_flags_click | SILENT_ADJACENCY)) + target.click_alt_secondary(src) + */ + +/** + * ## Custom alt click secondary interaction + * Override this to change default alt right click behavior. + * + * ### Guard clauses + * Consider adding `interaction_flags_click` before adding unique guard clauses. + **/ +/atom/proc/click_alt_secondary(mob/user) + SHOULD_CALL_PARENT(FALSE) + return NONE + +/** + * ## No-op for unambiguous loot panel bind as a non-living mob. + **/ +/mob/proc/alt_shift_click_on(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + return FALSE + +/** + * ## Bind for unambiguously opening the loot panel as a living mob. + * This raises no signals and is not meant to have its behavior overridden. + **/ +/mob/living/alt_shift_click_on(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + return try_open_loot_panel_on(target) + +///Helper for determining if a living mob may open the loot panel for some target, since it is shared between +///alt and alt-shift click. +///Returns FALSE if the mob is unable to open the loot panel at the target and TRUE if the loot panel was opened. +/mob/living/proc/try_open_loot_panel_on(atom/target) + //Just a copy past of /mob/living/MouseDrop until we get the loot panel. + var/mob/living/living_target = target + if(living_target.is_incorporeal()) + return + if(istype(living_target) && living_target != src && Adjacent(living_target)) + living_target.show_inventory_panel(src) //We don't have the loot panel, so...We'll use our inventory panel for now. + + /* //NYI + if(!CAN_I_SEE(target) || (is_blind() && !IN_GIVEN_RANGE(src, target, 1))) + return FALSE + + // No alt clicking to view turf from beneath + if(HAS_TRAIT(src, TRAIT_MOVE_VENTCRAWLING)) + return FALSE + + /// No loot panel if it's on our person + if(isobj(target) && (target in get_all_gear(INCLUDE_PROSTHETICS|INCLUDE_ABSTRACT|INCLUDE_ACCESSORIES))) + to_chat(src, span_warning("You can't search for this item, it's already in your inventory![!HAS_TRAIT(target, TRAIT_NODROP) ? " Take it off first." : ""]")) + return FALSE + + client.loot_panel.open(get_turf(target)) + return TRUE + */ diff --git a/code/_onclick/click_ctrl.dm b/code/_onclick/click_ctrl.dm new file mode 100644 index 0000000000..2375fb6852 --- /dev/null +++ b/code/_onclick/click_ctrl.dm @@ -0,0 +1,117 @@ +/** + * Ctrl click + */ +/mob/proc/CtrlClickOn(atom/A) + base_click_ctrl(A) + +/** + * ### Base proc for ctrl click interaction left click. + * + * If you wish to add custom `click_ctrl` behavior for a single type, use that proc. + */ +/mob/proc/base_click_ctrl(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + // Check if they've hooked in to prevent src from ctrl clicking anything + if(SEND_SIGNAL(src, COMSIG_MOB_CTRL_CLICKED, target) & COMSIG_MOB_CANCEL_CLICKON) + return TRUE + + // If it has a signal handler that returns a click action, done. + if(SEND_SIGNAL(target, COMSIG_CLICK_CTRL, src) & CLICK_ACTION_ANY) + return TRUE + + target.click_ctrl(src) + /* //NYI + // If it has a custom click_alt that returns success/block, done. + if(can_perform_action(target, target.interaction_flags_click | SILENT_ADJACENCY)) + return target.click_ctrl(src) & CLICK_ACTION_ANY + */ + return + +/** + * Ctrl click + * For most objects, pull + */ +/mob/living/base_click_ctrl(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + . = ..() + if(. || world.time < next_move) // || !can_perform_action(target, NOT_INSIDE_TARGET | SILENT_ADJACENCY | ALLOW_RESTING | FORBID_TELEKINESIS_REACH)) + return + + . = TRUE + /* + if(grab(target)) + changeNext_move(CLICK_CD_MELEE) + return + */ + pulled(target) + +/** + * Ctrl mouse wheel click + * Except for tagging datumns same as control click + */ +/mob/proc/CtrlMiddleClickOn(atom/A) + if(check_rights_for(client, R_ADMIN)) + client.toggle_tag_datum(A) + return + CtrlClickOn(A) + +/** + * ## Custom ctrl click interaction + * Override this to change default ctrl click behavior. Return `CLICK_ACTION_SUCCESS`, `CLICK_ACTION_BLOCKING` or `NONE`. + * + * ### Guard clauses + * Consider adding `interaction_flags_click` before adding unique guard clauses. + * + * ### Return flags + * Forgetting your return will cause the default ctrl click behavior to occur thereafter. + * + * Returning any value besides NONE will stop the attack chain and thus stop the object from getting pulled/grabbed + **/ +/atom/proc/click_ctrl(mob/user) + SHOULD_CALL_PARENT(FALSE) + return NONE + +/turf/click_ctrl(mob/user) + user.stop_pulling() + +/** + * Control+Shift click + * Unused except for AI + */ +/mob/proc/CtrlShiftClickOn(atom/A) + base_click_ctrl_shift(A) + +/** + * ### Base proc for ctrl shift click interaction left click. + * + * If you wish to add custom `click_ctrl_shift` behavior for a single type, use that proc. + */ +/mob/proc/base_click_ctrl_shift(atom/target) + SHOULD_NOT_OVERRIDE(TRUE) + + // Check if they've hooked in to prevent src from ctrl clicking anything + if(SEND_SIGNAL(src, COMSIG_MOB_CTRL_SHIFT_CLICKED, target) & COMSIG_MOB_CANCEL_CLICKON) + return + + // If it has a signal handler that returns a click action, done. + if(SEND_SIGNAL(target, COMSIG_CLICK_CTRL_SHIFT, src) & CLICK_ACTION_ANY) + return + + target.click_ctrl_shift(src) + /* //NYI + // Proceed with ctrl shift click + if(can_perform_action(target, target.interaction_flags_click | SILENT_ADJACENCY)) + target.click_ctrl_shift(src) + */ + +/** + * ## Custom ctrl shift click interaction + * + * ### Guard clauses + * Consider adding `interaction_flags_click` before adding unique guard clauses. + **/ +/atom/proc/click_ctrl_shift(mob/user) + SHOULD_CALL_PARENT(FALSE) + return NONE diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 63214cd8b3..4486c73ab9 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -17,22 +17,35 @@ return var/list/modifiers = params2list(params) - if(modifiers["shift"] && modifiers["ctrl"]) - CtrlShiftClickOn(A) + + if(LAZYACCESS(modifiers, BUTTON4) || LAZYACCESS(modifiers, BUTTON5)) return - if(modifiers["shift"] && modifiers["middle"]) - ShiftMiddleClickOn(A) - return - if(modifiers["middle"]) - MiddleClickOn(A) - return - if(modifiers["shift"]) + + if(LAZYACCESS(modifiers, SHIFT_CLICK)) + if(LAZYACCESS(modifiers, MIDDLE_CLICK)) + ShiftMiddleClickOn(A) + return + if(LAZYACCESS(modifiers, CTRL_CLICK)) + CtrlShiftClickOn(A) + return + if (LAZYACCESS(modifiers, ALT_CLICK)) + alt_shift_click_on(A) + return ShiftClickOn(A) return - if(modifiers["alt"]) // alt and alt-gr (rightalt) - AltClickOn(A) + if(LAZYACCESS(modifiers, MIDDLE_CLICK)) + if(LAZYACCESS(modifiers, CTRL_CLICK)) + CtrlMiddleClickOn(A) + else + MiddleClickOn(A, params) return - if(modifiers["ctrl"]) + if(LAZYACCESS(modifiers, ALT_CLICK)) // alt and alt-gr (rightalt) + if(LAZYACCESS(modifiers, RIGHT_CLICK)) + AltClickSecondaryOn(A) + else + AltClickOn(A) + return + if(LAZYACCESS(modifiers, CTRL_CLICK)) CtrlClickOn(A) return @@ -106,26 +119,26 @@ //Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks // for non-doors/apcs -/mob/living/silicon/robot/CtrlShiftClickOn(var/atom/A) - A.BorgCtrlShiftClick(src) +/mob/living/silicon/robot/CtrlShiftClickOn(atom/target) + target.BorgCtrlShiftClick(src) -/mob/living/silicon/robot/ShiftClickOn(var/atom/A) - A.BorgShiftClick(src) +/mob/living/silicon/robot/ShiftClickOn(atom/target) + target.BorgShiftClick(src) -/mob/living/silicon/robot/CtrlClickOn(var/atom/A) - A.BorgCtrlClick(src) +/mob/living/silicon/robot/CtrlClickOn(atom/target) + target.BorgCtrlClick(src) -/mob/living/silicon/robot/AltClickOn(var/atom/A) - A.BorgAltClick(src) +/mob/living/silicon/robot/AltClickOn(atom/target) + target.BorgAltClick(src) -/atom/proc/BorgCtrlShiftClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden - CtrlShiftClick(user) +/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden + user.click_ctrl_shift(user) /obj/machinery/door/airlock/BorgCtrlShiftClick(var/mob/living/silicon/robot/user) if(user.bolt && !user.bolt.malfunction) return - AICtrlShiftClick(user) + AIclick_ctrl_shift(user) /atom/proc/BorgShiftClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden ShiftClick(user) @@ -137,28 +150,28 @@ AIShiftClick(user) /atom/proc/BorgCtrlClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden - CtrlClick(user) + user.base_click_ctrl(src) /obj/machinery/door/airlock/BorgCtrlClick(var/mob/living/silicon/robot/user) // Bolts doors. Forwards to AI code. if(user.bolt && !user.bolt.malfunction) return - AICtrlClick(user) + ctrl_click_ai(user) /obj/machinery/power/apc/BorgCtrlClick(var/mob/living/silicon/robot/user) // turns off/on APCs. Forwards to AI code. if(user.bolt && !user.bolt.malfunction) return - AICtrlClick(user) + ctrl_click_ai(user) /obj/machinery/turretid/BorgCtrlClick(var/mob/living/silicon/robot/user) //turret control on/off. Forwards to AI code. if(user.bolt && !user.bolt.malfunction) return - AICtrlClick(user) + ctrl_click_ai(user) /atom/proc/BorgAltClick(var/mob/living/silicon/robot/user) - AltClick(user) + click_alt(user) return /obj/machinery/door/airlock/BorgAltClick(var/mob/living/silicon/robot/user) // Eletrifies doors. Forwards to AI code. diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 71de8a5bf5..d795cdd277 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -41,7 +41,7 @@ if(modifiers["alt"]) // alt and alt-gr (rightalt) var/turf/T = get_turf(A) if(T && TurfAdjacent(T)) - T.AltClick(src) + T.click_alt(src) return // You are responsible for checking config.ghost_interaction when you override this function // Not all of them require checking, see below diff --git a/code/datums/components/reagent_hose/item.dm b/code/datums/components/reagent_hose/item.dm index 4bccb8b89d..067d59b0a2 100644 --- a/code/datums/components/reagent_hose/item.dm +++ b/code/datums/components/reagent_hose/item.dm @@ -24,7 +24,7 @@ remembered = null . = ..() -/obj/item/stack/hose/CtrlClick(mob/user) +/obj/item/stack/hose/item_ctrl_click(mob/user) if(remembered) to_chat(user, span_notice("You wind \the [src] back up.")) remembered = null diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 1d83cd39bc..3b6f727b11 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -873,7 +873,7 @@ to_chat(user, span_warning("Access denied.")) return -/obj/machinery/alarm/AltClick(mob/user) +/obj/machinery/alarm/click_alt(mob/user) ..() togglelock(user) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c548521132..30ab139903 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -503,7 +503,7 @@ About the new airlock wires panel: . = ..() -/obj/machinery/door/airlock/CtrlClick(mob/user) //Hold door open +/obj/machinery/door/airlock/click_ctrl(mob/user) //Hold door open user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(user.is_incorporeal()) return diff --git a/code/game/machinery/painter_vr.dm b/code/game/machinery/painter_vr.dm index d8fe09ba77..c9c6b3c83a 100644 --- a/code/game/machinery/painter_vr.dm +++ b/code/game/machinery/painter_vr.dm @@ -101,7 +101,7 @@ // inserted = null // return ..() -/obj/machinery/gear_painter/AltClick(mob/user) +/obj/machinery/gear_painter/click_alt(mob/user) . = ..() drop_item(user) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 5e226f3ced..e4c2f79dab 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -42,7 +42,7 @@ . = ..() -/obj/machinery/washing_machine/AltClick() +/obj/machinery/washing_machine/click_alt() start() /obj/machinery/washing_machine/verb/start_washing() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 26736268fe..b5cb8c980c 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -2044,7 +2044,7 @@ else//Everyone else gets the normal noise who << sound('sound/mecha/nominal.ogg',volume=50) -/obj/mecha/AltClick(mob/living/user) +/obj/mecha/click_alt(mob/living/user) if(user == occupant) strafing() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index e0901b3489..7d3efd7f62 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -185,6 +185,19 @@ return ..() +/obj/item/click_ctrl(mob/user) + SHOULD_NOT_OVERRIDE(TRUE) + + //If the item is on the ground & not anchored we allow the player to drag it + . = item_ctrl_click(user) + if(. & CLICK_ACTION_ANY) + return (isturf(loc) && !anchored) ? NONE : . //allow the object to get dragged on the floor + +/// Subtypes only override this proc for ctrl click purposes. obeys same principles as ctrl_click() +/obj/item/proc/item_ctrl_click(mob/user) + SHOULD_CALL_PARENT(FALSE) + return NONE + /// Called when an action associated with our item is deleted /obj/item/proc/on_action_deleted(datum/source) SIGNAL_HANDLER diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index c499e23b53..d6612f82f8 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -108,7 +108,7 @@ // Description: Checks if the user is made of silicon and returns if they are. If the user is not made of silicon and can use the communicator, // removes the ID from the communicator if it has one, or sends a chat message indicating that the communicator does not have an ID. -/obj/item/communicator/AltClick() +/obj/item/communicator/click_alt() if(issilicon(usr)) return diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 7f68598bc0..3a9601ac7f 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -132,7 +132,7 @@ GLOBAL_LIST_EMPTY(GPS_list) compass.show_waypoint("\ref[gps]") compass.rebuild_overlay_lists(update_compass_icon) -/obj/item/gps/AltClick(mob/user) +/obj/item/gps/click_alt(mob/user) toggletracking(user) /obj/item/gps/proc/toggletracking(mob/living/user) 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 93b98afe58..136a06d983 100644 --- a/code/game/objects/items/devices/personal_shield_generator_vr.dm +++ b/code/game/objects/items/devices/personal_shield_generator_vr.dm @@ -147,7 +147,7 @@ else ..() -/obj/item/personal_shield_generator/AltClick(mob/living/user) +/obj/item/personal_shield_generator/click_alt(mob/living/user) weapon_toggle() /obj/item/personal_shield_generator/MouseDrop() diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 2960fe66ce..9ab94c18ab 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -209,7 +209,7 @@ set_light_on(TRUE) //VOREStation Add Start -/obj/item/radio/intercom/AICtrlClick(var/mob/user) +/obj/item/radio/intercom/ctrl_click_ai(var/mob/user) ToggleBroadcast() to_chat(user, span_notice("\The [src]'s microphone is now [broadcasting ? "enabled" : "disabled"].")) diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index dfb59008dc..00f112f3d8 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -30,5 +30,5 @@ if(ismob(loc)) loc.runechat_message("\[TTS Voice\] [message]") -/obj/item/text_to_speech/AltClick(mob/user) // QOL Change +/obj/item/text_to_speech/click_alt(mob/user) // QOL Change attack_self(user) diff --git a/code/game/objects/items/robobag.dm b/code/game/objects/items/robobag.dm index e3ad240ee2..3a466f8cb2 100644 --- a/code/game/objects/items/robobag.dm +++ b/code/game/objects/items/robobag.dm @@ -47,7 +47,7 @@ add_overlay(corptag_icon_state) -/obj/structure/closet/body_bag/cryobag/robobag/AltClick(mob/user) +/obj/structure/closet/body_bag/cryobag/robobag/click_alt(mob/user) if(!Adjacent(user)) ..() if(corptag) diff --git a/code/game/objects/items/stacks/marker_beacons.dm b/code/game/objects/items/stacks/marker_beacons.dm index 4eda3d6446..2265ebbfc9 100644 --- a/code/game/objects/items/stacks/marker_beacons.dm +++ b/code/game/objects/items/stacks/marker_beacons.dm @@ -62,7 +62,7 @@ var/list/marker_beacon_colors = list( var/obj/structure/marker_beacon/M = new(user.loc, picked_color) transfer_fingerprints_to(M) -/obj/item/stack/marker_beacon/AltClick(mob/living/user) +/obj/item/stack/marker_beacon/click_alt(mob/living/user) if(user.incapacitated() || !istype(user)) to_chat(user, span_warning("You can't do that right now!")) return @@ -138,7 +138,7 @@ var/list/marker_beacon_colors = list( else return ..() -/obj/structure/marker_beacon/AltClick(mob/living/user) +/obj/structure/marker_beacon/click_alt(mob/living/user) ..() if(perma) return diff --git a/code/game/objects/items/toys/toy_customizable.dm b/code/game/objects/items/toys/toy_customizable.dm index 94e6475775..4e2ac07f19 100644 --- a/code/game/objects/items/toys/toy_customizable.dm +++ b/code/game/objects/items/toys/toy_customizable.dm @@ -181,7 +181,7 @@ adjusted_name = sane_name return TRUE -/obj/item/toy/plushie/customizable/AltClick(mob/user) +/obj/item/toy/plushie/customizable/click_alt(mob/user) tgui_interact(user) /obj/item/toy/plushie/customizable/dragon diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 78f9cc484e..5c51e7fd27 100644 --- a/code/game/objects/items/toys/toys.dm +++ b/code/game/objects/items/toys/toys.dm @@ -191,7 +191,7 @@ H.update_inv_l_hand() H.update_inv_r_hand() -/obj/item/toy/sword/AltClick(mob/living/user) +/obj/item/toy/sword/click_alt(mob/living/user) if(!in_range(src, user)) //Basic checks to prevent abuse return if(user.incapacitated() || !istype(user)) diff --git a/code/game/objects/items/toys/toys_vr.dm b/code/game/objects/items/toys/toys_vr.dm index 5ac735574b..1bd460cdde 100644 --- a/code/game/objects/items/toys/toys_vr.dm +++ b/code/game/objects/items/toys/toys_vr.dm @@ -106,7 +106,7 @@ icon = 'icons/obj/drakietoy.dmi' var/lights_glowing = FALSE -/obj/item/toy/plushie/borgplushie/drake/AltClick(mob/living/user) +/obj/item/toy/plushie/borgplushie/drake/click_alt(mob/living/user) . = ..() var/turf/T = get_turf(src) if(!T.AdjacentQuick(user)) // So people aren't messing with these from across the room @@ -1033,7 +1033,7 @@ /obj/item/toy/desk/attack_self(mob/user) activate(user) -/obj/item/toy/desk/AltClick(mob/user) +/obj/item/toy/desk/click_alt(mob/user) activate(user) /obj/item/toy/desk/MouseDrop(mob/user as mob) // Code from Paper bin, so you can still pick up the deck diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index 45d4d6957e..a9d6fb91cd 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -54,7 +54,7 @@ GLOBAL_LIST_INIT(robot_glass_options, list( balloon_alert(user,"the fabricator now holds [stored_matter]/30 fabrication-units.") return -/obj/item/rsf/CtrlClick(mob/living/user) +/obj/item/rsf/item_ctrl_click(mob/living/user) if(!Adjacent(user) || !istype(user)) balloon_alert(user,"you are too far away.") return diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index ee9885fee0..b48c61f8b5 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -177,7 +177,7 @@ -/obj/item/melee/energy/AltClick(mob/living/user) +/obj/item/melee/energy/click_alt(mob/living/user) if(!colorable) //checks if is not colorable return if(!in_range(src, user)) //Basic checks to prevent abuse diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index bc7943f44b..cfb7323dd2 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -202,7 +202,7 @@ H.update_inv_l_hand() H.update_inv_r_hand() -/obj/item/shield/energy/AltClick(mob/living/user) +/obj/item/shield/energy/click_alt(mob/living/user) if(!in_range(src, user)) //Basic checks to prevent abuse return if(user.incapacitated() || !istype(user)) diff --git a/code/game/objects/items/weapons/storage/quickdraw.dm b/code/game/objects/items/weapons/storage/quickdraw.dm index 3482c4e812..6b2eabcdaa 100644 --- a/code/game/objects/items/weapons/storage/quickdraw.dm +++ b/code/game/objects/items/weapons/storage/quickdraw.dm @@ -44,7 +44,7 @@ if(0) to_chat(usr, "[src] now opens as a container.") -/obj/item/storage/quickdraw/AltClick(mob/user) +/obj/item/storage/quickdraw/click_alt(mob/user) ..() if(src.loc == user) //Are they carrying us? toggle_quickdraw() diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index 5e72b13186..814c8e0c82 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -80,7 +80,7 @@ return ..() -/obj/item/storage/secure/AltClick(mob/user as mob) +/obj/item/storage/secure/click_alt(mob/user as mob) if (isliving(user) && Adjacent(user) && (src.locked == 1)) to_chat(user, span_warning("[src] is locked and cannot be opened!")) else if (isliving(user) && Adjacent(user) && (!src.locked)) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 1c5c7d7558..a7436ad4f4 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -159,7 +159,7 @@ usr.put_in_l_hand(src) src.add_fingerprint(usr) -/obj/item/storage/AltClick(mob/user) +/obj/item/storage/click_alt(mob/user) if(user in is_seeing) src.close(user) // I would think there should be some incap check here or something diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index 47d9cbab86..c5eb395765 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -117,7 +117,7 @@ initialize_for_recipient(recipient_mob.mind, preset_goodies = TRUE) return TRUE -/obj/item/mail/blank/AltClick(mob/user) +/obj/item/mail/blank/click_alt(mob/user) if(sealed) return diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 753d7121d8..22cfc4d66c 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -116,7 +116,7 @@ else toggle(user) -/obj/structure/closet/secure_closet/AltClick() +/obj/structure/closet/secure_closet/click_alt() ..() verb_togglelock() diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index c28103a6fb..4f00eea6e1 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -90,7 +90,7 @@ if(health <= 0) puncture() -/obj/structure/inflatable/CtrlClick() +/obj/structure/inflatable/click_ctrl() hand_deflate() /obj/item/inflatable/proc/inflate(var/mob/user,var/location) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 78b28a7064..32cc34bf5d 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -190,7 +190,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) //New Altclick functionality! //Altclick the cart with a mop to stow the mop away //Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash -/obj/structure/janitorialcart/AltClick(mob/living/user) +/obj/structure/janitorialcart/click_alt(mob/living/user) if(user.incapacitated() || !Adjacent(user)) return var/obj/I = user.get_active_hand() if(istype(I, /obj/item/mop)) diff --git a/code/game/objects/structures/reflectors_ch.dm b/code/game/objects/structures/reflectors_ch.dm index 27b75cdc59..af2564d4d5 100644 --- a/code/game/objects/structures/reflectors_ch.dm +++ b/code/game/objects/structures/reflectors_ch.dm @@ -177,7 +177,7 @@ setAngle(SIMPLIFY_DEGREES(new_angle)) return TRUE -/obj/structure/reflector/AltClick(mob/user) +/obj/structure/reflector/click_alt(mob/user) if(!CanUseTopic(user)) return else if(finished) diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm index ed279a706c..1fbadd8fc8 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -80,7 +80,7 @@ return TryToSwitchState(user) /* // CHOMPEDIT: disabling becaue alt-clicking to view a turf is pretty important. -/obj/structure/simple_door/AltClick(mob/user as mob) +/obj/structure/simple_door/click_alt(mob/user as mob) . = ..() user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(!Adjacent(user)) diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index f0c3b9eb91..e8e44a190f 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -157,7 +157,7 @@ user_unbuckle_mob(A, user) return -/obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user) +/obj/structure/bed/chair/wheelchair/click_ctrl(mob/user) if(in_range(src, user)) if(!ishuman(user)) return if(has_buckled_mobs() && (user in buckled_mobs)) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 04c751f4a1..21c8548bb0 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -179,7 +179,7 @@ ChangeTurf(/turf/simulated/floor/cult, preserve_outdoors = TRUE) return TRUE -/turf/simulated/floor/AltClick(mob/user) +/turf/simulated/floor/click_alt(mob/user) if(isliving(user)) var/mob/living/livingUser = user if(try_graffiti(livingUser, livingUser.get_active_hand())) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 5f438f3b28..9600c3fc26 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -347,7 +347,7 @@ ChangeTurf(/turf/simulated/wall/cult, preserve_outdoors = TRUE) return TRUE -/turf/simulated/wall/AltClick(mob/user) +/turf/simulated/wall/click_alt(mob/user) if(isliving(user)) var/mob/living/livingUser = user if(try_graffiti(livingUser, livingUser.get_active_hand())) diff --git a/code/modules/artifice/cursedform.dm b/code/modules/artifice/cursedform.dm index 2fcbad5d4d..b830f2819a 100644 --- a/code/modules/artifice/cursedform.dm +++ b/code/modules/artifice/cursedform.dm @@ -6,7 +6,7 @@ info = {"