Skip to content

Commit

Permalink
UI|Client: Draw post-busy transition in BusyWidget
Browse files Browse the repository at this point in the history
This commit fixes the issue where the transition was not drawn
correctly when the sidebar is open. Previously the drawing was done
in GameUIWidget, which is affected by the game viewport.
  • Loading branch information
skyjake committed Nov 22, 2013
1 parent 46958aa commit f9de783
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/include/ui/framework/guiwidget.h
Expand Up @@ -225,9 +225,9 @@ class GuiWidget : public QObject, public de::Widget
void setOpacity(float opacity, de::TimeDelta span = 0, de::TimeDelta startDelay = 0);

/**
* Determines the widget's current opacity.
* Determines the widget's opacity animation.
*/
float opacity() const;
de::Animation opacity() const;

/**
* Determines the widget's opacity, factoring in all ancestor opacities.
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/busymode.cpp
Expand Up @@ -147,6 +147,7 @@ static void beginTask(BusyTask* task)
busyInited = true;

ProgressWidget &prog = ClientWindow::main().busy().progress();
prog.show();
prog.setText(task->name);
prog.setMode(task->mode & BUSYF_ACTIVITY? ProgressWidget::Indefinite :
ProgressWidget::Ranged);
Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -251,7 +251,8 @@ DENG2_OBSERVES(App, GameChange)
break;

default:
busy->hide();
//busy->hide();
// The busy widget will hide itself after a possible transition has finished.
busy->disable();

game->show();
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/framework/guiwidget.cpp
Expand Up @@ -410,7 +410,7 @@ void GuiWidget::setOpacity(float opacity, TimeDelta span, TimeDelta startDelay)
d->opacity.setValue(opacity, span, startDelay);
}

float GuiWidget::opacity() const
Animation GuiWidget::opacity() const
{
return d->opacity;
}
Expand Down
21 changes: 18 additions & 3 deletions doomsday/client/src/ui/widgets/busywidget.cpp
Expand Up @@ -27,6 +27,7 @@
#include "GuiRootWidget"
#include "busymode.h"
#include "sys_system.h"
#include "con_main.h"

#include <de/concurrency.h>
#include <de/Drawable>
Expand Down Expand Up @@ -104,11 +105,25 @@ void BusyWidget::update()

void BusyWidget::drawContent()
{
if(d->transitionTex.isNull())
if(!BusyMode_Active())
{
//root().window().canvas().renderTarget().clear(GLTarget::ColorDepth);
d->progress->hide();

if(Con_TransitionInProgress())
{
Con_DrawTransition();
}
else
{
// Time to hide the busy widget, the transition has ended (or
// was never started).
hide();
releaseTransitionFrame();
}
return;
}
else

if(!d->transitionTex.isNull())
{
GLState::top().apply();

Expand Down
6 changes: 0 additions & 6 deletions doomsday/client/src/ui/widgets/gameuiwidget.cpp
Expand Up @@ -73,12 +73,6 @@ DENG2_PIMPL(GameUIWidget)
}
}

if(Con_TransitionInProgress())
{
/// @todo Transition must be done at window level to work correctly.
Con_DrawTransition();
}

// Draw the widgets of the Shadow Bias Editor (if active).
SBE_DrawGui();

Expand Down

0 comments on commit f9de783

Please sign in to comment.