Jeck - Basic set metadata support. Also a minor improvement to WGuiImage.

* Metadata is currently only used in exactly one place: the set's "Pretty Name" is displayed when the set is first unlocked. 
* WGuiImage now has a function to set scaling.
This commit is contained in:
wagic.jeck
2009-11-18 09:27:24 +00:00
parent 2f327edb6a
commit 37ad16d90e
16 changed files with 334 additions and 113 deletions

View File

@@ -71,9 +71,10 @@ void GameStateShop::load(){
//Unlock a default set if no set is unlocked
int ok = 0;
int defaultSet = 0;
for (int i = 0; i < MtgSets::SetsList->nb_items; i++){
string s = MtgSets::SetsList->values[i];
if (s.compare("10E") == 0) defaultSet = i;
for (int i = 0; i < setlist.size(); i++){
if (setlist[i].compare("10E") == 0) defaultSet = i;
unlocked[i] = options[Options::optionSet(i)].number;
if (unlocked[i])
@@ -85,7 +86,7 @@ void GameStateShop::load(){
options.save();
}
for (int i = 0; i < MtgSets::SetsList->nb_items; i++){
for (int i = 0; i < setlist.size(); i++){
if (unlocked[i]){
sets[nbsets] = i;
nbsets++;
@@ -101,7 +102,7 @@ void GameStateShop::load(){
}
}else{
for (int i = 0; i < SHOP_BOOSTERS; i++){
setIds[i] = (rand() % MtgSets::SetsList->nb_items);
setIds[i] = (rand() % setlist.size());
}
}
JQuad * mBackThumb = resources.GetQuad("back_thumb");
@@ -109,9 +110,14 @@ void GameStateShop::load(){
shop = NEW ShopItems(10, this, itemFont, 10, 0, mParent->collection, setIds);
MTGSetInfo * si = NULL;
for (int i = 0; i < SHOP_BOOSTERS; i++){
sprintf(setNames[i], "%s Booster (15 %s)",MtgSets::SetsList->values[setIds[i]].c_str(), _("cards").c_str());
shop->Add(setNames[i],mBack,mBackThumb, 700);
si = setlist.getInfo(setIds[i]);
if(!si)
continue;
sprintf(setNames[i], "%s %s (%i %s)", si->id.c_str(), _("Booster").c_str(), si->boosterSize(), _("Cards").c_str());
shop->Add(setNames[i],mBack,mBackThumb, si->boosterCost());
}
MTGDeck * tempDeck = NEW MTGDeck(mParent->collection);