Permalink
Browse files

Merge pull request #79 from IkarusDowned/working

Formation and Status merge
  • Loading branch information...
2 parents 9866690 + 9ad448f commit 0dcce260b619f9d282a6205dad6136b8d4c11b48 @Bertram25 Bertram25 committed Dec 17, 2012
Showing with 149 additions and 356 deletions.
  1. +26 −88 src/modes/menu/menu.cpp
  2. +15 −45 src/modes/menu/menu.h
  3. +94 −168 src/modes/menu/menu_views.cpp
  4. +14 −55 src/modes/menu/menu_views.h
View
@@ -210,8 +210,7 @@ void MainMenuState::Reset()
std::vector<ustring> options;
options.push_back(UTranslate("Inventory"));
options.push_back(UTranslate("Skills"));
- options.push_back(UTranslate("Status"));
- options.push_back(UTranslate("Formation"));
+ options.push_back(UTranslate("Party"));
// Add strings and set default selection.
_options.SetOptions(options);
@@ -229,10 +228,7 @@ AbstractMenuState* MainMenuState::GetTransitionState(uint32 selection)
return &(_menu_mode->_skills_state);
break;
case MAIN_OPTIONS_STATUS:
- return &(_menu_mode->_status_state);
- break;
- case MAIN_OPTIONS_FORMATION:
- return &(_menu_mode->_formation_state);
+ return &(_menu_mode->_party_state);
break;
default:
PRINT_ERROR << "MENU ERROR: Invalid option in " << GetStateName() << "::GetTransitionState" << std::endl;
@@ -253,69 +249,19 @@ void MainMenuState::_OnDraw()
_menu_mode->_inventory_window.Draw();
break;
- case MAIN_OPTIONS_STATUS:
- _menu_mode->_status_window.Draw();
- break;
-
case MAIN_OPTIONS_SKILLS:
_menu_mode->_skills_window.Draw();
break;
- case MAIN_OPTIONS_FORMATION:
+
+ case MAIN_OPTIONS_STATUS:
default:
- _menu_mode->_formation_window.Draw();
+ _menu_mode->_party_window.Draw();
break;
} // switch draw_window
}
-void FormationState::_ActiveWindowUpdate()
-{
- _menu_mode->_formation_window.Update();
-}
-bool FormationState::_IsActive()
-{
- return _menu_mode->_formation_window.IsActive();
-}
-
-void FormationState::Reset()
-{
- // setup the save options box
- SetupOptionBoxCommonSettings(&_options);
- _options.SetDimensions(415.0f, 50.0f, FORMATION_OPTIONS_SIZE, 1, FORMATION_OPTIONS_SIZE, 1);
-
- // Generate the strings
- std::vector<ustring> options;
- options.push_back(UTranslate("Switch"));
- options.push_back(UTranslate("Back"));
-
- // Add strings and set default selection.
- _options.SetOptions(options);
- _options.SetSelection(FORMATION_OPTIONS_SWITCH);
-}
-AbstractMenuState* FormationState::GetTransitionState(uint32 selection)
-{
- switch(selection)
- {
- case FORMATION_OPTIONS_BACK:
- return &(_menu_mode->_main_menu_state);
- break;
- case FORMATION_OPTIONS_SWITCH:
- _menu_mode->_formation_window.Activate(true);
- default:
- break;
-
- };
- return NULL;
-}
-void FormationState::_OnDraw()
-{
-
- AbstractMenuState::_DrawBottomMenu();
- _menu_mode->_formation_window.Draw();
-
-}
-
void InventoryState::Reset()
{
// Setup the option box
@@ -428,51 +374,51 @@ void InventoryState::_DrawBottomMenu()
}
-void StatusState::_ActiveWindowUpdate()
+void PartyState::_ActiveWindowUpdate()
{
- _menu_mode->_status_window.Update();
+ _menu_mode->_party_window.Update();
}
-bool StatusState::_IsActive(){
- return _menu_mode->_status_window.IsActive();
+bool PartyState::_IsActive(){
+ return _menu_mode->_party_window.IsActive();
}
-void StatusState::Reset()
+void PartyState::Reset()
{
// Setup the status option box
SetupOptionBoxCommonSettings(&_options);
- _options.SetDimensions(415.0f, 50.0f, STATUS_OPTIONS_SIZE, 1, STATUS_OPTIONS_SIZE, 1);
+ _options.SetDimensions(415.0f, 50.0f, PARTY_OPTIONS_SIZE, 1, PARTY_OPTIONS_SIZE, 1);
// Generate the strings
std::vector<ustring> options;
- options.push_back(UTranslate("View"));
+ options.push_back(UTranslate("View/Reorder"));
options.push_back(UTranslate("Back"));
// Add strings and set default selection.
_options.SetOptions(options);
- _options.SetSelection(STATUS_OPTIONS_VIEW);
+ _options.SetSelection(PARTY_OPTIONS_VIEW_ALTER);
}
-AbstractMenuState* StatusState::GetTransitionState(uint32 selection)
+AbstractMenuState* PartyState::GetTransitionState(uint32 selection)
{
switch(selection)
{
- case STATUS_OPTIONS_BACK:
+ case PARTY_OPTIONS_BACK:
return &(_menu_mode->_main_menu_state);
- case STATUS_OPTIONS_VIEW:
- _menu_mode->_status_window.Activate(true);
+ case PARTY_OPTIONS_VIEW_ALTER:
+ _menu_mode->_party_window.Activate(true);
break;
default:
break;
};
return NULL;
}
-void StatusState::_OnDraw()
+void PartyState::_OnDraw()
{
AbstractMenuState::_DrawBottomMenu();
- _menu_mode->_status_window.Draw();
+ _menu_mode->_party_window.Draw();
}
@@ -845,9 +791,8 @@ const uint32 win_width = 208;
MenuMode::MenuMode(const ustring &locale_name, const std::string &locale_image) :
_main_menu_state(this),
- _formation_state(this),
_inventory_state(this),
- _status_state(this),
+ _party_state(this),
_skills_state(this),
_equip_state(this),
_message_window(NULL)
@@ -907,9 +852,9 @@ MenuMode::MenuMode(const ustring &locale_name, const std::string &locale_image)
_main_options_window.Create(static_cast<float>(win_width * 4 + 16), 60, ~VIDEO_MENU_EDGE_BOTTOM, VIDEO_MENU_EDGE_BOTTOM);
_main_options_window.SetPosition(static_cast<float>(win_start_x), static_cast<float>(win_start_y - 50));
- // Set up the status window
- _status_window.Create(static_cast<float>(win_width * 4 + 16), 448, VIDEO_MENU_EDGE_ALL);
- _status_window.SetPosition(static_cast<float>(win_start_x), static_cast<float>(win_start_y + 10));
+ // Set up the party window
+ _party_window.Create(static_cast<float>(win_width * 4 + 16), 448, VIDEO_MENU_EDGE_ALL);
+ _party_window.SetPosition(static_cast<float>(win_start_x), static_cast<float>(win_start_y + 10));
//Set up the skills window
_skills_window.Create(static_cast<float>(win_width * 4 + 16), 448, VIDEO_MENU_EDGE_ALL);
@@ -923,10 +868,6 @@ MenuMode::MenuMode(const ustring &locale_name, const std::string &locale_image)
_inventory_window.Create(static_cast<float>(win_width * 4 + 16), 448, VIDEO_MENU_EDGE_ALL);
_inventory_window.SetPosition(static_cast<float>(win_start_x), static_cast<float>(win_start_y + 10));
- // Set up the formation window
- _formation_window.Create(static_cast<float>(win_width * 4 + 16), 448, VIDEO_MENU_EDGE_ALL);
- _formation_window.SetPosition(static_cast<float>(win_start_x), static_cast<float>(win_start_y + 10));
-
_current_menu_state = &_main_menu_state;
// Load menu sounds
@@ -958,11 +899,10 @@ MenuMode::~MenuMode()
_character_window2.Destroy();
_character_window3.Destroy();
_inventory_window.Destroy();
- _status_window.Destroy();
+ _party_window.Destroy();
_skills_window.Destroy();
_main_options_window.Destroy();
_equip_window.Destroy();
- _formation_window.Destroy();
// Free sounds
_menu_sounds["confirm"].FreeAudio();
@@ -990,18 +930,16 @@ void MenuMode::Reset()
_character_window2.Show();
_character_window3.Show();
_inventory_window.Show();
- _status_window.Show();
+ _party_window.Show();
_skills_window.Show();
_equip_window.Show();
- _formation_window.Show();
_inventory_window.Activate(false);
// Reset states
_main_menu_state.Reset();
- _formation_state.Reset();
_inventory_state.Reset();
- _status_state.Reset();
+ _party_state.Reset();
_skills_state.Reset();
_equip_state.Reset();
View
@@ -142,7 +142,6 @@ class MainMenuState : virtual public AbstractMenuState {
MAIN_OPTIONS_INVENTORY,
MAIN_OPTIONS_SKILLS,
MAIN_OPTIONS_STATUS,
- MAIN_OPTIONS_FORMATION,
MAIN_OPTIONS_SIZE
};
@@ -160,32 +159,6 @@ class MainMenuState : virtual public AbstractMenuState {
};
/**
-*** \brief Formation state. This state allows players to change their character position
-**/
-class FormationState : virtual public AbstractMenuState {
-public:
- //! \brief transition states for formation state
- enum FORMATION_CATEGORY {
- FORMATION_OPTIONS_SWITCH,
- FORMATION_OPTIONS_BACK,
- FORMATION_OPTIONS_SIZE
- };
-
- FormationState(MenuMode* menu_mode):
- AbstractMenuState("Formation Menu",menu_mode)
- {}
- ~FormationState(){}
- void Reset();
- AbstractMenuState* GetTransitionState(uint32 selection);
-
-
-protected:
-
- void _OnDraw();
- void _ActiveWindowUpdate();
- bool _IsActive();
-};
-/**
*** \brief Inventory State. Handles user interactions for item use and equiping
**/
class InventoryState : virtual public AbstractMenuState {
@@ -213,22 +186,23 @@ class InventoryState : virtual public AbstractMenuState {
};
/**
-*** \brief Status state. shows the user the character status information
+*** \brief Party state. shows the user the character status information. Allows
+*** switching of formation
**/
-class StatusState : virtual public AbstractMenuState {
+class PartyState : virtual public AbstractMenuState {
public:
- enum STATUS_CATEGORY {
- STATUS_OPTIONS_VIEW,
- STATUS_OPTIONS_BACK,
- STATUS_OPTIONS_SIZE
+ enum PARTY_CATEGORY {
+ PARTY_OPTIONS_VIEW_ALTER,
+ PARTY_OPTIONS_BACK,
+ PARTY_OPTIONS_SIZE
};
- //! \brief Status state constructor
- StatusState(MenuMode* menu_mode):
- AbstractMenuState("Status State",menu_mode)
+ //! \brief Party state constructor
+ PartyState(MenuMode* menu_mode):
+ AbstractMenuState("Party State",menu_mode)
{}
- ~StatusState(){}
+ ~PartyState(){}
void Reset();
AbstractMenuState* GetTransitionState(uint32 selection);
protected:
@@ -305,16 +279,14 @@ class MenuMode : public hoa_mode_manager::GameMode
{
friend class private_menu::CharacterWindow;
friend class private_menu::InventoryWindow;
- friend class private_menu::StatusWindow;
+ friend class private_menu::PartyWindow;
friend class private_menu::SkillsWindow;
friend class private_menu::EquipWindow;
- friend class private_menu::FormationWindow;
friend class private_menu::AbstractMenuState;
friend class private_menu::MainMenuState;
- friend class private_menu::FormationState;
friend class private_menu::InventoryState;
- friend class private_menu::StatusState;
+ friend class private_menu::PartyState;
friend class private_menu::SkillsState;
friend class private_menu::EquipState;
public:
@@ -382,9 +354,8 @@ class MenuMode : public hoa_mode_manager::GameMode
**/
//@{
private_menu::MainMenuState _main_menu_state;
- private_menu::FormationState _formation_state;
private_menu::InventoryState _inventory_state;
- private_menu::StatusState _status_state;
+ private_menu::PartyState _party_state;
private_menu::SkillsState _skills_state;
private_menu::EquipState _equip_state;
//@}
@@ -397,10 +368,9 @@ class MenuMode : public hoa_mode_manager::GameMode
private_menu::CharacterWindow _character_window2;
private_menu::CharacterWindow _character_window3;
private_menu::InventoryWindow _inventory_window;
- private_menu::StatusWindow _status_window;
+ private_menu::PartyWindow _party_window;
private_menu::SkillsWindow _skills_window;
private_menu::EquipWindow _equip_window;
- private_menu::FormationWindow _formation_window;
MessageWindow *_message_window;
//! \brief A map of the sounds used while in MenuMode
Oops, something went wrong.

0 comments on commit 0dcce26

Please sign in to comment.