modified text for "Save as AI deck" option

added descriptions for editor menu items
code clean up.
This commit is contained in:
techdragon.nguyen@gmail.com
2010-10-30 06:46:58 +00:00
parent a88ea7cb54
commit ab37002fd7
2 changed files with 19 additions and 18 deletions
+16 -15
View File
@@ -134,7 +134,7 @@ void GameStateDeckViewer::switchDisplay(){
void GameStateDeckViewer::updateDecks(){ void GameStateDeckViewer::updateDecks(){
SAFE_DELETE(welcome_menu); SAFE_DELETE(welcome_menu);
welcome_menu = NEW SimpleMenu( MENU_DECK_SELECTION, this, Fonts::MENU_FONT,20,20); welcome_menu = NEW SimpleMenu( MENU_DECK_SELECTION, this, Fonts::MENU_FONT, 20, 20);
DeckManager * deckManager = DeckManager::GetInstance(); DeckManager * deckManager = DeckManager::GetInstance();
vector<DeckMetaData *> playerDeckList = fillDeckMenu( welcome_menu,options.profileFile()); vector<DeckMetaData *> playerDeckList = fillDeckMenu( welcome_menu,options.profileFile());
@@ -159,21 +159,24 @@ void GameStateDeckViewer::buildEditorMenu()
if ( myDeck ) { if ( myDeck ) {
aiDeckMsg aiDeckMsg
<< "****WARNING*****"<< endl << "**** All changes are final ****" << endl << endl
<< "All changes are final." << endl << endl
<< "------- Deck Summary -----" << endl << "------- Deck Summary -----" << endl
<< "# Cards: "<< myDeck->getCount() << endl << "# Cards: "<< myDeck->getCount() << endl
<< "# Lands: "<< myDeck->getCount(Constants::MTG_COLOR_LAND ) << endl << "# Lands: "<< myDeck->getCount(Constants::MTG_COLOR_LAND ) << endl
<< "# Creatures: "<< stw.countCreatures << endl
<< "# Spells: " << stw.countSpells << endl
<< "Avg. Creature Cost: " << setprecision(2) << stw.avgCreatureCost << endl << "Avg. Creature Cost: " << setprecision(2) << stw.avgCreatureCost << endl
<< "Avg. Mana Cost: " << setprecision(2) << stw.avgManaCost << endl << "Avg. Mana Cost: " << setprecision(2) << stw.avgManaCost << endl
<< "Avg. Spell Cost: " << setprecision(2) << stw.avgSpellCost << endl << "Avg. Spell Cost: " << setprecision(2) << stw.avgSpellCost << endl
<< " --- Card color count --- " << endl << " --- Card color count --- " << endl
<< "A: " << myDeck->getCount(Constants::MTG_COLOR_ARTIFACT) << "A: " << myDeck->getCount(Constants::MTG_COLOR_ARTIFACT)
<< " G: " << myDeck->getCount(Constants::MTG_COLOR_GREEN) << " G: " << myDeck->getCount(Constants::MTG_COLOR_GREEN)
<< " U: " << myDeck->getCount(Constants::MTG_COLOR_BLUE) << endl << " U: " << myDeck->getCount(Constants::MTG_COLOR_BLUE)
<< endl
<< "R: " << myDeck->getCount(Constants::MTG_COLOR_RED) << "R: " << myDeck->getCount(Constants::MTG_COLOR_RED)
<< " B: " << myDeck->getCount(Constants::MTG_COLOR_BLACK) << " B: " << myDeck->getCount(Constants::MTG_COLOR_BLACK)
<< " W: " << myDeck->getCount(Constants::MTG_COLOR_WHITE) << endl; << " W: " << myDeck->getCount(Constants::MTG_COLOR_WHITE)
<< endl;
} }
else else
aiDeckMsg << "****WARNING*****" << endl << "All changes are final." << endl; aiDeckMsg << "****WARNING*****" << endl << "All changes are final." << endl;
@@ -181,16 +184,17 @@ void GameStateDeckViewer::buildEditorMenu()
if ( menu ) if ( menu )
SAFE_DELETE( menu ); SAFE_DELETE( menu );
//Build menu. //Build menu.
menu = NEW SimpleMenu( MENU_DECK_BUILDER, this, Fonts::MENU_FONT, SCREEN_WIDTH/2-150, 20);
menu->Add( MENU_ITEM_FILTER_BY, "Filter By..."); menu = NEW SimpleMenu( MENU_DECK_BUILDER, this, Fonts::MENU_FONT, 20, 40, "Deck Editor");
menu->Add( MENU_ITEM_SWITCH_DECKS_NO_SAVE, "Switch Decks");
menu->Add( MENU_ITEM_SAVE_RENAME, "Rename Deck"); menu->Add( MENU_ITEM_FILTER_BY, "Filter By...", "Narrow down the list of cards. ");
menu->Add( MENU_ITEM_SAVE_RETURN_MAIN_MENU, "Save & Quit Editor"); menu->Add( MENU_ITEM_SWITCH_DECKS_NO_SAVE, "Switch Decks", "Do not make any changes\nView another deck.");
menu->Add( MENU_ITEM_SAVE_RENAME, "Rename Deck", "Change the name of the deck");
menu->Add( MENU_ITEM_SAVE_RETURN_MAIN_MENU, "Save & Quit Editor", "Save the changes and return to the main menu");
menu->Add( MENU_ITEM_SAVE_AS_AI_DECK, "Save As AI Deck", aiDeckMsg.str() ); menu->Add( MENU_ITEM_SAVE_AS_AI_DECK, "Save As AI Deck", aiDeckMsg.str() );
menu->Add( MENU_ITEM_MAIN_MENU, "Main Menu"); menu->Add( MENU_ITEM_MAIN_MENU, "Main Menu", "Go back to the main menu.\nDo not make any changes to deck");
menu->Add( MENU_ITEM_EDITOR_CANCEL, "Cancel"); menu->Add( MENU_ITEM_EDITOR_CANCEL, "Cancel");
aiDeckMsg.str(""); // clear the stream
} }
void GameStateDeckViewer::Start() void GameStateDeckViewer::Start()
@@ -321,9 +325,6 @@ void GameStateDeckViewer::saveAsAIDeck( string deckName )
filepath.append("/ai/baka/").append( defaultAiDeckName ).append( ".txt" ); filepath.append("/ai/baka/").append( defaultAiDeckName ).append( ".txt" );
DebugTrace("saving AI deck " << filepath); DebugTrace("saving AI deck " << filepath);
myDeck->save( filepath, true, deckName, deckDesc); myDeck->save( filepath, true, deckName, deckDesc);
oss.clear();
delete deckManager;
} }
void GameStateDeckViewer::Update(float dt) void GameStateDeckViewer::Update(float dt)
+2 -2
View File
@@ -125,8 +125,8 @@ void GameStateDuel::Start()
premadeDeck = true; premadeDeck = true;
fillDeckMenu(deckmenu,RESPATH"/player/premade"); fillDeckMenu(deckmenu,RESPATH"/player/premade");
} }
deckmenu->Add( MENUITEM_NEW_DECK, "New Deck..."); deckmenu->Add( MENUITEM_NEW_DECK, "New Deck...", "Create a new deck to play with.");
deckmenu->Add( MENUITEM_MAIN_MENU, "Main Menu", _("Return to Main Menu").c_str()); deckmenu->Add( MENUITEM_MAIN_MENU, "Main Menu", "Return to Main Menu");
} }
for (int i = 0; i < 2; ++i){ for (int i = 0; i < 2; ++i){