yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::FeatureHintManager Class Reference

Show-once feature tips backed by ToastManager + UserSettings. More...

#include <feature_hint_manager.h>

Collaboration diagram for yaze::editor::FeatureHintManager:

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_
 

Detailed Description

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.

Member Function Documentation

◆ SetUserSettings()

void yaze::editor::FeatureHintManager::SetUserSettings ( UserSettings * settings)
inline

Definition at line 53 of file feature_hint_manager.h.

References user_settings_.

Referenced by yaze::editor::EditorManager::InitializeServices().

◆ SetToastManager()

void yaze::editor::FeatureHintManager::SetToastManager ( ToastManager * toast_manager)
inline

Definition at line 54 of file feature_hint_manager.h.

References toast_manager_.

Referenced by yaze::editor::EditorManager::InitializeServices().

◆ SetGuideCallback()

void yaze::editor::FeatureHintManager::SetGuideCallback ( std::function< void()> callback)
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().

◆ RegisterBuiltinHints()

◆ RegisterHint()

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().

◆ MaybeShow()

bool yaze::editor::FeatureHintManager::MaybeShow ( std::string_view id)

◆ Dismiss()

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().

Here is the call graph for this function:

◆ IsDismissed()

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().

Here is the call graph for this function:

◆ IsEnabled()

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().

Here is the call graph for this function:

◆ SetEnabled()

void yaze::editor::FeatureHintManager::SetEnabled ( bool enabled)

◆ ResetDismissed()

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_.

Here is the call graph for this function:

◆ registered_count()

size_t yaze::editor::FeatureHintManager::registered_count ( ) const
inline

Definition at line 82 of file feature_hint_manager.h.

References catalog_.

◆ dismissed_count()

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_.

Here is the call graph for this function:

◆ Persist()

void yaze::editor::FeatureHintManager::Persist ( )
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().

Here is the call graph for this function:

Member Data Documentation

◆ user_settings_

UserSettings* yaze::editor::FeatureHintManager::user_settings_ = nullptr
private

◆ toast_manager_

ToastManager* yaze::editor::FeatureHintManager::toast_manager_ = nullptr
private

Definition at line 89 of file feature_hint_manager.h.

Referenced by MaybeShow(), and SetToastManager().

◆ guide_callback_

std::function<void()> yaze::editor::FeatureHintManager::guide_callback_
private

Definition at line 90 of file feature_hint_manager.h.

Referenced by MaybeShow(), and SetGuideCallback().

◆ catalog_

std::unordered_map<std::string, FeatureHintDefinition> yaze::editor::FeatureHintManager::catalog_
private

Definition at line 91 of file feature_hint_manager.h.

Referenced by MaybeShow(), registered_count(), and RegisterHint().


The documentation for this class was generated from the following files: