diff --git a/src/modules/ui/windows/UIMapFinishedWindow.cpp b/src/modules/ui/windows/UIMapFinishedWindow.cpp index c1c1f1b62..b71209039 100644 --- a/src/modules/ui/windows/UIMapFinishedWindow.cpp +++ b/src/modules/ui/windows/UIMapFinishedWindow.cpp @@ -34,26 +34,24 @@ UIMapFinishedWindow::UIMapFinishedWindow (IFrontend *frontend, CampaignManager& const float gapBack = std::max(0.01f, getScreenPadding()); - UINodeMainButton *continueCampaign = new UINodeMainButton(frontend, tr("Continue")); - continueCampaign->alignTo(background, NODE_ALIGN_BOTTOM | NODE_ALIGN_RIGHT, gapBack); - continueCampaign->addListener(UINodeListenerPtr(new ContinuePlayNodeListener(campaignManager, serviceProvider))); - add(continueCampaign); - - _replayCampaign = new UINodeMainButton(frontend, tr("Retry")); - _replayCampaign->alignTo(background, NODE_ALIGN_BOTTOM | NODE_ALIGN_CENTER, gapBack); - _replayCampaign->addListener(UINodeListenerPtr(new ReplayNodeListener(campaignManager))); - add(_replayCampaign); - UINodePoint *points = new UINodePoint(frontend); points->setFont(LARGE_FONT); points->setId(UINODE_FINISHEDPOINTS); points->alignTo(background, NODE_ALIGN_CENTER | NODE_ALIGN_MIDDLE, 0.1f); add(points); - if (!wantBackButton()) - return; + if (wantBackButton()) + add(new UINodeBackButton(frontend, background)); + + _replayCampaign = new UINodeMainButton(frontend, tr("Retry")); + _replayCampaign->alignTo(background, NODE_ALIGN_BOTTOM | NODE_ALIGN_CENTER, gapBack); + _replayCampaign->addListener(UINodeListenerPtr(new ReplayNodeListener(campaignManager))); + add(_replayCampaign); - add(new UINodeBackButton(frontend, background)); + UINodeMainButton *continueCampaign = new UINodeMainButton(frontend, tr("Continue")); + continueCampaign->alignTo(background, NODE_ALIGN_BOTTOM | NODE_ALIGN_RIGHT, gapBack); + continueCampaign->addListener(UINodeListenerPtr(new ContinuePlayNodeListener(campaignManager, serviceProvider))); + add(continueCampaign); } bool UIMapFinishedWindow::onPush () @@ -66,3 +64,9 @@ bool UIMapFinishedWindow::onPush () } return UIWindow::onPush(); } + +void UIMapFinishedWindow::onActive () +{ + UIWindow::onActive(); + addLastFocus(); +} diff --git a/src/modules/ui/windows/UIMapFinishedWindow.h b/src/modules/ui/windows/UIMapFinishedWindow.h index 523f49e0a..80ad0772e 100644 --- a/src/modules/ui/windows/UIMapFinishedWindow.h +++ b/src/modules/ui/windows/UIMapFinishedWindow.h @@ -17,4 +17,5 @@ class UIMapFinishedWindow: public UIWindow { public: UIMapFinishedWindow (IFrontend *frontend, CampaignManager& campaignManager, ServiceProvider& serviceProvider, const SoundType& soundType); bool onPush () override; + void onActive () override; };