Some organisational prep work before I start working on a new navigation method (ie replacement for CardSelector). The current design was to allocate a CardSelector and pass in its pointer to a variety of classes via their constructors. To simplify things, now we use a singleton style pattern with an Instance() function - this means that when I implement a new class to replace CardSelector, I only need to modify what's returned by the singleton callback - as long as the new pointer class supports the same function calls, it'll be a straight drop-in.
This commit is contained in:
@@ -217,7 +217,7 @@ void CardDisplay::Render(){
|
||||
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;
|
||||
showMode = CardSelectorSingleton::Instance()->bigMode;
|
||||
pos.actY = 150;
|
||||
if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user