From fdfac13c19fdc01f8fe1396c3e782107dd184a44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 17:08:39 +0000 Subject: [PATCH 1/6] Bump webpack from 5.75.0 to 5.76.0 in /tgui Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- tgui/package.json | 2 +- tgui/yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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 From 6ab934f6a1f92c81c23d0170db140b0ffc94ede9 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 19 Jul 2023 15:06:23 -0300 Subject: [PATCH 2/6] pushies --- code/__DEFINES/dcs/signals/signals_hud.dm | 4 + code/__DEFINES/layers_planes.dm | 10 +- code/__byond_version_compat.dm | 34 ++++ code/_onclick/hud/new_player.dm | 157 +++++++++++++++--- .../modules/mob/dead/new_player/new_player.dm | 44 ++++- icons/hud/lobby/background.dmi | Bin 527 -> 558 bytes icons/hud/lobby/bottom_buttons.dmi | Bin 844 -> 1040 bytes icons/hud/lobby/collapse_expand.dmi | Bin 0 -> 919 bytes icons/hud/lobby/shutter.dmi | Bin 0 -> 603 bytes tgstation.dme | 2 + 10 files changed, 220 insertions(+), 31 deletions(-) create mode 100644 code/__DEFINES/dcs/signals/signals_hud.dm create mode 100644 code/__byond_version_compat.dm create mode 100644 icons/hud/lobby/collapse_expand.dmi create mode 100644 icons/hud/lobby/shutter.dmi 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/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/icons/hud/lobby/background.dmi b/icons/hud/lobby/background.dmi index baae06fc1bd10d114eed3d0a20fe48a920347b1e..554543ecf3f728d6af47ef9bd33312457d93c537 100644 GIT binary patch delta 339 zcmeBYS;sQrNxiA3i(^PexvKZzZLQyZ59Y+jr{I z+88-Qt*KwwE8==)PEMG0GkImvzgh2h1#v!-O*qiN$jrubW3fT~pXID7%rN;=YQK43 zltJRpvTUX`xwr3@n3(;^UV6sl$fvpTe4n%Z%44@Le%*FobLmp~7wr+7{#49~FaCS( zSd!19dCLyH{r)*q^7J{23@yK-x)H}@=1rU%d&hT~ ih4=d#Wzp$P!+qN6LZ{rznJ z`tmk*PWgPA^{R|~-t%q0Rkx{rQexKWd+f}fE&Wf!SGc*fYm-j*w>6hPxJOQVQ+55P zS4e2+h1G5GPb)9&PY-y0GS9qZ7T5LfuK&{xUA39{&P4S1&CutLye9MBgTe~DWM4fhJuWj diff --git a/icons/hud/lobby/bottom_buttons.dmi b/icons/hud/lobby/bottom_buttons.dmi index d0aa1228c7db38b89bcc173373c4b38c5d81126f..6cbebb6e68ccbfb9b91529c412a58275bbb350db 100644 GIT binary patch literal 1040 zcmV+r1n>KaP)w00001bW%=J06^y0W&i*H z*LqY~bVOxyV{&P5bZKvH004NLos-K7gD?<9*U47|-Imgd+ir?dT-0BXv>8nxKFEYh z|GrT{E4297&4hcxJ%sq|8sCzXMfZfhz@Vxtc46W1L`kcJm2L?_N+hU4+F?P!ycXtR=6DhITS>8@oaU47jtfLPsl z6EwEpMtz%XB73XG0OG%J;7&pFcQ+n>>FuH?&wcnzc-IxZxlqU-ddp+3CMLu6$joX9 z^I4om{fGMi(asJgM~Al`0008FNklqK5Jk;~HPs$+0B0`XPA<@lH!MM7 z&uoI=0EipF0nkXfz-+hyTn;Chw!iIicNL6;2KT1o_IKHx@++&%GfM4+);7Z~HLtbJ z;FBF+*lgP!Z^QW3vvaIHI_I{H=W5V4gfWRjNd4C#gqvzoQxAGYbe+URbN^`L(rq>A zMLf|M*K~TZzapA$TCsO1ei%QC_i;_97mju#xpvQo_Kei3X4KD2v2 zf8&cdkB{OwNfuATM4p&sd-4yS^Z1jPtU#PS=kc|8yn4Hxwwz}_@3}ADQwYR;ZHecd zCGyPw>|=mAMqGtw78K$bU?KfgMR=lEVVl7wTXw3z{yWbv-=+3OYn$7Qm5tUm2X*`K zvoWNLfyT@=g8Pwt)!@HhQ&|^583>xTn7~b_P5wOXih5n_r;@qE- z!6Tol6#@1ao+YgALSMq_F7zd=E};KJx&068Bp3|Jnu$S_HXc^);RaE<$Z+N!ZiY?` zq+xgmy=)C+f#C&u*&0a0aONIv5G&f6i9wWVYbKRvUCqQGO0_kUCC{t(aDyn-)=Uhd zbP>JGJ^T?*7248M^~avIwGs7wd!bH(ckE9;e#Q3lUS>a0ZvO@?&yg?d2QTyh0000< KMNUMnLSTZN0_?s3 literal 844 zcmV-S1GD^zP)fFDZ*Bkpc$}S*K?;K~6hzm_DS~cGX~k_fMJX=o6(rPe5{OaqL#4NGRIn|y z*tnYsGhrV5n4R-WQL^k>&^uUEona@I?hlj+wB&9@x64K2E9e3bm)OT7(l+?!>s0aZ#gH)AO)3S~ZrnpU|V$eNpEXj4A5Q7}FjrBonQ39UGkE_?2^R%LbUZ zCc0t+QHXciKbB_0K%K95nAog{hHY-JCNXS$y~Bi|z9W;b!ICC@GWeT&1L@<0)6Q9! zui^MEPX>SU(J(XvSt>k|B^xUE+zJC$Kts2>YlpT}!BVlphMc3)TaqgDn#dOR!TOCh z<7>sEF(yR@ztOI2n9-`ytbce~=PF#@^SG_iYBzp<>l&>dzd6*?{$+n0H~ZHb?H_6F zFWUKQU8B|cSnZ)ktA$Jb!li{vLH`pjJ->hY@$q)}#^?24oz$kmJ0>k5GEuR12@f`&vRRu*AGjl7m3@_8oDGC24RmM19>h=5orVgkv)oqtI z&>Y5+AirP+hi5m^fSfH=ArU1msl~}fnFS@8`FRWs6?1~a3W`diyr_xBoQvPAjc>{$J&3_Rn_@CR<(kwA|r6XRQ8; z$Nr6d;jNe5uV@~5`L!w8X?6X+KfSx=$p1ZJ_fSOC?!BCY{3)88^S^1@l~q2;A))^z{#0 zysXRxiv^Okd>NR2U`q{?Kegb@E9aa4JtSRy184sc>z)n^)&BfKJG|Ha})uCkP^;aB!=sMm--${({+tM0)m{*WIBrpm7P(x@E{ z6#Ch?ASXIt8C#Q)slb$6?o(GBK%7mvjx(h=K%8y58o|t9&NkP;>_scCI=mG%UC*Z~ zFl8k+omoAbF4a2SEadvmoXW0smw(FYPiuv5HUha%*{#&<>Xq;6mCxTdvn@;fjQIbR z4#)N9bNs4lj$R|qHtD&rvTFW^RqDW?*}p(u!}~u2+e6`o%*rG3z)Zp5>FVdQ&MBb@ E0F)%4j{pDw literal 0 HcmV?d00001 diff --git a/icons/hud/lobby/shutter.dmi b/icons/hud/lobby/shutter.dmi new file mode 100644 index 0000000000000000000000000000000000000000..baecaca4217b43e982f71b53b0a6b61f315b69d3 GIT binary patch literal 603 zcmeAS@N?(olHy`uVBq!ia0vp^>w&n5g&9a5>T6vGq~rp8LR=3VIG~`QHEZ$w2aoRr zhR0dhxJ1V%nVDNXx!*CR(dF>%uL?kwj3q&S!3+-1ZlnP@c~v11B`&GO$wiq3C7Jno z3=9=>g2M`mO22;zF8KKMiI%sn*10q1gExd4Tr__0Nawtd=1GPkp0mC?EsTSVFB^L~ z*d#Nrdo=0Dq!5MZl@^P)EK%9&(b;XRx_O0!%ITvs!=}ub&6TLFz2n!;hF&&?b)C|U z+B{J@Kvxucx;TbpG`^kY=*40v;41uup>xZQcRF{v)iXGEls#lko48luh;)bfh1*tP z>bAibCPrR~7rAo(>X+xfr4@~3=YDF)xqr;`n>6$Cor9Mya@S2c$1F8x>1LA+m1`t; zF7vXP^^3k{V?JEc+;}$m=&pkY4DKc*e2&hMzm6csO>t1P)S@>J& z{l{#D4SSB)Kgj-At9j10)7p`f&Fll;53fH?!A+C*mrZ%F?BUa$o=c~gY=1rfowwzZ zd(V`!*I72X|F`trd2QD8)@7>p*MH5cp541==f5xZKOR5-%=72#*#pZbnwx+4pm9s? z?cLj5mH8=W>qH)Z&ad8*8CzI=!tLG?7W2OT Date: Wed, 19 Jul 2023 20:51:25 -0300 Subject: [PATCH 3/6] some hints --- code/datums/components/gps.dm | 12 +++++++++ code/datums/components/rotation.dm | 18 ++++++++++++- code/datums/elements/mob_holder.dm | 16 +++++++++-- code/game/machinery/ai_slipper.dm | 10 +++++++ code/game/machinery/doors/airlock.dm | 12 +++++++-- code/game/machinery/hologram.dm | 13 +++++++++ code/game/machinery/pipe/construction.dm | 7 +++++ .../machinery/porta_turret/portable_turret.dm | 8 ++++++ code/game/machinery/status_display.dm | 6 +++++ code/game/objects/items/dna_injector.dm | 16 +++++++++++ code/game/objects/structures/bedsheet_bin.dm | 7 +++++ .../atmospherics/machinery/airalarm.dm | 6 +++++ .../atmospherics/machinery/atmosmachinery.dm | 15 +++++++++++ code/modules/clothing/under/_under.dm | 20 ++++++++++++-- .../computers/item/tablet.dm | 11 ++++++++ code/modules/power/apc.dm | 7 +++++ .../reagents/reagent_containers/hypospray.dm | 27 +++++++++++++++++++ code/modules/surgery/tools.dm | 10 +++++++ 18 files changed, 214 insertions(+), 7 deletions(-) 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..2f2bfffcb0 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -299,6 +299,12 @@ /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 /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..04a39ac8cf 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -99,12 +99,13 @@ has_sensor = BROKEN_SENSORS sensordamage = sensormaxintegrity -/obj/item/clothing/under/New() +/obj/item/clothing/under/Initialize(mapload) if(sensor_flags & SENSOR_RANDOM) //make the sensor mode favor higher levels, except coords. sensor_mode = pick(SENSOR_OFF, SENSOR_LIVING, SENSOR_LIVING, SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_COORDS, SENSOR_COORDS) sensor_mode_intended = sensor_mode - ..() + register_context() + return ..() /obj/item/clothing/under/equipped(mob/user, slot) ..() @@ -360,5 +361,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/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)) ..() From 86cc2c0b0db7f1b19d4d52fe8b9091a162a8f376 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 19 Jul 2023 20:57:09 -0300 Subject: [PATCH 4/6] must return --- code/game/machinery/status_display.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 2f2bfffcb0..c550f72946 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -305,6 +305,7 @@ . = ..() 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) . = ..() From 3645d00ec04a8194fcb34bf7df8dee6610ae3600 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 19 Jul 2023 21:15:52 -0300 Subject: [PATCH 5/6] alright then --- code/modules/clothing/under/_under.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 04a39ac8cf..4c872e5f83 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -99,13 +99,13 @@ has_sensor = BROKEN_SENSORS sensordamage = sensormaxintegrity -/obj/item/clothing/under/Initialize(mapload) +/obj/item/clothing/under/New() if(sensor_flags & SENSOR_RANDOM) //make the sensor mode favor higher levels, except coords. sensor_mode = pick(SENSOR_OFF, SENSOR_LIVING, SENSOR_LIVING, SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_COORDS, SENSOR_COORDS) sensor_mode_intended = sensor_mode register_context() - return ..() + ..() /obj/item/clothing/under/equipped(mob/user, slot) ..() From 994ff214d51ff47255738d953e2bf3a6f26255d0 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 23 Jul 2023 15:06:20 -0300 Subject: [PATCH 6/6] ? --- code/modules/clothing/under/_under.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 4c872e5f83..fc4cee1bed 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -104,9 +104,12 @@ //make the sensor mode favor higher levels, except coords. sensor_mode = pick(SENSOR_OFF, SENSOR_LIVING, SENSOR_LIVING, SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_COORDS, SENSOR_COORDS) sensor_mode_intended = sensor_mode - register_context() ..() +/obj/item/clothing/under/Initialize(mapload) + . = ..() + register_context() + /obj/item/clothing/under/equipped(mob/user, slot) ..() if(adjusted)