Skip to content

Commit

Permalink
UI|Client|Busy Mode: Don’t show progress indicator during startup
Browse files Browse the repository at this point in the history
Looks cleaner this way, and it wouldn’t be visible for long anyway.
  • Loading branch information
skyjake committed Feb 8, 2017
1 parent 078b383 commit cdae54f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/busyrunner.cpp
Expand Up @@ -181,7 +181,7 @@ BusyRunner::Result BusyRunner::runTask(BusyTask *task)
BusyVisual_PrepareResources();

de::ProgressWidget &prog = ClientWindow::main().busy().progress();
prog.show();
prog.show((task->mode & BUSYF_PROGRESS_BAR) != 0);
prog.setText(task->name);
prog.setMode(task->mode & BUSYF_ACTIVITY? de::ProgressWidget::Indefinite :
de::ProgressWidget::Ranged);
Expand Down Expand Up @@ -244,8 +244,8 @@ void BusyRunner::loop()
}

if (!d->busyDone ||
(canUpload && GL_DeferredTaskCount() > 0) ||
!Con_IsProgressAnimationCompleted())
(canUpload && GL_DeferredTaskCount() > 0) ||
!Con_IsProgressAnimationCompleted())
{
// Let's keep running the busy loop.
return;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/dd_main.cpp
Expand Up @@ -1036,7 +1036,7 @@ static void initialize()
// Enter busy mode until startup complete.
Con_InitProgress(200);
#endif
BusyMode_RunNewTaskWithName(BUSYF_NO_UPLOADS | BUSYF_STARTUP | BUSYF_PROGRESS_BAR | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
BusyMode_RunNewTaskWithName(BUSYF_NO_UPLOADS | BUSYF_STARTUP /*| BUSYF_PROGRESS_BAR*/ | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
DD_StartupWorker, 0, "Starting up...");

// Engine initialization is complete. Now finish up with the GL.
Expand All @@ -1052,7 +1052,7 @@ static void initialize()
// Do deferred uploads.
Con_SetProgress(100);
#endif
BusyMode_RunNewTaskWithName(BUSYF_STARTUP | BUSYF_PROGRESS_BAR | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
BusyMode_RunNewTaskWithName(BUSYF_STARTUP /*| BUSYF_PROGRESS_BAR*/ | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
DD_DummyWorker, 0, "Buffering...");

//
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/gl/gl_texmanager.cpp
Expand Up @@ -130,7 +130,7 @@ void GL_TexReset()
BusyMode_FreezeGameForBusyMode();

Con_InitProgress(200);
BusyMode_RunNewTaskWithName(BUSYF_ACTIVITY | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
BusyMode_RunNewTaskWithName(BUSYF_ACTIVITY | BUSYF_PROGRESS_BAR| (verbose? BUSYF_CONSOLE_OUTPUT : 0),
reloadTextures, &useBusyMode, "Reseting textures...");
}
else
Expand Down
13 changes: 9 additions & 4 deletions doomsday/apps/client/src/ui/home/homewidget.cpp
Expand Up @@ -220,7 +220,8 @@ DENG_GUI_PIMPL(HomeWidget)

void appStartupCompleted()
{
blanker->guiDeleteLater();
blanker->start(0.75);
//blanker->guiDeleteLater();
}

void gameReadinessUpdated()
Expand Down Expand Up @@ -521,14 +522,14 @@ HomeWidget::HomeWidget()
d->moveLeft ->rule().setInput(Rule::Left, rule().left());
d->moveRight->rule().setInput(Rule::Right, rule().right());

add(d->taskBarHintButton);

// Hide content until first update.
d->blanker.reset(new FadeToBlackWidget);
d->blanker->rule().setRect(rule());
d->blanker->initFadeFromBlack(0);
d->blanker->initFadeFromBlack(1.75);
add(d->blanker);

add(d->taskBarHintButton);

// Define widget layout.
Rule const &gap = rule("gap");
d->tabsBackground->rule()
Expand Down Expand Up @@ -597,6 +598,10 @@ void HomeWidget::update()
{
GuiWidget::update();
d->checkDismissHiding();
if (d->blanker)
{
d->blanker->disposeIfDone();
}
}

PopupWidget *HomeWidget::makeSettingsPopup()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/progress.cpp
Expand Up @@ -47,7 +47,7 @@ void Con_InitProgress(int maxProgress)

dd_bool Con_IsProgressAnimationCompleted(void)
{
return !progress().isAnimating();
return progress().isHidden() || !progress().isAnimating();
}

void Con_SetProgress(int progressValue)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/world/base/clientserverworld.cpp
Expand Up @@ -820,7 +820,7 @@ bool ClientServerWorld::changeMap(de::Uri const &mapUri)
{
/// @todo Use progress bar mode and update progress during the setup.
return DoomsdayApp::app().busyMode().runNewTaskWithName(
BUSYF_ACTIVITY | /*BUSYF_PROGRESS_BAR |*/ BUSYF_TRANSITION | (::verbose ? BUSYF_CONSOLE_OUTPUT : 0),
BUSYF_ACTIVITY | BUSYF_PROGRESS_BAR | BUSYF_TRANSITION | (::verbose ? BUSYF_CONSOLE_OUTPUT : 0),
"Loading map...", [this, &mapDef] (void *)
{
return d->changeMap(mapDef);
Expand Down

0 comments on commit cdae54f

Please sign in to comment.