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

ImGui panel for Mesen2-OoS debugging integration. More...

#include <mesen_debug_panel.h>

Collaboration diagram for yaze::editor::MesenDebugPanel:

Public Member Functions

 MesenDebugPanel ()
 
 ~MesenDebugPanel ()
 
void Draw ()
 Draw the panel.
 
void SetClient (std::shared_ptr< emu::mesen::MesenSocketClient > client)
 Set the socket client for Mesen2 communication.
 
bool IsConnected () const
 Get connection status.
 
void Connect ()
 Attempt to connect to Mesen2.
 
void ConnectToPath (const std::string &socket_path)
 
void Disconnect ()
 Disconnect from Mesen2.
 

Private Member Functions

void DrawConnectionHeader ()
 
void DrawLinkState ()
 
void DrawSpriteList ()
 
void DrawGameMode ()
 
void DrawControlButtons ()
 
void DrawOverlayControls ()
 
void DrawStateControls ()
 
void RefreshSocketList ()
 
void RefreshState ()
 

Private Attributes

std::shared_ptr< emu::mesen::MesenSocketClientclient_
 
emu::mesen::GameState game_state_
 
std::vector< emu::mesen::SpriteInfosprites_
 
emu::mesen::MesenState emu_state_
 
emu::mesen::CpuState cpu_state_
 
bool auto_refresh_ = true
 
float refresh_interval_ = 0.1f
 
float time_since_refresh_ = 0.0f
 
bool show_all_sprites_ = false
 
bool show_cpu_state_ = false
 
std::string connection_error_
 
std::vector< std::string > socket_paths_
 
int selected_socket_index_ = -1
 
char socket_path_buffer_ [256] = {}
 
std::string status_message_
 
bool collision_overlay_enabled_ = false
 
int collision_map_index_ = 0
 
int save_state_slot_ = 0
 
bool link_expanded_ = true
 
bool sprites_expanded_ = true
 
bool game_mode_expanded_ = true
 
bool cpu_expanded_ = false
 

Detailed Description

ImGui panel for Mesen2-OoS debugging integration.

Displays real-time ALTTP game state from a running Mesen2 emulator, including Link position, health, active sprites, and game mode.

Definition at line 19 of file mesen_debug_panel.h.

Constructor & Destructor Documentation

◆ MesenDebugPanel()

yaze::editor::MesenDebugPanel::MesenDebugPanel ( )

◆ ~MesenDebugPanel()

yaze::editor::MesenDebugPanel::~MesenDebugPanel ( )
default

Member Function Documentation

◆ Draw()

◆ SetClient()

void yaze::editor::MesenDebugPanel::SetClient ( std::shared_ptr< emu::mesen::MesenSocketClient > client)

Set the socket client for Mesen2 communication.

Definition at line 56 of file mesen_debug_panel.cc.

References client_, and yaze::emu::mesen::MesenClientRegistry::SetClient().

Here is the call graph for this function:

◆ IsConnected()

bool yaze::editor::MesenDebugPanel::IsConnected ( ) const

Get connection status.

Definition at line 62 of file mesen_debug_panel.cc.

References client_.

Referenced by Draw(), DrawConnectionHeader(), DrawControlButtons(), DrawOverlayControls(), DrawStateControls(), and RefreshState().

◆ Connect()

void yaze::editor::MesenDebugPanel::Connect ( )

Attempt to connect to Mesen2.

Definition at line 66 of file mesen_debug_panel.cc.

References client_, connection_error_, yaze::emu::mesen::MesenClientRegistry::GetOrCreate(), RefreshState(), and yaze::emu::mesen::MesenClientRegistry::SetClient().

Referenced by DrawConnectionHeader().

Here is the call graph for this function:

◆ ConnectToPath()

void yaze::editor::MesenDebugPanel::ConnectToPath ( const std::string & socket_path)

◆ Disconnect()

void yaze::editor::MesenDebugPanel::Disconnect ( )

Disconnect from Mesen2.

Definition at line 94 of file mesen_debug_panel.cc.

References client_.

Referenced by DrawConnectionHeader().

◆ DrawConnectionHeader()

◆ DrawLinkState()

void yaze::editor::MesenDebugPanel::DrawLinkState ( )
private

◆ DrawSpriteList()

void yaze::editor::MesenDebugPanel::DrawSpriteList ( )
private

Definition at line 347 of file mesen_debug_panel.cc.

References yaze::editor::AgentUI::GetTheme(), ICON_MD_PEST_CONTROL, show_all_sprites_, sprites_, and sprites_expanded_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawGameMode()

◆ DrawControlButtons()

void yaze::editor::MesenDebugPanel::DrawControlButtons ( )
private

◆ DrawOverlayControls()

void yaze::editor::MesenDebugPanel::DrawOverlayControls ( )
private

Definition at line 498 of file mesen_debug_panel.cc.

References client_, collision_map_index_, collision_overlay_enabled_, IsConnected(), and status_message_.

Referenced by DrawControlButtons().

Here is the call graph for this function:

◆ DrawStateControls()

void yaze::editor::MesenDebugPanel::DrawStateControls ( )
private

Definition at line 528 of file mesen_debug_panel.cc.

References client_, ICON_MD_PHOTO_CAMERA, ICON_MD_SAVE, ICON_MD_UPLOAD, IsConnected(), save_state_slot_, and status_message_.

