16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 14:39:18 +02:00

Loading screen overhaul POC

The loading screen has been significantly changed:
- The background image is now properly picked randomly instead of taking the `textures/logo.bmp` file, prepended by an external program such as Rainsted/Starter.
- The progress bar has been moved from a floating window to a thin green line at the bottom of the loading screen.
- The log window is now hidden by default. It can be turned on by setting `loadinglog` to `true` in `eu07.ini`.
- There is an animated wheel icon on the loading screen, and a trivia text is displayed.

New translation key:
- `"Did you know"`

TODO:
- Load trivia from a separate file.
This commit is contained in:
jakubg1
2025-09-10 01:53:22 +02:00
parent 9fa22d81e5
commit 5e2175302b
10 changed files with 160 additions and 81 deletions

View File

@@ -14,7 +14,6 @@ http://mozilla.org/MPL/2.0/.
#include "simulation.h"
#include "simulationtime.h"
#include "simulationenvironment.h"
#include "Timer.h"
#include "application.h"
#include "scenarioloaderuilayer.h"
#include "renderer.h"
@@ -22,20 +21,17 @@ http://mozilla.org/MPL/2.0/.
#include "translation.h"
scenarioloader_mode::scenarioloader_mode() {
m_userinterface = std::make_shared<scenarioloader_ui>();
}
// initializes internal data structures of the mode. returns: true on success, false otherwise
bool
scenarioloader_mode::init() {
bool scenarioloader_mode::init() {
// nothing to do here
return true;
}
// mode-specific update of simulation data. returns: false on error, true otherwise
bool
scenarioloader_mode::update() {
bool scenarioloader_mode::update() {
if (!Global.ready_to_load)
// waiting for network connection
return true;
@@ -69,31 +65,24 @@ scenarioloader_mode::update() {
return true;
}
bool
scenarioloader_mode::is_command_processor() const {
bool scenarioloader_mode::is_command_processor() const {
return false;
}
// maintenance method, called when the mode is activated
void
scenarioloader_mode::enter() {
void scenarioloader_mode::enter() {
// TBD: hide cursor in fullscreen mode?
Application.set_cursor( GLFW_CURSOR_NORMAL );
simulation::is_ready = false;
m_userinterface->set_background( "logo" );
Application.set_title( Global.AppName + " (" + Global.SceneryFile + ")" );
m_userinterface->set_progress();
m_userinterface->set_progress(STR("Loading scenery"));
GfxRenderer->Render();
}
// maintenance method, called when the mode is deactivated
void
scenarioloader_mode::exit() {
void scenarioloader_mode::exit() {
simulation::Time.init( Global.starting_timestamp );
simulation::Environment.init();
}