per-row explanation text in ScreenEditMenu
This commit is contained in:
@@ -23,9 +23,9 @@ enum EditMenuRow
|
|||||||
ROW_ACTION,
|
ROW_ACTION,
|
||||||
NUM_EDIT_MENU_ROWS
|
NUM_EDIT_MENU_ROWS
|
||||||
};
|
};
|
||||||
#define FOREACH_EditMenuRow( emr ) FOREACH_ENUM( EditMenuRow, NUM_EDIT_MENU_ROWS, emr )
|
#define FOREACH_EditMenuRow( r ) FOREACH_ENUM( EditMenuRow, NUM_EDIT_MENU_ROWS, r )
|
||||||
const CString& RadarCategoryToString( RadarCategory cat );
|
const CString& EditMenuRowToString( EditMenuRow r );
|
||||||
const CString& RadarCategoryToThemedString( RadarCategory cat );
|
const CString& EditMenuRowToThemedString( EditMenuRow r );
|
||||||
|
|
||||||
|
|
||||||
class EditMenu: public ActorFrame
|
class EditMenu: public ActorFrame
|
||||||
@@ -58,6 +58,8 @@ public:
|
|||||||
Difficulty GetSelectedDifficulty();
|
Difficulty GetSelectedDifficulty();
|
||||||
Difficulty GetSelectedSourceDifficulty();
|
Difficulty GetSelectedSourceDifficulty();
|
||||||
|
|
||||||
|
EditMenuRow GetSelectedRow() const { return m_SelectedRow; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Sprite m_sprArrows[2];
|
Sprite m_sprArrows[2];
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
#include "Steps.h"
|
#include "Steps.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
|
|
||||||
#define PREV_SCREEN THEME->GetMetric(m_sName,"PrevScreen")
|
#define PREV_SCREEN THEME->GetMetric(m_sName,"PrevScreen")
|
||||||
#define EXPLANATION_TEXT THEME->GetMetric(m_sName,"ExplanationText")
|
#define EXPLANATION_TEXT( row ) THEME->GetMetric(m_sName,"Explanation"+EditMenuRowToString(row))
|
||||||
#define HELP_TEXT THEME->GetMetric(m_sName,"HelpText")
|
#define HELP_TEXT THEME->GetMetric(m_sName,"HelpText")
|
||||||
|
|
||||||
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
|
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
|
||||||
|
|
||||||
@@ -40,8 +40,8 @@ void ScreenEditMenu::Init()
|
|||||||
|
|
||||||
m_textExplanation.SetName( "Explanation" );
|
m_textExplanation.SetName( "Explanation" );
|
||||||
m_textExplanation.LoadFromFont( THEME->GetPathF(m_sName,"explanation") );
|
m_textExplanation.LoadFromFont( THEME->GetPathF(m_sName,"explanation") );
|
||||||
SET_XY_AND_ON_COMMAND( m_textExplanation );
|
SET_XY( m_textExplanation );
|
||||||
m_textExplanation.SetText( EXPLANATION_TEXT );
|
RefreshExplanationText();
|
||||||
this->AddChild( &m_textExplanation );
|
this->AddChild( &m_textExplanation );
|
||||||
|
|
||||||
this->SortByDrawOrder();
|
this->SortByDrawOrder();
|
||||||
@@ -67,22 +67,38 @@ void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
|
|
||||||
void ScreenEditMenu::MenuUp( PlayerNumber pn )
|
void ScreenEditMenu::MenuUp( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
m_Selector.Up();
|
if( m_Selector.CanGoUp() )
|
||||||
|
{
|
||||||
|
m_Selector.Up();
|
||||||
|
RefreshExplanationText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEditMenu::MenuDown( PlayerNumber pn )
|
void ScreenEditMenu::MenuDown( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
m_Selector.Down();
|
if( m_Selector.CanGoDown() )
|
||||||
|
{
|
||||||
|
m_Selector.Down();
|
||||||
|
RefreshExplanationText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEditMenu::MenuLeft( PlayerNumber pn, const InputEventType type )
|
void ScreenEditMenu::MenuLeft( PlayerNumber pn, const InputEventType type )
|
||||||
{
|
{
|
||||||
m_Selector.Left();
|
if( m_Selector.CanGoLeft() )
|
||||||
|
{
|
||||||
|
m_Selector.Left();
|
||||||
|
RefreshExplanationText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEditMenu::MenuRight( PlayerNumber pn, const InputEventType type )
|
void ScreenEditMenu::MenuRight( PlayerNumber pn, const InputEventType type )
|
||||||
{
|
{
|
||||||
m_Selector.Right();
|
if( m_Selector.CanGoRight() )
|
||||||
|
{
|
||||||
|
m_Selector.Right();
|
||||||
|
RefreshExplanationText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -221,6 +237,14 @@ void ScreenEditMenu::MenuBack( PlayerNumber pn )
|
|||||||
SOUND->StopMusic();
|
SOUND->StopMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenEditMenu::RefreshExplanationText()
|
||||||
|
{
|
||||||
|
m_textExplanation.SetText( EXPLANATION_TEXT(m_Selector.GetSelectedRow()) );
|
||||||
|
m_textExplanation.StopTweening();
|
||||||
|
ON_COMMAND( m_textExplanation );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2002-2004 Chris Danford
|
* (c) 2002-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ private:
|
|||||||
void MenuBack( PlayerNumber pn );
|
void MenuBack( PlayerNumber pn );
|
||||||
void MenuStart( PlayerNumber pn );
|
void MenuStart( PlayerNumber pn );
|
||||||
|
|
||||||
|
void RefreshExplanationText();
|
||||||
|
|
||||||
EditMenu m_Selector;
|
EditMenu m_Selector;
|
||||||
|
|
||||||
BitmapText m_textExplanation;
|
BitmapText m_textExplanation;
|
||||||
|
|||||||
Reference in New Issue
Block a user