mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
More consistent progress bar from 0-100 on startup
This commit is contained in:
parent
35149a10e3
commit
0db73bd83e
2 changed files with 26 additions and 14 deletions
17
src/game.cpp
17
src/game.cpp
|
@ -1325,7 +1325,6 @@ struct FpsControl {
|
|||
* many functions that do require objects of thse types do not modify them
|
||||
* (so they can be passed as a const qualified parameter)
|
||||
*/
|
||||
|
||||
struct CameraOrientation {
|
||||
f32 camera_yaw; // "right/left"
|
||||
f32 camera_pitch; // "up/down"
|
||||
|
@ -1898,7 +1897,7 @@ bool Game::initSound()
|
|||
bool Game::createSingleplayerServer(const std::string map_dir,
|
||||
const SubgameSpec &gamespec, u16 port, std::string *address)
|
||||
{
|
||||
showOverlayMessage("Creating server...", 0, 25);
|
||||
showOverlayMessage("Creating server...", 0, 5);
|
||||
|
||||
std::string bind_str = g_settings->get("bind_address");
|
||||
Address bind_addr(0, 0, 0, 0, port);
|
||||
|
@ -1936,7 +1935,7 @@ bool Game::createClient(const std::string &playername,
|
|||
const std::string &password, std::string *address, u16 port,
|
||||
std::wstring *error_message)
|
||||
{
|
||||
showOverlayMessage("Creating client...", 0, 50);
|
||||
showOverlayMessage("Creating client...", 0, 10);
|
||||
|
||||
draw_control = new MapDrawControl;
|
||||
if (!draw_control)
|
||||
|
@ -2105,7 +2104,7 @@ bool Game::connectToServer(const std::string &playername,
|
|||
const std::string &password, std::string *address, u16 port,
|
||||
bool *connect_ok, bool *aborted)
|
||||
{
|
||||
showOverlayMessage("Resolving address...", 0, 75);
|
||||
showOverlayMessage("Resolving address...", 0, 15);
|
||||
|
||||
Address connect_address(0, 0, 0, 0, port);
|
||||
|
||||
|
@ -2196,7 +2195,7 @@ bool Game::connectToServer(const std::string &playername,
|
|||
}
|
||||
|
||||
// Update status
|
||||
showOverlayMessage("Connecting to server...", dtime, 100);
|
||||
showOverlayMessage("Connecting to server...", dtime, 20);
|
||||
}
|
||||
} catch (con::PeerNotFoundException &e) {
|
||||
// TODO: Should something be done here? At least an info/error
|
||||
|
@ -2251,16 +2250,16 @@ bool Game::getServerContent(bool *aborted)
|
|||
}
|
||||
|
||||
// Display status
|
||||
int progress = 0;
|
||||
int progress = 25;
|
||||
|
||||
if (!client->itemdefReceived()) {
|
||||
wchar_t *text = wgettext("Item definitions...");
|
||||
progress = 0;
|
||||
progress = 25;
|
||||
draw_load_screen(text, device, guienv, dtime, progress);
|
||||
delete[] text;
|
||||
} else if (!client->nodedefReceived()) {
|
||||
wchar_t *text = wgettext("Node definitions...");
|
||||
progress = 25;
|
||||
progress = 30;
|
||||
draw_load_screen(text, device, guienv, dtime, progress);
|
||||
delete[] text;
|
||||
} else {
|
||||
|
@ -2281,7 +2280,7 @@ bool Game::getServerContent(bool *aborted)
|
|||
message << " ( " << cur << cur_unit << " )";
|
||||
}
|
||||
|
||||
progress = 50 + client->mediaReceiveProgress() * 50 + 0.5;
|
||||
progress = 30 + client->mediaReceiveProgress() * 35 + 0.5;
|
||||
draw_load_screen(narrow_to_wide(message.str().c_str()), device,
|
||||
guienv, dtime, progress);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue