Reworks pAIs (#68241)

A pretty heavy refactor for pAIs that just spilled into a rework.

Attempts to fully document and organize backend code.
Fixes a large number of bugs left untouched for a decade.
Breaks down the frontend into subcomponents.
Rebalances their software modules.
(should) fix pAI faces get removed if you activate them during alert #68242
This commit is contained in:
Jeremiah
2022-07-24 16:18:59 +01:00
committed by GitHub
parent c529eab0e0
commit 86e801987e
63 changed files with 2304 additions and 2067 deletions
-20
View File
@@ -1,20 +0,0 @@
/**
* tgui state: paicard_state
*
* Checks that the paicard is in the user's top-level
* (hand, ear, pocket, belt, etc) inventory OR
* if the paicard has been slotted into a PDA which
* is also on the user's person.
*
*/
GLOBAL_DATUM_INIT(paicard_state, /datum/ui_state/paicard_state, new)
/datum/ui_state/paicard_state/can_use_topic(obj/item/paicard/paicard, mob/user)
/// paicard is in the user's closest inventory
if(!paicard.slotted && (paicard in user))
return user.shared_ui_interaction(paicard)
/// paicard is in a pda slot which is in the user's closest inventory
if(paicard.slotted && (paicard.loc in user))
return user.shared_ui_interaction(paicard)
return UI_CLOSE