code cleanup. No code changes
- removed unused variables - added line breaks between methods (not everywhere just where i saw it while removing unused variables)
This commit is contained in:
@@ -3216,21 +3216,24 @@ public:
|
|||||||
AResetCost(int id, MTGCardInstance * source, MTGCardInstance * target) :
|
AResetCost(int id, MTGCardInstance * source, MTGCardInstance * target) :
|
||||||
MTGAbility(id, source, target)
|
MTGAbility(id, source, target)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int addToGame()
|
int addToGame()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
_target->controller()->game->putInZone(_target, _target->controller()->game->hand, _target->controller()->game->hand);
|
_target->controller()->game->putInZone(_target, _target->controller()->game->hand, _target->controller()->game->hand);
|
||||||
return MTGAbility::addToGame();
|
return MTGAbility::addToGame();
|
||||||
}
|
}
|
||||||
AResetCost * clone() const
|
|
||||||
|
AResetCost * clone() const
|
||||||
{
|
{
|
||||||
AResetCost * a = NEW AResetCost(*this);
|
AResetCost * a = NEW AResetCost(*this);
|
||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
~AResetCost()
|
|
||||||
|
~AResetCost()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -3242,8 +3245,8 @@ public:
|
|||||||
ABloodThirst(int id, MTGCardInstance * source, MTGCardInstance * target, int amount) :
|
ABloodThirst(int id, MTGCardInstance * source, MTGCardInstance * target, int amount) :
|
||||||
MTGAbility(id, source, target), amount(amount)
|
MTGAbility(id, source, target), amount(amount)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int addToGame()
|
int addToGame()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
@@ -3257,12 +3260,14 @@ public:
|
|||||||
}
|
}
|
||||||
return MTGAbility::addToGame();
|
return MTGAbility::addToGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
ABloodThirst * clone() const
|
ABloodThirst * clone() const
|
||||||
{
|
{
|
||||||
ABloodThirst * a = NEW ABloodThirst(*this);
|
ABloodThirst * a = NEW ABloodThirst(*this);
|
||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
~ABloodThirst()
|
~ABloodThirst()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ int AIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
||||||
MTGAbility * a = AbilityFactory::getCoreAbility(ability);
|
MTGAbility * a = AbilityFactory::getCoreAbility(ability);
|
||||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
//trying to encourage Ai to use his foreach manaproducers in first main
|
//trying to encourage Ai to use his foreach manaproducers in first main
|
||||||
if (a->naType == MTGAbility::MANA_PRODUCER && (g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN
|
if (a->naType == MTGAbility::MANA_PRODUCER && (g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN
|
||||||
@@ -489,7 +489,7 @@ int AIAction::getEfficiency()
|
|||||||
case MTGAbility::STANDARDABILITYGRANT:
|
case MTGAbility::STANDARDABILITYGRANT:
|
||||||
{
|
{
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
|
||||||
if (!target && !dynamic_cast<ALord*> (a))
|
if (!target && !dynamic_cast<ALord*> (a))
|
||||||
break;
|
break;
|
||||||
if(dynamic_cast<ALord*> (a) && !target)
|
if(dynamic_cast<ALord*> (a) && !target)
|
||||||
@@ -1264,7 +1264,7 @@ int AIPlayerBaka::computeActions()
|
|||||||
else if (p == this && g->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
|
else if (p == this && g->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
|
||||||
{ //standard actions
|
{ //standard actions
|
||||||
CardDescriptor cd;
|
CardDescriptor cd;
|
||||||
MTGCardInstance * card = NULL;
|
|
||||||
switch (currentGamePhase)
|
switch (currentGamePhase)
|
||||||
{
|
{
|
||||||
case Constants::MTG_PHASE_FIRSTMAIN:
|
case Constants::MTG_PHASE_FIRSTMAIN:
|
||||||
|
|||||||
@@ -1097,13 +1097,14 @@ AAWhatsMax::AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source,
|
|||||||
|
|
||||||
int AAWhatsMax::resolve()
|
int AAWhatsMax::resolve()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
source->MaxLevelUp = value;
|
source->MaxLevelUp = value;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AAWhatsMax * AAWhatsMax::clone() const
|
AAWhatsMax * AAWhatsMax::clone() const
|
||||||
{
|
{
|
||||||
AAWhatsMax * a = NEW AAWhatsMax(*this);
|
AAWhatsMax * a = NEW AAWhatsMax(*this);
|
||||||
@@ -1428,7 +1429,6 @@ GenericTargetAbility::~GenericTargetAbility()
|
|||||||
AAlterCost::AAlterCost(int id, MTGCardInstance * source, MTGCardInstance * target, int amount, int type) :
|
AAlterCost::AAlterCost(int id, MTGCardInstance * source, MTGCardInstance * target, int amount, int type) :
|
||||||
MTGAbility(id, source, target), amount(amount), type(type)
|
MTGAbility(id, source, target), amount(amount), type(type)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int AAlterCost::addToGame()
|
int AAlterCost::addToGame()
|
||||||
@@ -1483,7 +1483,7 @@ AAlterCost::~AAlterCost()
|
|||||||
ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities) :
|
ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities) :
|
||||||
MTGAbility(id, source, target)
|
MTGAbility(id, source, target)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
PopulateAbilityIndexVector(abilities, sabilities);
|
PopulateAbilityIndexVector(abilities, sabilities);
|
||||||
PopulateColorIndexVector(colors, sabilities);
|
PopulateColorIndexVector(colors, sabilities);
|
||||||
|
|
||||||
@@ -1639,7 +1639,6 @@ AForeverTransformer::AForeverTransformer(int id, MTGCardInstance * source, MTGCa
|
|||||||
MTGAbility(id, source, target)
|
MTGAbility(id, source, target)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::STANDARD_BECOMES;
|
aType = MTGAbility::STANDARD_BECOMES;
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
|
|
||||||
PopulateAbilityIndexVector(abilities, sabilities);
|
PopulateAbilityIndexVector(abilities, sabilities);
|
||||||
PopulateColorIndexVector(colors, sabilities);
|
PopulateColorIndexVector(colors, sabilities);
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos)
|
|||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
//Has X?
|
//Has X?
|
||||||
if (int cost = manacost->hasX())
|
if (manacost->hasX())
|
||||||
{
|
{
|
||||||
char buffer[10];
|
char buffer[10];
|
||||||
sprintf(buffer, "X");
|
sprintf(buffer, "X");
|
||||||
@@ -662,7 +662,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
|
|||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
//Has X?
|
//Has X?
|
||||||
if (int cost = manacost->hasX())
|
if (manacost->hasX())
|
||||||
{
|
{
|
||||||
char buffer[10];
|
char buffer[10];
|
||||||
sprintf(buffer, "X");
|
sprintf(buffer, "X");
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ JGuiController(id, listener), fontId(fontId), mShowDetailsScreen( showDetailsOve
|
|||||||
|
|
||||||
float scrollerWidth = 200.0f;
|
float scrollerWidth = 200.0f;
|
||||||
float scrollerHeight = 28.0f;
|
float scrollerHeight = 28.0f;
|
||||||
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, 28.0f, kVerticalScrollSpeed);
|
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, kVerticalScrollSpeed);
|
||||||
|
|
||||||
mAutoTranslate = true;
|
mAutoTranslate = true;
|
||||||
maxItems = 7;
|
maxItems = 7;
|
||||||
|
|||||||
@@ -268,7 +268,6 @@ void StatsWrapper::initStatistics(string deckstats)
|
|||||||
|
|
||||||
if ((deckStat != NULL) && (deckStat->nbgames > 0))
|
if ((deckStat != NULL) && (deckStat->nbgames > 0))
|
||||||
{
|
{
|
||||||
int percentVictories = stats->percentVictories(string(smallDeckName));
|
|
||||||
aiDeckNames.push_back(string(mtgd->meta_name));
|
aiDeckNames.push_back(string(mtgd->meta_name));
|
||||||
aiDeckStats.push_back(deckStat);
|
aiDeckStats.push_back(deckStat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ ExileTargetCost::ExileTargetCost(TargetChooser *_tc) :
|
|||||||
|
|
||||||
int ExileTargetCost::doPay()
|
int ExileTargetCost::doPay()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
target->controller()->game->putInExile(target);
|
target->controller()->game->putInExile(target);
|
||||||
@@ -321,7 +321,7 @@ BounceTargetCost::BounceTargetCost(TargetChooser *_tc) :
|
|||||||
|
|
||||||
int BounceTargetCost::doPay()
|
int BounceTargetCost::doPay()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
target->controller()->game->putInHand(target);
|
target->controller()->game->putInHand(target);
|
||||||
@@ -365,7 +365,7 @@ int Ninja::isPaymentSet()
|
|||||||
|
|
||||||
int Ninja::doPay()
|
int Ninja::doPay()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
target->controller()->game->putInHand(target);
|
target->controller()->game->putInHand(target);
|
||||||
|
|||||||
@@ -931,7 +931,7 @@ GameOptionAward::GameOptionAward()
|
|||||||
bool GameOptionAward::read(string input)
|
bool GameOptionAward::read(string input)
|
||||||
{
|
{
|
||||||
//This is quick and dirty.
|
//This is quick and dirty.
|
||||||
bool bNumeric = true;
|
|
||||||
achieved = time(NULL);
|
achieved = time(NULL);
|
||||||
tm * at = localtime(&achieved);
|
tm * at = localtime(&achieved);
|
||||||
viewed = false;
|
viewed = false;
|
||||||
@@ -1040,7 +1040,7 @@ string GameOptionAward::menuStr()
|
|||||||
return _("Unlocked.");
|
return _("Unlocked.");
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
Translator * t = Translator::GetInstance();
|
|
||||||
tm * lt = localtime(&achieved);
|
tm * lt = localtime(&achieved);
|
||||||
if (!lt)
|
if (!lt)
|
||||||
return "Error";
|
return "Error";
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
vector<DeckMetaData *> GameState::fillDeckMenu(SimpleMenu * _menu, const string& path, const string& smallDeckPrefix,
|
vector<DeckMetaData *> GameState::fillDeckMenu(SimpleMenu * _menu, const string& path, const string& smallDeckPrefix,
|
||||||
Player * statsPlayer)
|
Player * statsPlayer)
|
||||||
{
|
{
|
||||||
bool translate = _menu->autoTranslate;
|
|
||||||
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer);
|
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer);
|
||||||
renderDeckMenu(_menu, deckMetaDataVector);
|
renderDeckMenu(_menu, deckMetaDataVector);
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ vector<DeckMetaData *> GameState::fillDeckMenu(SimpleMenu * _menu, const string&
|
|||||||
vector<DeckMetaData *> GameState::fillDeckMenu(DeckMenu * _menu, const string& path, const string& smallDeckPrefix,
|
vector<DeckMetaData *> GameState::fillDeckMenu(DeckMenu * _menu, const string& path, const string& smallDeckPrefix,
|
||||||
Player * statsPlayer, int maxDecks)
|
Player * statsPlayer, int maxDecks)
|
||||||
{
|
{
|
||||||
bool translate = _menu->mAutoTranslate;
|
|
||||||
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer, maxDecks);
|
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer, maxDecks);
|
||||||
renderDeckMenu(_menu, deckMetaDataVector);
|
renderDeckMenu(_menu, deckMetaDataVector);
|
||||||
|
|
||||||
|
|||||||
@@ -90,8 +90,9 @@ void GameStateDeckViewer::rotateCards(int direction)
|
|||||||
lastPos = getCurrentPos();
|
lastPos = getCurrentPos();
|
||||||
lastTotal = total;
|
lastTotal = total;
|
||||||
}
|
}
|
||||||
int i = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateDeckViewer::rebuildFilters()
|
void GameStateDeckViewer::rebuildFilters()
|
||||||
{
|
{
|
||||||
if (!filterMenu) filterMenu = NEW WGuiFilters("Filter by...", NULL);
|
if (!filterMenu) filterMenu = NEW WGuiFilters("Filter by...", NULL);
|
||||||
@@ -106,6 +107,7 @@ void GameStateDeckViewer::rebuildFilters()
|
|||||||
if (stw && myDeck)
|
if (stw && myDeck)
|
||||||
stw->updateStats( myDeck );;
|
stw->updateStats( myDeck );;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateDeckViewer::updateFilters()
|
void GameStateDeckViewer::updateFilters()
|
||||||
{
|
{
|
||||||
if (!displayed_deck) return;
|
if (!displayed_deck) return;
|
||||||
@@ -136,6 +138,7 @@ void GameStateDeckViewer::updateFilters()
|
|||||||
stw->updateStats( myDeck );;
|
stw->updateStats( myDeck );;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateDeckViewer::loadIndexes()
|
void GameStateDeckViewer::loadIndexes()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 7; i++)
|
for (int i = 0; i < 7; i++)
|
||||||
@@ -316,7 +319,7 @@ void GameStateDeckViewer::saveDeck()
|
|||||||
*/
|
*/
|
||||||
void GameStateDeckViewer::saveAsAIDeck(string deckName)
|
void GameStateDeckViewer::saveAsAIDeck(string deckName)
|
||||||
{
|
{
|
||||||
DeckManager * deckManager = DeckManager::GetInstance();
|
|
||||||
vector<DeckMetaData *> aiDecks = GameState::getValidDeckMetaData(JGE_GET_RES("ai/baka"), "ai_baka", NULL);
|
vector<DeckMetaData *> aiDecks = GameState::getValidDeckMetaData(JGE_GET_RES("ai/baka"), "ai_baka", NULL);
|
||||||
int nbAiDecks = aiDecks.size() + 1;
|
int nbAiDecks = aiDecks.size() + 1;
|
||||||
aiDecks.clear();
|
aiDecks.clear();
|
||||||
@@ -340,8 +343,6 @@ void GameStateDeckViewer::saveAsAIDeck(string deckName)
|
|||||||
void GameStateDeckViewer::Update(float dt)
|
void GameStateDeckViewer::Update(float dt)
|
||||||
{
|
{
|
||||||
|
|
||||||
int myD = (displayed_deck == myDeck);
|
|
||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
unsigned int distance2;
|
unsigned int distance2;
|
||||||
unsigned int minDistance2 = -1;
|
unsigned int minDistance2 = -1;
|
||||||
@@ -619,7 +620,6 @@ void GameStateDeckViewer::renderOnScreenBasicInfo()
|
|||||||
JRenderer *renderer = JRenderer::GetInstance();
|
JRenderer *renderer = JRenderer::GetInstance();
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
int myD = (displayed_deck == myDeck);
|
|
||||||
|
|
||||||
float y = 0;
|
float y = 0;
|
||||||
int allCopies, nowCopies;
|
int allCopies, nowCopies;
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ void GameStateMenu::fillScroller()
|
|||||||
char buff2[512];
|
char buff2[512];
|
||||||
|
|
||||||
DeckStats * stats = DeckStats::GetInstance();
|
DeckStats * stats = DeckStats::GetInstance();
|
||||||
DeckManager *deckManager = DeckManager::GetInstance();
|
|
||||||
vector<DeckMetaData *> playerDecks = getValidDeckMetaData(options.profileFile(), "", NULL, 6);
|
vector<DeckMetaData *> playerDecks = getValidDeckMetaData(options.profileFile(), "", NULL, 6);
|
||||||
int totalGames = 0;
|
int totalGames = 0;
|
||||||
for (size_t j = 0; j < playerDecks.size(); j++)
|
for (size_t j = 0; j < playerDecks.size(); j++)
|
||||||
@@ -731,7 +730,6 @@ void GameStateMenu::Render()
|
|||||||
|
|
||||||
void GameStateMenu::ButtonPressed(int controllerId, int controlId)
|
void GameStateMenu::ButtonPressed(int controllerId, int controlId)
|
||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
|
||||||
|
|
||||||
DebugTrace("GameStateMenu: controllerId " << controllerId << " selected");
|
DebugTrace("GameStateMenu: controllerId " << controllerId << " selected");
|
||||||
switch (controllerId)
|
switch (controllerId)
|
||||||
|
|||||||
@@ -371,9 +371,6 @@ void GameStateShop::updateCounts()
|
|||||||
}
|
}
|
||||||
void GameStateShop::load()
|
void GameStateShop::load()
|
||||||
{
|
{
|
||||||
int nbsets = 0;
|
|
||||||
int nbboostersets = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < BOOSTER_SLOTS; i++)
|
for (int i = 0; i < BOOSTER_SLOTS; i++)
|
||||||
{
|
{
|
||||||
mBooster[i].randomize(packlist);
|
mBooster[i].randomize(packlist);
|
||||||
@@ -891,7 +888,7 @@ void ShopBooster::randomCustom(MTGPacks * packlist)
|
|||||||
}
|
}
|
||||||
void ShopBooster::randomStandard()
|
void ShopBooster::randomStandard()
|
||||||
{
|
{
|
||||||
int mSet = -1;
|
|
||||||
MTGSetInfo * si = setlist.randomSet(-1);
|
MTGSetInfo * si = setlist.randomSet(-1);
|
||||||
mainSet = si;
|
mainSet = si;
|
||||||
altSet = NULL;
|
altSet = NULL;
|
||||||
|
|||||||
@@ -1089,7 +1089,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
size_t end = s.find(")", found);
|
size_t end = s.find(")", found);
|
||||||
string sname = s.substr(found + 5, end - found - 5);
|
string sname = s.substr(found + 5, end - found - 5);
|
||||||
size_t previous = end + 1;
|
|
||||||
ANamer * tok = NEW ANamer(id, card, NULL, sname, 0);
|
ANamer * tok = NEW ANamer(id, card, NULL, sname, 0);
|
||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -962,7 +962,7 @@ MTGSetInfo* MTGSets::getInfo(int setID)
|
|||||||
MTGSetInfo* MTGSets::randomSet(int blockId, int atleast)
|
MTGSetInfo* MTGSets::randomSet(int blockId, int atleast)
|
||||||
{
|
{
|
||||||
char * unlocked = (char *) calloc(size(), sizeof(char));
|
char * unlocked = (char *) calloc(size(), sizeof(char));
|
||||||
int attempts = 50;
|
|
||||||
//Figure out which sets are available.
|
//Figure out which sets are available.
|
||||||
for (int i = 0; i < size(); i++)
|
for (int i = 0; i < size(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void MTGPlayerCards::OptimizedHand(Player * who,int amount, int lands, int creat
|
|||||||
Player * p = who;
|
Player * p = who;
|
||||||
MTGCardInstance * card = NULL;
|
MTGCardInstance * card = NULL;
|
||||||
MTGGameZone * z = p->game->library;
|
MTGGameZone * z = p->game->library;
|
||||||
MTGGameZone * e = p->game->temp;
|
|
||||||
int optimizedland = 0;
|
int optimizedland = 0;
|
||||||
int optimizedothercards = 0;
|
int optimizedothercards = 0;
|
||||||
int optimizedcreatures = 0;
|
int optimizedcreatures = 0;
|
||||||
|
|||||||
@@ -28,11 +28,7 @@ int MTGPackEntryRandom::addCard(WSrcCards *pool, MTGDeck *to)
|
|||||||
}
|
}
|
||||||
int MTGPackEntrySpecific::addCard(WSrcCards *pool, MTGDeck *to)
|
int MTGPackEntrySpecific::addCard(WSrcCards *pool, MTGDeck *to)
|
||||||
{
|
{
|
||||||
int fails = 0;
|
if (!card)
|
||||||
//Ignores pool entirely.
|
|
||||||
MTGAllCards * ac = GameApp::collection;
|
|
||||||
|
|
||||||
if (!card)
|
|
||||||
return copies;
|
return copies;
|
||||||
for (int i = 0; i < copies; i++)
|
for (int i = 0; i < copies; i++)
|
||||||
to->add(card);
|
to->add(card);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
&& game->players[0]->game->exile->nb_cards == 0
|
&& game->players[0]->game->exile->nb_cards == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Player * p = game->currentPlayer;
|
|
||||||
if (card->basicAbilities[Constants::LEYLINE])
|
if (card->basicAbilities[Constants::LEYLINE])
|
||||||
{
|
{
|
||||||
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
|
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
|
||||||
@@ -52,8 +52,6 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
{
|
{
|
||||||
ManaCost * playerMana = player->getManaPool();
|
ManaCost * playerMana = player->getManaPool();
|
||||||
ManaCost * cost = card->getManaCost();
|
ManaCost * cost = card->getManaCost();
|
||||||
ManaCost * alternative = card->getManaCost()->alternative;
|
|
||||||
ManaCost * BuyBack = card->getManaCost()->BuyBack;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
cost->Dump();
|
cost->Dump();
|
||||||
@@ -124,7 +122,7 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card)
|
|||||||
return 0;
|
return 0;
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
ManaCost * cost = card->getManaCost();
|
ManaCost * cost = card->getManaCost();
|
||||||
ManaCost * playerMana = player->getManaPool();
|
|
||||||
//this handles extra cost payments at the moment a card is played.
|
//this handles extra cost payments at the moment a card is played.
|
||||||
|
|
||||||
if (cost->isExtraPaymentSet())
|
if (cost->isExtraPaymentSet())
|
||||||
@@ -237,7 +235,7 @@ MTGAlternativeCostRule::MTGAlternativeCostRule(int _id) :
|
|||||||
}
|
}
|
||||||
int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||||
{
|
{
|
||||||
int cardsinhand = game->players[0]->game->hand->nb_cards;
|
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
Player * currentPlayer = game->currentPlayer;
|
Player * currentPlayer = game->currentPlayer;
|
||||||
if (!player->game->hand->hasCard(card))
|
if (!player->game->hand->hasCard(card))
|
||||||
@@ -259,10 +257,9 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
ManaCost * playerMana = player->getManaPool();
|
ManaCost * playerMana = player->getManaPool();
|
||||||
ManaCost * cost = card->getManaCost();
|
|
||||||
ManaCost * alternative = card->getManaCost()->alternative;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
ManaCost * cost = card->getManaCost();
|
||||||
cost->Dump();
|
cost->Dump();
|
||||||
#endif
|
#endif
|
||||||
if (player->castrestrictedspell == true && !card->hasType("land"))
|
if (player->castrestrictedspell == true && !card->hasType("land"))
|
||||||
@@ -428,7 +425,7 @@ MTGBuyBackRule::MTGBuyBackRule(int _id) :
|
|||||||
}
|
}
|
||||||
int MTGBuyBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
int MTGBuyBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||||
{
|
{
|
||||||
int cardsinhand = game->players[0]->game->hand->nb_cards;
|
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
Player * currentPlayer = game->currentPlayer;
|
Player * currentPlayer = game->currentPlayer;
|
||||||
if (!player->game->hand->hasCard(card))
|
if (!player->game->hand->hasCard(card))
|
||||||
@@ -448,10 +445,10 @@ int MTGBuyBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
== Constants::MTG_PHASE_SECONDMAIN)))
|
== Constants::MTG_PHASE_SECONDMAIN)))
|
||||||
{
|
{
|
||||||
ManaCost * playerMana = player->getManaPool();
|
ManaCost * playerMana = player->getManaPool();
|
||||||
ManaCost * cost = card->getManaCost();
|
|
||||||
ManaCost * BuyBack = card->getManaCost()->BuyBack;
|
ManaCost * BuyBack = card->getManaCost()->BuyBack;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
ManaCost * cost = card->getManaCost();
|
||||||
cost->Dump();
|
cost->Dump();
|
||||||
#endif
|
#endif
|
||||||
if (player->castrestrictedspell == true && !card->hasType("land"))
|
if (player->castrestrictedspell == true && !card->hasType("land"))
|
||||||
@@ -621,7 +618,7 @@ MTGFlashBackRule::MTGFlashBackRule(int _id) :
|
|||||||
}
|
}
|
||||||
int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||||
{
|
{
|
||||||
int cardsingraveyard = game->players[0]->game->graveyard->nb_cards;
|
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
Player * currentPlayer = game->currentPlayer;
|
Player * currentPlayer = game->currentPlayer;
|
||||||
if (!player->game->graveyard->hasCard(card))
|
if (!player->game->graveyard->hasCard(card))
|
||||||
@@ -634,11 +631,12 @@ int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
|| game->currentGamePhase == Constants::MTG_PHASE_SECONDMAIN))
|
|| game->currentGamePhase == Constants::MTG_PHASE_SECONDMAIN))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ManaCost * playerMana = player->getManaPool();
|
|
||||||
ManaCost * cost = card->getManaCost();
|
|
||||||
ManaCost * FlashBack = card->getManaCost()->FlashBack;
|
ManaCost * FlashBack = card->getManaCost()->FlashBack;
|
||||||
|
ManaCost * playerMana = player->getManaPool();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
ManaCost * cost = card->getManaCost();
|
||||||
cost->Dump();
|
cost->Dump();
|
||||||
#endif
|
#endif
|
||||||
if (player->castrestrictedspell == true && !card->hasType("land"))
|
if (player->castrestrictedspell == true && !card->hasType("land"))
|
||||||
@@ -807,7 +805,7 @@ MTGRetraceRule::MTGRetraceRule(int _id) :
|
|||||||
}
|
}
|
||||||
int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||||
{
|
{
|
||||||
int cardsingraveyard = game->players[0]->game->graveyard->nb_cards;
|
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
Player * currentPlayer = game->currentPlayer;
|
Player * currentPlayer = game->currentPlayer;
|
||||||
if (!player->game->graveyard->hasCard(card))
|
if (!player->game->graveyard->hasCard(card))
|
||||||
@@ -821,10 +819,10 @@ int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
ManaCost * playerMana = player->getManaPool();
|
ManaCost * playerMana = player->getManaPool();
|
||||||
ManaCost * cost = card->getManaCost();
|
|
||||||
ManaCost * Retrace = card->getManaCost()->Retrace;
|
ManaCost * Retrace = card->getManaCost()->Retrace;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
ManaCost * cost = card->getManaCost();
|
||||||
cost->Dump();
|
cost->Dump();
|
||||||
#endif
|
#endif
|
||||||
if (player->castrestrictedspell == true && !card->hasType("land"))
|
if (player->castrestrictedspell == true && !card->hasType("land"))
|
||||||
@@ -1118,7 +1116,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
|
|||||||
}
|
}
|
||||||
//---------------
|
//---------------
|
||||||
}
|
}
|
||||||
if (WEventAttackersChosen * event = dynamic_cast<WEventAttackersChosen*>(e))
|
if (dynamic_cast<WEventAttackersChosen*>(e))
|
||||||
{
|
{
|
||||||
MTGCardInstance * lonelyAttacker = NULL;
|
MTGCardInstance * lonelyAttacker = NULL;
|
||||||
int nbattackers = 0;
|
int nbattackers = 0;
|
||||||
@@ -1141,7 +1139,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
|
|||||||
else
|
else
|
||||||
lonelyAttacker = NULL;
|
lonelyAttacker = NULL;
|
||||||
}
|
}
|
||||||
if (WEventBlockersChosen * event = dynamic_cast<WEventBlockersChosen*>(e))
|
if (dynamic_cast<WEventBlockersChosen*>(e))
|
||||||
{
|
{
|
||||||
Player * p = game->currentPlayer;
|
Player * p = game->currentPlayer;
|
||||||
MTGGameZone * z = p->game->inPlay;
|
MTGGameZone * z = p->game->inPlay;
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ void OptionInteger::Render()
|
|||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
|
|
||||||
mFont->DrawString(_(displayValue).c_str(), x + 2, y + 3);
|
mFont->DrawString(_(displayValue).c_str(), x + 2, y + 3);
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
if (maxValue == 1)
|
if (maxValue == 1)
|
||||||
{
|
{
|
||||||
if (value)
|
if (value)
|
||||||
@@ -80,8 +79,6 @@ void OptionSelect::Render()
|
|||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
|
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
mFont->DrawString(_(displayValue).c_str(), x, y + 2);
|
mFont->DrawString(_(displayValue).c_str(), x, y + 2);
|
||||||
|
|
||||||
if (value < selections.size())
|
if (value < selections.size())
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ void SimplePopup::Render()
|
|||||||
// draws a bounding box around the popup.
|
// draws a bounding box around the popup.
|
||||||
void SimplePopup::drawBoundingBox( float x, float y, float width, float height )
|
void SimplePopup::drawBoundingBox( float x, float y, float width, float height )
|
||||||
{
|
{
|
||||||
JRenderer *r = JRenderer::GetInstance();
|
|
||||||
|
|
||||||
//draw the corners
|
//draw the corners
|
||||||
string topCornerImageName = "top_corner.png";
|
string topCornerImageName = "top_corner.png";
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ int WSrcCards::loadMatches(WSrcCards* src, bool all)
|
|||||||
if (!src) return count;
|
if (!src) return count;
|
||||||
|
|
||||||
MTGCard * c = NULL;
|
MTGCard * c = NULL;
|
||||||
size_t t = 0;
|
|
||||||
int oldp = src->getOffset();
|
int oldp = src->getOffset();
|
||||||
src->setOffset(0);
|
src->setOffset(0);
|
||||||
for (int t = 0; t < src->Size(all); t++)
|
for (int t = 0; t < src->Size(all); t++)
|
||||||
@@ -257,8 +257,6 @@ int WSrcCards::addToDeck(MTGDeck * i, int num)
|
|||||||
|
|
||||||
bool WSrcCards::next()
|
bool WSrcCards::next()
|
||||||
{
|
{
|
||||||
int oldpos = currentPos;
|
|
||||||
bool bMatch = true;
|
|
||||||
int size = (int) cards.size();
|
int size = (int) cards.size();
|
||||||
if (filtersRoot) size = (int) validated.size();
|
if (filtersRoot) size = (int) validated.size();
|
||||||
if (currentPos + 1 >= size) return false;
|
if (currentPos + 1 >= size) return false;
|
||||||
@@ -268,8 +266,6 @@ bool WSrcCards::next()
|
|||||||
|
|
||||||
bool WSrcCards::prev()
|
bool WSrcCards::prev()
|
||||||
{
|
{
|
||||||
int oldpos = currentPos;
|
|
||||||
bool bMatch = true;
|
|
||||||
if (currentPos == 0) return false;
|
if (currentPos == 0) return false;
|
||||||
|
|
||||||
currentPos--;
|
currentPos--;
|
||||||
|
|||||||
+31
-15
@@ -94,7 +94,7 @@ bool WGuiItem::Leaving(JButton key)
|
|||||||
|
|
||||||
void WGuiItem::Render()
|
void WGuiItem::Render()
|
||||||
{
|
{
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||||
DWORD oldcolor = mFont->GetColor();
|
DWORD oldcolor = mFont->GetColor();
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
@@ -190,8 +190,6 @@ void WGuiHeader::Render()
|
|||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
|
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
mFont->DrawString(_(displayValue).c_str(), x + width / 2, y, JGETEXT_CENTER);
|
mFont->DrawString(_(displayValue).c_str(), x + width / 2, y, JGETEXT_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,8 +439,8 @@ void WDecoEnum::Render()
|
|||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||||
mFont->SetColor(getColor(WGuiColor::TEXT));
|
mFont->SetColor(getColor(WGuiColor::TEXT));
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
mFont->DrawString(_(getDisplay()).c_str(), getX() + 2, getY() + 3);
|
mFont->DrawString(_(getDisplay()).c_str(), getX() + 2, getY() + 3);
|
||||||
|
|
||||||
OptionInteger* opt = dynamic_cast<OptionInteger*> (it);
|
OptionInteger* opt = dynamic_cast<OptionInteger*> (it);
|
||||||
if (opt) mFont->DrawString(_(lookupVal(opt->value)).c_str(), getWidth() - 5, getY() + 3, JGETEXT_RIGHT);
|
if (opt) mFont->DrawString(_(lookupVal(opt->value)).c_str(), getWidth() - 5, getY() + 3, JGETEXT_RIGHT);
|
||||||
}
|
}
|
||||||
@@ -880,7 +878,6 @@ bool WGuiMenu::CheckUserInput(JButton key)
|
|||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
bool kidModal = false;
|
bool kidModal = false;
|
||||||
bool handledInput = false;
|
|
||||||
int nbitems = (int) items.size();
|
int nbitems = (int) items.size();
|
||||||
JGE * mEngine = JGE::GetInstance();
|
JGE * mEngine = JGE::GetInstance();
|
||||||
|
|
||||||
@@ -998,7 +995,6 @@ bool WGuiMenu::isButtonDir(JButton key, int dir)
|
|||||||
void WGuiMenu::Update(float dt)
|
void WGuiMenu::Update(float dt)
|
||||||
{
|
{
|
||||||
int nbitems = (int) items.size();
|
int nbitems = (int) items.size();
|
||||||
JGE * mEngine = JGE::GetInstance();
|
|
||||||
|
|
||||||
if (held) duration += dt;
|
if (held) duration += dt;
|
||||||
|
|
||||||
@@ -1348,7 +1344,6 @@ WGuiCardDistort::~WGuiCardDistort()
|
|||||||
|
|
||||||
void WGuiCardDistort::Render()
|
void WGuiCardDistort::Render()
|
||||||
{
|
{
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
JQuad * q = NULL;
|
JQuad * q = NULL;
|
||||||
|
|
||||||
if (distortSrc)
|
if (distortSrc)
|
||||||
@@ -1447,10 +1442,7 @@ WDistort::WDistort(float x1, float y1, float x2, float y2, float x3, float y3, f
|
|||||||
|
|
||||||
void WGuiListRow::Render()
|
void WGuiListRow::Render()
|
||||||
{
|
{
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
|
||||||
int listHeight = 40;
|
|
||||||
int listSelectable = 0;
|
|
||||||
int adjustedCurrent = 0;
|
|
||||||
int start = 0, nowPos = 0, vHeight = 0;
|
int start = 0, nowPos = 0, vHeight = 0;
|
||||||
int nbitems = (int) items.size();
|
int nbitems = (int) items.size();
|
||||||
|
|
||||||
@@ -1496,7 +1488,6 @@ void WGuiListRow::Render()
|
|||||||
|
|
||||||
items[pos]->setX(x + nowPos);
|
items[pos]->setX(x + nowPos);
|
||||||
items[pos]->setY(y + nowVPos);
|
items[pos]->setY(y + nowVPos);
|
||||||
//items[pos]->setWidth(width/nbitems);
|
|
||||||
items[pos]->setWidth(items[pos]->minWidth());
|
items[pos]->setWidth(items[pos]->minWidth());
|
||||||
float temp = items[pos]->getHeight() + 3;
|
float temp = items[pos]->getHeight() + 3;
|
||||||
if (temp > tallestRow) tallestRow = temp;
|
if (temp > tallestRow) tallestRow = temp;
|
||||||
@@ -1519,6 +1510,7 @@ void WGuiListRow::Render()
|
|||||||
}
|
}
|
||||||
setHeight(tallestRow * numRows + 10);
|
setHeight(tallestRow * numRows + 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
WGuiListRow::WGuiListRow(string n, WSyncable * s) :
|
WGuiListRow::WGuiListRow(string n, WSyncable * s) :
|
||||||
WGuiList(n, s)
|
WGuiList(n, s)
|
||||||
{
|
{
|
||||||
@@ -1527,6 +1519,7 @@ WGuiListRow::WGuiListRow(string n, WSyncable * s) :
|
|||||||
width = SCREEN_WIDTH;
|
width = SCREEN_WIDTH;
|
||||||
height = 20;
|
height = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
//WGuiFilterUI
|
//WGuiFilterUI
|
||||||
bool WGuiFilters::Finish(bool emptyset)
|
bool WGuiFilters::Finish(bool emptyset)
|
||||||
{
|
{
|
||||||
@@ -1561,6 +1554,7 @@ bool WGuiFilters::Finish(bool emptyset)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::ButtonPressed(int controllerId, int controlId)
|
void WGuiFilters::ButtonPressed(int controllerId, int controlId)
|
||||||
{
|
{
|
||||||
if (controllerId == -102)
|
if (controllerId == -102)
|
||||||
@@ -1588,6 +1582,7 @@ void WGuiFilters::ButtonPressed(int controllerId, int controlId)
|
|||||||
if (list != NULL) list->ButtonPressed(controllerId, controlId);
|
if (list != NULL) list->ButtonPressed(controllerId, controlId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::buildList()
|
void WGuiFilters::buildList()
|
||||||
{
|
{
|
||||||
list = NEW WGuiList("");
|
list = NEW WGuiList("");
|
||||||
@@ -1601,18 +1596,20 @@ void WGuiFilters::buildList()
|
|||||||
list->Add(wgs);
|
list->Add(wgs);
|
||||||
list->Entering(JGE_BTN_NONE);
|
list->Entering(JGE_BTN_NONE);
|
||||||
}
|
}
|
||||||
WGuiFilters::WGuiFilters(string header, WSrcCards * src) :
|
|
||||||
WGuiItem(header)
|
WGuiFilters::WGuiFilters(string header, WSrcCards * src) : WGuiItem(header)
|
||||||
{
|
{
|
||||||
bFinished = false;
|
bFinished = false;
|
||||||
source = src;
|
source = src;
|
||||||
recolorTo = -1;
|
recolorTo = -1;
|
||||||
buildList();
|
buildList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::recolorFilter(int color)
|
void WGuiFilters::recolorFilter(int color)
|
||||||
{
|
{
|
||||||
recolorTo = color;
|
recolorTo = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
string WGuiFilters::getCode()
|
string WGuiFilters::getCode()
|
||||||
{
|
{
|
||||||
if (!list) return "";
|
if (!list) return "";
|
||||||
@@ -1642,10 +1639,12 @@ string WGuiFilters::getCode()
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::setSrc(WSrcCards * wsc)
|
void WGuiFilters::setSrc(WSrcCards * wsc)
|
||||||
{
|
{
|
||||||
source = wsc;
|
source = wsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::Update(float dt)
|
void WGuiFilters::Update(float dt)
|
||||||
{
|
{
|
||||||
if (subMenu && !subMenu->isClosed()) subMenu->Update(dt);
|
if (subMenu && !subMenu->isClosed()) subMenu->Update(dt);
|
||||||
@@ -1667,11 +1666,13 @@ void WGuiFilters::Update(float dt)
|
|||||||
if (bDeleted) wgl->Entering(JGE_BTN_NONE);
|
if (bDeleted) wgl->Entering(JGE_BTN_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::Entering(JButton key)
|
void WGuiFilters::Entering(JButton key)
|
||||||
{
|
{
|
||||||
bFinished = false;
|
bFinished = false;
|
||||||
WGuiItem::Entering(key);
|
WGuiItem::Entering(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::Render()
|
void WGuiFilters::Render()
|
||||||
{
|
{
|
||||||
if (!list) return; //Hurrah for paranoia.
|
if (!list) return; //Hurrah for paranoia.
|
||||||
@@ -1686,6 +1687,7 @@ void WGuiFilters::Render()
|
|||||||
|
|
||||||
if (subMenu && !subMenu->isClosed()) subMenu->Render();
|
if (subMenu && !subMenu->isClosed()) subMenu->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiFilters::CheckUserInput(JButton key)
|
bool WGuiFilters::CheckUserInput(JButton key)
|
||||||
{
|
{
|
||||||
if (subMenu && !subMenu->isClosed() && subMenu->CheckUserInput(key)) return true;
|
if (subMenu && !subMenu->isClosed() && subMenu->CheckUserInput(key)) return true;
|
||||||
@@ -1700,11 +1702,13 @@ bool WGuiFilters::CheckUserInput(JButton key)
|
|||||||
}
|
}
|
||||||
return WGuiItem::CheckUserInput(key);
|
return WGuiItem::CheckUserInput(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
WGuiFilters::~WGuiFilters()
|
WGuiFilters::~WGuiFilters()
|
||||||
{
|
{
|
||||||
SAFE_DELETE(list);
|
SAFE_DELETE(list);
|
||||||
SAFE_DELETE(subMenu);
|
SAFE_DELETE(subMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::addColumn()
|
void WGuiFilters::addColumn()
|
||||||
{
|
{
|
||||||
if (!list) return;
|
if (!list) return;
|
||||||
@@ -1715,6 +1719,7 @@ void WGuiFilters::addColumn()
|
|||||||
wgl->Add(NEW WGuiFilterItem(this));
|
wgl->Add(NEW WGuiFilterItem(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiFilters::isAvailableCode(string code)
|
bool WGuiFilters::isAvailableCode(string code)
|
||||||
{
|
{
|
||||||
if (!list) return false;
|
if (!list) return false;
|
||||||
@@ -1733,6 +1738,7 @@ bool WGuiFilters::isAvailableCode(string code)
|
|||||||
}
|
}
|
||||||
return false; //For some reason, we don't have any rows?
|
return false; //For some reason, we don't have any rows?
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiFilters::isAvailable(int type)
|
bool WGuiFilters::isAvailable(int type)
|
||||||
{
|
{
|
||||||
if (!list) return false;
|
if (!list) return false;
|
||||||
@@ -1766,10 +1772,12 @@ bool WGuiFilters::isAvailable(int type)
|
|||||||
}
|
}
|
||||||
return false; //For some reason, we don't have any rows?
|
return false; //For some reason, we don't have any rows?
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::clearArgs()
|
void WGuiFilters::clearArgs()
|
||||||
{
|
{
|
||||||
tempArgs.clear();
|
tempArgs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilters::addArg(string display, string code)
|
void WGuiFilters::addArg(string display, string code)
|
||||||
{
|
{
|
||||||
if (!subMenu || !isAvailableCode(code)) return;
|
if (!subMenu || !isAvailableCode(code)) return;
|
||||||
@@ -1787,7 +1795,7 @@ WGuiFilterItem::WGuiFilterItem(WGuiFilters * parent) :
|
|||||||
mParent = parent;
|
mParent = parent;
|
||||||
mNew = true;
|
mNew = true;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
void WGuiFilterItem::updateValue()
|
void WGuiFilterItem::updateValue()
|
||||||
{
|
{
|
||||||
bool delMenu = true;
|
bool delMenu = true;
|
||||||
@@ -2013,6 +2021,7 @@ void WGuiFilterItem::updateValue()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiFilterItem::ButtonPressed(int controllerId, int controlId)
|
void WGuiFilterItem::ButtonPressed(int controllerId, int controlId)
|
||||||
{
|
{
|
||||||
if (!mParent) return;
|
if (!mParent) return;
|
||||||
@@ -2083,6 +2092,7 @@ WGuiKeyBinder::WGuiKeyBinder(string name, GameStateOptions* parent) :
|
|||||||
for (JGE::keybindings_it it = start; it != end; ++it)
|
for (JGE::keybindings_it it = start; it != end; ++it)
|
||||||
Add(NEW OptionKey(parent, it->first, it->second));
|
Add(NEW OptionKey(parent, it->first, it->second));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiKeyBinder::Update(float dt)
|
void WGuiKeyBinder::Update(float dt)
|
||||||
{
|
{
|
||||||
OptionKey* o = dynamic_cast<OptionKey*> (items[0]);
|
OptionKey* o = dynamic_cast<OptionKey*> (items[0]);
|
||||||
@@ -2096,12 +2106,14 @@ void WGuiKeyBinder::Update(float dt)
|
|||||||
(*it)->Update(dt);
|
(*it)->Update(dt);
|
||||||
if (confirmMenu) confirmMenu->Update(dt);
|
if (confirmMenu) confirmMenu->Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiKeyBinder::isModal()
|
bool WGuiKeyBinder::isModal()
|
||||||
{
|
{
|
||||||
for (vector<WGuiBase*>::iterator it = items.begin(); it != items.end(); ++it)
|
for (vector<WGuiBase*>::iterator it = items.begin(); it != items.end(); ++it)
|
||||||
if ((*it)->isModal()) return true;
|
if ((*it)->isModal()) return true;
|
||||||
return modal;
|
return modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiKeyBinder::CheckUserInput(JButton key)
|
bool WGuiKeyBinder::CheckUserInput(JButton key)
|
||||||
{
|
{
|
||||||
if (confirmMenu) return confirmMenu->CheckUserInput(key);
|
if (confirmMenu) return confirmMenu->CheckUserInput(key);
|
||||||
@@ -2109,6 +2121,7 @@ bool WGuiKeyBinder::CheckUserInput(JButton key)
|
|||||||
if (!items[currentItem]->Selectable()) nextItem();
|
if (!items[currentItem]->Selectable()) nextItem();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiKeyBinder::setData()
|
void WGuiKeyBinder::setData()
|
||||||
{
|
{
|
||||||
JGE* j = JGE::GetInstance();
|
JGE* j = JGE::GetInstance();
|
||||||
@@ -2205,6 +2218,7 @@ WGuiBase::CONFIRM_TYPE WGuiKeyBinder::needsConfirm()
|
|||||||
|
|
||||||
return CONFIRM_OK;
|
return CONFIRM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiKeyBinder::ButtonPressed(int controllerId, int controlId)
|
void WGuiKeyBinder::ButtonPressed(int controllerId, int controlId)
|
||||||
{
|
{
|
||||||
if (2 == controlId)
|
if (2 == controlId)
|
||||||
@@ -2222,6 +2236,7 @@ void WGuiKeyBinder::ButtonPressed(int controllerId, int controlId)
|
|||||||
SAFE_DELETE(confirmMenu);
|
SAFE_DELETE(confirmMenu);
|
||||||
confirmMenu = NULL;
|
confirmMenu = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WGuiKeyBinder::Render()
|
void WGuiKeyBinder::Render()
|
||||||
{
|
{
|
||||||
WGuiList::Render();
|
WGuiList::Render();
|
||||||
@@ -2245,6 +2260,7 @@ void WGuiKeyBinder::Render()
|
|||||||
confirmMenu->Render();
|
confirmMenu->Render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WGuiKeyBinder::yieldFocus()
|
bool WGuiKeyBinder::yieldFocus()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ JQuad * WResourceManager::RetrieveCard(MTGCard * card, int style, int submode)
|
|||||||
}
|
}
|
||||||
filename1 = filename + card->data->getName() + ".jpg";
|
filename1 = filename + card->data->getName() + ".jpg";
|
||||||
jq = RetrieveQuad(filename1, 0, 0, 0, 0, "", style, submode | TEXTURE_SUB_5551, id);
|
jq = RetrieveQuad(filename1, 0, 0, 0, 0, "", style, submode | TEXTURE_SUB_5551, id);
|
||||||
int i = 0; //TODO remove debug test;
|
|
||||||
}
|
}
|
||||||
lastError = textureWCache.mError;
|
lastError = textureWCache.mError;
|
||||||
if (jq)
|
if (jq)
|
||||||
|
|||||||
Reference in New Issue
Block a user