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

#include <oracle_validation_panel.h>

Inheritance diagram for yaze::editor::OracleValidationPanel:
Collaboration diagram for yaze::editor::OracleValidationPanel:

Public Member Functions

 ~OracleValidationPanel () override
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
std::string GetWorkflowGroup () const override
 Optional workflow group for hack-centric actions.
 
std::string GetWorkflowLabel () const override
 Optional workflow label for menus/command palette.
 
std::string GetWorkflowDescription () const override
 Optional workflow description for menus/command palette.
 
bool IsEnabled () const override
 Check if this panel is currently enabled.
 
std::string GetDisabledTooltip () const override
 Get tooltip text when panel is disabled.
 
WindowLifecycle GetWindowLifecycle () const override
 Get the lifecycle category for this window.
 
float GetPreferredWidth () const override
 Get preferred width for this panel (optional)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
 ~OracleValidationPanel () override
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
std::string GetWorkflowGroup () const override
 Optional workflow group for hack-centric actions.
 
std::string GetWorkflowLabel () const override
 Optional workflow label for menus/command palette.
 
std::string GetWorkflowDescription () const override
 Optional workflow description for menus/command palette.
 
bool IsEnabled () const override
 Check if this panel is currently enabled.
 
std::string GetDisabledTooltip () const override
 Get tooltip text when panel is disabled.
 
WindowLifecycle GetWindowLifecycle () const override
 Get the lifecycle category for this window.
 
float GetPreferredWidth () const override
 Get preferred width for this panel (optional)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual int GetPriority () const
 Get display priority for menu ordering.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Member Functions

void PollPendingResult ()
 
RomGetRom () const
 
void LaunchRun (oracle_validation::RunMode mode)
 
void DrawOptions ()
 
void DrawActionButtons ()
 
void DrawResults ()
 
void DrawSmokeCards (const oracle_validation::SmokeResult &smoke)
 
void DrawPreflightCards (const oracle_validation::PreflightResult &preflight)
 
void DrawRawOutput (const oracle_validation::OracleRunResult &result)
 
void PollPendingResult ()
 
RomGetRom () const
 
void LaunchRun (oracle_validation::RunMode mode)
 
void DrawOptions ()
 
void DrawActionButtons ()
 
void DrawResults ()
 
void DrawSmokeCards (const oracle_validation::SmokeResult &smoke)
 
void DrawPreflightCards (const oracle_validation::PreflightResult &preflight)
 
void DrawRawOutput (const oracle_validation::OracleRunResult &result)
 

Static Private Member Functions

static std::string DefaultRomPath ()
 
static std::string DefaultRomPath ()
 

Private Attributes

std::string rom_path_ = DefaultRomPath()
 
int min_d6_track_rooms_ = 4
 
bool write_report_ = false
 
std::string report_path_
 
std::string required_collision_rooms_ = "0x25,0x27"
 
bool running_ = false
 
std::future< oracle_validation::OracleRunResultpending_
 
std::optional< oracle_validation::OracleRunResultlast_result_
 
std::string status_message_
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

Definition at line 17 of file oracle_validation_panel.h.

Constructor & Destructor Documentation

◆ ~OracleValidationPanel() [1/2]

yaze::editor::OracleValidationPanel::~OracleValidationPanel ( )
override

Definition at line 121 of file oracle_validation_panel.cc.

References pending_.

◆ ~OracleValidationPanel() [2/2]

yaze::editor::OracleValidationPanel::~OracleValidationPanel ( )
override

Member Function Documentation

◆ GetId() [1/2]

std::string yaze::editor::OracleValidationPanel::GetId ( ) const
overridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

Definition at line 127 of file oracle_validation_panel.cc.

◆ GetDisplayName() [1/2]

std::string yaze::editor::OracleValidationPanel::GetDisplayName ( ) const
overridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

Definition at line 131 of file oracle_validation_panel.cc.

◆ GetIcon() [1/2]

std::string yaze::editor::OracleValidationPanel::GetIcon ( ) const
overridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 135 of file oracle_validation_panel.cc.

References ICON_MD_VERIFIED_USER.

◆ GetEditorCategory() [1/2]

std::string yaze::editor::OracleValidationPanel::GetEditorCategory ( ) const
overridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

Definition at line 139 of file oracle_validation_panel.cc.

