4#include <ftxui/component/component.hpp>
5#include <ftxui/dom/elements.hpp>
9#include "absl/strings/str_format.h"
17 : rom_context_(rom_context) {
69 return Renderer(container, [
this] {
70 return vbox({text(
"📊 Status Panel") | bold | center, separator(),
96 if (event == Event::Character(
'e')) {
101 if (event == Event::Character(
'd')) {
111 return vbox({text(
"🎮 ROM Information") | bold | color(Color::Red),
112 text(
"No ROM loaded") | color(Color::Red),
113 text(
"Load a ROM to see information") | dim});
117 {text(
"🎮 ROM Information") | bold | color(Color::Green),
120 text(absl::StrFormat(
"Size: %s",
rom_info_.
size)) | color(Color::Cyan),
122 color(Color::Yellow),
124 color(Color::Magenta)});
128 return vbox({text(
"💻 System Information") | bold | color(Color::Blue),
134 color(Color::Yellow),
136 color(Color::Green)});
141 {text(
"🖥️ Layout Information") | bold | color(Color::Magenta),
147 color(Color::Yellow),
149 color(Color::Green)});
154 return vbox({text(
"✅ No Errors") | color(Color::Green)});
157 return vbox({text(
"⚠️ Error") | bold | color(Color::Red),
162 return hbox({text(
"e: Expand | d: Details | q: Quit") | dim, filler(),
163 text(
expanded_ ?
"EXPANDED" :
"COLLAPSED") | color(Color::Cyan),
166 color(Color::Yellow)});
184 uint32_t checksum = 0;
195 switch (region_byte) {
213 auto now = std::chrono::system_clock::now();
214 auto time_t = std::chrono::system_clock::to_time_t(now);
215 auto tm = *std::localtime(&time_t);
217 std::stringstream ss;
218 ss << std::put_time(&tm,
"%H:%M:%S");
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
const auto & vector() const
ftxui::Component CreateStatusContainer()
ftxui::Element RenderLayoutInfo()
struct yaze::cli::EnhancedStatusPanel::LayoutInfo layout_info_
ftxui::Component error_section_
ftxui::Element RenderRomInfo()
std::string current_error_
bool HandleStatusEvents(const ftxui::Event &event)
ftxui::Component GetComponent()
ftxui::Component CreateSystemInfoSection()
void SetShowDetailedInfo(bool show)
ftxui::Component CreateLayoutInfoSection()
ftxui::Component system_info_section_
ftxui::Component rom_info_section_
ftxui::Component status_container_
ftxui::Component layout_info_section_
struct yaze::cli::EnhancedStatusPanel::SystemInfo system_info_
ftxui::Element RenderErrorInfo()
std::function< bool(const ftxui::Event &) status_event_handler_)
void SetError(const std::string &error)
ftxui::Component CreateErrorSection()
void SetExpanded(bool expanded)
ftxui::Component CreateRomInfoSection()
void SetRomContext(Rom *rom_context)
EnhancedStatusPanel(Rom *rom_context=nullptr)
ftxui::Element RenderStatusBar()
ftxui::Element RenderSystemInfo()
struct yaze::cli::EnhancedStatusPanel::RomInfo rom_info_