Jeck - Added full filtering system to deck editor and shop. I've spent 24hours on pure debugging, but there are likely a couple bugs I've missed. So please, if you find something, make an issue of it! :P Also split OptionItem classes into separate files, and added support for mixed-set boosters (which I think are way, way cool).

This commit is contained in:
wagic.jeck
2010-02-08 01:03:07 +00:00
parent 64d592f588
commit 83e2b04547
31 changed files with 4125 additions and 2742 deletions
-93
View File
@@ -1,93 +0,0 @@
#ifndef _SHOP_ITEM_H
#define _SHOP_ITEM_H
#include <JGui.h>
#include <JLBFont.h>
#include "SimpleMenu.h"
#include "MTGDeck.h"
#include "../include/PriceList.h"
#include "../include/PlayerData.h"
#include "../include/CardDisplay.h"
#include "../include/DeckDataWrapper.h"
#include <string>
using std::string;
class hgeDistortionMesh;
#define SHOP_BOOSTERS 3
class ShopItem:public JGuiObject{
private:
friend class ShopItems;
bool mHasFocus;
bool mRelease;
JLBFont *mFont;
string mText;
float xy[8];
JQuad * quad;
JQuad * thumb;
float mScale;
float mTargetScale;
hgeDistortionMesh* mesh;
void updateThumb();
public:
int nameCount;
int quantity;
MTGCard * card;
int price;
ShopItem(int id, JLBFont * font, int _cardid, float _xy[], bool hasFocus, MTGAllCards * collection, int _price, DeckDataWrapper * ddw);
ShopItem(int id, JLBFont * font, char* text, JQuad * _quad, JQuad * _thumb,float _xy[], bool hasFocus, int _price);
~ShopItem();
int updateCount(DeckDataWrapper * ddw);
virtual void Render();
virtual void Update(float dt);
virtual void Entering();
virtual bool Leaving(u32 key);
virtual bool ButtonPressed();
const char * getText();
virtual ostream& toString(ostream& out) const;
};
class ShopItems:public JGuiController,public JGuiListener{
private:
PlayerData * playerdata;
PriceList * pricelist;
int mX, mY, mHeight;
JLBFont* mFont;
JTexture * mBgAATex;
JQuad * mBgAA;
MTGAllCards * collection;
SimpleMenu * dialog;
int showPriceDialog;
int setIds[SHOP_BOOSTERS];
MTGCardInstance * displayCards[100];
CardDisplay * display;
void safeDeleteDisplay();
DeckDataWrapper * myCollection;
int lightAlpha;
int alphaChange;
public:
bool showCardList;
ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y, MTGAllCards * _collection, int _setIds[]);
~ShopItems();
void Render();
virtual void Update(float dt);
void Add(int cardid);
void Add(char * text, JQuad * quad, JQuad * thumb,int _price);
void pricedialog(int id, int mode=1);
virtual void ButtonPressed(int controllerId, int controlId);
bool CheckUserInput(u32 key);
void savePriceList();
void saveAll();
static float _x1[],_y1[],_x2[],_y2[],_x3[],_y3[],_x4[],_y4[];
};
#endif