- fix issue 89 and issue 90 - In the future, we will probably want cardSelector to handle CardDisplay somehow (although carddisplay is used in the Shop as well...)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-29 12:31:26 +00:00
parent a3717b7269
commit 5443e6ff89
4 changed files with 34 additions and 13 deletions

View File

@@ -12,6 +12,13 @@ using std::vector;
class PlayGuiObject;
class DuelLayers;
enum {
BIG_MODE_SHOW = 0,
BIG_MODE_TEXT = 1,
BIG_MODE_HIDE = 2,
NB_BIG_MODES = 3
};
template <typename T>
struct LimitorFunctor
{
@@ -38,7 +45,6 @@ class ObjectSelector : public GuiLayer
protected:
vector<T*> cards;
T* active;
int bigMode;
DuelLayers* duel;
LimitorFunctor<T>* limitor;
Pos bigpos;
@@ -48,6 +54,7 @@ class ObjectSelector : public GuiLayer
T* fetchMemory(SelectorMemory&);
public:
int bigMode;
ObjectSelector(DuelLayers*);
void Add(T*);
void Remove(T*);

View File

@@ -9,8 +9,8 @@ CardDisplay::CardDisplay() : mId(0), game(GameObserver::GetInstance()) {
listener = NULL;
nb_displayed_items = 7;
start_item = 0;
x= 0;
y= 0;
x = 0;
y = 0;
zone = NULL;
}
@@ -159,11 +159,29 @@ void CardDisplay::Render(){
}
}
//TODO: CardSelector should handle the graveyard and the library in the future...
if (mCount && mObjects[mCurr] != NULL){
mObjects[mCurr]->Render();
//TODO Put these two lines back!!!
// CardGui * cardg = ((CardGui *)mObjects[mCurr]);
// cardg->RenderBig(-1,-1,showBigCards-1);
CardGui * cardg = ((CardGui *)mObjects[mCurr]);
Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220);
int showMode = BIG_MODE_SHOW;
if (game){
showMode = game->mLayers->cs->bigMode;
pos.actY = 150;
if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2;
}
switch(showMode){
case BIG_MODE_SHOW:
cardg->RenderBig(pos);
break;
case BIG_MODE_TEXT:
cardg->alternateRenderBig(pos);
break;
default:
break;
}
}
}

View File

@@ -7,12 +7,7 @@
using std::cout;
enum {
BIG_MODE_SHOW = 0,
BIG_MODE_TEXT = 1,
BIG_MODE_HIDE = 2,
NB_BIG_MODES = 3
};
struct Left : public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)

View File

@@ -301,11 +301,12 @@ void ShopItems::Render(){
JGuiController::Render();
JRenderer * r = JRenderer::GetInstance();
if (display) display->Render();
if (mBgAA)
r->RenderQuad(mBgAA,0,SCREEN_HEIGHT-128);
if (display) display->Render();
if (showPriceDialog==-1){
}else{