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

Panel for viewing and toggling ASM feature flags from the hack manifest. More...

#include <feature_flag_editor_panel.h>

Collaboration diagram for yaze::editor::FeatureFlagEditorPanel:

Classes

struct  EditableFlag
 

Public Member Functions

 FeatureFlagEditorPanel ()
 
 ~FeatureFlagEditorPanel ()
 
void SetProject (project::YazeProject *project)
 Set the project pointer for manifest and path access.
 
void Draw ()
 Draw the panel content (no ImGui::Begin/End).
 

Private Member Functions

void RefreshFromManifest ()
 Refresh the local flags list from the hack manifest.
 
bool SaveToFile ()
 Write the current flag state to Config/feature_flags.asm.
 
std::string ResolveConfigPath () const
 Resolve the absolute path to Config/feature_flags.asm.
 

Private Attributes

project::YazeProjectproject_ = nullptr
 
std::vector< EditableFlagflags_
 
bool needs_refresh_ = true
 
std::string status_message_
 
bool status_is_error_ = false
 
char filter_text_ [128] = {}
 

Detailed Description

Panel for viewing and toggling ASM feature flags from the hack manifest.

Reads feature flags from the loaded HackManifest and allows toggling them by writing updated values back to Config/feature_flags.asm.

The panel displays a table with columns: Flag Name | Value | Status | Source | Toggle

When the user clicks "Save", the panel regenerates the feature_flags.asm file, preserving the header comment block and updating flag values.

Definition at line 29 of file feature_flag_editor_panel.h.

Constructor & Destructor Documentation

◆ FeatureFlagEditorPanel()

yaze::editor::FeatureFlagEditorPanel::FeatureFlagEditorPanel ( )
default

◆ ~FeatureFlagEditorPanel()

yaze::editor::FeatureFlagEditorPanel::~FeatureFlagEditorPanel ( )
default

Member Function Documentation

◆ SetProject()

void yaze::editor::FeatureFlagEditorPanel::SetProject ( project::YazeProject * project)
inline

Set the project pointer for manifest and path access.

Definition at line 37 of file feature_flag_editor_panel.h.

References project_.

◆ Draw()

void yaze::editor::FeatureFlagEditorPanel::Draw ( )

Draw the panel content (no ImGui::Begin/End).

Definition at line 51 of file feature_flag_editor_panel.cc.

References filter_text_, flags_, yaze::project::YazeProject::hack_manifest, ICON_MD_FLAG, ICON_MD_REFRESH, ICON_MD_SAVE, needs_refresh_, project_, RefreshFromManifest(), ResolveConfigPath(), SaveToFile(), status_is_error_, and status_message_.

Here is the call graph for this function:

◆ RefreshFromManifest()

◆ SaveToFile()

bool yaze::editor::FeatureFlagEditorPanel::SaveToFile ( )
private

Write the current flag state to Config/feature_flags.asm.

Returns
true on success.

Definition at line 267 of file feature_flag_editor_panel.cc.

References flags_, ResolveConfigPath(), and status_message_.

Referenced by Draw().

Here is the call graph for this function:

◆ ResolveConfigPath()

std::string yaze::editor::FeatureFlagEditorPanel::ResolveConfigPath ( ) const
private

Resolve the absolute path to Config/feature_flags.asm.

Definition at line 255 of file feature_flag_editor_panel.cc.

References yaze::project::YazeProject::code_folder, yaze::project::YazeProject::GetAbsolutePath(), and project_.

Referenced by Draw(), and SaveToFile().

Here is the call graph for this function:

Member Data Documentation

◆ project_

project::YazeProject* yaze::editor::FeatureFlagEditorPanel::project_ = nullptr
private

◆ flags_

std::vector<EditableFlag> yaze::editor::FeatureFlagEditorPanel::flags_
private

Definition at line 72 of file feature_flag_editor_panel.h.

Referenced by Draw(), RefreshFromManifest(), and SaveToFile().

◆ needs_refresh_

bool yaze::editor::FeatureFlagEditorPanel::needs_refresh_ = true
private

Definition at line 75 of file feature_flag_editor_panel.h.

Referenced by Draw().

◆ status_message_

std::string yaze::editor::FeatureFlagEditorPanel::status_message_
private

Definition at line 76 of file feature_flag_editor_panel.h.

Referenced by Draw(), and SaveToFile().

◆ status_is_error_

bool yaze::editor::FeatureFlagEditorPanel::status_is_error_ = false
private

Definition at line 77 of file feature_flag_editor_panel.h.

Referenced by Draw().

◆ filter_text_

char yaze::editor::FeatureFlagEditorPanel::filter_text_[128] = {}
private

Definition at line 78 of file feature_flag_editor_panel.h.

Referenced by Draw().


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