diff --git a/code/__DEFINES/dcs/signals/signals_hud.dm b/code/__DEFINES/dcs/signals/signals_hud.dm new file mode 100644 index 0000000000..c771204773 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_hud.dm @@ -0,0 +1,4 @@ +/// Sent from /atom/movable/screen/lobby/button/collapse/proc/collapse_buttons() : () +#define COMSIG_HUD_LOBBY_COLLAPSED "hud_lobby_collapsed" +/// Sent from /atom/movable/screen/lobby/button/collapse/proc/expand_buttons() : () +#define COMSIG_HUD_LOBBY_EXPANDED "hud_lobby_expanded" diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm index b4c616243f..578dfe87e5 100644 --- a/code/__DEFINES/layers_planes.dm +++ b/code/__DEFINES/layers_planes.dm @@ -187,8 +187,14 @@ #define ABOVE_HUD_LAYER 30 #define ABOVE_HUD_RENDER_TARGET "ABOVE_HUD_PLANE" -#define LOBBY_BACKGROUND_LAYER 3 -#define LOBBY_BUTTON_LAYER 4 +///Layer for lobby menu collapse button +#define LOBBY_BELOW_MENU_LAYER 2 +///Layer for lobby menu background image and main buttons (Join/Ready, Observe, Charater Prefs) +#define LOBBY_MENU_LAYER 3 +///Layer for lobby menu shutter, which covers up the menu to collapse/expand it +#define LOBBY_SHUTTER_LAYER 4 +///Layer for lobby menu buttons that are hanging away from and lower than the main panel +#define LOBBY_BOTTOM_BUTTON_LAYER 5 #define SPLASHSCREEN_LAYER 90 #define SPLASHSCREEN_PLANE 90 diff --git a/code/__byond_version_compat.dm b/code/__byond_version_compat.dm new file mode 100644 index 0000000000..aed9bbf176 --- /dev/null +++ b/code/__byond_version_compat.dm @@ -0,0 +1,34 @@ +// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof() +// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global. + +#if DM_VERSION < 515 + +/// Call by name proc references, checks if the proc exists on either this type or as a global proc. +#define PROC_REF(X) (.proc/##X) +/// Call by name verb references, checks if the verb exists on either this type or as a global verb. +#define VERB_REF(X) (.verb/##X) + +/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc +#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X) +/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb +#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X) + +/// Call by name proc reference, checks if the proc is an existing global proc +#define GLOBAL_PROC_REF(X) (/proc/##X) + +#else + +/// Call by name proc references, checks if the proc exists on either this type or as a global proc. +#define PROC_REF(X) (nameof(.proc/##X)) +/// Call by name verb references, checks if the verb exists on either this type or as a global verb. +#define VERB_REF(X) (nameof(.verb/##X)) + +/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc +#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) +/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb +#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X)) + +/// Call by name proc reference, checks if the proc is an existing global proc +#define GLOBAL_PROC_REF(X) (/proc/##X) + +#endif diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index b426db1aac..4eff9cd7e6 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -1,12 +1,20 @@ +#define SHUTTER_MOVEMENT_DURATION 0.4 SECONDS +#define SHUTTER_WAIT_DURATION 0.2 SECONDS + /datum/hud/new_player + ///Whether the menu is currently on the client's screen or not + var/menu_hud_status = TRUE /datum/hud/new_player/proc/populate_buttons(mob/dead/new_player/owner) var/list/buttons = subtypesof(/atom/movable/screen/lobby) for(var/button_type in buttons) - var/atom/movable/screen/lobby/lobbyscreen = new button_type() + var/atom/movable/screen/lobby/lobbyscreen = new button_type(our_hud = src) lobbyscreen.SlowInit() lobbyscreen.hud = src static_inventory += lobbyscreen + if(!lobbyscreen.always_shown) + lobbyscreen.RegisterSignal(src, COMSIG_HUD_LOBBY_COLLAPSED, TYPE_PROC_REF(/atom/movable/screen/lobby, collapse_button)) + lobbyscreen.RegisterSignal(src, COMSIG_HUD_LOBBY_EXPANDED, TYPE_PROC_REF(/atom/movable/screen/lobby, expand_button)) if(istype(lobbyscreen, /atom/movable/screen/lobby/button)) var/atom/movable/screen/lobby/button/lobby_button = lobbyscreen lobby_button.owner = REF(owner) @@ -14,15 +22,35 @@ /atom/movable/screen/lobby plane = SPLASHSCREEN_PLANE - layer = LOBBY_BUTTON_LAYER + layer = LOBBY_MENU_LAYER screen_loc = "TOP,CENTER" + ///Whether this HUD element can be hidden from the client's "screen" (moved off-screen) or not + var/always_shown = FALSE + +/atom/movable/screen/lobby/New(loc, datum/hud/our_hud, ...) + if(our_hud) + hud = our_hud + return ..() /// Run sleeping actions after initialize /atom/movable/screen/lobby/proc/SlowInit() return +///Animates moving the button off-screen +/atom/movable/screen/lobby/proc/collapse_button() + SIGNAL_HANDLER + //wait for the shutter to come down + animate(src, transform = transform, time = SHUTTER_MOVEMENT_DURATION + SHUTTER_WAIT_DURATION) + //then pull the buttons up with the shutter + animate(transform = transform.Translate(x = 0, y = 146), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_IN) + +///Animates moving the button back into place +/atom/movable/screen/lobby/proc/expand_button() + SIGNAL_HANDLER + //the buttons are off-screen, so we sync them up to come down with the shutter + animate(src, transform = matrix(), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_OUT) + /atom/movable/screen/lobby/background - layer = LOBBY_BACKGROUND_LAYER icon = 'icons/hud/lobby/background.dmi' icon_state = "background" screen_loc = "TOP,CENTER:-61" @@ -73,6 +101,7 @@ return icon_state = base_icon_state +///Updates the button's status: TRUE to enable interaction with the button, FALSE to disable /atom/movable/screen/lobby/button/proc/set_button_status(status) if(status == enabled) return FALSE @@ -82,6 +111,7 @@ ///Prefs menu /atom/movable/screen/lobby/button/character_setup + name = "View Character Setup" screen_loc = "TOP:-70,CENTER:-54" icon = 'icons/hud/lobby/character_setup.dmi' icon_state = "character_setup" @@ -96,10 +126,12 @@ ///Button that appears before the game has started /atom/movable/screen/lobby/button/ready + name = "Toggle Readiness" screen_loc = "TOP:-8,CENTER:-65" icon = 'icons/hud/lobby/ready.dmi' icon_state = "not_ready" base_icon_state = "not_ready" + ///Whether we are readied up for the round or not var/ready = FALSE /atom/movable/screen/lobby/button/ready/Initialize(mapload) @@ -141,6 +173,7 @@ ///Shown when the game has started /atom/movable/screen/lobby/button/join + name = "Join Game" screen_loc = "TOP:-13,CENTER:-58" icon = 'icons/hud/lobby/join.dmi' icon_state = "" //Default to not visible @@ -204,6 +237,7 @@ RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/show_join_button) /atom/movable/screen/lobby/button/observe + name = "Observe" screen_loc = "TOP:-40,CENTER:-54" icon = 'icons/hud/lobby/observe.dmi' icon_state = "observe_disabled" @@ -230,13 +264,18 @@ set_button_status(TRUE) UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/enable_observing) -/atom/movable/screen/lobby/button/settings +//Subtype the bottom buttons away so the collapse/expand shutter goes behind them +/atom/movable/screen/lobby/button/bottom + layer = LOBBY_BOTTOM_BUTTON_LAYER icon = 'icons/hud/lobby/bottom_buttons.dmi' + +/atom/movable/screen/lobby/button/bottom/settings + name = "View Game Preferences" icon_state = "settings" base_icon_state = "settings" - screen_loc = "TOP:-122,CENTER:+30" + screen_loc = "TOP:-122,CENTER:+29" -/atom/movable/screen/lobby/button/settings/Click(location, control, params) +/atom/movable/screen/lobby/button/bottom/settings/Click(location, control, params) . = ..() if(!.) return @@ -244,39 +283,38 @@ hud.mymob.client.prefs.current_tab = GAME_PREFERENCES_TAB hud.mymob.client.prefs.ShowChoices(hud.mymob) -/atom/movable/screen/lobby/button/changelog_button - icon = 'icons/hud/lobby/bottom_buttons.dmi' +/atom/movable/screen/lobby/button/bottom/changelog_button + name = "View Changelog" icon_state = "changelog" base_icon_state = "changelog" - screen_loc ="TOP:-122,CENTER:+58" + screen_loc ="TOP:-122,CENTER:+57" +/atom/movable/screen/lobby/button/bottom/changelog_button/Click(location, control, params) + . = ..() + usr.client?.changelog() -/atom/movable/screen/lobby/button/crew_manifest - icon = 'icons/hud/lobby/bottom_buttons.dmi' +/atom/movable/screen/lobby/button/bottom/crew_manifest + name = "View Crew Manifest" icon_state = "crew_manifest" base_icon_state = "crew_manifest" screen_loc = "TOP:-122,CENTER:+2" -/atom/movable/screen/lobby/button/crew_manifest/Click(location, control, params) +/atom/movable/screen/lobby/button/bottom/crew_manifest/Click(location, control, params) . = ..() if(!.) return var/mob/dead/new_player/new_player = hud.mymob new_player.ViewManifest() -/atom/movable/screen/lobby/button/changelog_button/Click(location, control, params) - . = ..() - usr.client?.changelog() - -/atom/movable/screen/lobby/button/poll - icon = 'icons/hud/lobby/bottom_buttons.dmi' +/atom/movable/screen/lobby/button/bottom/poll + name = "View Available Polls" icon_state = "poll" base_icon_state = "poll" screen_loc = "TOP:-122,CENTER:-26" - + ///Whether the button should have a New Poll notification overlay var/new_poll = FALSE -/atom/movable/screen/lobby/button/poll/SlowInit(mapload) +/atom/movable/screen/lobby/button/bottom/poll/SlowInit(mapload) . = ..() if(!usr) return @@ -320,14 +358,89 @@ set_button_status(FALSE) return -/atom/movable/screen/lobby/button/poll/update_overlays() +/atom/movable/screen/lobby/button/bottom/poll/update_overlays() . = ..() if(new_poll) . += mutable_appearance('icons/hud/lobby/poll_overlay.dmi', "new_poll") -/atom/movable/screen/lobby/button/poll/Click(location, control, params) +/atom/movable/screen/lobby/button/bottom/poll/Click(location, control, params) . = ..() if(!.) return var/mob/dead/new_player/new_player = hud.mymob new_player.handle_player_polling() + +/atom/movable/screen/lobby/button/collapse + name = "Collapse Lobby Menu" + icon = 'icons/hud/lobby/collapse_expand.dmi' + icon_state = "collapse" + base_icon_state = "collapse" + layer = LOBBY_BELOW_MENU_LAYER + screen_loc = "TOP:-82,CENTER:-54" + always_shown = TRUE + +/atom/movable/screen/lobby/button/collapse/Click(location, control, params) + . = ..() + if(!.) + return + + if(!istype(hud, /datum/hud/new_player)) + return + var/datum/hud/new_player/our_hud = hud + base_icon_state = our_hud.menu_hud_status ? "expand" : "collapse" + name = "[our_hud.menu_hud_status ? "Expand" : "Collapse"] Lobby Menu" + set_button_status(FALSE) + + //get the shutter object used by our hud + var/atom/movable/screen/lobby/shutter/menu_shutter = locate(/atom/movable/screen/lobby/shutter) in hud.static_inventory + + //animate the shutter + menu_shutter.setup_shutter_animation() + //animate bottom buttons' movement + if(our_hud.menu_hud_status) + collapse_menu() + else + expand_menu() + our_hud.menu_hud_status = !our_hud.menu_hud_status + + //re-enable clicking the button when the shutter animation finishes + //we use sleep here so it can work during game setup, as addtimer would not work until the game would finish setting up + sleep(2 * SHUTTER_MOVEMENT_DURATION + SHUTTER_WAIT_DURATION) + set_button_status(TRUE) + +///Moves the button to the top of the screen, leaving only the screen part in view +///Sends a signal on the hud for the menu hud elements to listen to +/atom/movable/screen/lobby/button/collapse/proc/collapse_menu() + SEND_SIGNAL(hud, COMSIG_HUD_LOBBY_COLLAPSED) + //wait for the shutter to come down + animate(src, transform = transform, time = SHUTTER_MOVEMENT_DURATION + SHUTTER_WAIT_DURATION) + //then pull the button up with the shutter and leave it on the edge of the screen + animate(transform = transform.Translate(x = 0, y = 134), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_IN) + +///Extends the button back to its usual spot +///Sends a signal on the hud for the menu hud elements to listen to +/atom/movable/screen/lobby/button/collapse/proc/expand_menu() + SEND_SIGNAL(hud, COMSIG_HUD_LOBBY_EXPANDED) + animate(src, transform = matrix(), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_OUT) + +/atom/movable/screen/lobby/shutter + icon = 'icons/hud/lobby/shutter.dmi' + icon_state = "shutter" + base_icon_state = "shutter" + screen_loc = "TOP:+143,CENTER:-73" //"home" position is off-screen + layer = LOBBY_SHUTTER_LAYER + always_shown = TRUE + +///Sets up the shutter pulling down and up. It's the same animation for both collapsing and expanding the menu. +/atom/movable/screen/lobby/shutter/proc/setup_shutter_animation() + //bring down the shutter + animate(src, transform = transform.Translate(x = 0, y = -143), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_OUT) + + //wait a little bit before bringing the shutter up + animate(transform = transform, time = SHUTTER_WAIT_DURATION) + + //pull the shutter back off-screen + animate(transform = matrix(), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_IN) + +#undef SHUTTER_MOVEMENT_DURATION +#undef SHUTTER_WAIT_DURATION diff --git a/code/datums/components/gps.dm b/code/datums/components/gps.dm index 38b6376716..d78bd799a2 100644 --- a/code/datums/components/gps.dm +++ b/code/datums/components/gps.dm @@ -44,6 +44,7 @@ GLOBAL_LIST_EMPTY(GPS_list) RegisterSignal(parent, COMSIG_ATOM_EMP_ACT, .proc/on_emp_act) RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine) RegisterSignal(parent, COMSIG_CLICK_ALT, .proc/on_AltClick) + RegisterSignal(parent, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item) ///Called on COMSIG_ITEM_ATTACK_SELF /datum/component/gps/item/proc/interact(datum/source, mob/user) @@ -54,6 +55,17 @@ GLOBAL_LIST_EMPTY(GPS_list) /datum/component/gps/item/proc/on_examine(datum/source, mob/user, list/examine_list) examine_list += "Alt-click to switch it [tracking ? "off":"on"]." +/datum/component/gps/item/proc/on_requesting_context_from_item( + obj/source, + list/context, + obj/item/held_item, + mob/living/user, +) + SIGNAL_HANDLER + + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, tracking ? "Turn off" : "Turn on") + return CONTEXTUAL_SCREENTIP_SET + ///Called on COMSIG_ATOM_EMP_ACT /datum/component/gps/item/proc/on_emp_act(datum/source, severity) emped = TRUE diff --git a/code/datums/components/rotation.dm b/code/datums/components/rotation.dm index b8d629273b..4b0e58df18 100644 --- a/code/datums/components/rotation.dm +++ b/code/datums/components/rotation.dm @@ -44,6 +44,7 @@ RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/ExamineMessage) if(rotation_flags & ROTATION_WRENCH) RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/WrenchRot) + RegisterSignal(parent, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item) /datum/component/simple_rotation/proc/add_verbs() if(rotation_flags & ROTATION_VERBS) @@ -63,7 +64,7 @@ AM.verbs -= /atom/movable/proc/simple_rotate_counterclockwise /datum/component/simple_rotation/proc/remove_signals() - UnregisterSignal(parent, list(COMSIG_CLICK_ALT, COMSIG_PARENT_EXAMINE, COMSIG_PARENT_ATTACKBY)) + UnregisterSignal(parent, list(COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, COMSIG_CLICK_ALT, COMSIG_PARENT_EXAMINE, COMSIG_PARENT_ATTACKBY)) /datum/component/simple_rotation/RegisterWithParent() add_verbs() @@ -157,6 +158,21 @@ /datum/component/simple_rotation/proc/default_after_rotation(mob/user, rotation_type) to_chat(user,"You [rotation_type == ROTATION_FLIP ? "flip" : "rotate"] [parent].") +/datum/component/simple_rotation/proc/on_requesting_context_from_item( + obj/source, + list/context, + obj/item/held_item, + mob/living/user, +) + var/rotation = (rotation_flags & ROTATION_FLIP) ? "Flip" : "Rotate [rotation_flags & ROTATION_CLOCKWISE ? "clockwise" : "counter-clockwise"]" + + if(rotation_flags & ROTATION_ALTCLICK) + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, rotation) + . = CONTEXTUAL_SCREENTIP_SET + if(held_item?.tool_behaviour == TOOL_WRENCH && (rotation_flags & ROTATION_WRENCH)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, rotation) + . = CONTEXTUAL_SCREENTIP_SET + /atom/movable/proc/simple_rotate_clockwise() set name = "Rotate Clockwise" set category = "Object" diff --git a/code/datums/elements/mob_holder.dm b/code/datums/elements/mob_holder.dm index 0a56095437..5f57b4fce3 100644 --- a/code/datums/elements/mob_holder.dm +++ b/code/datums/elements/mob_holder.dm @@ -23,18 +23,30 @@ src.proctype = proctype src.escape_on_find = escape_on_find + RegisterSignal(target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, .proc/on_requesting_context_from_item) RegisterSignal(target, COMSIG_CLICK_ALT, .proc/mob_try_pickup) RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/on_examine) /datum/element/mob_holder/Detach(datum/source, force) . = ..() - UnregisterSignal(source, COMSIG_CLICK_ALT) - UnregisterSignal(source, COMSIG_PARENT_EXAMINE) + UnregisterSignal(source, list(COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, COMSIG_CLICK_ALT, COMSIG_PARENT_EXAMINE)) /datum/element/mob_holder/proc/on_examine(mob/living/source, mob/user, list/examine_list) if(ishuman(user) && !istype(source.loc, /obj/item/clothing/head/mob_holder)) examine_list += "Looks like [source.p_they(TRUE)] can be picked up with Alt+Click!" +/datum/element/mob_holder/proc/on_requesting_context_from_item( + obj/source, + list/context, + obj/item/held_item, + mob/living/user, +) + SIGNAL_HANDLER + + if(ishuman(user)) + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Pick up") + return CONTEXTUAL_SCREENTIP_SET + /datum/element/mob_holder/proc/mob_try_pickup(mob/living/source, mob/user) if(!ishuman(user) || !user.Adjacent(source) || user.incapacitated()) return FALSE diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 80621e2bcd..b59e71d62e 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -13,6 +13,16 @@ var/cooldown_time = 100 req_access = list(ACCESS_AI_UPLOAD) +/obj/machinery/ai_slipper/Initialize(mapload) + . = ..() + register_context() + +/obj/machinery/ai_slipper/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(issilicon(user)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Dispense foam") + return CONTEXTUAL_SCREENTIP_SET + /obj/machinery/ai_slipper/examine(mob/user) . = ..() . += "It has [uses] uses of foam remaining." diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 0b31ecdf9f..d9d6f65e93 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -700,6 +700,14 @@ /obj/machinery/door/airlock/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) . = ..() + if(hasSiliconAccessInArea(user)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Open interface") + LAZYSET(context[SCREENTIP_CONTEXT_SHIFT_LMB], INTENT_ANY, density ? "Open" : "Close") + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, locked ? "Unbolt" : "Bolt") + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, secondsElectrified ? "Un-electrify" : "Electrify") + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB], INTENT_ANY, emergency ? "Disable emergency access" : "Enable emergency access") + . = CONTEXTUAL_SCREENTIP_SET + if(istype(held_item, /obj/item/stack/sheet/plasteel)) LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Reinforce") return CONTEXTUAL_SCREENTIP_SET @@ -720,12 +728,12 @@ return CONTEXTUAL_SCREENTIP_SET if (TOOL_WELDER) - LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Weld shut") + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "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") + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "Cut shielding") return CONTEXTUAL_SCREENTIP_SET LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Repair") diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 755894d906..cd87a858b8 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -80,6 +80,19 @@ Possible to do for anyone motivated enough: /// If we are currently calling another holopad var/calling = FALSE +/obj/machinery/holopad/Initialize(mapload) + . = ..() + register_context() + +/obj/machinery/holopad/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(isAI(user) && on_network) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Project yourself") + if(LAZYLEN(masters) && masters[user]) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Stop projecting") + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Stop projecting") + return CONTEXTUAL_SCREENTIP_SET + /obj/machinery/holopad/secure name = "secure holopad" desc = "It's a floor-mounted device for projecting holographic images. This one will refuse to auto-connect incoming calls." diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 8a084353e4..f849d2f31b 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -52,8 +52,15 @@ Buildable meters update() pixel_x += rand(-5, 5) pixel_y += rand(-5, 5) + register_context() return ..() +/obj/item/pipe/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(held_item?.tool_behaviour == TOOL_WRENCH) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Fasten") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/pipe/proc/make_from_existing(obj/machinery/atmospherics/make_from) setDir(make_from.dir) pipename = make_from.name diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index f4a82cb883..b94e51b813 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -930,6 +930,14 @@ DEFINE_BITFIELD(turret_flags, list( pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 power_change() //Checks power and initial settings + register_context() + +/obj/machinery/turretid/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(issilicon(user) && !(stat & BROKEN)) + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, enabled ? "Disable" : "Enable") + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, lethal ? "Set to stun" : "Set to kill") + return CONTEXTUAL_SCREENTIP_SET /obj/machinery/turretid/Destroy() turrets.Cut() diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 5aaed2a808..c550f72946 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -299,6 +299,13 @@ /obj/machinery/status_display/Initialize(mapload, ndir, building) . = ..() update_appearance() + register_context() + +/obj/machinery/status_display/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(isAI(user)) + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Start streaming") // funny + return CONTEXTUAL_SCREENTIP_SET /obj/machinery/status_display/evac/Initialize(mapload) . = ..() diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index f361e557d0..9366f5f935 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -16,6 +16,16 @@ var/used = 0 +/obj/item/dnainjector/Initialize(mapload) + . = ..() + register_item_context() + +/obj/item/dnainjector/add_item_context(obj/item/source, list/context, mob/living/target, mob/living/user) + . = ..() + if(isliving(target) && target.has_dna() && !used) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Inject") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/dnainjector/attack_paw(mob/user) return attack_hand(user) @@ -524,6 +534,12 @@ var/research = FALSE //Set to true to get expended and filled injectors for chromosomes var/filled = FALSE +/obj/item/dnainjector/activator/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) + . = ..() + if(istype(target, /obj/machinery/computer/scan_consolenew) && used) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Recycle") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/dnainjector/activator/inject(mob/living/carbon/M, mob/user) if(M.has_dna() && !HAS_TRAIT_NOT_FROM(M, TRAIT_RADIMMUNE,BLOODSUCKER_TRAIT) && !HAS_TRAIT(M,TRAIT_NOCLONE)) M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2)) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 1403eb999c..2c3b0545f8 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -65,6 +65,13 @@ GLOBAL_LIST_INIT(double_bedsheets, list(/obj/item/bedsheet/double, if(bedsheet_type == BEDSHEET_DOUBLE) stack_amount *= 2 dying_key = DYE_REGISTRY_DOUBLE_BEDSHEET + register_item_context() + +/obj/item/bedsheet/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) + . = ..() + if(iscarbon(target)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Prepare Surgery") + return CONTEXTUAL_SCREENTIP_SET /obj/item/bedsheet/attack(mob/living/M, mob/user) if(!attempt_initiate_surgery(src, M, user)) diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 90407264ad..19b94eb64e 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -233,6 +233,12 @@ power_change() set_frequency(frequency) + register_context() + +/obj/machinery/airalarm/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, locked ? "Unlock" : "Lock") + return CONTEXTUAL_SCREENTIP_SET /obj/machinery/airalarm/Destroy() SSradio.remove_object(src, frequency) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 49fc0322df..a59cd5b304 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -41,6 +41,10 @@ var/on = FALSE var/interacts_with_air = FALSE +/obj/machinery/atmospherics/Initialize(mapload) + . = ..() + register_context() + /obj/machinery/atmospherics/examine(mob/user) . = ..() if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user)) @@ -48,6 +52,17 @@ if(SEND_SIGNAL(L, COMSIG_CHECK_VENTCRAWL)) . += "Alt-click to crawl through it." +/obj/machinery/atmospherics/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + + if(can_unwrench && held_item?.tool_behaviour == TOOL_WRENCH) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Unfasten") + . = CONTEXTUAL_SCREENTIP_SET + + if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user) && SEND_SIGNAL(user, COMSIG_CHECK_VENTCRAWL)) + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Crawl into") + . = CONTEXTUAL_SCREENTIP_SET + /obj/machinery/atmospherics/New(loc, process = TRUE, setdir) if(!isnull(setdir)) setDir(setdir) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 2fc5270a6b..fc4cee1bed 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -106,6 +106,10 @@ sensor_mode_intended = sensor_mode ..() +/obj/item/clothing/under/Initialize(mapload) + . = ..() + register_context() + /obj/item/clothing/under/equipped(mob/user, slot) ..() if(adjusted) @@ -360,5 +364,20 @@ return TRUE +/obj/item/clothing/under/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if (!(item_flags & IN_INVENTORY)) + return + + if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Set to highest sensor") + if(attached_accessory) + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Remove [attached_accessory]") + else + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Adjust [src]") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/clothing/under/rank dying_key = DYE_REGISTRY_UNDER diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 3e3a7c2c51..9b9cceee84 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -1,6 +1,9 @@ +///Cooldown for the Reset Lobby Menu HUD verb +#define RESET_HUD_INTERVAL 15 SECONDS /mob/dead/new_player var/ready = 0 - var/spawning = 0//Referenced when you want to delete the new_player later on in the code. + ///Referenced when you want to delete the new_player later on in the code. + var/spawning = 0 flags_1 = NONE @@ -11,13 +14,16 @@ hud_type = /datum/hud/new_player hud_possible = list() - var/mob/living/new_character //for instant transfer once the round is set up + ///For instant transfer once the round is set up + var/mob/living/new_character - //Used to make sure someone doesn't get spammed with messages if they're ineligible for roles + ///Used to make sure someone doesn't get spammed with messages if they're ineligible for roles var/ineligible_for_roles = FALSE - //is there a result we want to read from the age gate + ///Is there a result we want to read from the age gate var/age_gate_result + ///Cooldown for the Reset Lobby Menu HUD verb + COOLDOWN_DECLARE(reset_hud_cooldown) /mob/dead/new_player/Initialize(mapload) if(client && SSticker.state == GAME_STATE_STARTUP) @@ -34,6 +40,7 @@ . = ..() GLOB.new_player_list += src + add_verb(src, /mob/dead/new_player/proc/reset_menu_hud) /mob/dead/new_player/Destroy() GLOB.new_player_list -= src @@ -351,6 +358,11 @@ return to_chat(src, "Vote successful.") +/mob/dead/new_player/get_status_tab_items() + . = ..() + if(!SSticker.HasRoundStarted()) //only show this when the round hasn't started yet + . += "Readiness status: [ready ? "" : "Not "]Readied Up!" + //When you cop out of the round (NB: this HAS A SLEEP FOR PLAYER INPUT IN IT) /mob/dead/new_player/proc/make_me_an_observer() if(QDELETED(src) || !src.client) @@ -579,14 +591,14 @@ if(job_datum && IsJobUnavailable(job_datum.title, TRUE) == JOB_AVAILABLE) // Get currently occupied slots var/num_positions_current = job_datum.current_positions - + // Get total slots that can be occupied var/num_positions_total = job_datum.total_positions - + // Change to lemniscate for infinite-slot jobs // This variable should only used to display text! num_positions_total = (num_positions_total == -1 ? "∞" : num_positions_total) - + var/command_bold = "" if(job in GLOB.command_positions) command_bold = " command" @@ -752,3 +764,21 @@ return FALSE //This is the only case someone should actually be completely blocked from antag rolling as well return TRUE + +///Resets the Lobby Menu HUD, recreating and reassigning it to the new player +/mob/dead/new_player/proc/reset_menu_hud() + set name = "Reset Lobby Menu HUD" + set category = "OOC" + var/mob/dead/new_player/new_player = usr + if(!COOLDOWN_FINISHED(new_player, reset_hud_cooldown)) + to_chat(new_player, span_warning("You must wait [DisplayTimeText(COOLDOWN_TIMELEFT(new_player, reset_hud_cooldown))] before resetting the Lobby Menu HUD again!")) + return + if(!new_player?.client) + return + COOLDOWN_START(new_player, reset_hud_cooldown, RESET_HUD_INTERVAL) + qdel(new_player.hud_used) + create_mob_hud() + to_chat(new_player, span_info("Lobby Menu HUD reset. You may reset the HUD again in [DisplayTimeText(RESET_HUD_INTERVAL)].")) + hud_used.show_hud(hud_used.hud_version) + +#undef RESET_HUD_INTERVAL diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index 113a0b33fa..f495dadbf2 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -36,6 +36,17 @@ inserted_item = new inserted_item(src) else inserted_item = new /obj/item/pen(src) + register_context() + +/obj/item/modular_computer/tablet/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(can_have_pen) + if(inserted_item) + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Remove [inserted_item]") + . = CONTEXTUAL_SCREENTIP_SET + else if(is_type_in_list(held_item, contained_item)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Insert [held_item]") + . = CONTEXTUAL_SCREENTIP_SET /obj/item/modular_computer/tablet/proc/insert_pen(obj/item/pen) if(!usr.transferItemToLoc(pen, src)) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 5e7872b92e..9896cc4088 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -290,6 +290,13 @@ set_machine_stat(stat | MAINT) update_appearance() addtimer(CALLBACK(src, .proc/update), 5) + register_context() + +/obj/machinery/power/apc/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + if(operating) + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, locked ? "Unlock" : "Lock") + return CONTEXTUAL_SCREENTIP_SET /obj/machinery/power/apc/Destroy() GLOB.apcs_list -= src diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 75c9f3c117..8eff48a3f8 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -15,6 +15,16 @@ var/ignore_flags = 0 var/infinite = FALSE +/obj/item/reagent_containers/hypospray/Initialize(mapload, vol) + . = ..() + register_item_context() + +/obj/item/reagent_containers/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) + . = ..() + if(iscarbon(target)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Inject") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/reagent_containers/hypospray/attack_paw(mob/user) return attack_hand(user) @@ -378,6 +388,23 @@ if(start_vial) vial = new start_vial update_icon() + register_context() + register_item_context() + +/obj/item/hypospray/mkii/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + . = ..() + // Did you know that clicking something while you're holding it is the same as attack_self()? + if(vial && (held_item == src)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Remove [vial]") + LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Set to [mode ? "spray" : "inject"]") + LAZYSET(context[SCREENTIP_CONTEXT_ALT_LMB], INTENT_ANY, "Set transfer amount") + return CONTEXTUAL_SCREENTIP_SET + +/obj/item/hypospray/mkii/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) + . = ..() + if(iscarbon(target)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, mode ? "Inject" : "Spray") + return CONTEXTUAL_SCREENTIP_SET /obj/item/hypospray/mkii/ComponentInitialize() . = ..() diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index b193e5917a..f916180b4c 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -349,6 +349,16 @@ w_class = WEIGHT_CLASS_TINY attack_verb = list("slapped") +/obj/item/surgical_drapes/Initialize(mapload) + . = ..() + register_item_context() + +/obj/item/surgical_drapes/add_item_context(obj/item/source, list/context, atom/target, mob/living/user) + . = ..() + if(iscarbon(target)) + LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, "Prepare Surgery") + return CONTEXTUAL_SCREENTIP_SET + /obj/item/surgical_drapes/attack(mob/living/M, mob/user) if(!attempt_initiate_surgery(src, M, user)) ..() diff --git a/icons/hud/lobby/background.dmi b/icons/hud/lobby/background.dmi index baae06fc1b..554543ecf3 100644 Binary files a/icons/hud/lobby/background.dmi and b/icons/hud/lobby/background.dmi differ diff --git a/icons/hud/lobby/bottom_buttons.dmi b/icons/hud/lobby/bottom_buttons.dmi index d0aa1228c7..6cbebb6e68 100644 Binary files a/icons/hud/lobby/bottom_buttons.dmi and b/icons/hud/lobby/bottom_buttons.dmi differ diff --git a/icons/hud/lobby/collapse_expand.dmi b/icons/hud/lobby/collapse_expand.dmi new file mode 100644 index 0000000000..03f9f02f3d Binary files /dev/null and b/icons/hud/lobby/collapse_expand.dmi differ diff --git a/icons/hud/lobby/shutter.dmi b/icons/hud/lobby/shutter.dmi new file mode 100644 index 0000000000..baecaca421 Binary files /dev/null and b/icons/hud/lobby/shutter.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 86f9534e45..5b1fb2c3df 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -16,6 +16,7 @@ // BEGIN_INCLUDE #include "_maps\_basemap.dm" #include "_maps\map_files\FestiveBall\doorButtonOrganizer.dm" +#include "code\__byond_version_compat.dm" #include "code\_compile_options.dm" #include "code\world.dm" #include "code\__DEFINES\_auxtools.dm" diff --git a/tgui/package.json b/tgui/package.json index cc4f66beca..34788d4a49 100644 --- a/tgui/package.json +++ b/tgui/package.json @@ -38,7 +38,7 @@ "terser-webpack-plugin": "^5.1.4", "typescript": "^4.3.5", "url-loader": "^4.1.1", - "webpack": "^5.75.0", + "webpack": "^5.76.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-cli": "^4.7.2" }, diff --git a/tgui/yarn.lock b/tgui/yarn.lock index b311fc090b..c6e43316de 100644 --- a/tgui/yarn.lock +++ b/tgui/yarn.lock @@ -7742,7 +7742,7 @@ resolve@^2.0.0-next.3: terser-webpack-plugin: ^5.1.4 typescript: ^4.3.5 url-loader: ^4.1.1 - webpack: ^5.75.0 + webpack: ^5.76.0 webpack-bundle-analyzer: ^4.4.2 webpack-cli: ^4.7.2 languageName: unknown @@ -8334,9 +8334,9 @@ typescript@^4.3.5: languageName: node linkType: hard -"webpack@npm:^5.75.0": - version: 5.75.0 - resolution: "webpack@npm:5.75.0" +"webpack@npm:^5.76.0": + version: 5.76.1 + resolution: "webpack@npm:5.76.1" dependencies: "@types/eslint-scope": ^3.7.3 "@types/estree": ^0.0.51 @@ -8367,7 +8367,7 @@ typescript@^4.3.5: optional: true bin: webpack: bin/webpack.js - checksum: 2bcc5f3c195f375944e8af2f00bf2feea39cb9fda5f763b0d1b00077f1c51783db25c94d3fae96a07dead9fa085e6ae7474417e5ab31719c9776ea5969ceb83a + checksum: b01fe0bc2dbca0e10d290ddb0bf81e807a031de48028176e2b21afd696b4d3f25ab9accdad888ef4a1f7c7f4d41f13d5bf2395b7653fdf3e5e3dafa54e56dab2 languageName: node linkType: hard