By default, McRogueFace now exits with code 1 on the first unhandled exception in timer, click, key, or animation callbacks. This prevents repeated exception output that wastes resources in AI-driven development. Changes: - Add exit_on_exception config flag (default: true) - Add --continue-after-exceptions CLI flag to preserve old behavior - Update exception handlers in Timer, PyCallable, and Animation - Signal game loop via McRFPy_API atomic flags - Return proper exit code from main() Before: Timer exceptions repeated 1000+ times until timeout After: Single traceback, clean exit with code 1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
No EOL
1.2 KiB
C++
40 lines
No EOL
1.2 KiB
C++
#ifndef MCROGUEFACE_CONFIG_H
|
|
#define MCROGUEFACE_CONFIG_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <filesystem>
|
|
|
|
struct McRogueFaceConfig {
|
|
// McRogueFace specific
|
|
bool headless = false;
|
|
bool audio_enabled = true;
|
|
|
|
// Python interpreter emulation
|
|
bool python_mode = false;
|
|
std::string python_command; // -c command
|
|
std::string python_module; // -m module
|
|
bool interactive_mode = false; // -i flag
|
|
bool show_version = false; // -V flag
|
|
bool show_help = false; // -h flag
|
|
|
|
// Script execution
|
|
std::filesystem::path script_path;
|
|
std::vector<std::string> script_args;
|
|
|
|
// Scripts to execute before main script (--exec flag)
|
|
std::vector<std::filesystem::path> exec_scripts;
|
|
|
|
// Screenshot functionality for headless mode
|
|
std::string screenshot_path;
|
|
bool take_screenshot = false;
|
|
|
|
// Auto-exit when no timers remain (for --headless --exec automation)
|
|
bool auto_exit_after_exec = false;
|
|
|
|
// Exception handling: exit on first Python callback exception (default: true)
|
|
// Use --continue-after-exceptions to disable
|
|
bool exit_on_exception = true;
|
|
};
|
|
|
|
#endif // MCROGUEFACE_CONFIG_H
|