Show-once feature tips backed by ToastManager + UserSettings. More...
#include <feature_hint_manager.h>

Public Member Functions | |
| void | SetUserSettings (UserSettings *settings) |
| void | SetToastManager (ToastManager *toast_manager) |
| void | SetGuideCallback (std::function< void()> callback) |
| Opens Help → Coming from ZScream (or equivalent) from actionable tips. | |
| void | RegisterBuiltinHints () |
| Register built-in ZScream migrant tips. Safe to call more than once. | |
| void | RegisterHint (FeatureHintDefinition definition) |
| Register or replace a hint definition (tests / future packs). | |
| bool | MaybeShow (std::string_view id) |
| void | Dismiss (std::string_view id) |
| Mark dismissed without showing (e.g. user opened the guide manually). | |
| bool | IsDismissed (std::string_view id) const |
| bool | IsEnabled () const |
| void | SetEnabled (bool enabled) |
| void | ResetDismissed () |
| Clear all dismissed ids and persist. Tips can fire again. | |
| size_t | registered_count () const |
| size_t | dismissed_count () const |
Private Member Functions | |
| void | Persist () |
Private Attributes | |
| UserSettings * | user_settings_ = nullptr |
| ToastManager * | toast_manager_ = nullptr |
| std::function< void()> | guide_callback_ |
| std::unordered_map< std::string, FeatureHintDefinition > | catalog_ |
Show-once feature tips backed by ToastManager + UserSettings.
Modern onboarding layer: fire contextual tips the first time a trigger hits, then persist dismissal so survivors aren't nagged. Reset clears the dismissed set (Settings > Editor Behavior).
Definition at line 51 of file feature_hint_manager.h.
|
inline |
Definition at line 53 of file feature_hint_manager.h.
References user_settings_.
Referenced by yaze::editor::EditorManager::InitializeServices().
|
inline |
Definition at line 54 of file feature_hint_manager.h.
References toast_manager_.
Referenced by yaze::editor::EditorManager::InitializeServices().
|
inline |
Opens Help → Coming from ZScream (or equivalent) from actionable tips.
Definition at line 58 of file feature_hint_manager.h.
References guide_callback_.
Referenced by yaze::editor::EditorManager::InitializeServices().
| void yaze::editor::FeatureHintManager::RegisterBuiltinHints | ( | ) |
Register built-in ZScream migrant tips. Safe to call more than once.
Definition at line 8 of file feature_hint_manager.cc.
References yaze::editor::kInfo, yaze::editor::FeatureHintId::kZScreamDungeon, yaze::editor::FeatureHintId::kZScreamOverworld, yaze::editor::FeatureHintId::kZScreamProjects, yaze::editor::FeatureHintId::kZScreamSave, yaze::editor::FeatureHintId::kZScreamScreenMap, yaze::editor::FeatureHintId::kZScreamTile16, yaze::editor::FeatureHintId::kZScreamWelcome, yaze::editor::FeatureHintId::kZScreamZso, and RegisterHint().
Referenced by yaze::editor::EditorManager::InitializeServices().

| void yaze::editor::FeatureHintManager::RegisterHint | ( | FeatureHintDefinition | definition | ) |
Register or replace a hint definition (tests / future packs).
Definition at line 47 of file feature_hint_manager.cc.
References catalog_, yaze::editor::FeatureHintDefinition::id, and yaze::editor::FeatureHintDefinition::message.
Referenced by RegisterBuiltinHints().
| bool yaze::editor::FeatureHintManager::MaybeShow | ( | std::string_view | id | ) |
Show the tip if enabled, known, and not yet dismissed. Returns true when a toast was emitted (and the id was marked dismissed).
Definition at line 54 of file feature_hint_manager.cc.
References catalog_, Dismiss(), guide_callback_, IsDismissed(), IsEnabled(), yaze::editor::FeatureHintDefinition::message, yaze::editor::FeatureHintDefinition::offer_guide, yaze::editor::ToastManager::Show(), toast_manager_, yaze::editor::FeatureHintDefinition::ttl_seconds, and yaze::editor::FeatureHintDefinition::type.
Referenced by yaze::editor::MenuOrchestrator::AddFileMenuItems(), yaze::editor::EditorManager::MaybeEmitZScreamRomLoadHints(), and yaze::editor::EditorManager::SwitchToEditor().

| void yaze::editor::FeatureHintManager::Dismiss | ( | std::string_view | id | ) |
Mark dismissed without showing (e.g. user opened the guide manually).
Definition at line 77 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::dismissed_feature_hints, Persist(), yaze::editor::UserSettings::prefs(), and user_settings_.
Referenced by MaybeShow(), and yaze::editor::UICoordinator::UICoordinator().

| bool yaze::editor::FeatureHintManager::IsDismissed | ( | std::string_view | id | ) | const |
Definition at line 87 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::dismissed_feature_hints, yaze::editor::UserSettings::prefs(), and user_settings_.
Referenced by MaybeShow().

| bool yaze::editor::FeatureHintManager::IsEnabled | ( | ) | const |
Definition at line 95 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::feature_hints_enabled, yaze::editor::UserSettings::prefs(), and user_settings_.
Referenced by MaybeShow().

| void yaze::editor::FeatureHintManager::SetEnabled | ( | bool | enabled | ) |
Definition at line 102 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::feature_hints_enabled, Persist(), yaze::editor::UserSettings::prefs(), and user_settings_.

| void yaze::editor::FeatureHintManager::ResetDismissed | ( | ) |
Clear all dismissed ids and persist. Tips can fire again.
Definition at line 113 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::dismissed_feature_hints, Persist(), yaze::editor::UserSettings::prefs(), and user_settings_.

|
inline |
Definition at line 82 of file feature_hint_manager.h.
References catalog_.
| size_t yaze::editor::FeatureHintManager::dismissed_count | ( | ) | const |
Definition at line 121 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Preferences::dismissed_feature_hints, yaze::editor::UserSettings::prefs(), and user_settings_.

|
private |
Definition at line 128 of file feature_hint_manager.cc.
References yaze::editor::UserSettings::Save(), and user_settings_.
Referenced by Dismiss(), ResetDismissed(), and SetEnabled().

|
private |
Definition at line 88 of file feature_hint_manager.h.
Referenced by Dismiss(), dismissed_count(), IsDismissed(), IsEnabled(), Persist(), ResetDismissed(), SetEnabled(), and SetUserSettings().
|
private |
Definition at line 89 of file feature_hint_manager.h.
Referenced by MaybeShow(), and SetToastManager().
|
private |
Definition at line 90 of file feature_hint_manager.h.
Referenced by MaybeShow(), and SetGuideCallback().
|
private |
Definition at line 91 of file feature_hint_manager.h.
Referenced by MaybeShow(), registered_count(), and RegisterHint().