fixed deck renaming to make changes immediate.
This commit is contained in:
@@ -52,7 +52,9 @@ public:
|
|||||||
int getDifficulty();
|
int getDifficulty();
|
||||||
string getDifficultyString();
|
string getDifficultyString();
|
||||||
|
|
||||||
|
// setters
|
||||||
void setColorIndex(const string& colorIndex);
|
void setColorIndex(const string& colorIndex);
|
||||||
|
void setDeckName( const string& newDeckTitle );
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
|
|
||||||
string mStatsFilename;
|
string mStatsFilename;
|
||||||
|
|||||||
@@ -186,6 +186,11 @@ void DeckMetaData::setColorIndex(const string& colorIndex)
|
|||||||
mColorIndex = colorIndex;
|
mColorIndex = colorIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeckMetaData::setDeckName(const string& newDeckTitle)
|
||||||
|
{
|
||||||
|
mName = newDeckTitle;
|
||||||
|
}
|
||||||
|
|
||||||
void DeckMetaData::Invalidate()
|
void DeckMetaData::Invalidate()
|
||||||
{
|
{
|
||||||
mStatsLoaded = false;
|
mStatsLoaded = false;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#include "DeckManager.h"
|
|
||||||
#include "GameStateDuel.h"
|
#include "GameStateDuel.h"
|
||||||
#include "GameStateDeckViewer.h"
|
#include "GameStateDeckViewer.h"
|
||||||
#include "Translate.h"
|
#include "Translate.h"
|
||||||
@@ -16,6 +15,8 @@
|
|||||||
#include "MTGCardInstance.h"
|
#include "MTGCardInstance.h"
|
||||||
#include "WFilter.h"
|
#include "WFilter.h"
|
||||||
#include "WDataSrc.h"
|
#include "WDataSrc.h"
|
||||||
|
#include "DeckManager.h"
|
||||||
|
#include "DeckMetaData.h"
|
||||||
#include "DeckEditorMenu.h"
|
#include "DeckEditorMenu.h"
|
||||||
#include "SimpleMenu.h"
|
#include "SimpleMenu.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@@ -302,6 +303,10 @@ void GameStateDeckViewer::addRemove(MTGCard * card)
|
|||||||
|
|
||||||
void GameStateDeckViewer::saveDeck()
|
void GameStateDeckViewer::saveDeck()
|
||||||
{
|
{
|
||||||
|
//update the corresponding meta data object
|
||||||
|
DeckMetaData *metaData = DeckManager::GetInstance()->getDeckMetaDataById( myDeck->parent->meta_id, false );
|
||||||
|
metaData->setDeckName( newDeckname );
|
||||||
|
mSwitching = true;
|
||||||
myDeck->save();
|
myDeck->save();
|
||||||
playerdata->save();
|
playerdata->save();
|
||||||
pricelist->save();
|
pricelist->save();
|
||||||
@@ -360,6 +365,7 @@ void GameStateDeckViewer::Update(float dt)
|
|||||||
{
|
{
|
||||||
myDeck->parent->meta_name = newDeckname;
|
myDeck->parent->meta_name = newDeckname;
|
||||||
saveDeck();
|
saveDeck();
|
||||||
|
updateDecks();
|
||||||
}
|
}
|
||||||
mStage = STAGE_WAITING;
|
mStage = STAGE_WAITING;
|
||||||
}
|
}
|
||||||
@@ -1558,7 +1564,6 @@ void GameStateDeckViewer::ButtonPressed(int controllerId, int controlId)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ITEM_SWITCH_DECKS_NO_SAVE:
|
case MENU_ITEM_SWITCH_DECKS_NO_SAVE:
|
||||||
//updateDecks();
|
|
||||||
mStage = STAGE_WELCOME;
|
mStage = STAGE_WELCOME;
|
||||||
mSwitching = true;
|
mSwitching = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user