diff --git a/code/__DEFINES/_flags/_flags.dm b/code/__DEFINES/_flags/_flags.dm
index fbc920cee6..25fe684b3e 100644
--- a/code/__DEFINES/_flags/_flags.dm
+++ b/code/__DEFINES/_flags/_flags.dm
@@ -68,6 +68,8 @@ GLOBAL_LIST_INIT(bitflags, list(
#define NO_RUINS_1 (1<<10)
/// Should this tile be cleaned up and reinserted into an excited group?
#define EXCITED_CLEANUP_1 (1 << 13)
+/// Whether or not this atom has contextual screentips when hovered OVER
+#define HAS_CONTEXTUAL_SCREENTIPS_1 (1 << 14)
////////////////Area flags\\\\\\\\\\\\\\
/// If it's a valid territory for cult summoning or the CRAB-17 phone to spawn
diff --git a/code/__DEFINES/_flags/obj_flags.dm b/code/__DEFINES/_flags/obj_flags.dm
index 5f5ea12aaa..c3c48c7d74 100644
--- a/code/__DEFINES/_flags/obj_flags.dm
+++ b/code/__DEFINES/_flags/obj_flags.dm
@@ -17,6 +17,8 @@
#define EXAMINE_SKIP (1<<14) /// Makes the Examine proc not read out this item.
#define IN_STORAGE (1<<15) //is this item in the storage item, such as backpack? used for tooltips
#define HAND_ITEM (1<<16) // If an item is just your hand (circled hand, slapper) and shouldn't block things like riding
+/// Has contextual screentips when HOVERING OVER OTHER objects
+#define ITEM_HAS_CONTEXTUAL_SCREENTIPS (1 << 17)
/// Integrity defines for clothing (not flags but close enough)
#define CLOTHING_PRISTINE 0 // We have no damage on the clothing
diff --git a/code/__DEFINES/dcs/signals/signals_painting.dm b/code/__DEFINES/dcs/signals/signals_painting.dm
new file mode 100644
index 0000000000..4f9201ec8f
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/signals_painting.dm
@@ -0,0 +1,7 @@
+// signals for painting canvases, tools and the /datum/component/palette component
+
+///from base of /item/proc/set_painting_tool_color(): (chosen_color)
+#define COMSIG_PAINTING_TOOL_SET_COLOR "painting_tool_set_color"
+
+/// from base of /item/canvas/ui_data(): (data)
+#define COMSIG_PAINTING_TOOL_GET_ADDITIONAL_DATA "painting_tool_get_data"
diff --git a/code/__DEFINES/dcs/signals/signals_screentips.dm b/code/__DEFINES/dcs/signals/signals_screentips.dm
new file mode 100644
index 0000000000..8f7326ee2e
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/signals_screentips.dm
@@ -0,0 +1,23 @@
+/// A "Type-A" contextual screentip interaction.
+/// These are used for items that are defined by their behavior. They define their contextual text within *themselves*,
+/// not in their targets.
+/// Examples include syringes (LMB to inject, RMB to draw) and health analyzers (LMB to scan health/wounds, RMB for chems)
+/// Items can override `add_item_context()`, and call `register_item_context()` in order to easily connect to this.
+/// Called on /obj/item with a mutable screentip context list, the hovered target, and the mob hovering.
+/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
+/// that map to the action as text.
+/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
+#define COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET "item_requesting_context_for_target"
+
+/// A "Type-B" contextual screentip interaction.
+/// These are atoms that are defined by what happens *to* them. These should define contextual text within themselves, and
+/// not in their operating tools.
+/// Examples include construction objects (LMB with glass to put in screen for computers).
+/// Called on /atom with a mutable screentip context list, the item being used, and the mob hovering.
+/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
+/// that map to the action as text.
+/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
+#define COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM "atom_requesting_context_from_item"
+
+/// Tells the contextual screentips system that the list context was mutated.
+#define CONTEXTUAL_SCREENTIP_SET (1 << 0)
diff --git a/code/__DEFINES/screentips.dm b/code/__DEFINES/screentips.dm
new file mode 100644
index 0000000000..a3b1018352
--- /dev/null
+++ b/code/__DEFINES/screentips.dm
@@ -0,0 +1,35 @@
+/// Context applied to LMB actions
+#define SCREENTIP_CONTEXT_LMB "LMB"
+
+/// Context applied to RMB actions
+#define SCREENTIP_CONTEXT_RMB "RMB"
+
+/// Context applied to Shift-LMB actions
+#define SCREENTIP_CONTEXT_SHIFT_LMB "Shift-LMB"
+
+/// Context applied to Ctrl-LMB actions
+#define SCREENTIP_CONTEXT_CTRL_LMB "Ctrl-LMB"
+
+/// Context applied to Ctrl-RMB actions
+#define SCREENTIP_CONTEXT_CTRL_RMB "Ctrl-RMB"
+
+/// Context applied to Alt-LMB actions
+#define SCREENTIP_CONTEXT_ALT_LMB "Alt-LMB"
+
+/// Context applied to Alt-RMB actions
+#define SCREENTIP_CONTEXT_ALT_RMB "Alt-RMB"
+
+/// Context applied to Ctrl-Shift-LMB actions
+#define SCREENTIP_CONTEXT_CTRL_SHIFT_LMB "Ctrl-Shift-LMB"
+
+/// Screentips are always disabled
+#define SCREENTIP_PREFERENCE_DISABLED "Disabled"
+
+/// Screentips are always enabled
+#define SCREENTIP_PREFERENCE_ENABLED "Enabled"
+
+/// Screentips are only enabled when they have context
+#define SCREENTIP_PREFERENCE_CONTEXT_ONLY "Only with tips"
+
+/// Regardless of intent
+#define INTENT_ANY "intent_any"
diff --git a/code/__HELPERS/screentips.dm b/code/__HELPERS/screentips.dm
new file mode 100644
index 0000000000..967e1c3bb6
--- /dev/null
+++ b/code/__HELPERS/screentips.dm
@@ -0,0 +1,31 @@
+// Generate intent icons
+/// Help intent icon for screentip context
+GLOBAL_DATUM_INIT(icon_intent_help, /image, image('icons/emoji.dmi', icon_state = INTENT_HELP))
+/// Disarm intent icon for screentip context
+GLOBAL_DATUM_INIT(icon_intent_disarm, /image, image('icons/emoji.dmi', icon_state = INTENT_DISARM))
+/// Grab intent icon for screentip context
+GLOBAL_DATUM_INIT(icon_intent_grab, /image, image('icons/emoji.dmi', icon_state = INTENT_GRAB))
+/// Harm intent icon for screentip context
+GLOBAL_DATUM_INIT(icon_intent_harm, /image, image('icons/emoji.dmi', icon_state = INTENT_HARM))
+
+/*
+ * # Builds context with each intent for this key
+ * Args:
+ * - context = list (REQUIRED)
+ * - key = string (REQUIRED)
+*/
+/proc/build_context(list/context, key)
+ var/list/to_add
+ for(var/intent in context[key])
+ switch(intent)
+ if(INTENT_HELP)
+ LAZYADD(to_add, "\icon[GLOB.icon_intent_help] [key]: [context[key][INTENT_HELP]]")
+ if(INTENT_DISARM)
+ LAZYADD(to_add, "\icon[GLOB.icon_intent_disarm] [key]: [context[key][INTENT_DISARM]]")
+ if(INTENT_GRAB)
+ LAZYADD(to_add, "\icon[GLOB.icon_intent_grab] [key]: [context[key][INTENT_GRAB]]")
+ if(INTENT_HARM)
+ LAZYADD(to_add, "\icon[GLOB.icon_intent_harm] [key]: [context[key][INTENT_HARM]]")
+ else // If you're adding intent-less YOU BETTER ADD IT FIRST IN THE LIST
+ LAZYADD(to_add, "[key]: [context[key][intent]]")
+ return english_list(to_add, "", " ", " ")
diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm
index 1f261903d2..d16c24be44 100644
--- a/code/_globalvars/bitfields.dm
+++ b/code/_globalvars/bitfields.dm
@@ -155,6 +155,7 @@ DEFINE_BITFIELD(flags_1, list(
"CAN_BE_DIRTY_1" = CAN_BE_DIRTY_1,
"CONDUCT_1" = CONDUCT_1,
"DEFAULT_RICOCHET_1" = DEFAULT_RICOCHET_1,
+ "HAS_CONTEXTUAL_SCREENTIPS_1" = HAS_CONTEXTUAL_SCREENTIPS_1,
"HEAR_1" = HEAR_1,
"HOLOGRAM_1" = HOLOGRAM_1,
"INITIALIZED_1" = INITIALIZED_1,
@@ -246,6 +247,7 @@ DEFINE_BITFIELD(item_flags, list(
"IN_STORAGE" = IN_STORAGE,
"ITEM_CAN_BLOCK" = ITEM_CAN_BLOCK,
"ITEM_CAN_PARRY" = ITEM_CAN_PARRY,
+ "ITEM_HAS_CONTEXTUAL_SCREENTIPS" = ITEM_HAS_CONTEXTUAL_SCREENTIPS,
"NEEDS_PERMIT" = NEEDS_PERMIT,
"NOBLUDGEON" = NOBLUDGEON,
"NO_MAT_REDEMPTION" = NO_MAT_REDEMPTION,
diff --git a/code/_globalvars/lists/maintenance_loot.dm b/code/_globalvars/lists/maintenance_loot.dm
index b41b7356a8..cec25c0047 100644
--- a/code/_globalvars/lists/maintenance_loot.dm
+++ b/code/_globalvars/lists/maintenance_loot.dm
@@ -49,6 +49,8 @@ GLOBAL_LIST_INIT(maintenance_loot, list(
/obj/item/radio/off = 2,
/obj/item/t_scanner = 5,
/obj/item/airlock_painter = 1,
+ /obj/item/airlock_painter/decal = 1,
+ /obj/item/airlock_painter/decal/tile = 1,
/obj/item/stack/cable_coil/random = 4,
/obj/item/stack/cable_coil/random/five = 6,
/obj/item/stack/medical/suture = 1,
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index cd8fb4b30c..593fa1a411 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -64,13 +64,15 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
/// This is updated by the preference for cheaper reads than would be
/// had with a proc call, especially on one of the hottest procs in the
/// game (MouseEntered).
- var/screentips_enabled = TRUE
+ // var/screentips_enabled = SCREENTIP_PREFERENCE_ENABLED
/// The color to use for the screentips.
/// This is updated by the preference for cheaper reads than would be
/// had with a proc call, especially on one of the hottest procs in the
/// game (MouseEntered).
- var/screentip_color
+ // var/screentip_color
+
+ // We don't actually do proccalls really yet, so let's grab at prefs
var/atom/movable/screen/movable/action_button/hide_toggle/hide_actions_toggle
var/action_buttons_hidden = FALSE
diff --git a/code/datums/elements/object_reskinning.dm b/code/datums/elements/object_reskinning.dm
index 8b5d905e72..a75a818fc3 100644
--- a/code/datums/elements/object_reskinning.dm
+++ b/code/datums/elements/object_reskinning.dm
@@ -18,21 +18,20 @@
/datum/element/object_reskinning
element_flags = ELEMENT_DETACH
-/datum/element/object_reskinning/Attach(datum/target)
+/datum/element/object_reskinning/Attach(obj/target)
. = ..()
- var/obj/the_obj = target
- if(!istype(the_obj))
+ if(!istype(target))
return ELEMENT_INCOMPATIBLE
- if(!islist(the_obj.unique_reskin) || !length(the_obj.unique_reskin))
+ if(!islist(target.unique_reskin) || !length(target.unique_reskin))
message_admins("[src] was given to an object without any unique reskins, if you really need to, give it a couple skins first.")
return ELEMENT_INCOMPATIBLE
- RegisterSignal(the_obj, COMSIG_PARENT_EXAMINE, .proc/on_examine)
- RegisterSignal(the_obj, the_obj.reskin_binding, .proc/reskin)
+ RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/on_examine)
+ RegisterSignal(target, target.reskin_binding, .proc/reskin)
+ RegisterSignal(target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
-/datum/element/object_reskinning/Detach(datum/source, force)
- var/obj/being_deleted = source
- UnregisterSignal(source, list(COMSIG_PARENT_EXAMINE, being_deleted.reskin_binding))
+/datum/element/object_reskinning/Detach(obj/source, force)
+ UnregisterSignal(source, list(COMSIG_PARENT_EXAMINE, source.reskin_binding, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM))
return ..()
/datum/element/object_reskinning/proc/on_examine(obj/obj, mob/user, list/examine_list)
@@ -102,3 +101,19 @@
if(user.incapacitated())
return FALSE
return TRUE
+
+/datum/element/object_reskinning/proc/on_requesting_context_from_item(
+ obj/source,
+ list/context,
+ obj/item/held_item,
+ mob/living/user,
+)
+ SIGNAL_HANDLER
+
+ if(isnull(held_item))
+ switch(source.reskin_binding)
+ if(COMSIG_CLICK_CTRL_SHIFT)
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB], INTENT_ANY, "Reskin PDA")
+ else
+ LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Reskin [source]")
+ return CONTEXTUAL_SCREENTIP_SET
diff --git a/code/datums/elements/screentips/README.md b/code/datums/elements/screentips/README.md
new file mode 100644
index 0000000000..5b4ee4fd18
--- /dev/null
+++ b/code/datums/elements/screentips/README.md
@@ -0,0 +1,136 @@
+# Contextual screentips (and when to not use this folder)
+
+Contextual screentips provide information in the form of text at the top of your screen to inform you of the possibilities of an item. The "contextual" here refers to this being handled entirely through code, what it displays and when is completely up to you.
+
+## The elements (and this folder)
+
+This folder provides several useful shortcuts to be able to handle 95% of situations.
+
+### `/datum/element/contextual_screentip_bare_hands`
+
+This element is used to display screentips **when the user hovers over the object with nothing in their active hand.**
+
+It takes parameters in the form of both non-combat mode and, optionally, combat mode.
+
+Example:
+
+```dm
+/obj/machinery/firealarm/Initialize(mapload)
+ . = ..()
+
+ AddElement( \
+ /datum/element/contextual_screentip_bare_hands, \
+ lmb_text = list(INTENT_HELP = "Turn on"), \
+ rmb_text = list(INTENT_HELP = "Turn off"), \
+ )
+```
+
+This will display "LMB: Turn on | RMB: Turn off" when the user hovers over a fire alarm with an empty active hand.
+
+### `/datum/element/contextual_screentip_tools`
+
+This element takes a map of tool behaviors to [context lists](#context-lists). These will be displayed **when the user hovers over the object with an item that has the tool behavior.**
+
+Example:
+
+```dm
+/obj/structure/table/Initialize(mapload)
+ if (!(flags_1 & NODECONSTRUCT_1))
+ var/static/list/tool_behaviors = list(
+ TOOL_SCREWDRIVER = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Disassemble"),
+ ),
+
+ TOOL_WRENCH = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Deconstruct"),
+ ),
+ )
+
+ AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
+```
+
+This will display "LMB: Deconstruct" when the user hovers over a table with a wrench.
+
+### `/datum/element/contextual_screentip_item_typechecks`
+
+This element takes a map of item typepaths to [context lists](#context-lists). These will be displayed **when the user hovers over the object with the selected item.**
+
+Example:
+
+```dm
+/obj/item/restraints/handcuffs/cable/Initialize(mapload)
+ . = ..()
+
+ var/static/list/hovering_item_typechecks = list(
+ /obj/item/stack/rods = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft wired rod"),
+ ),
+
+ /obj/item/stack/sheet/iron = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft bola"),
+ ),
+ )
+
+ AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
+```
+
+This will display "LMB: Craft bola" when the user hovers over cable restraints with metal in their hand.
+
+## The basic system (and when to not use this folder)
+
+The basic system acknowledges the following two interactions:
+
+### Self-defining items (Type A)
+These are items that are defined by their behavior. These should define their contextual text within themselves, and not in their targets.
+
+- Stun batons (LMB to stun, RMB to harm)
+- Syringes (LMB to inject, RMB to draw)
+- Health analyzers (LMB to scan for health/wounds [another piece of context], RMB to scans for chemicals)
+
+### Receiving action defining objects (Type B)
+These are objects (not necessarily items) that are defined by what happens *to* them. These should define their contextual text within themselves, and not in their operating tools.
+
+- Tables (RMB with wrench to deconstruct)
+- Construction objects (LMB with glass to put in screen for computers)
+- Carbon copies (RMB to take a copy)
+
+---
+
+Both of these are supported, and can be hooked to through several means.
+
+Note that you **must return `CONTEXTUAL_SCREENTIP_SET` if you change the contextual screentip at all**, otherwise you may not see it.
+
+### `COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET`
+
+This signal is registered on **items**, and receives **the hovering object**, provided in the form of `obj/item/source, list/context, atom/target, mob/living/user`.
+
+### `/atom/proc/register_item_context()`, and `/atom/proc/add_item_context()`
+`/atom/proc/add_item_context()` is a proc intended to be overridden to easily create Type-B interactions (ones where atoms are hovered over by items). It receives the exact same arguments as `COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET`: `obj/item/source, list/context, atom/target, mob/living/user`.
+
+In order for your `add_item_context()` method to be run, you **must** call `register_item_context()`.
+
+### `COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM`
+
+This signal is registered on **atoms**, and receives **what the user is hovering with**, provided in the form of `atom/source, list/context, obj/item/held_item, mob/living/user`.
+
+### `/atom/proc/register_context()`, and `/atom/proc/add_context()`
+`/atom/proc/add_context()` is a proc intended to be overridden to easily create Type-B interactions (ones where atoms are hovered over by items). It receives the exact same arguments as `COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM`: `atom/source, list/context, obj/item/held_item, mob/living/user`.
+
+In order for your `add_context()` method to be run, you **must** call `register_context()`.
+
+---
+
+When using any of these methods, you will receive a mutable context list.
+
+### Context lists
+
+Context lists are lists with keys mapping from `SCREENTIP_CONTEXT_*` to a string. You can find these keys in `code/__DEFINES/screentips.dm`.
+
+The signals and `add_context()` variants mutate the list directly, while shortcut elements will just have you pass them in directly.
+
+For example:
+
+```dm
+context[SCREENTIP_CONTEXT_LMB] = "Open"
+context[SCREENTIP_CONTEXT_RMB] = "Destroy"
+```
diff --git a/code/datums/elements/screentips/contextual_screentip_bare_hands.dm b/code/datums/elements/screentips/contextual_screentip_bare_hands.dm
new file mode 100644
index 0000000000..98ef45af3f
--- /dev/null
+++ b/code/datums/elements/screentips/contextual_screentip_bare_hands.dm
@@ -0,0 +1,92 @@
+/// Apply basic contextual screentips when the user hovers over this item with an empty hand.
+/// A "Type B" interaction.
+/// This stacks with other contextual screentip elements, though you may want to register the signal/flag manually at that point for performance.
+/datum/element/contextual_screentip_bare_hands
+ element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH
+ id_arg_index = 3
+
+ /* How to use SandPoot's version of this:
+ *
+ * Combat mode will be checked first, then the intents for it, if the
+ * current intent has not been set it defaults to the first item of the list.
+ *
+ * Otherwise if not in combat mode or no messages for it
+ * will also try to get messages for the current intent
+ * if failing to, will try to get the first item of the list.
+ */
+
+ /// If set, the text to show for LMB
+ var/list/lmb_text
+
+ /// If set, the text to show for RMB
+ var/list/rmb_text
+
+ /// If set, the text to show for LMB when in combat mode. Otherwise, defaults to lmb_text.
+ var/list/lmb_text_combat_mode
+
+ /// If set, the text to show for RMB when in combat mode. Otherwise, defaults to rmb_text.
+ var/list/rmb_text_combat_mode
+
+// If you're curious about `use_named_parameters`, it's because you should use named parameters!
+// AddElement(/datum/element/contextual_screentip_bare_hands, lmb_text = list(INTENT_HELP = "Do the thing"))
+/datum/element/contextual_screentip_bare_hands/Attach(
+ datum/target,
+ use_named_parameters,
+ lmb_text,
+ rmb_text,
+ lmb_text_combat_mode,
+ rmb_text_combat_mode,
+)
+ . = ..()
+ if (!isatom(target))
+ return ELEMENT_INCOMPATIBLE
+
+ if (!isnull(use_named_parameters))
+ CRASH("Use named parameters instead of positional ones.")
+
+ src.lmb_text = lmb_text
+ src.rmb_text = rmb_text
+ src.lmb_text_combat_mode = lmb_text_combat_mode || lmb_text
+ src.rmb_text_combat_mode = rmb_text_combat_mode || rmb_text
+
+ var/atom/atom_target = target
+ atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
+ RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
+
+/datum/element/contextual_screentip_bare_hands/Detach(datum/source, ...)
+ UnregisterSignal(source, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM)
+
+ // We don't remove HAS_CONTEXTUAL_SCREENTIPS_1, since there could be other stuff still hooked to it,
+ // and being set without signals is not dangerous, just less performant.
+ // A lot of things don't do this, perhaps make a proc that checks if any signals are still set, and if not,
+ // remove the flag.
+
+ return ..()
+
+/datum/element/contextual_screentip_bare_hands/proc/on_requesting_context_from_item(
+ datum/source,
+ list/context,
+ obj/item/held_item,
+ mob/living/user,
+)
+ SIGNAL_HANDLER
+
+ if (!isnull(held_item))
+ return NONE
+
+ var/combat_mode = SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE)
+
+ // Combat lmb
+ if(combat_mode && length(lmb_text_combat_mode))
+ context[SCREENTIP_CONTEXT_LMB] = lmb_text_combat_mode
+ // LMB
+ else if(length(lmb_text))
+ context[SCREENTIP_CONTEXT_LMB] = lmb_text
+ // Combat rmb
+ if(combat_mode && length(rmb_text_combat_mode))
+ context[SCREENTIP_CONTEXT_RMB] = rmb_text_combat_mode
+ // RMB
+ else if(length(rmb_text))
+ context[SCREENTIP_CONTEXT_RMB] = rmb_text
+
+ return CONTEXTUAL_SCREENTIP_SET
diff --git a/code/datums/elements/screentips/contextual_screentip_item_typechecks.dm b/code/datums/elements/screentips/contextual_screentip_item_typechecks.dm
new file mode 100644
index 0000000000..44ff1f3190
--- /dev/null
+++ b/code/datums/elements/screentips/contextual_screentip_item_typechecks.dm
@@ -0,0 +1,47 @@
+/// Apply basic contextual screentips when the user hovers over this item with a provided item.
+/// A "Type B" interaction.
+/// This stacks with other contextual screentip elements, though you may want to register the signal/flag manually at that point for performance.
+/datum/element/contextual_screentip_item_typechecks
+ element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH
+ id_arg_index = 2
+
+ /// Map of item paths to contexts to usages
+ var/list/item_paths_to_contexts
+
+/datum/element/contextual_screentip_item_typechecks/Attach(datum/target, item_paths_to_contexts)
+ . = ..()
+ if (!isatom(target))
+ return ELEMENT_INCOMPATIBLE
+
+ src.item_paths_to_contexts = item_paths_to_contexts
+
+ var/atom/atom_target = target
+ atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
+ RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
+
+/datum/element/contextual_screentip_item_typechecks/Detach(datum/source, ...)
+ UnregisterSignal(source, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM)
+
+ // We don't remove HAS_CONTEXTUAL_SCREENTIPS_1, since there could be other stuff still hooked to it,
+ // and being set without signals is not dangerous, just less performant.
+ // A lot of things don't do this, perhaps make a proc that checks if any signals are still set, and if not,
+ // remove the flag.
+
+ return ..()
+
+/datum/element/contextual_screentip_item_typechecks/proc/on_requesting_context_from_item(
+ datum/source,
+ list/context,
+ obj/item/held_item,
+)
+ SIGNAL_HANDLER
+
+ if (isnull(held_item))
+ return NONE
+
+ for (var/item_path in item_paths_to_contexts)
+ if (istype(held_item, item_path))
+ context += item_paths_to_contexts[item_path]
+ return CONTEXTUAL_SCREENTIP_SET
+
+ return NONE
diff --git a/code/datums/elements/screentips/contextual_screentip_sharpness.dm b/code/datums/elements/screentips/contextual_screentip_sharpness.dm
new file mode 100644
index 0000000000..0ee89f2fd7
--- /dev/null
+++ b/code/datums/elements/screentips/contextual_screentip_sharpness.dm
@@ -0,0 +1,57 @@
+/// Apply basic contextual screentips when the user hovers over this item with an item of the given tool behavior.
+/// A "Type B" interaction.
+/// This stacks with other contextual screentip elements, though you may want to register the signal/flag manually at that point for performance.
+/datum/element/contextual_screentip_sharpness
+ element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH
+ id_arg_index = 2
+
+ /// If set, the text to show for LMB
+ var/list/lmb_text
+
+ /// If set, the text to show for RMB
+ var/list/rmb_text
+
+/datum/element/contextual_screentip_sharpness/Attach(datum/target, lmb_text, rmb_text)
+ . = ..()
+ if (!isatom(target))
+ return ELEMENT_INCOMPATIBLE
+
+ src.lmb_text = lmb_text
+ src.rmb_text = rmb_text
+
+ var/atom/atom_target = target
+ atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
+ RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
+
+/datum/element/contextual_screentip_sharpness/Detach(datum/source, ...)
+ UnregisterSignal(source, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM)
+
+ // We don't remove HAS_CONTEXTUAL_SCREENTIPS_1, since there could be other stuff still hooked to it,
+ // and being set without signals is not dangerous, just less performant.
+ // A lot of things don't do this, perhaps make a proc that checks if any signals are still set, and if not,
+ // remove the flag.
+
+ return ..()
+
+/datum/element/contextual_screentip_sharpness/proc/on_requesting_context_from_item(
+ datum/source,
+ list/context,
+ obj/item/held_item,
+)
+ SIGNAL_HANDLER
+
+ if (isnull(held_item))
+ return NONE
+
+ var/sharpness = held_item.get_sharpness()
+ if (!sharpness)
+ return NONE
+
+ if (length(lmb_text))
+ context[SCREENTIP_CONTEXT_LMB] = lmb_text
+
+ if (length(rmb_text))
+ context[SCREENTIP_CONTEXT_RMB] = rmb_text
+
+ return CONTEXTUAL_SCREENTIP_SET
+
diff --git a/code/datums/elements/screentips/contextual_screentip_tools.dm b/code/datums/elements/screentips/contextual_screentip_tools.dm
new file mode 100644
index 0000000000..a0850f8742
--- /dev/null
+++ b/code/datums/elements/screentips/contextual_screentip_tools.dm
@@ -0,0 +1,48 @@
+/// Apply basic contextual screentips when the user hovers over this item with an item of the given tool behavior.
+/// A "Type B" interaction.
+/// This stacks with other contextual screentip elements, though you may want to register the signal/flag manually at that point for performance.
+/datum/element/contextual_screentip_tools
+ element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH
+ id_arg_index = 2
+
+ /// Map of tool behaviors to contexts to usages
+ var/list/tool_behaviors
+
+/datum/element/contextual_screentip_tools/Attach(datum/target, tool_behaviors)
+ . = ..()
+ if (!isatom(target))
+ return ELEMENT_INCOMPATIBLE
+
+ src.tool_behaviors = tool_behaviors
+
+ var/atom/atom_target = target
+ atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
+ RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item)
+
+/datum/element/contextual_screentip_tools/Detach(datum/source, ...)
+ UnregisterSignal(source, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM)
+
+ // We don't remove HAS_CONTEXTUAL_SCREENTIPS_1, since there could be other stuff still hooked to it,
+ // and being set without signals is not dangerous, just less performant.
+ // A lot of things don't do this, perhaps make a proc that checks if any signals are still set, and if not,
+ // remove the flag.
+
+ return ..()
+
+/datum/element/contextual_screentip_tools/proc/on_requesting_context_from_item(
+ datum/source,
+ list/context,
+ obj/item/held_item,
+)
+ SIGNAL_HANDLER
+
+ if (isnull(held_item))
+ return NONE
+
+ var/tool_behavior = held_item.tool_behaviour
+ if (!(tool_behavior in tool_behaviors))
+ return NONE
+
+ context += tool_behaviors[tool_behavior]
+
+ return CONTEXTUAL_SCREENTIP_SET
diff --git a/code/datums/screentips/atom_context.dm b/code/datums/screentips/atom_context.dm
new file mode 100644
index 0000000000..ae71d6f929
--- /dev/null
+++ b/code/datums/screentips/atom_context.dm
@@ -0,0 +1,25 @@
+/// Create a "Type-B" contextual screentip interaction, registering to `add_context()`.
+/// This will run `add_context()` when the atom is hovered over by an item for context.
+/// `add_context()` will *not* be called unless this is run.
+/// This is not necessary for Type-B interactions, as you can just apply the flag and register to the signal yourself.
+/atom/proc/register_context()
+ flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
+ RegisterSignal(src, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/add_context)
+
+/// Creates a "Type-B" contextual screentip interaction.
+/// When a user hovers over this, this proc will be called in order
+/// to provide context for contextual screentips.
+/// You must call `register_context()` in order for this to be registered.
+/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
+/// that map to the action as text.
+/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
+/// `source` can, in all cases, be replaced with `src`, and only exists because this proc directly connects to a signal.
+/atom/proc/add_context(
+ atom/source,
+ list/context,
+ obj/item/held_item,
+ mob/living/user,
+)
+ SIGNAL_HANDLER
+
+ return NONE
diff --git a/code/datums/screentips/item_context.dm b/code/datums/screentips/item_context.dm
new file mode 100644
index 0000000000..239cd18683
--- /dev/null
+++ b/code/datums/screentips/item_context.dm
@@ -0,0 +1,29 @@
+/// Create a "Type-A" contextual screentip interaction, registering to `add_item_context()`.
+/// This will run `add_item_context()` when the item hovers over another object for context.
+/// `add_item_context()` will *not* be called unless this is run.
+/// This is not necessary for Type-A interactions, as you can just apply the flag and register to the signal yourself.
+/obj/item/proc/register_item_context()
+ item_flags |= ITEM_HAS_CONTEXTUAL_SCREENTIPS
+ RegisterSignal(
+ src,
+ COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET,
+ .proc/add_item_context,
+ )
+
+/// Creates a "Type-A" contextual screentip interaction.
+/// When a user hovers over something with this item in hand, this proc will be called in order
+/// to provide context for contextual screentips.
+/// You must call `register_item_context()` in order for this to be registered.
+/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
+/// that map to the action as text.
+/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
+/// `source` can, in all cases, be replaced with `src`, and only exists because this proc directly connects to a signal.
+/obj/item/proc/add_item_context(
+ obj/item/source,
+ list/context,
+ atom/target,
+ mob/living/user,
+)
+ SIGNAL_HANDLER
+
+ return NONE
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 089bb78a3e..0b0843c67e 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1466,11 +1466,97 @@
/atom/MouseEntered(location, control, params)
. = ..()
// Screentips
- var/client/client = usr?.client
- var/datum/hud/active_hud = client?.mob?.hud_used
+ var/mob/user = usr
+ if(isnull(user) && !user.client)
+ return
+
+ var/datum/hud/active_hud = user.hud_used
if(active_hud)
- if(!client.prefs.screentip_pref || (flags_1 & NO_SCREENTIPS_1))
+ var/screentips_enabled = user.client.prefs.screentip_pref
+ if(screentips_enabled == SCREENTIP_PREFERENCE_DISABLED || (flags_1 & NO_SCREENTIPS_1))
active_hud.screentip_text.maptext = ""
else
- //We inline a MAPTEXT() here, because there's no good way to statically add to a string like this
- active_hud.screentip_text.maptext = MAPTEXT("[name]")
+ active_hud.screentip_text.maptext_y = 0
+ var/lmb_rmb_line = ""
+ var/ctrl_lmb_ctrl_rmb_line = ""
+ var/alt_lmb_alt_rmb_line = ""
+ var/shift_lmb_ctrl_shift_lmb_line = ""
+ var/extra_lines = 0
+ var/extra_context = ""
+
+ if (isliving(user) || isovermind(user) || isaicamera(user))
+ var/obj/item/held_item = user.get_active_held_item()
+
+ if (flags_1 & HAS_CONTEXTUAL_SCREENTIPS_1 || held_item?.item_flags & ITEM_HAS_CONTEXTUAL_SCREENTIPS)
+ var/list/context = list()
+
+ var/contextual_screentip_returns = \
+ SEND_SIGNAL(src, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, context, held_item, user) \
+ | (held_item && SEND_SIGNAL(held_item, COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET, context, src, user))
+
+ if (contextual_screentip_returns & CONTEXTUAL_SCREENTIP_SET)
+ // LMB and RMB on one line...
+ var/lmb_text = ""
+ if((SCREENTIP_CONTEXT_LMB in context) && (length(context[SCREENTIP_CONTEXT_LMB]) > 0))
+ lmb_text = build_context(context, SCREENTIP_CONTEXT_LMB)
+ var/rmb_text = ""
+ if((SCREENTIP_CONTEXT_RMB in context) && (length(context[SCREENTIP_CONTEXT_RMB]) > 0))
+ rmb_text = build_context(context, SCREENTIP_CONTEXT_RMB)
+
+ if (lmb_text)
+ lmb_rmb_line = lmb_text
+ if (rmb_text)
+ lmb_rmb_line += " | [rmb_text]"
+ else if (rmb_text)
+ lmb_rmb_line = rmb_text
+
+ // Ctrl-LMB, Ctrl-RMB on one line...
+ if (lmb_rmb_line != "")
+ lmb_rmb_line += "
"
+ extra_lines++
+ if((SCREENTIP_CONTEXT_CTRL_LMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_LMB]) > 0))
+ ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_LMB)
+
+ if((SCREENTIP_CONTEXT_CTRL_RMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_RMB]) > 0))
+ if (ctrl_lmb_ctrl_rmb_line != "")
+ ctrl_lmb_ctrl_rmb_line += " | "
+ ctrl_lmb_ctrl_rmb_line += "[SCREENTIP_CONTEXT_CTRL_RMB]: [context[SCREENTIP_CONTEXT_CTRL_RMB]]"
+ ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_RMB)
+
+ // Alt-LMB, Alt-RMB on one line...
+ if (ctrl_lmb_ctrl_rmb_line != "")
+ ctrl_lmb_ctrl_rmb_line += "
"
+ extra_lines++
+ if((SCREENTIP_CONTEXT_ALT_LMB in context) && (length(context[SCREENTIP_CONTEXT_ALT_LMB]) > 0))
+ alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_LMB)
+ if((SCREENTIP_CONTEXT_ALT_RMB in context) && (length(context[SCREENTIP_CONTEXT_ALT_RMB]) > 0))
+ if (alt_lmb_alt_rmb_line != "")
+ alt_lmb_alt_rmb_line += " | "
+ alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_RMB)
+
+ // Shift-LMB, Ctrl-Shift-LMB on one line...
+ if (alt_lmb_alt_rmb_line != "")
+ alt_lmb_alt_rmb_line += "
"
+ extra_lines++
+ if((SCREENTIP_CONTEXT_SHIFT_LMB in context) && (length(context[SCREENTIP_CONTEXT_SHIFT_LMB]) > 0))
+ shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_SHIFT_LMB)
+
+ if((SCREENTIP_CONTEXT_CTRL_SHIFT_LMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]) > 0))
+ if (shift_lmb_ctrl_shift_lmb_line != "")
+ shift_lmb_ctrl_shift_lmb_line += " | "
+ shift_lmb_ctrl_shift_lmb_line += "[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]: [context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]]"
+ shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_SHIFT_LMB)
+
+ if (shift_lmb_ctrl_shift_lmb_line != "")
+ extra_lines++
+
+ if(extra_lines)
+ extra_context = "
[lmb_rmb_line][ctrl_lmb_ctrl_rmb_line][alt_lmb_alt_rmb_line][shift_lmb_ctrl_shift_lmb_line]"
+ //first extra line pushes atom name line up 10px, subsequent lines push it up 9px, this offsets that and keeps the first line in the same place
+ active_hud.screentip_text.maptext_y = -10 + (extra_lines - 1) * -9
+
+ if (screentips_enabled == SCREENTIP_PREFERENCE_CONTEXT_ONLY && extra_context == "")
+ active_hud.screentip_text.maptext = ""
+ else
+ //We inline a MAPTEXT() here, because there's no good way to statically add to a string like this
+ active_hud.screentip_text.maptext = "[name][extra_context]"
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 21c3da4ab1..4b60569742 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -605,6 +605,16 @@
animate(time = 1)
animate(alpha = 0, time = 3, easing = CIRCULAR_EASING|EASE_OUT)
+/// Common proc used by painting tools like spraycans and palettes that can access the entire 24 bits color space.
+/obj/item/proc/pick_painting_tool_color(mob/user, default_color)
+ var/chosen_color = input(user,"Pick new color", "[src]", default_color) as color|null
+ if(!chosen_color || QDELETED(src) || IS_DEAD_OR_INCAP(user) || !user.is_holding(src))
+ return
+ set_painting_tool_color(chosen_color)
+
+/obj/item/proc/set_painting_tool_color(chosen_color)
+ SEND_SIGNAL(src, COMSIG_PAINTING_TOOL_SET_COLOR, chosen_color)
+
/atom/movable/vv_get_dropdown()
. = ..()
. += ""
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 84e7b93e1b..0b31ecdf9f 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -697,6 +697,42 @@
. += "Alt-click [src] to [ secondsElectrified ? "un-electrify" : "permanently electrify"] it."
. += "Ctrl-Shift-click [src] to [ emergency ? "disable" : "enable"] emergency access."
+/obj/machinery/door/airlock/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if(istype(held_item, /obj/item/stack/sheet/plasteel))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Reinforce")
+ return CONTEXTUAL_SCREENTIP_SET
+
+ switch (held_item?.tool_behaviour)
+ if (TOOL_CROWBAR)
+ if (panel_open)
+ if (security_level == AIRLOCK_SECURITY_PLASTEEL_O_S || security_level == AIRLOCK_SECURITY_PLASTEEL_I_S)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Remove shielding")
+ return CONTEXTUAL_SCREENTIP_SET
+ else if (should_try_removing_electronics())
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Remove electronics")
+ return CONTEXTUAL_SCREENTIP_SET
+
+ // Not always contextually true, but is contextually false in ways that make gameplay interesting.
+ // For example, trying to pry open an airlock, only for the bolts to be down and the lights off.
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Pry open")
+
+ return CONTEXTUAL_SCREENTIP_SET
+ if (TOOL_WELDER)
+ LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Weld shut")
+
+ if (panel_open)
+ switch (security_level)
+ if (AIRLOCK_SECURITY_METAL, AIRLOCK_SECURITY_PLASTEEL_I, AIRLOCK_SECURITY_PLASTEEL_O)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Cut shielding")
+ return CONTEXTUAL_SCREENTIP_SET
+
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Repair")
+ return CONTEXTUAL_SCREENTIP_SET
+
+ return .
+
/obj/machinery/door/airlock/attack_ai(mob/user)
if(!src.canAIControl(user))
if(src.canAIHack())
@@ -1024,6 +1060,31 @@
return
return !operating && density
+/// Returns if a crowbar would remove the airlock electronics
+/obj/machinery/door/airlock/proc/should_try_removing_electronics()
+ if (security_level != 0)
+ return FALSE
+
+ if (!panel_open)
+ return FALSE
+
+ if (obj_flags & EMAGGED)
+ return TRUE
+
+ if (!density)
+ return FALSE
+
+ if (!welded)
+ return FALSE
+
+ if (hasPower())
+ return FALSE
+
+ if (locked)
+ return FALSE
+
+ return TRUE
+
/obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/living/user)
var/beingcrowbarred = null
if(I.tool_behaviour == TOOL_CROWBAR)
@@ -1042,9 +1103,9 @@
charge.forceMove(get_turf(user))
charge = null
return
- if(beingcrowbarred && panel_open && ((obj_flags & EMAGGED) || (density && welded && !operating && !hasPower() && !locked)))
- user.visible_message("[user] removes the electronics from the airlock assembly.", \
- "You start to remove electronics from the airlock assembly...")
+ if(beingcrowbarred && should_try_removing_electronics() && !operating)
+ user.visible_message(span_notice("[user] removes the electronics from the airlock assembly."), \
+ span_notice("You start to remove electronics from the airlock assembly..."))
if(I.use_tool(src, user, 40, volume=100))
deconstruct(TRUE, user)
return
@@ -1201,81 +1262,29 @@
locked = TRUE
return
-
-/obj/machinery/door/airlock/proc/change_paintjob(obj/item/airlock_painter/W, mob/user)
- if(!W.can_use(user))
+// gets called when a player uses an airlock painter on this airlock
+/obj/machinery/door/airlock/proc/change_paintjob(obj/item/airlock_painter/painter, mob/user)
+ if((!in_range(src, user) && loc != user) || !painter.can_use(user)) // user should be adjacent to the airlock, and the painter should have a toner cartridge that isn't empty
return
- var/list/optionlist
- if(airlock_material == "glass")
- optionlist = list("Standard", "Public", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Science", "Virology", "Mining", "Maintenance", "External", "External Maintenance")
- else
- optionlist = list("Standard", "Public", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Freezer", "Science", "Virology", "Mining", "Maintenance", "External", "External Maintenance")
-
- var/paintjob = input(user, "Please select a paintjob for this airlock.") in optionlist
- if((!in_range(src, usr) && src.loc != usr) || !W.use_paint(user))
+ // reads from the airlock painter's `available paintjob` list. lets the player choose a paint option, or cancel painting
+ var/current_paintjob = tgui_input_list(user, "Paintjob for this airlock", "Customize", sortList(painter.available_paint_jobs))
+ if(isnull(current_paintjob)) // if the user clicked cancel on the popup, return
return
- switch(paintjob)
- if("Standard")
- icon = 'icons/obj/doors/airlocks/station/public.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly
- if("Public")
- icon = 'icons/obj/doors/airlocks/station2/glass.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station2/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_public
- if("Engineering")
- icon = 'icons/obj/doors/airlocks/station/engineering.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_eng
- if("Atmospherics")
- icon = 'icons/obj/doors/airlocks/station/atmos.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_atmo
- if("Security")
- icon = 'icons/obj/doors/airlocks/station/security.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_sec
- if("Command")
- icon = 'icons/obj/doors/airlocks/station/command.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_com
- if("Medical")
- icon = 'icons/obj/doors/airlocks/station/medical.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_med
- if("Research")
- icon = 'icons/obj/doors/airlocks/station/research.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_research
- if("Freezer")
- icon = 'icons/obj/doors/airlocks/station/freezer.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_fre
- if("Science")
- icon = 'icons/obj/doors/airlocks/station/science.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_science
- if("Virology")
- icon = 'icons/obj/doors/airlocks/station/virology.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_viro
- if("Mining")
- icon = 'icons/obj/doors/airlocks/station/mining.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_min
- if("Maintenance")
- icon = 'icons/obj/doors/airlocks/station/maintenance.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_mai
- if("External")
- icon = 'icons/obj/doors/airlocks/external/external.dmi'
- overlays_file = 'icons/obj/doors/airlocks/external/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_ext
- if("External Maintenance")
- icon = 'icons/obj/doors/airlocks/station/maintenanceexternal.dmi'
- overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
- assemblytype = /obj/structure/door_assembly/door_assembly_extmai
+
+ var/airlock_type = painter.available_paint_jobs["[current_paintjob]"] // get the airlock type path associated with the airlock name the user just chose
+ var/obj/machinery/door/airlock/airlock = airlock_type // we need to create a new instance of the airlock and assembly to read vars from them
+ var/obj/structure/door_assembly/assembly = initial(airlock.assemblytype)
+
+ if(airlock_material == "glass" && initial(assembly.noglass)) // prevents painting glass airlocks with a paint job that doesn't have a glass version, such as the freezer
+ to_chat(user, span_warning("This paint job can only be applied to non-glass airlocks."))
+ return
+
+ // applies the user-chosen airlock's icon, overlays and assemblytype to the src airlock
+ painter.use_paint(user)
+ icon = initial(airlock.icon)
+ overlays_file = initial(airlock.overlays_file)
+ assemblytype = initial(airlock.assemblytype)
update_icon()
/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index ef47a0e7f6..d565984bf0 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -55,6 +55,13 @@
if(!poddoor)
. += "Its maintenance panel is screwed in place."
+/obj/machinery/door/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if (isnull(held_item) && !istype(src, /obj/machinery/door/firedoor)) // You cannot open/close with your hands
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (density ? "Open" : "Close"))
+ return CONTEXTUAL_SCREENTIP_SET
+
/obj/machinery/door/check_access_list(list/access_list)
if(red_alert_access && GLOB.security_level >= SEC_LEVEL_RED)
return TRUE
@@ -65,6 +72,7 @@
set_init_door_layer()
update_freelook_sight()
air_update_turf(1)
+ register_context()
GLOB.airlocks += src
spark_system = new /datum/effect_system/spark_spread
spark_system.set_up(2, 1, src)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index c0866ce165..b094f5c28a 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -46,6 +46,34 @@
else
. += "The bolt locks have been unscrewed, but the bolts themselves are still wrenched to the floor."
+/obj/machinery/door/firedoor/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if (isnull(held_item))
+ if (density)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Knock")
+ return CONTEXTUAL_SCREENTIP_SET
+ else
+ return .
+
+ switch (held_item.tool_behaviour)
+ if (TOOL_CROWBAR)
+ if(!welded)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (density ? "Open" : "Close"))
+ return CONTEXTUAL_SCREENTIP_SET
+ if (TOOL_WELDER)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (welded ? "Unweld shut" : "Weld shut"))
+ return CONTEXTUAL_SCREENTIP_SET
+ if (TOOL_WRENCH)
+ if (welded && !boltslocked)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Unfasten bolts")
+ return CONTEXTUAL_SCREENTIP_SET
+ if (TOOL_SCREWDRIVER)
+ if (welded)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (boltslocked ? "Unlock bolts" : "Lock bolts"))
+ return CONTEXTUAL_SCREENTIP_SET
+ return .
+
/obj/machinery/door/firedoor/proc/CalculateAffectingAreas()
remove_from_areas()
affecting_areas = get_adjacent_open_areas(src) | get_base_area(src)
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index fe756b4022..1fbab1f75d 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -56,6 +56,15 @@
LAZYADD(myarea.firealarms, src)
wires = new /datum/wires/firealarm(src)
+ register_context()
+
+/obj/machinery/firealarm/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if(isnull(held_item))
+ var/area/location = get_area(src)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (location.fire ? "Turn off" : "Turn on"))
+ return CONTEXTUAL_SCREENTIP_SET
/obj/machinery/firealarm/Destroy()
myarea.firereset(src)
diff --git a/code/game/objects/items/airlock_painter.dm b/code/game/objects/items/airlock_painter.dm
index 5bd8ecc85e..b239033dca 100644
--- a/code/game/objects/items/airlock_painter.dm
+++ b/code/game/objects/items/airlock_painter.dm
@@ -1,10 +1,11 @@
/obj/item/airlock_painter
name = "airlock painter"
desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
+// desc_controls = "Alt-Click to remove the ink cartridge."
icon = 'icons/obj/objects.dmi'
- icon_state = "paint sprayer"
- item_state = "paint sprayer"
-
+ icon_state = "paint_sprayer"
+ item_state = "paint_sprayer" // inhand_icon_state = "paint_sprayer"
+ // worn_icon_state = "painter"
w_class = WEIGHT_CLASS_SMALL
custom_materials = list(/datum/material/iron=50, /datum/material/glass=50)
@@ -14,40 +15,66 @@
slot_flags = ITEM_SLOT_BELT
usesound = 'sound/effects/spray2.ogg'
+ /// The ink cartridge to pull charges from.
var/obj/item/toner/ink = null
+ /// The type path to instantiate for the ink cartridge the device initially comes with, eg. /obj/item/toner
+ var/initial_ink_type = /obj/item/toner
+ /// Associate list of all paint jobs the airlock painter can apply. The key is the name of the airlock the user will see. The value is the type path of the airlock
+ var/list/available_paint_jobs = list(
+ "Public" = /obj/machinery/door/airlock/public,
+ "Engineering" = /obj/machinery/door/airlock/engineering,
+ "Atmospherics" = /obj/machinery/door/airlock/atmos,
+ "Security" = /obj/machinery/door/airlock/security,
+ "Command" = /obj/machinery/door/airlock/command,
+ "Medical" = /obj/machinery/door/airlock/medical,
+ "Virology" = /obj/machinery/door/airlock/virology,
+ "Research" = /obj/machinery/door/airlock/research,
+// "Hydroponics" = /obj/machinery/door/airlock/hydroponics,
+ "Freezer" = /obj/machinery/door/airlock/freezer,
+ "Science" = /obj/machinery/door/airlock/science,
+ "Mining" = /obj/machinery/door/airlock/mining,
+ "Maintenance" = /obj/machinery/door/airlock/maintenance,
+ "External" = /obj/machinery/door/airlock/external,
+ "External Maintenance"= /obj/machinery/door/airlock/maintenance/external,
+ "Standard" = /obj/machinery/door/airlock
+ )
/obj/item/airlock_painter/Initialize(mapload)
. = ..()
- ink = new /obj/item/toner(src)
+ ink = new initial_ink_type(src)
+
+/obj/item/airlock_painter/examine(mob/user)
+ . = ..()
+ . += span_notice("Alt-Click to remove the ink cartridge.")
//This proc doesn't just check if the painter can be used, but also uses it.
//Only call this if you are certain that the painter will be used right after this check!
/obj/item/airlock_painter/proc/use_paint(mob/user)
if(can_use(user))
ink.charges--
- playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)
- return 1
+ playsound(src.loc, 'sound/effects/spray2.ogg', 50, TRUE)
+ return TRUE
else
- return 0
+ return FALSE
//This proc only checks if the painter can be used.
//Call this if you don't want the painter to be used right after this check, for example
//because you're expecting user input.
/obj/item/airlock_painter/proc/can_use(mob/user)
if(!ink)
- to_chat(user, "There is no toner cartridge installed in [src]!")
- return 0
+ balloon_alert(user, "no cartridge!")
+ return FALSE
else if(ink.charges < 1)
- to_chat(user, "[src] is out of ink!")
- return 0
+ balloon_alert(user, "out of ink!")
+ return FALSE
else
- return 1
+ return TRUE
-/obj/item/airlock_painter/suicide_act(mob/user)
+/obj/item/airlock_painter/suicide_act(mob/living/user)
var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
if(can_use(user) && L)
- user.visible_message("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!")
+ user.visible_message(span_suicide("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
use(user)
// Once you've inhaled the toner, you throw up your lungs
@@ -64,7 +91,7 @@
if(!L)
return OXYLOSS
- L.Remove()
+ L.Remove(user)
// make some colorful reagent, and apply it to the lungs
L.create_reagents(10, NONE, NO_REAGENTS_VALUE)
@@ -73,27 +100,27 @@
// TODO maybe add some colorful vomit?
- user.visible_message("[user] vomits out [user.p_their()] [L]!")
- playsound(user.loc, 'sound/effects/splat.ogg', 50, 1)
+ user.visible_message(span_suicide("[user] vomits out [user.p_their()] [L]!"))
+ playsound(user.loc, 'sound/effects/splat.ogg', 50, TRUE)
L.forceMove(T)
return (TOXLOSS|OXYLOSS)
else if(can_use(user) && !L)
- user.visible_message("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.")
+ user.visible_message(span_suicide("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide."))
user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1)
user.reagents.reaction(user, TOUCH, 1)
return TOXLOSS
else
- user.visible_message("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.")
+ user.visible_message(span_suicide("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner."))
return SHAME
/obj/item/airlock_painter/examine(mob/user)
. = ..()
if(!ink)
- . += "It doesn't have a toner cartridge installed."
+ . += span_notice("It doesn't have a toner cartridge installed.")
return
var/ink_level = "high"
if(ink.charges < 1)
@@ -102,89 +129,129 @@
ink_level = "low"
else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit)
ink_level = "dangerously high"
- . += "Its ink levels look [ink_level]."
+ . += span_notice("Its ink levels look [ink_level].")
/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/toner))
if(ink)
- to_chat(user, "[src] already contains \a [ink].")
+ to_chat(user, span_warning("[src] already contains \a [ink]!"))
return
if(!user.transferItemToLoc(W, src))
return
- to_chat(user, "You install [W] into [src].")
+ to_chat(user, span_notice("You install [W] into [src]."))
ink = W
- playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
+ playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
else
return ..()
-/obj/item/airlock_painter/attack_self(mob/user)
+/obj/item/airlock_painter/AltClick(mob/user)
+ . = ..()
if(ink)
- playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
+ playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
ink.forceMove(user.drop_location())
user.put_in_hands(ink)
- to_chat(user, "You remove [ink] from [src].")
+ to_chat(user, span_notice("You remove [ink] from [src]."))
ink = null
-
/obj/item/airlock_painter/decal
name = "decal painter"
- desc = "An airlock painter, reprogramed to use a different style of paint in order to apply decals for floor tiles as well, in addition to repainting doors. Decals break when the floor tiles are removed. Alt-Click to change design."
+ desc = "An airlock painter, reprogramed to use a different style of paint in order to apply decals for floor tiles as well, in addition to repainting doors. Decals break when the floor tiles are removed."
+// desc_controls = "Alt-Click to remove the ink cartridge."
icon = 'icons/obj/objects.dmi'
icon_state = "decal_sprayer"
- item_state = "decalsprayer"
- custom_materials = list(/datum/material/iron=2000, /datum/material/glass=500)
+ item_state = "decal_sprayer" // inhand_icon_state = "decal_sprayer"
+ custom_materials = list(/datum/material/iron=50, /datum/material/glass=50)
+ initial_ink_type = /obj/item/toner/large
+ /// The current direction of the decal being printed
var/stored_dir = 2
- var/stored_color = ""
+ /// The current color of the decal being printed.
+ var/stored_color = "yellow"
+ /// The current base icon state of the decal being printed.
var/stored_decal = "warningline"
+ /// The full icon state of the decal being printed.
var/stored_decal_total = "warningline"
- var/color_list = list("","red","white")
- var/dir_list = list(1,2,4,8)
+ /// The type path of the spritesheet being used for the frontend.
+ var/spritesheet_type = /datum/asset/spritesheet/decals // spritesheet containing previews
+ /// Does this printer implementation support custom colors?
+ var/supports_custom_color = FALSE
+ /// Current custom color
+ var/stored_custom_color
+ /// List of color options as list(user-friendly label, color value to return)
+ var/color_list = list(
+ list("Yellow", "yellow"),
+ list("Red", "red"),
+ list("White", "white"),
+ )
+ /// List of direction options as list(user-friendly label, dir value to return)
+ var/dir_list = list(
+ list("North", NORTH),
+ list("South", SOUTH),
+ list("East", EAST),
+ list("West", WEST),
+ )
+ /// List of decal options as list(user-friendly label, icon state base value to return)
var/decal_list = list(
- list("Warning Line","warningline"),
- list("Warning Line Corner","warninglinecorner"),
- list("Caution Label","caution"),
- list("Directional Arrows","arrows"),
- list("Stand Clear Label","stand_clear"),
- list("Box","box"),
- list("Box Corner","box_corners"),
- list("Delivery Marker","delivery"),
- list("Warning Box","warn_full"))
-
-/obj/item/airlock_painter/decal/afterattack(atom/target, mob/user, proximity)
- . = ..()
- var/turf/open/floor/F = target
- if(!proximity)
- to_chat(user, "You need to get closer!")
- return
- if(use_paint(user) && isturf(F))
- F.AddElement(/datum/element/decal, 'icons/turf/decals.dmi', stored_decal_total, stored_dir, CLEAN_STRONG, color, null, null, alpha)
-
-/obj/item/airlock_painter/decal/attack_self(mob/user)
- if((ink) && (ink.charges >= 1))
- to_chat(user, "[src] beeps to prevent you from removing the toner until out of charges.")
- return
- . = ..()
-
-/obj/item/airlock_painter/decal/AltClick(mob/user)
- . = ..()
- ui_interact(user)
+ list("Warning Line", "warningline"),
+ list("Warning Line Corner", "warninglinecorner"),
+ list("Caution Label", "caution"),
+ list("Directional Arrows", "arrows"),
+ list("Stand Clear Label", "stand_clear"),
+ list("Bot", "bot"),
+ list("Box", "box"),
+ list("Box Corner", "box_corners"),
+ list("Delivery Marker", "delivery"),
+ list("Warning Box", "warn_full"),
+ )
+ // These decals only have a south sprite.
+ var/nondirectional_decals = list(
+ "bot",
+ "box",
+ "delivery",
+ "warn_full",
+ )
/obj/item/airlock_painter/decal/Initialize(mapload)
. = ..()
- ink = new /obj/item/toner/large(src)
+ stored_custom_color = stored_color
+
+/obj/item/airlock_painter/decal/afterattack(atom/target, mob/user, proximity)
+ . = ..()
+ if(!proximity)
+ balloon_alert(user, "get closer!")
+ return
+
+ if(isfloorturf(target) && use_paint(user))
+ paint_floor(target)
+
+/**
+ * Actually add current decal to the floor.
+ *
+ * Responsible for actually adding the element to the turf for maximum flexibility.area
+ * Can be overriden for different decal behaviors.
+ * Arguments:
+ * * target - The turf being painted to
+*/
+/obj/item/airlock_painter/decal/proc/paint_floor(turf/open/floor/target)
+ target.AddElement(/datum/element/decal, 'icons/turf/decals.dmi', stored_decal_total, stored_dir, CLEAN_STRONG, color, null, null, alpha)
+
+/**
+ * Return the final icon_state for the given decal options
+ *
+ * Arguments:
+ * * decal - the selected decal base icon state
+ * * color - the selected color
+ * * dir - the selected dir
+ */
+/obj/item/airlock_painter/decal/proc/get_decal_path(decal, color, dir)
+ // Special case due to icon_state names
+ if(color == "yellow")
+ color = ""
+
+ return "[decal][color ? "_" : ""][color]"
/obj/item/airlock_painter/decal/proc/update_decal_path()
- var/yellow_fix = "" //This will have to do until someone refactor's markings.dm
- if (stored_color)
- yellow_fix = "_"
- stored_decal_total = "[stored_decal][yellow_fix][stored_color]"
- return
-
-/obj/item/airlock_painter/decal/ui_assets(mob/user)
- return list(
- get_asset_datum(/datum/asset/spritesheet/decals)
- )
+ stored_decal_total = get_decal_path(stored_decal, stored_color, stored_dir)
/obj/item/airlock_painter/decal/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -192,52 +259,215 @@
ui = new(user, src, "DecalPainter", name)
ui.open()
+/obj/item/airlock_painter/decal/ui_assets(mob/user)
+ . = ..()
+ . += get_asset_datum(spritesheet_type)
+
+/obj/item/airlock_painter/decal/ui_static_data(mob/user)
+ . = ..()
+ var/datum/asset/spritesheet/icon_assets = get_asset_datum(spritesheet_type)
+
+ .["icon_prefix"] = "[icon_assets.name]32x32"
+ .["supports_custom_color"] = supports_custom_color
+ .["decal_list"] = list()
+ .["color_list"] = list()
+ .["dir_list"] = list()
+ .["nondirectional_decals"] = nondirectional_decals
+
+ for(var/decal in decal_list)
+ .["decal_list"] += list(list(
+ "name" = decal[1],
+ "decal" = decal[2],
+ ))
+ for(var/color in color_list)
+ .["color_list"] += list(list(
+ "name" = color[1],
+ "color" = color[2],
+ ))
+ for(var/dir in dir_list)
+ .["dir_list"] += list(list(
+ "name" = dir[1],
+ "dir" = dir[2],
+ ))
+
/obj/item/airlock_painter/decal/ui_data(mob/user)
- var/list/data = list()
- data["decal_direction"] = stored_dir
- data["decal_dir_text"] = dir2text(stored_dir)
- data["decal_color"] = stored_color
- data["decal_style"] = stored_decal
- data["decal_list"] = list()
- data["color_list"] = list()
- data["dir_list"] = list()
+ . = ..()
+ .["current_decal"] = stored_decal
+ .["current_color"] = stored_color
+ .["current_dir"] = stored_dir
+ .["current_custom_color"] = stored_custom_color
- for(var/i in decal_list)
- data["decal_list"] += list(list(
- "name" = i[1],
- "decal" = i[2]
- ))
- for(var/j in color_list)
- data["color_list"] += list(list(
- "colors" = j
- ))
- for(var/k in dir_list)
- data["dir_list"] += list(list(
- "dirs" = k
- ))
- return data
-
-/obj/item/airlock_painter/decal/ui_act(action,list/params)
- if(..())
+/obj/item/airlock_painter/decal/ui_act(action, list/params)
+ . = ..()
+ if(.)
return
+
switch(action)
//Lists of decals and designs
if("select decal")
- var/selected_decal = params["decals"]
+ var/selected_decal = params["decal"]
+ var/selected_dir = text2num(params["dir"])
stored_decal = selected_decal
+ stored_dir = selected_dir
if("select color")
- var/selected_color = params["colors"]
+ var/selected_color = params["color"]
stored_color = selected_color
- if("selected direction")
- var/selected_direction = text2num(params["dirs"])
- stored_dir = selected_direction
+ if("pick custom color")
+ if(supports_custom_color)
+ pick_painting_tool_color(usr, stored_custom_color)
update_decal_path()
. = TRUE
+/obj/item/airlock_painter/decal/set_painting_tool_color(chosen_color)
+ . = ..()
+ stored_custom_color = chosen_color
+ stored_color = chosen_color
+
+/datum/asset/spritesheet/decals
+ name = "floor_decals"
+// cross_round_cachable = TRUE
+
+ /// The floor icon used for blend_preview_floor()
+ var/preview_floor_icon = 'icons/turf/floors.dmi'
+ /// The floor icon state used for blend_preview_floor()
+ var/preview_floor_state = "floor"
+ /// The associated decal painter type to grab decals, colors, etc from.
+ var/obj/item/airlock_painter/decal/painter_type = /obj/item/airlock_painter/decal
+
+/**
+ * Underlay an example floor for preview purposes, and return the new icon.
+ *
+ * Arguments:
+ * * decal - the decal to place over the example floor tile
+ */
+/datum/asset/spritesheet/decals/proc/blend_preview_floor(icon/decal)
+ var/icon/final = icon(preview_floor_icon, preview_floor_state)
+ final.Blend(decal, ICON_OVERLAY)
+ return final
+
+/**
+ * Insert a specific state into the spritesheet.
+ *
+ * Arguments:
+ * * decal - the given decal base state.
+ * * dir - the given direction.
+ * * color - the given color.
+ */
+/datum/asset/spritesheet/decals/proc/insert_state(decal, dir, color)
+ // Special case due to icon_state names
+ var/icon_state_color = color == "yellow" ? "" : color
+
+ var/icon/final = blend_preview_floor(icon('icons/turf/decals.dmi', "[decal][icon_state_color ? "_" : ""][icon_state_color]", dir))
+ Insert("[decal]_[dir]_[color]", final)
+
+/datum/asset/spritesheet/decals/register()
+ // Must actually create because initial(type) doesn't work for /lists for some reason.
+ var/obj/item/airlock_painter/decal/painter = new painter_type()
+
+ for(var/list/decal in painter.decal_list)
+ for(var/list/dir in painter.dir_list)
+ for(var/list/color in painter.color_list)
+ insert_state(decal[2], dir[2], color[2])
+ if(painter.supports_custom_color)
+ insert_state(decal[2], dir[2], "custom")
+
+ qdel(painter)
+ . = ..()
+
/obj/item/airlock_painter/decal/debug
name = "extreme decal painter"
icon_state = "decal_sprayer_ex"
+ initial_ink_type = /obj/item/toner/extreme
-/obj/item/airlock_painter/decal/debug/Initialize(mapload)
- . = ..()
- ink = new /obj/item/toner/extreme(src)
+/obj/item/airlock_painter/decal/tile
+ name = "tile sprayer"
+ desc = "An airlock painter, reprogramed to use a different style of paint in order to spray colors on floor tiles as well, in addition to repainting doors. Decals break when the floor tiles are removed."
+// desc_controls = "Alt-Click to remove the ink cartridge."
+ icon_state = "tile_sprayer"
+ stored_dir = 2
+ stored_color = "#D4D4D432"
+ stored_decal = "tile_corner"
+ spritesheet_type = /datum/asset/spritesheet/decals/tiles
+ supports_custom_color = TRUE
+ // Colors can have a an alpha component as RGBA, or just be RGB and use default alpha
+ color_list = list(
+ list("Neutral", "#D4D4D432"),
+ list("Dark", "#0e0f0f"),
+ list("Bar Burgundy", "#79150082"),
+ list("Sec Red", "#DE3A3A"),
+ list("Cargo Brown", "#A46106"),
+ list("Engi Yellow", "#EFB341"),
+ list("Service Green", "#9FED58"),
+ list("Med Blue", "#52B4E9"),
+ list("R&D Purple", "#D381C9"),
+ )
+ decal_list = list(
+ list("Corner", "tile_corner"),
+ list("Half", "tile_half_contrasted"),
+ list("Opposing Corners", "tile_opposing_corners"),
+ list("3 Corners", "tile_anticorner_contrasted"),
+ list("4 Corners", "tile_fourcorners"),
+ list("Trimline Corner", "trimline_corner_fill"),
+ list("Trimline Fill", "trimline_fill"),
+ list("Trimline Fill L", "trimline_fill__8"), // This is a hack that lives in the spritesheet builder and paint_floor
+ list("Trimline End", "trimline_end_fill"),
+ list("Trimline Box", "trimline_box_fill"),
+ )
+ nondirectional_decals = list(
+ "tile_fourcorners",
+ "trimline_box_fill",
+ )
+
+ /// Regex to split alpha out.
+ var/static/regex/rgba_regex = new(@"(#[0-9a-fA-F]{6})([0-9a-fA-F]{2})")
+
+ /// Default alpha for /obj/effect/turf_decal/tile
+ var/default_alpha = 110
+
+/obj/item/airlock_painter/decal/tile/paint_floor(turf/open/floor/target)
+ // Account for 8-sided decals.
+ var/source_decal = stored_decal
+ var/source_dir = stored_dir
+ if(copytext(stored_decal, -3) == "__8")
+ source_decal = splicetext(stored_decal, -3, 0, "")
+ source_dir = turn(stored_dir, 45)
+
+ var/decal_color = stored_color
+ var/decal_alpha = default_alpha
+ // Handle the RGBA case.
+ if(rgba_regex.Find(decal_color))
+ decal_color = rgba_regex.group[1]
+ decal_alpha = text2num(rgba_regex.group[2], 16)
+
+ target.AddElement(/datum/element/decal, 'icons/turf/decals.dmi', source_decal, source_dir, CLEAN_STRONG, decal_color, null, null, decal_alpha)
+
+/datum/asset/spritesheet/decals/tiles
+ name = "floor_tile_decals"
+ painter_type = /obj/item/airlock_painter/decal/tile
+
+/datum/asset/spritesheet/decals/tiles/insert_state(decal, dir, color)
+ // Account for 8-sided decals.
+ var/source_decal = decal
+ var/source_dir = dir
+ if(copytext(decal, -3) == "__8")
+ source_decal = splicetext(decal, -3, 0, "")
+ source_dir = turn(dir, 45)
+
+ // Handle the RGBA case.
+ var/obj/item/airlock_painter/decal/tile/tile_type = painter_type
+ var/render_color = color
+ var/render_alpha = initial(tile_type.default_alpha)
+ if(tile_type.rgba_regex.Find(color))
+ render_color = tile_type.rgba_regex.group[1]
+ render_alpha = text2num(tile_type.rgba_regex.group[2], 16)
+
+ var/icon/colored_icon = icon('icons/turf/decals.dmi', source_decal, dir=source_dir)
+ colored_icon.ChangeOpacity(render_alpha * 0.008)
+ if(color == "custom")
+ // Do a fun rainbow pattern to stand out while still being static.
+ colored_icon.Blend(icon('icons/effects/random_spawners.dmi', "rainbow"), ICON_MULTIPLY)
+ else
+ colored_icon.Blend(render_color, ICON_MULTIPLY)
+
+ colored_icon = blend_preview_floor(colored_icon)
+ Insert("[decal]_[dir]_[replacetext(color, "#", "")]", colored_icon)
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index b3eb8ab439..30877750f6 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -116,6 +116,38 @@ GLOBAL_LIST_EMPTY(PDAs)
if(inserted_item && (!isturf(loc)))
. += "Ctrl-click to remove [inserted_item]."
+/obj/item/pda/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if(held_item)
+ if(istype(held_item, /obj/item/cartridge) && !cartridge)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Insert Cartridge")
+ . = CONTEXTUAL_SCREENTIP_SET
+ else if(istype(held_item, /obj/item/card/id) && !id)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Insert ID")
+ . = CONTEXTUAL_SCREENTIP_SET
+ else if(istype(held_item, /obj/item/paicard) && !pai)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Insert pAI")
+ . = CONTEXTUAL_SCREENTIP_SET
+ else if(is_type_in_list(held_item, contained_item) && !inserted_item)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Insert [held_item]")
+ . = CONTEXTUAL_SCREENTIP_SET
+ else if(istype(held_item, /obj/item/photo))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Scan photo")
+ . = CONTEXTUAL_SCREENTIP_SET
+
+ if(id) // ID gets removed before inserted_item
+ LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Remove ID")
+ . = CONTEXTUAL_SCREENTIP_SET
+ else if(inserted_item)
+ LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Remove [inserted_item]")
+ . = CONTEXTUAL_SCREENTIP_SET
+
+ if(inserted_item)
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Remove [inserted_item]")
+ . = CONTEXTUAL_SCREENTIP_SET
+ return . || NONE
+
/obj/item/pda/Initialize(mapload)
if(GLOB.pda_reskins)
unique_reskin = GLOB.pda_reskins
@@ -133,6 +165,8 @@ GLOBAL_LIST_EMPTY(PDAs)
new_overlays = TRUE
update_icon()
+ register_context()
+
/obj/item/pda/reskin_obj(mob/M)
. = ..()
new_overlays = TRUE
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 8fa1bed6ad..6d2bdd28ca 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -91,6 +91,11 @@ GENETICS SCANNER
var/scanmode = SCANMODE_HEALTH
var/advanced = FALSE
+/obj/item/healthanalyzer/Initialize(mapload)
+ . = ..()
+
+ register_item_context()
+
/obj/item/healthanalyzer/suicide_act(mob/living/carbon/user)
user.visible_message("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!")
return BRUTELOSS
@@ -130,6 +135,24 @@ GENETICS SCANNER
add_fingerprint(user)
+/obj/item/healthanalyzer/add_item_context(
+ obj/item/source,
+ list/context,
+ atom/target,
+)
+ if (!isliving(target))
+ return NONE
+
+ switch (scanmode)
+ if (SCANMODE_HEALTH)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Scan health")
+ if (SCANMODE_CHEMICAL)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Scan chemicals")
+ if (SCANMODE_WOUND)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Scan wounds")
+
+ return CONTEXTUAL_SCREENTIP_SET
+
// Used by the PDA medical scanner too
/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE)
if(isliving(user) && (user.incapacitated() || user.eye_blind))
@@ -549,6 +572,7 @@ GENETICS SCANNER
name = "first aid analyzer"
icon_state = "adv_spectrometer"
desc = "A prototype MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds, but offers no further insight into the patient's health. You hope the final version is less annoying to read!"
+ scanmode = SCANMODE_WOUND // Forces context to give correct tip.
var/next_encouragement
var/greedy
diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm
index 163119800f..f0cd0fc1e7 100644
--- a/code/game/objects/items/handcuffs.dm
+++ b/code/game/objects/items/handcuffs.dm
@@ -122,6 +122,21 @@
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
+/obj/item/restraints/handcuffs/cable/Initialize(mapload)
+ . = ..()
+
+ var/static/list/hovering_item_typechecks = list(
+ /obj/item/stack/rods = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft wired rod"),
+ ),
+
+ /obj/item/stack/sheet/metal = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft bola"),
+ ),
+ )
+
+ AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
+
/obj/item/restraints/handcuffs/cable/attack_self(mob/user)
to_chat(user, "You start unwinding the cable restraints back into coil")
if(!do_after(user, 25, TRUE, user))
diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm
index efd20fdd9e..7d84d38624 100644
--- a/code/game/objects/items/stunbaton.dm
+++ b/code/game/objects/items/stunbaton.dm
@@ -54,6 +54,8 @@
cell = new preload_cell_type(src)
update_icon()
+ register_item_context()
+
/obj/item/melee/baton/DoRevenantThrowEffects(atom/target)
switch_status()
@@ -155,6 +157,26 @@
if(!interrupt)
return ..()
+/obj/item/melee/baton/add_item_context(datum/source, list/context, atom/target, mob/living/user)
+ if (isturf(target))
+ return NONE
+
+ if (isobj(target))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Attack")
+ else
+ if (turned_on)
+ LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Knockdown")
+
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Stun")
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "Harmful stun")
+ else
+ LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Knockdown") // DON'T TELL EM, PRANKED.
+
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Stun") // STILL DO NOT DARE TELLING THEM
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "Attack") // It's fine i guess...?
+
+ return CONTEXTUAL_SCREENTIP_SET
+
/obj/item/melee/baton/alt_pre_attack(atom/A, mob/living/user, params)
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return
diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm
index df4ea68af5..fa8a0bd239 100644
--- a/code/game/objects/items/weaponry.dm
+++ b/code/game/objects/items/weaponry.dm
@@ -583,6 +583,21 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")
wound_bonus = -10
+/obj/item/wirerod/Initialize(mapload)
+ . = ..()
+
+ var/static/list/hovering_item_typechecks = list(
+ /obj/item/shard = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft spear"),
+ ),
+
+ /obj/item/assembly/igniter = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Craft stunprod"),
+ ),
+ )
+
+ AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
+
/obj/item/wirerod/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/shard))
var/obj/item/spear/S = new /obj/item/spear
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 3858bd71fb..331b45eb18 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -37,6 +37,16 @@
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced, /obj/structure/table/greyscale)
+/obj/structure/table/Initialize(mapload)
+ . = ..()
+
+ var/static/list/barehanded_interactions = list(
+ INTENT_ANY = "Slap",
+ INTENT_HARM = "Slam"
+ )
+
+ AddElement(/datum/element/contextual_screentip_bare_hands, rmb_text_combat_mode = barehanded_interactions)
+
/obj/structure/table/examine(mob/user)
. = ..()
. += deconstruction_hints(user)
@@ -490,6 +500,19 @@
// the sprites in the editor to see why.
icon = smooth_icon
+ if (!(flags_1 & NODECONSTRUCT_1))
+ var/static/list/tool_behaviors = list(
+ TOOL_SCREWDRIVER = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Disassemble"),
+ ),
+
+ TOOL_WRENCH = list(
+ SCREENTIP_CONTEXT_LMB = list(INTENT_ANY = "Deconstruct"),
+ ),
+ )
+
+ AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
+
/obj/structure/table/wood/fancy/black
icon_state = "fancy_table_black"
buildstack = /obj/item/stack/tile/carpet/black
@@ -704,7 +727,7 @@
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSTABLE)
-
+
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
. = ..()
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm
index 1178df4ce6..4c74405389 100644
--- a/code/modules/asset_cache/asset_list_items.dm
+++ b/code/modules/asset_cache/asset_list_items.dm
@@ -311,14 +311,6 @@
InsertAll("", each, GLOB.alldirs)
..()
-/datum/asset/spritesheet/decals
- name = "decals"
-
-/datum/asset/spritesheet/decals/register()
- for(var/each in list('icons/turf/decals.dmi'))
- InsertAll("", each, GLOB.alldirs)
- ..()
-
/datum/asset/spritesheet/supplypods
name = "supplypods"
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index a7d9dffb3d..2a63aa0384 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/UI_style = null
var/outline_enabled = TRUE
var/outline_color = COLOR_THEME_MIDNIGHT
- var/screentip_pref = TRUE
+ var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED
var/screentip_color = "#ffd391"
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -1046,7 +1046,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "UI Style: [UI_style]
"
dat += "Outline: [outline_enabled ? "Enabled" : "Disabled"]
"
dat += "Outline Color: [outline_color ? "" : "Theme-based (null)"][outline_color] Change
"
- dat += "Screentip: [screentip_pref ? "Enabled" : "Disabled"]
"
+ dat += "Screentip: [screentip_pref]
"
dat += "Screentip Color: [screentip_color] Change
"
dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
"
dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
"
@@ -3120,7 +3120,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(pickedOutlineColor != pickedOutlineColor)
outline_color = pickedOutlineColor // nullable
if("screentip_pref")
- screentip_pref = !screentip_pref
+ var/choice = tgalert(user, "Choose your screentip preference", "Screentipping?", "Yes", "Context Only", "No")
+ switch(choice)
+ if("Yes")
+ screentip_pref = SCREENTIP_PREFERENCE_ENABLED
+ if("Context Only")
+ screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
+ else
+ screentip_pref = SCREENTIP_PREFERENCE_DISABLED
if("screentip_color")
var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null
if(pickedScreentipColor)
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index 3c89d1f4bf..6d42fd3441 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
-#define SAVEFILE_VERSION_MAX 56
+#define SAVEFILE_VERSION_MAX 57
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -56,6 +56,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
be_special -= "NO_ANTAGS"
for(var/be_special_type in be_special)
be_special[be_special_type] = 1
+ if(current_version < 57)
+ if(screentip_pref)
+ screentip_pref = SCREENTIP_PREFERENCE_ENABLED
+ else
+ // Let's give it a little chance okay, change if you don't like still.
+ screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
/datum/preferences/proc/update_character(current_version, savefile/S)
if(current_version < 19)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 743d7406c7..5990dcfef8 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -8,6 +8,7 @@
GLOB.carbon_list += src
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
add_movespeed_modifier(/datum/movespeed_modifier/carbon_crawling)
+ register_context()
/mob/living/carbon/Destroy()
//This must be done first, so the mob ghosts correctly before DNA etc is nulled
diff --git a/code/modules/mob/living/carbon/carbon_context.dm b/code/modules/mob/living/carbon/carbon_context.dm
new file mode 100644
index 0000000000..e7fc4d11bf
--- /dev/null
+++ b/code/modules/mob/living/carbon/carbon_context.dm
@@ -0,0 +1,48 @@
+/mob/living/carbon/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if (!isnull(held_item))
+ return .
+
+ if (!ishuman(user))
+ return .
+
+ var/combat_mode = SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE)
+
+ if(user == src)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Check injuries")
+ else if(!lying)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Comfort")
+ else if (health >= 0 && !HAS_TRAIT(src, TRAIT_FAKEDEATH))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Shake")
+ else
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "CPR")
+
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Disarm")
+ if(combat_mode && (src != user))
+ LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_DISARM, "Shove")
+
+ if(src != user)
+ if (pulledby == user)
+ switch (user.grab_state)
+ if (GRAB_PASSIVE)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Grip")
+ if (GRAB_AGGRESSIVE)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Choke")
+ if (GRAB_NECK)
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Strangle")
+ else
+ return .
+ else
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Pull")
+
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "Attack")
+
+ // Monkeys cannot be grabbed harder using ctrl-click, don't ask.
+ if((pulledby != user) && (src != user))
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Pull")
+ // Happens on any intent i believe
+ if((user == src) && combat_mode && lying)
+ LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Force to get up")
+
+ return CONTEXTUAL_SCREENTIP_SET
diff --git a/code/modules/mob/living/carbon/human/human_context.dm b/code/modules/mob/living/carbon/human/human_context.dm
new file mode 100644
index 0000000000..5229fba3ea
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/human_context.dm
@@ -0,0 +1,36 @@
+/mob/living/carbon/human/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
+ . = ..()
+
+ if (!ishuman(user))
+ return .
+
+ var/aim_for_mouth = user.zone_selected == "mouth"
+ var/target_on_help = a_intent == INTENT_HELP
+ var/target_aiming_for_mouth = zone_selected == "mouth"
+ var/target_restrained = restrained()
+ var/same_dir = (dir & user.dir)
+ var/aim_for_groin = user.zone_selected == "groin"
+ var/target_aiming_for_groin = zone_selected == "groin"
+
+ if(aim_for_mouth && (target_on_help || target_restrained || target_aiming_for_mouth))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Slap face")
+
+ else if(aim_for_groin && (src == user || lying || same_dir) && (target_on_help || target_restrained || target_aiming_for_groin))
+ LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Slap ass")
+
+ // Humans can actually be upgrade grabbed using ctrl-click
+ if(src != user)
+ if (pulledby == user)
+ switch (user.grab_state)
+ if (GRAB_PASSIVE)
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Grip")
+ if (GRAB_AGGRESSIVE)
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Choke")
+ if (GRAB_NECK)
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Strangle")
+ else
+ return .
+ else
+ LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Pull")
+
+ return CONTEXTUAL_SCREENTIP_SET
diff --git a/code/modules/research/designs/autolathe_desings/autolathe_designs_tcomms_and_misc.dm b/code/modules/research/designs/autolathe_desings/autolathe_designs_tcomms_and_misc.dm
index 1b1c710e8c..0ac303a3a0 100644
--- a/code/modules/research/designs/autolathe_desings/autolathe_designs_tcomms_and_misc.dm
+++ b/code/modules/research/designs/autolathe_desings/autolathe_designs_tcomms_and_misc.dm
@@ -92,6 +92,11 @@
category = list("initial","Tools","Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_SERVICE
+/datum/design/airlock_painter/decal/tile
+ name = "Tile Sprayer"
+ id = "tile_sprayer"
+ build_path = /obj/item/airlock_painter/decal/tile
+
/datum/design/cultivator
name = "Cultivator"
id = "cultivator"
diff --git a/code/modules/research/techweb/nodes/tools_nodes.dm b/code/modules/research/techweb/nodes/tools_nodes.dm
index 86a48ab8de..004795113b 100644
--- a/code/modules/research/techweb/nodes/tools_nodes.dm
+++ b/code/modules/research/techweb/nodes/tools_nodes.dm
@@ -5,7 +5,7 @@
display_name = "Basic Tools"
description = "Basic mechanical, electronic, surgical and botanical tools."
prereq_ids = list("base")
- design_ids = list("screwdriver", "wrench", "wirecutters", "crowbar", "multitool", "welding_tool", "tscanner", "analyzer", "cable_coil", "pipe_painter", "airlock_painter", "decal_painter", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", "cultivator", "plant_analyzer", "shovel", "spade", "hatchet", "mop", "broom", "normtrash", "spraycan")
+ design_ids = list("screwdriver", "wrench", "wirecutters", "crowbar", "multitool", "welding_tool", "tscanner", "analyzer", "cable_coil", "pipe_painter", "airlock_painter", "decal_painter", "tile_sprayer", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", "cultivator", "plant_analyzer", "shovel", "spade", "hatchet", "mop", "broom", "normtrash", "spraycan")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 500)
/datum/techweb_node/basic_mining
diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm
index 99aaa8d8ec..f350dd507e 100644
--- a/code/modules/surgery/bodyparts/helpers.dm
+++ b/code/modules/surgery/bodyparts/helpers.dm
@@ -3,6 +3,8 @@
return
/mob/living/carbon/get_bodypart(zone)
+ RETURN_TYPE(/obj/item/bodypart)
+
if(!zone)
zone = BODY_ZONE_CHEST
for(var/X in bodyparts)
diff --git a/icons/effects/random_spawners.dmi b/icons/effects/random_spawners.dmi
new file mode 100644
index 0000000000..144287ced0
Binary files /dev/null and b/icons/effects/random_spawners.dmi differ
diff --git a/icons/mob/clothing/belt.dmi b/icons/mob/clothing/belt.dmi
index 9746e61a3d..f7062b9f4e 100644
Binary files a/icons/mob/clothing/belt.dmi and b/icons/mob/clothing/belt.dmi differ
diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi
index d0ebbb4501..b694d0ba35 100644
Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ
diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi
index 0d87e7871c..3836f4c713 100644
Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ
diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi
index 8eb3b619a1..cc28f4e346 100644
Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ
diff --git a/icons/turf/decals.dmi b/icons/turf/decals.dmi
index 4ed8c8db9a..6b42ad12c7 100644
Binary files a/icons/turf/decals.dmi and b/icons/turf/decals.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index 92f409eab0..5e824bc0a5 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -108,6 +108,7 @@
#include "code\__DEFINES\rust_g.dm"
#include "code\__DEFINES\rust_g_overrides.dm"
#include "code\__DEFINES\say.dm"
+#include "code\__DEFINES\screentips.dm"
#include "code\__DEFINES\security_levels.dm"
#include "code\__DEFINES\shuttles.dm"
#include "code\__DEFINES\sight.dm"
@@ -157,6 +158,8 @@
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\signals.dm"
#include "code\__DEFINES\dcs\signals\signals_movable.dm"
+#include "code\__DEFINES\dcs\signals\signals_painting.dm"
+#include "code\__DEFINES\dcs\signals\signals_screentips.dm"
#include "code\__DEFINES\dcs\signals\signals_subsystem.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_living.dm"
@@ -211,6 +214,7 @@
#include "code\__HELPERS\reagents.dm"
#include "code\__HELPERS\roundend.dm"
#include "code\__HELPERS\sanitize_values.dm"
+#include "code\__HELPERS\screentips.dm"
#include "code\__HELPERS\shell.dm"
#include "code\__HELPERS\stat_tracking.dm"
#include "code\__HELPERS\text.dm"
@@ -735,6 +739,10 @@
#include "code\datums\elements\ventcrawling.dm"
#include "code\datums\elements\weather_listener.dm"
#include "code\datums\elements\wuv.dm"
+#include "code\datums\elements\screentips\contextual_screentip_bare_hands.dm"
+#include "code\datums\elements\screentips\contextual_screentip_item_typechecks.dm"
+#include "code\datums\elements\screentips\contextual_screentip_sharpness.dm"
+#include "code\datums\elements\screentips\contextual_screentip_tools.dm"
#include "code\datums\helper_datums\events.dm"
#include "code\datums\helper_datums\getrev.dm"
#include "code\datums\helper_datums\icon_snapshot.dm"
@@ -790,6 +798,8 @@
#include "code\datums\ruins\lavaland.dm"
#include "code\datums\ruins\space.dm"
#include "code\datums\ruins\station.dm"
+#include "code\datums\screentips\atom_context.dm"
+#include "code\datums\screentips\item_context.dm"
#include "code\datums\skills\_check_skills.dm"
#include "code\datums\skills\_skill.dm"
#include "code\datums\skills\_skill_holder.dm"
@@ -2662,6 +2672,7 @@
#include "code\modules\mob\living\brain\status_procs.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_active_parry.dm"
+#include "code\modules\mob\living\carbon\carbon_context.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\carbon_movement.dm"
@@ -2717,6 +2728,7 @@
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_block.dm"
+#include "code\modules\mob\living\carbon\human\human_context.dm"
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
diff --git a/tgui/packages/tgui/interfaces/DecalPainter.js b/tgui/packages/tgui/interfaces/DecalPainter.js
deleted file mode 100644
index f116d09c18..0000000000
--- a/tgui/packages/tgui/interfaces/DecalPainter.js
+++ /dev/null
@@ -1,114 +0,0 @@
-import { useBackend } from '../backend';
-import { Box, Button, Section } from '../components';
-import { Window } from '../layouts';
-import { classes } from 'common/react';
-
-export const DecalPainter = (props, context) => {
- const { act, data } = useBackend(context);
- const decal_list = data.decal_list || [];
- const color_list = data.color_list || [];
- const dir_list = data.dir_list || [];
- return (
-
-
-
- {decal_list.map(decal => (
-
- ))}
-
-
- {color_list.map(color => {
- return (
-
- );
- })}
-
-
- {dir_list.map(dir => {
- return (
-
- );
- })}
-
-
-
- );
-};
diff --git a/tgui/packages/tgui/interfaces/DecalPainter.tsx b/tgui/packages/tgui/interfaces/DecalPainter.tsx
new file mode 100644
index 0000000000..1a211cfba4
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/DecalPainter.tsx
@@ -0,0 +1,162 @@
+import { useBackend } from '../backend';
+import { Button, ColorBox, Flex, Section } from '../components';
+import { Window } from '../layouts';
+
+type DecalInfo = {
+ name: string;
+ decal: string;
+};
+
+type ColorInfo = {
+ name: string;
+ color: string;
+};
+
+type DirInfo = {
+ name: string;
+ dir: number;
+};
+
+type DecalPainterData = {
+ icon_prefix: string;
+ decal_list: DecalInfo[];
+ color_list: ColorInfo[];
+ dir_list: DirInfo[];
+ nondirectional_decals: string[];
+ supports_custom_color: number;
+ current_decal: string;
+ current_color: string;
+ current_dir: number;
+ current_custom_color: string;
+};
+
+const filterBoxColor = (color: string) => {
+ if (!color.startsWith('#')) {
+ return color;
+ }
+
+ // cut alpha
+ return color.substring(0, 7);
+};
+
+export const DecalPainter = (props, context) => {
+ const { act, data } = useBackend(context);
+
+ const custom_color_selected = !data.color_list.some(
+ (color) => color.color === data.current_color
+ );
+ const supports_custom_color = !!data.supports_custom_color;
+
+ // Handle custom color icon correctly
+ const preview_color = custom_color_selected ? 'custom' : data.current_color;
+
+ return (
+
+
+
+ {data.color_list.map((color) => {
+ return (
+
+ );
+ })}
+ {supports_custom_color && (
+
+ )}
+
+
+
+ {data.decal_list.map((decal) => {
+ const nondirectional = data.nondirectional_decals.includes(
+ decal.decal
+ );
+
+ return nondirectional ? (
+ // Tallll button for nondirectional
+
+ ) : (
+ // 4 buttons for directional
+
+ {data.dir_list.map((dir) => {
+ const selected
+ = decal.decal === data.current_decal
+ && dir.dir === data.current_dir;
+
+ return (
+
+ );
+ })}
+
+ );
+ })}
+
+
+
+
+ );
+};
+
+type IconButtonParams = {
+ decal: string;
+ dir: number;
+ color: string;
+ label: string;
+ selected: boolean;
+};
+
+const IconButton = (props: IconButtonParams, context) => {
+ const { act, data } = useBackend(context);
+
+ const generateIconKey = (decal: string, dir: number, color: string) =>
+ `${data.icon_prefix} ${decal}_${dir}_${color.replace('#', '')}`;
+
+ const icon = generateIconKey(props.decal, props.dir, props.color);
+
+ return (
+
+ );
+};