mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
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:
@@ -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
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user