diff --git a/CLAUDE.md b/CLAUDE.md index ffa4b0c..766d981 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -501,4 +501,5 @@ After modifying C++ inline documentation with MCRF_* macros: 4. **Generation** → HTML/Markdown/Stub files created with transformed links 5. **No drift**: Impossible for docs and code to disagree - they're the same file! -The macro system ensures complete, consistent documentation across all Python bindings. \ No newline at end of file +The macro system ensures complete, consistent documentation across all Python bindings. +- Close issues automatically in gitea by adding to the commit message "closes #X", where X is the issue number. This associates the issue closure with the specific commit, so granular commits are preferred. You should only use the MCP tool to close issues directly when discovering that the issue is already complete; when committing changes, always such "closes" (or the opposite, "reopens") references to related issues. If on a feature branch, the issue will be referenced by the commit, and when merged to master, the issue will be actually closed (or reopened). \ No newline at end of file diff --git a/ROADMAP.md b/ROADMAP.md index 8d02b12..4386775 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -80,9 +80,10 @@ For detailed task tracking and current priorities, see the [Gitea issue tracker] **Status**: Complete **Key Issues**: #50 (Grid backgrounds), #6 (RenderTexture), #8 (Viewport rendering) -### Phase 7: Documentation & Distribution -**Status**: In Progress +### Phase 7: Documentation & Distribution ✅ +**Status**: Complete (2025-10-30) **Key Issues**: #85 (Docstrings), #86 (Parameter docs), #108 (Type stubs), #97 (API docs) +**Completed**: All classes and functions converted to MCRF_* macro system with automated HTML/Markdown/man page generation See [current open issues](https://gamedev.ffwf.net/gitea/john/McRogueFace/issues?state=open) for active work. diff --git a/src/GameEngine.cpp b/src/GameEngine.cpp index e4e9035..3ac3cec 100644 --- a/src/GameEngine.cpp +++ b/src/GameEngine.cpp @@ -284,6 +284,11 @@ void GameEngine::run() if (!headless && window && !window->isOpen()) { running = false; } + + // In headless exec mode, auto-exit when no timers remain + if (config.auto_exit_after_exec && timers.empty()) { + running = false; + } } // Clean up before exiting the run loop diff --git a/src/McRogueFaceConfig.h b/src/McRogueFaceConfig.h index 34a589e..9534df6 100644 --- a/src/McRogueFaceConfig.h +++ b/src/McRogueFaceConfig.h @@ -28,6 +28,9 @@ struct McRogueFaceConfig { // 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; }; #endif // MCROGUEFACE_CONFIG_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index df6aaf3..3652e6c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -196,6 +196,14 @@ int run_python_interpreter(const McRogueFaceConfig& config, int argc, char* argv } else if (!config.exec_scripts.empty()) { // With --exec, run the game engine after scripts execute + // In headless mode, auto-exit when no timers remain + McRogueFaceConfig mutable_config = config; + if (mutable_config.headless) { + mutable_config.auto_exit_after_exec = true; + } + delete engine; + engine = new GameEngine(mutable_config); + McRFPy_API::game = engine; engine->run(); McRFPy_API::api_shutdown(); delete engine;