some hints

This commit is contained in:
SandPoot
2023-07-19 20:51:25 -03:00
parent 3c3f609541
commit 19ee7f8bd2
18 changed files with 214 additions and 7 deletions
+12
View File
@@ -44,6 +44,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
RegisterSignal(parent, COMSIG_ATOM_EMP_ACT, .proc/on_emp_act)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
RegisterSignal(parent, COMSIG_CLICK_ALT, .proc/on_AltClick)
RegisterSignal(parent, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
///Called on COMSIG_ITEM_ATTACK_SELF
/datum/component/gps/item/proc/interact(datum/source, mob/user)
@@ -54,6 +55,17 @@ GLOBAL_LIST_EMPTY(GPS_list)
/datum/component/gps/item/proc/on_examine(datum/source, mob/user, list/examine_list)
examine_list += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
/datum/component/gps/item/proc/on_requesting_context_from_item(
obj/source,
list/context,
obj/item/held_item,
mob/living/user,
)
SIGNAL_HANDLER
LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, tracking ? "Turn off" : "Turn on")
return CONTEXTUAL_SCREENTIP_SET
///Called on COMSIG_ATOM_EMP_ACT
/datum/component/gps/item/proc/on_emp_act(datum/source, severity)
emped = TRUE
+17 -1
View File
@@ -44,6 +44,7 @@
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/ExamineMessage)
if(rotation_flags & ROTATION_WRENCH)
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/WrenchRot)
RegisterSignal(parent, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
/datum/component/simple_rotation/proc/add_verbs()
if(rotation_flags & ROTATION_VERBS)
@@ -63,7 +64,7 @@
AM.verbs -= /atom/movable/proc/simple_rotate_counterclockwise
/datum/component/simple_rotation/proc/remove_signals()
UnregisterSignal(parent, list(COMSIG_CLICK_ALT, COMSIG_PARENT_EXAMINE, COMSIG_PARENT_ATTACKBY))
UnregisterSignal(parent, list(COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, COMSIG_CLICK_ALT, COMSIG_PARENT_EXAMINE, COMSIG_PARENT_ATTACKBY))
/datum/component/simple_rotation/RegisterWithParent()
add_verbs()
@@ -157,6 +158,21 @@
/datum/component/simple_rotation/proc/default_after_rotation(mob/user, rotation_type)
to_chat(user,"<span class='notice'>You [rotation_type == ROTATION_FLIP ? "flip" : "rotate"] [parent].</span>")
/datum/component/simple_rotation/proc/on_requesting_context_from_item(
obj/source,
list/context,
obj/item/held_item,
mob/living/user,
)
var/rotation = (rotation_flags & ROTATION_FLIP) ? "Flip" : "Rotate [rotation_flags & ROTATION_CLOCKWISE ? "clockwise" : "counter-clockwise"]"
if(rotation_flags & ROTATION_ALTCLICK)
LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, rotation)
. = CONTEXTUAL_SCREENTIP_SET
if(held_item?.tool_behaviour == TOOL_WRENCH && (rotation_flags & ROTATION_WRENCH))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, rotation)
. = CONTEXTUAL_SCREENTIP_SET
/atom/movable/proc/simple_rotate_clockwise()
set name = "Rotate Clockwise"
set category = "Object"