Skip to content

Commit

Permalink
qol: toggle item tips (#5909)
Browse files Browse the repository at this point in the history
* item tips

* fix

* Update

* fiiiix

* fiiiix

* dots
  • Loading branch information
syndicatecat committed Sep 21, 2024
1 parent 9d54dc1 commit 3d06ada
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
17 changes: 9 additions & 8 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@
#define PREFTOGGLE_2_MC_TAB (1<<11) // 2048
#define PREFTOGGLE_2_DISABLE_TGUI_INPUT (1<<12) // 4096
#define PREFTOGGLE_2_PARALLAX_MULTIZ (1<<13) // 8192
#define PREFTOGGLE_2_DISABLE_VOTE_POPUPS (1<<14) // 16384
#define PREFTOGGLE_2_SWAP_INPUT_BUTTONS (1<<15) // 32768
#define PREFTOGGLE_2_LARGE_INPUT_BUTTONS (1<<16) // 65536
#define PREFTOGGLE_2_BIG_STRIP_MENU (1<<17) // 131072
#define PREFTOGGLE_2_ENABLE_TGUI_SAY_LIGHT_MODE (1<<18) // 262144
#define PREFTOGGLE_2_PIXELATED_MENU (1<<19) // 524288
#define PREFTOGGLE_2_DISABLE_VOTE_POPUPS (1<<14) // 16384
#define PREFTOGGLE_2_SWAP_INPUT_BUTTONS (1<<15) // 32768
#define PREFTOGGLE_2_LARGE_INPUT_BUTTONS (1<<16) // 65536
#define PREFTOGGLE_2_BIG_STRIP_MENU (1<<17) // 131072
#define PREFTOGGLE_2_ENABLE_TGUI_SAY_LIGHT_MODE (1<<18) // 262144
#define PREFTOGGLE_2_PIXELATED_MENU (1<<19) // 524288
#define PREFTOGGLE_2_DESC_TIPS (1<<20) // 1048576

#define TOGGLES_2_TOTAL 1048575 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_2_TOTAL 2097151 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.

#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCYUI|PREFTOGGLE_2_ITEMATTACK|PREFTOGGLE_2_WINDOWFLASHING|PREFTOGGLE_2_RUNECHAT|PREFTOGGLE_2_DEATHMESSAGE|PREFTOGGLE_2_SEE_ITEM_OUTLINES|PREFTOGGLE_2_PARALLAX_MULTIZ|PREFTOGGLE_2_SWAP_INPUT_BUTTONS|PREFTOGGLE_2_LARGE_INPUT_BUTTONS)
#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCYUI|PREFTOGGLE_2_ITEMATTACK|PREFTOGGLE_2_WINDOWFLASHING|PREFTOGGLE_2_RUNECHAT|PREFTOGGLE_2_DEATHMESSAGE|PREFTOGGLE_2_SEE_ITEM_OUTLINES|PREFTOGGLE_2_PARALLAX_MULTIZ|PREFTOGGLE_2_SWAP_INPUT_BUTTONS|PREFTOGGLE_2_LARGE_INPUT_BUTTONS|PREFTOGGLE_2_DESC_TIPS)

// Sanity checks
#if TOGGLES_TOTAL > 16777215
Expand Down
15 changes: 8 additions & 7 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1001,18 +1001,19 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/g

/obj/item/MouseEntered(location, control, params)
if(item_flags & (IN_INVENTORY|IN_STORAGE))
var/timedelay = 8
var/mob/user = usr
tip_timer = addtimer(CALLBACK(src, PROC_REF(openTip), location, control, params, user), timedelay, TIMER_STOPPABLE)
var/mob/living/user = usr
if(user.client.prefs.toggles2 & PREFTOGGLE_2_DESC_TIPS)
var/timedelay = 8
tip_timer = addtimer(CALLBACK(src, PROC_REF(openTip), location, control, params, user), timedelay, TIMER_STOPPABLE)

if(QDELETED(src))
return
var/mob/living/L = user
if(!(user.client.prefs.toggles2 & PREFTOGGLE_2_SEE_ITEM_OUTLINES))
return
if(istype(L) && L.incapacitated())
apply_outline(L, COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now
if(istype(user) && user.incapacitated())
apply_outline(user, COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now
else
apply_outline(L) //if the player's alive and well we send the command with no color set, so it uses the theme's color
apply_outline(user) //if the player's alive and well we send the command with no color set, so it uses the theme's color


/obj/item/MouseExited()
Expand Down
10 changes: 10 additions & 0 deletions code/modules/client/preference/preferences_toggles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -580,3 +580,13 @@
enable_message = "You will see full-size TGUI strip menu."
disable_message = "You will see minuature TGUI strip menu."
blackbox_message = "Toggle TGUI strip menu size"

/datum/preference_toggle/toggle_item_descritpion_tips
name = "Toggle item description tips"
description = "Toggles item description tips on hover."
preftoggle_bitflag = PREFTOGGLE_2_DESC_TIPS
preftoggle_toggle = PREFTOGGLE_TOGGLE2
preftoggle_category = PREFTOGGLE_CATEGORY_LIVING
enable_message = "You will see item description tips now."
disable_message = "You will not see item description tips now."
blackbox_message = "Toggle item description tips on hover"

0 comments on commit 3d06ada

Please sign in to comment.