feat(cli): enhance TUI functionality and update CI test configurations
- Added support for a new `--tui` flag in the CLI to launch a chat-based TUI for ROM interaction. - Integrated a fallback mechanism for loading ROM files from specified directories. - Updated the ChatTUI to provide a more informative initial message and added a new option to display ROM info. - Refined the CI workflow to differentiate between stable and experimental test runs, improving test result organization. Benefits: - Improved user experience with the new TUI feature for ROM hacking. - Enhanced clarity in CI test results, facilitating better debugging and reporting.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/dom/table.hpp"
|
||||
#include "cli/tui/chat_tui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
@@ -31,6 +32,21 @@ absl::Status ModernCLI::Run(int argc, char* argv[]) {
|
||||
args.push_back(argv[i]);
|
||||
}
|
||||
|
||||
// Handle --tui flag
|
||||
if (args[0] == "--tui") {
|
||||
Rom rom;
|
||||
// Attempt to load a ROM from the current directory or a well-known path
|
||||
auto rom_status = rom.LoadFromFile("zelda3.sfc");
|
||||
if (!rom_status.ok()) {
|
||||
// Try assets directory as a fallback
|
||||
rom_status = rom.LoadFromFile("assets/zelda3.sfc");
|
||||
}
|
||||
|
||||
tui::ChatTUI chat_tui(rom.is_loaded() ? &rom : nullptr);
|
||||
chat_tui.Run();
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
if (args[0] == "help") {
|
||||
if (args.size() > 1) {
|
||||
ShowCategoryHelp(args[1]);
|
||||
|
||||
Reference in New Issue
Block a user