This commit is contained in:
Alayan
2018-11-13 22:21:44 +01:00
parent 814916a2a6
commit acd749d75f
4 changed files with 33 additions and 2 deletions

View File

@@ -2,7 +2,13 @@
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text="Race Setup" align="center" text_align="center" />
<div width="100%" layout="horizontal-row" height="12%">
<icon-button id="back" width="12%" align="left" icon="gui/icons/back.png"/>
<header id="title" width="80%" text="Race Setup" align="center" text_align="center" />
<spacer height="1" width="12%"/>
</div>
<spacer height="2%" width="1"/>

View File

@@ -2,7 +2,13 @@
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text="Race Setup" align="center" text_align="center" />
<div width="100%" layout="horizontal-row" height="12%">
<icon-button id="back" width="12%" align="left" icon="gui/icons/back.png"/>
<header id="title" width="80%" text="Race Setup" align="center" text_align="center" />
<spacer height="1" width="12%"/>
</div>
<spacer height="2%" width="1"/>

View File

@@ -174,11 +174,28 @@ void SelectChallengeDialog::updateSolvedIcon(const ChallengeStatus* c, RaceManag
}
} //updateSolvedIcon
// -----------------------------------------------------------------------------
void SelectChallengeDialog::onUpdate(float dt)
{
if (m_self_destroy)
{
ModalDialog::clearWindow();
ModalDialog::dismiss();
return;
}
} // onUpdate
// ----------------------------------------------------------------------------
GUIEngine::EventPropagation SelectChallengeDialog::processEvent(const std::string& eventSourceParam)
{
std::string eventSource = eventSourceParam;
if (eventSource == "back")
{
m_self_destroy = true;
return GUIEngine::EVENT_BLOCK;
}
if (eventSource == "novice" || eventSource == "intermediate" ||
eventSource == "expert" || eventSource == "supertux")
{

View File

@@ -30,6 +30,7 @@
class SelectChallengeDialog : public GUIEngine::ModalDialog
{
private:
bool m_self_destroy = false;
std::string m_challenge_id;
void updateSolvedIcon(const ChallengeStatus* c, RaceManager::Difficulty diff,
const char* widget_name, const char* path);
@@ -40,6 +41,7 @@ public:
virtual ~SelectChallengeDialog();
virtual GUIEngine::EventPropagation processEvent(const std::string& eventSource);
virtual void onUpdate(float dt);
};
#endif