载入中...
搜索中...
未找到
PcgLoadingScreen.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Result.h"
6
7#include <string>
8#include <vector>
9
10namespace ssq { class Table; }
11
12namespace eve::ui {
13
16 std::string terrainName;
17 std::string impostorName;
18 std::vector<std::string> regularReferences;
19 std::vector<std::string> impostorReferences;
20};
21
29public:
31 [[nodiscard]] Result<void> configure(float fadeOutSpeed);
33 void onLoadProgressStarted() noexcept;
35 [[nodiscard]] Result<void> onLoadProgressUpdated(float progress);
37 void onLoadProgressEnded() noexcept;
39 void beginTimeout() noexcept;
41 [[nodiscard]] Result<int> addMissingScene(const std::string& terrainName, const std::string& impostorName);
43 [[nodiscard]] Result<void> addRegularReference(int sceneIndex, const std::string& objectName);
45 [[nodiscard]] Result<void> addImpostorReference(int sceneIndex, const std::string& objectName);
47 [[nodiscard]] Result<void> endTimeout();
49 [[nodiscard]] Result<void> tick(float deltaTime);
50
52 bool getCanvasVisible() const noexcept { return canvasVisible_; }
54 bool getProgressVisible() const noexcept { return progressVisible_; }
56 bool getTextVisible() const noexcept { return textVisible_; }
58 bool getFading() const noexcept { return fading_; }
60 float getProgress() const noexcept { return progress_; }
62 float getBackgroundAlpha() const noexcept { return backgroundAlpha_; }
64 const std::string& getTimeoutMessage() const noexcept { return timeoutMessage_; }
65
66private:
67 [[nodiscard]] Result<void> addReference(int sceneIndex, const std::string& objectName, bool impostor);
68
69 float fadeOutSpeed_ = 0.f;
70 float progress_ = 0.f;
71 float backgroundAlpha_ = 1.f;
72 bool canvasVisible_ = false;
73 bool progressVisible_ = true;
74 bool textVisible_ = true;
75 bool fading_ = false;
76 bool timeoutOpen_ = false;
77 std::vector<PcgMissingTerrainScene> pendingMissingScenes_;
78 std::string timeoutMessage_;
79};
80
82void exposePcgLoadingScreenBindings(ssq::Table& table);
83
84} // namespace eve::ui
#define EVENGINE_API_WORLD
Definition Export.h:109
Move-only, checked operation results for the common layer.
SimulationTick tick
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Caller-owned loading-screen state driven by Pcg terrain load-progress events.
float getProgress() const noexcept
Return current progress without clamping Pcg's event value.
const std::string & getTimeoutMessage() const noexcept
Return the most recently published timeout warning.
bool getTextVisible() const noexcept
Return whether the loading text is enabled.
bool getFading() const noexcept
Return whether fade-out is running.
float getBackgroundAlpha() const noexcept
Return current background alpha.
bool getCanvasVisible() const noexcept
Return whether the loading canvas is enabled.
bool getProgressVisible() const noexcept
Return whether the progress bar is active.
void exposePcgLoadingScreenBindings(ssq::Table &table)
Register Pcg loading-screen bindings.
WidgetDesc progress(float fraction, std::string id, std::string overlay)
Progress bar; fraction is clamped to [0,1].
Definition Widget.cpp:395
enum EVENGINE_API_FOUNDATION Table
OT_TABLE (editable via Runtime table APIs / ReflectedPropertyModel).
Definition Runtime.h:121
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:14
One missing Pcg terrain scene and the objects retaining its regular or impostor representation.
std::vector< std::string > impostorReferences
std::vector< std::string > regularReferences