mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Alt click refactor (#82656)
## About The Pull Request Rewrites how alt click works. Based heavily on #82625. What a cool concept, it flows nicely with #82533. Fixes #81242 (tm bugs fixed) Fixes #82668 <details><summary>More info for devs</summary> Handy regex used for alt click s&r: `AltClick\((.*).*\)(\n\t.*\.\.\(\))?` `click_alt($1)` (yes I am aware this only copies the first arg. there are no other args!) ### Obj reskins No reason for obj reskin to check on every single alt click for every object. It applies to only a few items. - Moved to obj/item - Made into signal - Added screentips ### Ventcrawling Every single atmospherics machine checked for ventcrawling capability on alt click despite only 3 objects needing that functionality. This has been moved down to those individual items. </details> ## Why It's Good For The Game For players: - Alt clicking should work more logically, not causing double actions like eject disk and open item window - Added context menus for reskinnable items - Removed adjacency restriction on loot panel For devs: - Makes alt click interactions easier to work with, no more click chain nonsense and redundant guard clauses. - OOP hell reduced - Pascal Case reduced - Glorious snake case ## Changelog 🆑 add: The lootpanel now works at range. add: Screentips for reskinnable items. fix: Alt click interactions have been refactored, which may lead to unintentional changes to gameplay. Report any issues, please. /🆑
This commit is contained in:
@@ -223,19 +223,18 @@
|
||||
/obj/item/modular_computer/get_cell()
|
||||
return internal_cell
|
||||
|
||||
/obj/item/modular_computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
/obj/item/modular_computer/click_alt(mob/user)
|
||||
if(issilicon(user))
|
||||
return FALSE
|
||||
if(!user.can_perform_action(src))
|
||||
return FALSE
|
||||
return NONE
|
||||
|
||||
if(RemoveID(user))
|
||||
return TRUE
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
if(istype(inserted_pai)) // Remove pAI
|
||||
remove_pai(user)
|
||||
return TRUE
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs. //guess what
|
||||
/obj/item/modular_computer/GetAccess()
|
||||
|
||||
@@ -91,14 +91,11 @@
|
||||
toggle_open(user)
|
||||
|
||||
|
||||
/obj/item/modular_computer/laptop/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!can_interact(user))
|
||||
return
|
||||
if(screen_on) // Close it.
|
||||
try_toggle_open(user)
|
||||
else
|
||||
return ..()
|
||||
/obj/item/modular_computer/laptop/click_alt(mob/user)
|
||||
if(!screen_on)
|
||||
return CLICK_ACTION_BLOCKING
|
||||
try_toggle_open(user) // Close it.
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
|
||||
if(screen_on)
|
||||
|
||||
@@ -157,12 +157,6 @@
|
||||
inserted_item = attacking_item
|
||||
playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE)
|
||||
|
||||
/obj/item/modular_computer/pda/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
remove_pen(user)
|
||||
|
||||
/obj/item/modular_computer/pda/CtrlClick(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -116,11 +116,11 @@
|
||||
SIGNAL_HANDLER
|
||||
return update_icon(updates)
|
||||
|
||||
/obj/machinery/modular_computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
/obj/machinery/modular_computer/click_alt(mob/user)
|
||||
if(CPU_INTERACTABLE(user) || !can_interact(user))
|
||||
return
|
||||
cpu.AltClick(user)
|
||||
return NONE
|
||||
cpu.click_alt(user)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
|
||||
Reference in New Issue
Block a user