◆ GetWorkflowGroup() [1/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowGroup ( ) const
overridevirtual

Optional workflow group for hack-centric actions.

Returns
Non-empty group name to surface this panel in hack workflows.

Reimplemented from yaze::editor::WindowContent.

Definition at line 143 of file oracle_validation_panel.cc.

◆ GetWorkflowLabel() [1/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowLabel ( ) const
overridevirtual

Optional workflow label for menus/command palette.

Returns
Action label to use when surfacing this panel via workflows.

Reimplemented from yaze::editor::WindowContent.

Definition at line 147 of file oracle_validation_panel.cc.

◆ GetWorkflowDescription() [1/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowDescription ( ) const
overridevirtual

Optional workflow description for menus/command palette.

Reimplemented from yaze::editor::WindowContent.

Definition at line 151 of file oracle_validation_panel.cc.

◆ IsEnabled() [1/2]

bool yaze::editor::OracleValidationPanel::IsEnabled ( ) const
overridevirtual

Check if this panel is currently enabled.

Returns
true if panel can be shown, false if disabled

Disabled panels appear grayed out in menus. Override to implement conditional availability (e.g., requires ROM loaded).

Reimplemented from yaze::editor::WindowContent.

Definition at line 155 of file oracle_validation_panel.cc.

References yaze::editor::ContentRegistry::Context::current_project(), and yaze::editor::ContentRegistry::Context::hack_validation_backend().

Referenced by Draw().

Here is the call graph for this function:

◆ GetDisabledTooltip() [1/2]

std::string yaze::editor::OracleValidationPanel::GetDisabledTooltip ( ) const
overridevirtual

Get tooltip text when panel is disabled.

Returns
Explanation of why panel is disabled (e.g., "Requires ROM to be loaded")

Reimplemented from yaze::editor::WindowContent.

Definition at line 161 of file oracle_validation_panel.cc.

Referenced by Draw().

◆ GetWindowLifecycle() [1/2]

WindowLifecycle yaze::editor::OracleValidationPanel::GetWindowLifecycle ( ) const
overridevirtual

Get the lifecycle category for this window.

Returns
WindowLifecycle determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::WindowContent.

Definition at line 165 of file oracle_validation_panel.cc.

References yaze::editor::CrossEditor.

◆ GetPreferredWidth() [1/2]

float yaze::editor::OracleValidationPanel::GetPreferredWidth ( ) const
overridevirtual

Get preferred width for this panel (optional)

Returns
Preferred width in pixels, or 0 to use default (250px)

Override this to specify content-based sizing. For example, a tile selector with 8 tiles at 16px × 2.0 scale would return ~276px.

Reimplemented from yaze::editor::WindowContent.

Definition at line 169 of file oracle_validation_panel.cc.

◆ Draw() [1/2]

void yaze::editor::OracleValidationPanel::Draw ( bool * p_open)
overridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::WindowContent.

Definition at line 173 of file oracle_validation_panel.cc.

References DrawActionButtons(), DrawOptions(), DrawResults(), GetDisabledTooltip(), IsEnabled(), and PollPendingResult().

◆ DefaultRomPath() [1/2]

std::string yaze::editor::OracleValidationPanel::DefaultRomPath ( )
staticprivate

◆ PollPendingResult() [1/2]

void yaze::editor::OracleValidationPanel::PollPendingResult ( )
private

Definition at line 198 of file oracle_validation_panel.cc.

References last_result_, pending_, running_, and status_message_.

Referenced by Draw().

◆ GetRom() [1/2]

Rom * yaze::editor::OracleValidationPanel::GetRom ( ) const
private

Definition at line 211 of file oracle_validation_panel.cc.

References yaze::editor::ContentRegistry::Context::rom().

Referenced by DrawActionButtons(), and LaunchRun().

Here is the call graph for this function:

◆ LaunchRun() [1/2]

◆ DrawOptions() [1/2]

void yaze::editor::OracleValidationPanel::DrawOptions ( )
private

Definition at line 260 of file oracle_validation_panel.cc.

References DefaultRomPath(), min_d6_track_rooms_, report_path_, required_collision_rooms_, rom_path_, and write_report_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawActionButtons() [1/2]

void yaze::editor::OracleValidationPanel::DrawActionButtons ( )
private

◆ DrawResults() [1/2]

void yaze::editor::OracleValidationPanel::DrawResults ( )
private

◆ DrawSmokeCards() [1/2]

◆ DrawPreflightCards() [1/2]

◆ DrawRawOutput() [1/2]

void yaze::editor::OracleValidationPanel::DrawRawOutput ( const oracle_validation::OracleRunResult & result)
private

◆ GetId() [2/2]

std::string yaze::editor::OracleValidationPanel::GetId ( ) const
overridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

◆ GetDisplayName() [2/2]

std::string yaze::editor::OracleValidationPanel::GetDisplayName ( ) const
overridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

◆ GetIcon() [2/2]

std::string yaze::editor::OracleValidationPanel::GetIcon ( ) const
overridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

◆ GetEditorCategory() [2/2]

std::string yaze::editor::OracleValidationPanel::GetEditorCategory ( ) const
overridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

◆ GetWorkflowGroup() [2/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowGroup ( ) const
overridevirtual

Optional workflow group for hack-centric actions.

Returns
Non-empty group name to surface this panel in hack workflows.

Reimplemented from yaze::editor::WindowContent.

◆ GetWorkflowLabel() [2/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowLabel ( ) const
overridevirtual

Optional workflow label for menus/command palette.

Returns
Action label to use when surfacing this panel via workflows.

Reimplemented from yaze::editor::WindowContent.

◆ GetWorkflowDescription() [2/2]

std::string yaze::editor::OracleValidationPanel::GetWorkflowDescription ( ) const
overridevirtual

Optional workflow description for menus/command palette.

Reimplemented from yaze::editor::WindowContent.

◆ IsEnabled() [2/2]

bool yaze::editor::OracleValidationPanel::IsEnabled ( ) const
overridevirtual

Check if this panel is currently enabled.

Returns
true if panel can be shown, false if disabled

Disabled panels appear grayed out in menus. Override to implement conditional availability (e.g., requires ROM loaded).

Reimplemented from yaze::editor::WindowContent.

◆ GetDisabledTooltip() [2/2]

std::string yaze::editor::OracleValidationPanel::GetDisabledTooltip ( ) const
overridevirtual

Get tooltip text when panel is disabled.

Returns
Explanation of why panel is disabled (e.g., "Requires ROM to be loaded")

Reimplemented from yaze::editor::WindowContent.

◆ GetWindowLifecycle() [2/2]

WindowLifecycle yaze::editor::OracleValidationPanel::GetWindowLifecycle ( ) const
overridevirtual

Get the lifecycle category for this window.

Returns
WindowLifecycle determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::WindowContent.

◆ GetPreferredWidth() [2/2]

float yaze::editor::OracleValidationPanel::GetPreferredWidth ( ) const
overridevirtual

Get preferred width for this panel (optional)

Returns
Preferred width in pixels, or 0 to use default (250px)

Override this to specify content-based sizing. For example, a tile selector with 8 tiles at 16px × 2.0 scale would return ~276px.

Reimplemented from yaze::editor::WindowContent.

◆ Draw() [2/2]

void yaze::editor::OracleValidationPanel::Draw ( bool * p_open)
overridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::WindowContent.

◆ DefaultRomPath() [2/2]

static std::string yaze::editor::OracleValidationPanel::DefaultRomPath ( )
staticprivate

◆ PollPendingResult() [2/2]

void yaze::editor::OracleValidationPanel::PollPendingResult ( )
private

◆ GetRom() [2/2]

Rom * yaze::editor::OracleValidationPanel::GetRom ( ) const
private

◆ LaunchRun() [2/2]

void yaze::editor::OracleValidationPanel::LaunchRun ( oracle_validation::RunMode mode)
private

◆ DrawOptions() [2/2]

void yaze::editor::OracleValidationPanel::DrawOptions ( )
private

◆ DrawActionButtons() [2/2]

void yaze::editor::OracleValidationPanel::DrawActionButtons ( )
private

◆ DrawResults() [2/2]

void yaze::editor::OracleValidationPanel::DrawResults ( )
private

◆ DrawSmokeCards() [2/2]

void yaze::editor::OracleValidationPanel::DrawSmokeCards ( const oracle_validation::SmokeResult & smoke)
private

◆ DrawPreflightCards() [2/2]

void yaze::editor::OracleValidationPanel::DrawPreflightCards ( const oracle_validation::PreflightResult & preflight)
private

◆ DrawRawOutput() [2/2]

void yaze::editor::OracleValidationPanel::DrawRawOutput ( const oracle_validation::OracleRunResult & result)
private

Member Data Documentation

◆ rom_path_

std::string yaze::editor::OracleValidationPanel::rom_path_ = DefaultRomPath()
private

Definition at line 48 of file oracle_validation_panel.h.

Referenced by DrawActionButtons(), DrawOptions(), and LaunchRun().

◆ min_d6_track_rooms_

int yaze::editor::OracleValidationPanel::min_d6_track_rooms_ = 4
private

Definition at line 49 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ write_report_

bool yaze::editor::OracleValidationPanel::write_report_ = false
private

Definition at line 50 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ report_path_

std::string yaze::editor::OracleValidationPanel::report_path_
private

Definition at line 51 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ required_collision_rooms_

std::string yaze::editor::OracleValidationPanel::required_collision_rooms_ = "0x25,0x27"
private

Definition at line 52 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ running_

bool yaze::editor::OracleValidationPanel::running_ = false
private

Definition at line 54 of file oracle_validation_panel.h.

Referenced by DrawActionButtons(), LaunchRun(), and PollPendingResult().

◆ pending_

std::future< oracle_validation::OracleRunResult > yaze::editor::OracleValidationPanel::pending_
private

Definition at line 55 of file oracle_validation_panel.h.

Referenced by LaunchRun(), PollPendingResult(), and ~OracleValidationPanel().

◆ last_result_

std::optional< oracle_validation::OracleRunResult > yaze::editor::OracleValidationPanel::last_result_
private

Definition at line 56 of file oracle_validation_panel.h.

Referenced by DrawResults(), and PollPendingResult().

◆ status_message_

std::string yaze::editor::OracleValidationPanel::status_message_
private

Definition at line 57 of file oracle_validation_panel.h.

Referenced by DrawActionButtons(), LaunchRun(), and PollPendingResult().


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