diff options
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/scripts/init.lua | 1 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/loading-styles.rcss | 9 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/loading.rml | 11 | ||||
-rw-r--r-- | src/GameState.cpp | 5 |
4 files changed, 25 insertions, 1 deletions
diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua index 790bab0..ffd74b7 100644 --- a/cwd/assets/altcraft/scripts/init.lua +++ b/cwd/assets/altcraft/scripts/init.lua @@ -15,6 +15,7 @@ function plugin.onLoad () con:LoadDocument("altcraft/ui/hud") con:LoadDocument("altcraft/ui/pause") con:LoadDocument("altcraft/ui/options") + con:LoadDocument("altcraft/ui/loading") uiMainMenu:Show() AC.Settings.Load() diff --git a/cwd/assets/altcraft/ui/loading-styles.rcss b/cwd/assets/altcraft/ui/loading-styles.rcss new file mode 100644 index 0000000..b376fe8 --- /dev/null +++ b/cwd/assets/altcraft/ui/loading-styles.rcss @@ -0,0 +1,9 @@ +#body-loading { + background-color: #160f08; + color: white; +} + +#loading { + font-size: 20vh; + margin: 30% auto auto; +} diff --git a/cwd/assets/altcraft/ui/loading.rml b/cwd/assets/altcraft/ui/loading.rml new file mode 100644 index 0000000..2d84c37 --- /dev/null +++ b/cwd/assets/altcraft/ui/loading.rml @@ -0,0 +1,11 @@ +<rml> + <head> + <link type="text/rcss" href="mc-styles" /> + <link type="text/rcss" href="loading-styles" /> + <title>Loading</title> + <script src="/altcraft/scripts/ui"></script> + </head> + <body id="body-loading"> + <strong class="mc-title" id="loading">Loading</strong> + </body> +</rml> diff --git a/src/GameState.cpp b/src/GameState.cpp index be408dd..bb93c45 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -6,6 +6,7 @@ #include "Event.hpp" #include "Packet.hpp" +#include "Game.hpp" void GameState::Update(double deltaTime) { OPTICK_EVENT(); @@ -383,7 +384,6 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { auto packetResponse = std::make_shared<PacketTeleportConfirm>(packet->TeleportId); PUSH_EVENT("SendPacket", std::static_pointer_cast<Packet>(packetResponse)); - break; } @@ -418,6 +418,9 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { gameStatus.dimension = packet->Dimension; gameStatus.difficulty = packet->Difficulty; gameStatus.levelType = packet->LevelType; + SetState(State::Loading); + gameStatus.isGameStarted = false; + receivedEnoughChunks = false; break; } case EntityHeadLook: |