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.
 
PanelCategory GetPanelCategory () const override
 Get the lifecycle category for this panel.
 
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::EditorPanel
virtual ~EditorPanel ()=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 PanelContextScope GetContextScope () const
 Optional context binding for this panel (room/selection/etc)
 
virtual PanelScope GetScope () const
 Get the registration scope for this panel.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual int GetPriority () const
 Get display priority for menu ordering.
 
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)
 

Static Private Member Functions

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::EditorPanel
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()

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

Definition at line 50 of file oracle_validation_panel.cc.

References pending_.

Member Function Documentation

◆ GetId()

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::EditorPanel.

Definition at line 56 of file oracle_validation_panel.cc.

◆ GetDisplayName()

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::EditorPanel.

Definition at line 58 of file oracle_validation_panel.cc.

◆ GetIcon()

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::EditorPanel.

Definition at line 62 of file oracle_validation_panel.cc.

References ICON_MD_VERIFIED_USER.

◆ GetEditorCategory()

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::EditorPanel.

Definition at line 66 of file oracle_validation_panel.cc.

◆ GetPanelCategory()

PanelCategory yaze::editor::OracleValidationPanel::GetPanelCategory ( ) const
overridevirtual

Get the lifecycle category for this panel.

Returns
PanelCategory determining visibility behavior on editor switch

Default is EditorBound (hidden when switching editors).

Reimplemented from yaze::editor::EditorPanel.

Definition at line 70 of file oracle_validation_panel.cc.

References yaze::editor::CrossEditor.

◆ GetPreferredWidth()

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::EditorPanel.

Definition at line 74 of file oracle_validation_panel.cc.

◆ Draw()

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 PanelManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::EditorPanel.

Definition at line 76 of file oracle_validation_panel.cc.

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

Here is the call graph for this function:

◆ DefaultRomPath()

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

Definition at line 86 of file oracle_validation_panel.cc.

References yaze::Rom::filename(), yaze::Rom::is_loaded(), and yaze::editor::ContentRegistry::Context::rom().

Referenced by DrawOptions().

Here is the call graph for this function:

◆ PollPendingResult()

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

Definition at line 93 of file oracle_validation_panel.cc.

References last_result_, pending_, running_, and status_message_.

Referenced by Draw().

◆ GetRom()

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

Definition at line 106 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()

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

Definition at line 110 of file oracle_validation_panel.cc.

References yaze::editor::oracle_validation::BuildCliCommand(), yaze::editor::oracle_validation::BuildPreflightArgs(), yaze::editor::oracle_validation::BuildSmokeArgs(), yaze::editor::oracle_validation::OracleRunResult::cli_command, yaze::editor::oracle_validation::OracleRunResult::command_ok, yaze::editor::oracle_validation::CurrentTimestamp(), yaze::editor::oracle_validation::OracleRunResult::error_message, GetRom(), yaze::editor::oracle_validation::OracleRunResult::json_parse_failed, yaze::editor::oracle_validation::kPreflight, yaze::editor::oracle_validation::kStrictReadiness, yaze::editor::oracle_validation::SmokeOptions::min_d6_track_rooms, min_d6_track_rooms_, yaze::editor::oracle_validation::OracleRunResult::mode, yaze::editor::oracle_validation::ParsePreflightOutput(), yaze::editor::oracle_validation::ParseSmokeCheckOutput(), pending_, yaze::editor::oracle_validation::OracleRunResult::preflight, yaze::editor::oracle_validation::OracleRunResult::raw_output, yaze::editor::oracle_validation::SmokeOptions::report_path, yaze::editor::oracle_validation::PreflightOptions::report_path, report_path_, yaze::editor::oracle_validation::PreflightOptions::required_collision_rooms, required_collision_rooms_, yaze::editor::oracle_validation::SmokeOptions::rom_path, yaze::editor::oracle_validation::PreflightOptions::rom_path, rom_path_, yaze::cli::resources::CommandHandler::Run(), running_, yaze::editor::oracle_validation::OracleRunResult::smoke, yaze::editor::oracle_validation::OracleRunResult::status_code, status_message_, yaze::editor::oracle_validation::SmokeOptions::strict_readiness, yaze::editor::oracle_validation::OracleRunResult::timestamp, and write_report_.

Referenced by DrawActionButtons().

◆ DrawOptions()

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

Definition at line 208 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()

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

◆ DrawResults()

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

◆ DrawSmokeCards()

◆ DrawPreflightCards()

◆ DrawRawOutput()

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 43 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 44 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ write_report_

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

Definition at line 45 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ report_path_

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

Definition at line 46 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 47 of file oracle_validation_panel.h.

Referenced by DrawOptions(), and LaunchRun().

◆ running_

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

Definition at line 49 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 50 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 51 of file oracle_validation_panel.h.

Referenced by DrawResults(), and PollPendingResult().

◆ status_message_

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

Definition at line 52 of file oracle_validation_panel.h.

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


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