Referenced by DrawControlButtons().

Here is the call graph for this function:

◆ RefreshSocketList()

void yaze::editor::MesenDebugPanel::RefreshSocketList ( )
private

◆ RefreshState()

void yaze::editor::MesenDebugPanel::RefreshState ( )
private

Definition at line 116 of file mesen_debug_panel.cc.

References client_, cpu_state_, emu_state_, game_state_, IsConnected(), show_all_sprites_, show_cpu_state_, and sprites_.

Referenced by Connect(), ConnectToPath(), Draw(), and DrawControlButtons().

Here is the call graph for this function:

Member Data Documentation

◆ client_

std::shared_ptr<emu::mesen::MesenSocketClient> yaze::editor::MesenDebugPanel::client_
private

◆ game_state_

emu::mesen::GameState yaze::editor::MesenDebugPanel::game_state_
private

Definition at line 64 of file mesen_debug_panel.h.

Referenced by DrawGameMode(), DrawLinkState(), and RefreshState().

◆ sprites_

std::vector<emu::mesen::SpriteInfo> yaze::editor::MesenDebugPanel::sprites_
private

Definition at line 65 of file mesen_debug_panel.h.

Referenced by DrawSpriteList(), and RefreshState().

◆ emu_state_

emu::mesen::MesenState yaze::editor::MesenDebugPanel::emu_state_
private

Definition at line 66 of file mesen_debug_panel.h.

Referenced by DrawControlButtons(), DrawGameMode(), and RefreshState().

◆ cpu_state_

emu::mesen::CpuState yaze::editor::MesenDebugPanel::cpu_state_
private

Definition at line 67 of file mesen_debug_panel.h.

Referenced by DrawGameMode(), and RefreshState().

◆ auto_refresh_

bool yaze::editor::MesenDebugPanel::auto_refresh_ = true
private

Definition at line 70 of file mesen_debug_panel.h.

Referenced by Draw(), and DrawConnectionHeader().

◆ refresh_interval_

float yaze::editor::MesenDebugPanel::refresh_interval_ = 0.1f
private

Definition at line 71 of file mesen_debug_panel.h.

Referenced by Draw(), and DrawConnectionHeader().

◆ time_since_refresh_

float yaze::editor::MesenDebugPanel::time_since_refresh_ = 0.0f
private

Definition at line 72 of file mesen_debug_panel.h.

Referenced by Draw().

◆ show_all_sprites_

bool yaze::editor::MesenDebugPanel::show_all_sprites_ = false
private

Definition at line 73 of file mesen_debug_panel.h.

Referenced by DrawSpriteList(), and RefreshState().

◆ show_cpu_state_

bool yaze::editor::MesenDebugPanel::show_cpu_state_ = false
private

Definition at line 74 of file mesen_debug_panel.h.

Referenced by DrawGameMode(), and RefreshState().

◆ connection_error_

std::string yaze::editor::MesenDebugPanel::connection_error_
private

Definition at line 75 of file mesen_debug_panel.h.

Referenced by Connect(), ConnectToPath(), and DrawConnectionHeader().

◆ socket_paths_

std::vector<std::string> yaze::editor::MesenDebugPanel::socket_paths_
private

Definition at line 76 of file mesen_debug_panel.h.

Referenced by DrawConnectionHeader(), MesenDebugPanel(), and RefreshSocketList().

◆ selected_socket_index_

int yaze::editor::MesenDebugPanel::selected_socket_index_ = -1
private

Definition at line 77 of file mesen_debug_panel.h.

Referenced by DrawConnectionHeader(), MesenDebugPanel(), and RefreshSocketList().

◆ socket_path_buffer_

char yaze::editor::MesenDebugPanel::socket_path_buffer_[256] = {}
private

Definition at line 78 of file mesen_debug_panel.h.

Referenced by DrawConnectionHeader(), MesenDebugPanel(), and RefreshSocketList().

◆ status_message_

std::string yaze::editor::MesenDebugPanel::status_message_
private

◆ collision_overlay_enabled_

bool yaze::editor::MesenDebugPanel::collision_overlay_enabled_ = false
private

Definition at line 81 of file mesen_debug_panel.h.

Referenced by DrawOverlayControls().

◆ collision_map_index_

int yaze::editor::MesenDebugPanel::collision_map_index_ = 0
private

Definition at line 82 of file mesen_debug_panel.h.

Referenced by DrawOverlayControls().

◆ save_state_slot_

int yaze::editor::MesenDebugPanel::save_state_slot_ = 0
private

Definition at line 83 of file mesen_debug_panel.h.

Referenced by DrawStateControls().

◆ link_expanded_

bool yaze::editor::MesenDebugPanel::link_expanded_ = true
private

Definition at line 86 of file mesen_debug_panel.h.

Referenced by DrawLinkState().

◆ sprites_expanded_

bool yaze::editor::MesenDebugPanel::sprites_expanded_ = true
private

Definition at line 87 of file mesen_debug_panel.h.

Referenced by DrawSpriteList().

◆ game_mode_expanded_

bool yaze::editor::MesenDebugPanel::game_mode_expanded_ = true
private

Definition at line 88 of file mesen_debug_panel.h.

Referenced by DrawGameMode().

◆ cpu_expanded_

bool yaze::editor::MesenDebugPanel::cpu_expanded_ = false
private

Definition at line 89 of file mesen_debug_panel.h.


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