feat: add --direct-enter option to skip to world scene

Support a new CLI flag that launches the app directly into the world scene. If no IP is provided, it starts a local server on the specified port and connects to 127.0.0.1; otherwise it connects to the given IP. With this flag enabled, a port must be specified via -p. Also expose SceneManager::push as public so scenes can be pushed immediately when bypassing the normal menu flow.
This commit is contained in:
2026-08-05 15:30:14 +08:00
parent 30b4060fb5
commit 277aab1b81
4 changed files with 38 additions and 15 deletions

View File

@@ -13,5 +13,6 @@ struct Argument {
std::optional<int> log_level;
std::optional<bool> enable_filelog;
std::optional<bool> enable_consolelog;
std::optional<bool> direct_enter;
};
} // namespace Cubed

View File

@@ -36,6 +36,7 @@ public:
App& app();
WorldSceneParam& world_scene_param();
void push(SceneType type);
private:
enum class OperationType { PUSH, POP, CHANGE };
@@ -51,7 +52,7 @@ private:
std::stack<std::unique_ptr<Scene>> m_scenes;
void process_operation();
void change(SceneType type);
void push(SceneType type);
void pop(bool re_enter = true);
std::unique_ptr<Scene> create_scene(SceneType);