Jeck - Trophy room added, triangle is now dedicated alt-render toggle. Hopefully I'm not forgetting anything...
This commit is contained in:
@@ -31,9 +31,6 @@
|
||||
|
||||
#include "../include/CardEffect.h"
|
||||
|
||||
#define MAX_STATE 6
|
||||
|
||||
|
||||
#define PLAYER_TYPE_CPU 0
|
||||
#define PLAYER_TYPE_HUMAN 1
|
||||
#define PLAYER_TYPE_TESTSUITE 2
|
||||
@@ -59,7 +56,7 @@ class GameApp: public JApp
|
||||
|
||||
GameState* mCurrentState;
|
||||
GameState* mNextState;
|
||||
GameState* mGameStates[MAX_STATE];
|
||||
GameState* mGameStates[GAME_STATE_MAX];
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
using std::map;
|
||||
using std::string;
|
||||
#include <JGE.h>
|
||||
#include <time.h>
|
||||
#include "../include/SimplePad.h"
|
||||
#include "../include/GameApp.h"
|
||||
|
||||
@@ -23,14 +24,10 @@ public:
|
||||
enum {
|
||||
//Global settings
|
||||
ACTIVE_PROFILE,
|
||||
DIFFICULTY_MODE_UNLOCKED,
|
||||
MOMIR_MODE_UNLOCKED,
|
||||
EVILTWIN_MODE_UNLOCKED,
|
||||
RANDOMDECK_MODE_UNLOCKED,
|
||||
LANG,
|
||||
LAST_GLOBAL = LANG, //This must be the value above, to keep ordering.
|
||||
//Values /must/ match ordering in optionNames, or everything loads wrong.
|
||||
//Profile settings
|
||||
//Profile settings
|
||||
ACTIVE_THEME,
|
||||
ACTIVE_MODE,
|
||||
MUSICVOLUME,
|
||||
@@ -62,6 +59,11 @@ public:
|
||||
INTERRUPT_ENDTURN,
|
||||
INTERRUPT_CLEANUP,
|
||||
INTERRUPT_AFTEREND,
|
||||
BEGIN_AWARDS, //Options after this use the GameOptionAward struct, which includes a timestamp.
|
||||
DIFFICULTY_MODE_UNLOCKED = BEGIN_AWARDS,
|
||||
MOMIR_MODE_UNLOCKED,
|
||||
EVILTWIN_MODE_UNLOCKED,
|
||||
RANDOMDECK_MODE_UNLOCKED,
|
||||
LAST_NAMED, //Any option after this does not look up in optionNames.
|
||||
SET_UNLOCKS = LAST_NAMED + 1, //For sets.
|
||||
};
|
||||
@@ -109,6 +111,19 @@ public:
|
||||
EnumDefinition * def;
|
||||
};
|
||||
|
||||
class GameOptionAward: public GameOption {
|
||||
public:
|
||||
virtual string menuStr();
|
||||
virtual bool write(std::ofstream * file, string name);
|
||||
virtual bool read(string input);
|
||||
virtual bool giveAward(); //Returns false if already awarded
|
||||
virtual bool isViewed() {return viewed;};
|
||||
virtual void setViewed(bool v = true) {viewed = v;};
|
||||
private:
|
||||
time_t achieved; //When was it awarded?
|
||||
bool viewed; //Flag it as "New!" or not.
|
||||
};
|
||||
|
||||
class OptionVolume: public EnumDefinition{
|
||||
public:
|
||||
enum { MUTE = 0, MAX = 100 };
|
||||
@@ -181,6 +196,7 @@ public:
|
||||
void keypadUpdate(float dt) {if(keypad) keypad->Update(dt);};
|
||||
void keypadRender() {if(keypad) keypad->Render();};
|
||||
|
||||
bool newAward();
|
||||
|
||||
//These return a filepath accurate to the current mode/profile/theme, and can
|
||||
//optionally fallback to a file within a certain directory.
|
||||
|
||||
@@ -11,11 +11,13 @@ using namespace std;
|
||||
|
||||
enum ENUM_GAME_STATE
|
||||
{
|
||||
GAME_STATE_MENU = 0x01,
|
||||
GAME_STATE_DUEL = 0x02,
|
||||
GAME_STATE_DECK_VIEWER = 0x03,
|
||||
GAME_STATE_SHOP = 0x04,
|
||||
GAME_STATE_OPTIONS = 0x05,
|
||||
GAME_STATE_MENU = 1,
|
||||
GAME_STATE_DUEL = 2,
|
||||
GAME_STATE_DECK_VIEWER = 3,
|
||||
GAME_STATE_SHOP = 4,
|
||||
GAME_STATE_OPTIONS = 5,
|
||||
GAME_STATE_AWARDS = 6,
|
||||
GAME_STATE_MAX = 7,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
using std::string;
|
||||
|
||||
#define MAX_OPTION_TABS 5
|
||||
#define MAX_OPTION_ITEMS 20
|
||||
#define MAX_ONSCREEN_OPTIONS 8
|
||||
#define OPTION_CENTER 4
|
||||
|
||||
@@ -130,6 +129,67 @@ protected:
|
||||
int id;
|
||||
};
|
||||
|
||||
class WDataSource{
|
||||
public:
|
||||
WDataSource() {};
|
||||
virtual JQuad * getImage() {return NULL;};
|
||||
virtual MTGCard * getCard() {return NULL;};
|
||||
virtual bool thisCard(int mtgid) {return false;};
|
||||
|
||||
virtual int getPos() {return -1;};
|
||||
virtual bool setPos(int pos) {return false;};
|
||||
virtual bool next() {return false;};
|
||||
virtual bool prev() {return false;};
|
||||
};
|
||||
|
||||
class WSrcImage: public WDataSource{
|
||||
public:
|
||||
virtual JQuad * getImage();
|
||||
WSrcImage(string s);
|
||||
|
||||
private:
|
||||
string filename;
|
||||
};
|
||||
|
||||
class WSrcMTGSet: public WDataSource{
|
||||
public:
|
||||
WSrcMTGSet(int setid);
|
||||
|
||||
virtual JQuad * getImage();
|
||||
virtual MTGCard * getCard();
|
||||
|
||||
virtual bool thisCard(int mtgid);
|
||||
virtual bool next();
|
||||
virtual bool prev();
|
||||
virtual int getPos() {return currentCard;};
|
||||
virtual bool setPos(int pos);
|
||||
|
||||
protected:
|
||||
vector<MTGCard*> cards;
|
||||
int currentCard;
|
||||
};
|
||||
|
||||
class WGuiImage: public WGuiItem{
|
||||
public:
|
||||
WGuiImage(WDataSource * wds, float _w = 0, float _h = 0, int _margin = 0);
|
||||
virtual bool Selectable() {return false;};
|
||||
virtual void Render();
|
||||
virtual float getHeight();
|
||||
virtual void imageScale(float _w, float _h);
|
||||
protected:
|
||||
int margin;
|
||||
float imgW, imgH;
|
||||
WDataSource * source;
|
||||
};
|
||||
|
||||
class WGuiCardImage: public WGuiImage{
|
||||
public:
|
||||
WGuiCardImage(WDataSource * wds, int _offset=0);
|
||||
virtual void Render();
|
||||
protected:
|
||||
int offset;
|
||||
};
|
||||
|
||||
//This is our base class for decorators. It wraps everything about WGuiBase.
|
||||
class WGuiDeco: public WGuiBase{
|
||||
public:
|
||||
@@ -174,10 +234,24 @@ protected:
|
||||
WGuiBase * it;
|
||||
};
|
||||
|
||||
class WGuiAward: public WGuiItem{
|
||||
public:
|
||||
WGuiAward(int _id, string name, string _text);
|
||||
virtual ~WGuiAward();
|
||||
virtual void Render();
|
||||
virtual bool Selectable() {return Visible();};
|
||||
virtual bool Visible();
|
||||
virtual int getId() {return id;};
|
||||
virtual void Overlay();
|
||||
protected:
|
||||
int id;
|
||||
string text;
|
||||
};
|
||||
|
||||
class WGuiSplit: public WGuiItem{
|
||||
public:
|
||||
WGuiSplit(WGuiBase* _left,WGuiBase* _right);
|
||||
~WGuiSplit();
|
||||
virtual ~WGuiSplit();
|
||||
|
||||
virtual void Reload();
|
||||
virtual void Overlay();
|
||||
@@ -206,7 +280,7 @@ public:
|
||||
class WDecoConfirm: public WGuiDeco{
|
||||
public:
|
||||
WDecoConfirm(JGuiListener * _listener, WGuiBase * it);
|
||||
~WDecoConfirm();
|
||||
virtual ~WDecoConfirm();
|
||||
|
||||
virtual bool isModal();
|
||||
virtual void setData();
|
||||
@@ -261,13 +335,6 @@ protected:
|
||||
JGuiListener * mListener;
|
||||
};
|
||||
|
||||
class WGuiText:public WGuiItem {
|
||||
public:
|
||||
WGuiText(string _displayValue): WGuiItem(_displayValue) {};
|
||||
virtual bool Selectable() {return false;};
|
||||
virtual void Render();
|
||||
};
|
||||
|
||||
class WGuiHeader:public WGuiItem{
|
||||
public:
|
||||
WGuiHeader(string _displayValue): WGuiItem(_displayValue) {};
|
||||
@@ -277,41 +344,7 @@ class WGuiHeader:public WGuiItem{
|
||||
};
|
||||
|
||||
|
||||
class WGuiList: public WGuiItem{
|
||||
public:
|
||||
WGuiList(string name);
|
||||
~WGuiList();
|
||||
|
||||
string failMsg;
|
||||
int nbitems;
|
||||
int current;
|
||||
|
||||
virtual bool hasFocus() {return mFocus;};
|
||||
virtual void setFocus(bool bFocus) {mFocus = bFocus;};
|
||||
virtual bool Leaving(u32 key);
|
||||
virtual void Entering(u32 key);
|
||||
virtual void Render();
|
||||
virtual void confirmChange(bool confirmed);
|
||||
virtual void renderBack(WGuiBase * it);
|
||||
virtual void Reload();
|
||||
virtual void ButtonPressed(int controllerId, int controlId);
|
||||
virtual void Update(float dt);
|
||||
virtual void setData();
|
||||
virtual bool isModal();
|
||||
virtual void setModal(bool val);
|
||||
|
||||
void Add(WGuiBase * item);
|
||||
WGuiBase * Current();
|
||||
void nextOption();
|
||||
void prevOption();
|
||||
|
||||
WGuiBase * operator[](int);
|
||||
protected:
|
||||
bool mFocus;
|
||||
WGuiBase * listItems[MAX_OPTION_ITEMS];
|
||||
};
|
||||
|
||||
class WGuiMenu{
|
||||
class WGuiMenu: public WGuiItem{
|
||||
public:
|
||||
|
||||
virtual ~WGuiMenu();
|
||||
@@ -323,16 +356,49 @@ public:
|
||||
virtual void ButtonPressed(int controllerId, int controlId);
|
||||
virtual void Add(WGuiBase* item); //Remember, does not set X & Y of items automatically.
|
||||
virtual void confirmChange(bool confirmed);
|
||||
virtual bool Leaving(u32 key);
|
||||
virtual void Entering(u32 key);
|
||||
virtual void renderBack(WGuiBase * it);
|
||||
|
||||
WGuiBase * Current();
|
||||
void nextItem();
|
||||
void prevItem();
|
||||
virtual void nextItem();
|
||||
virtual void prevItem();
|
||||
virtual bool isModal();
|
||||
virtual void setModal(bool val);
|
||||
|
||||
void setData();
|
||||
|
||||
protected:
|
||||
u32 buttonNext, buttonPrev;
|
||||
vector<WGuiBase*> items;
|
||||
int currentItem;
|
||||
u32 held;
|
||||
float duration;
|
||||
};
|
||||
|
||||
class WGuiFlow: public WGuiMenu{
|
||||
public:
|
||||
WGuiFlow();
|
||||
};
|
||||
|
||||
class WGuiList: public WGuiMenu{
|
||||
public:
|
||||
WGuiList(string name, WDataSource * syncme = NULL);
|
||||
|
||||
string failMsg;
|
||||
|
||||
virtual void Render();
|
||||
virtual void confirmChange(bool confirmed);
|
||||
virtual void ButtonPressed(int controllerId, int controlId);
|
||||
virtual void setData();
|
||||
|
||||
virtual void nextItem();
|
||||
virtual void prevItem();
|
||||
|
||||
WGuiBase * operator[](int);
|
||||
protected:
|
||||
WDataSource * sync;
|
||||
bool mFocus;
|
||||
};
|
||||
|
||||
class WGuiTabMenu: public WGuiMenu {
|
||||
|
||||
Reference in New Issue
Block a user