[MIRROR] Contextual screentips -- Screentips now show you what items/objects can do [MDB IGNORE] (#11529)

* Contextual screentips -- Screentips now show you what items/objects can do (#64502)

Adds the foundational system for contextual screentips, which will show you what you can do with objects/items, including through context, such as what you are holding.

Provides several helper elements for most use cases, and applies it to a handful of common objects in order to show the full breadth of the system.

Changes screentips preference from on/off to on/off/only with context. Players who originally had it on off will have it migrated to only with context, though can re-disable it.

* Contextual screentips -- Screentips now show you what items/objects can do

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-15 23:48:07 +00:00
committed by GitHub
co-authored by Mothblocks
parent 5cc0350ff9
commit d1cfb4338e
30 changed files with 770 additions and 29 deletions
+22 -2
View File
@@ -1,11 +1,31 @@
/datum/preference/toggle/enable_screentips
/datum/preference/choiced/enable_screentips
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "screentip_pref"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/enable_screentips/apply_to_client(client/client, value)
/datum/preference/choiced/enable_screentips/init_possible_values()
return list(SCREENTIP_PREFERENCE_ENABLED, SCREENTIP_PREFERENCE_CONTEXT_ONLY, SCREENTIP_PREFERENCE_DISABLED)
/datum/preference/choiced/enable_screentips/create_default_value()
return SCREENTIP_PREFERENCE_ENABLED
/datum/preference/choiced/enable_screentips/apply_to_client(client/client, value)
client.mob?.hud_used?.screentips_enabled = value
/datum/preference/choiced/enable_screentips/deserialize(input, datum/preferences/preferences)
// Migrate old always disabled screentips to context only.
// Screentips were always meant to have context, though were initially merged without it.
// This accepts that those users found screentips distracting, but gives a second chance now that
// they provide a more obvious helping hand.
// If they are still too distracting, there's nothing stopping them from disabling it again for good.
if (input == FALSE)
return ..(SCREENTIP_PREFERENCE_CONTEXT_ONLY, preferences)
if (input == TRUE)
return ..(SCREENTIP_PREFERENCE_ENABLED, preferences)
return ..(input, preferences)
/datum/preference/color/screentip_color
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "screentip_color"