Erwan
- fixed bugs introduced in revision 2034 (Giant Growth) - Extended Story mode xml: much easier to write basic thing, font selection, possibility to position answers, answers now in correct order - moved story in the menu because it is not major for now
This commit is contained in:
@@ -11,42 +11,48 @@ class GameObserver;
|
||||
#define CAMPAIGNS_FOLDER "Res/campaigns/"
|
||||
|
||||
|
||||
class StoryGraphicalElement:public JGuiObject {
|
||||
class StoryDialogElement:public JGuiObject {
|
||||
public:
|
||||
float mX;
|
||||
float mY;
|
||||
StoryGraphicalElement(float x, float y);
|
||||
StoryDialogElement(float x, float y, int id = 0);
|
||||
void Entering(){};
|
||||
bool Leaving(JButton key) {return false;};
|
||||
bool ButtonPressed() {return false;};
|
||||
bool hasFocus() {return false;};
|
||||
virtual float getHeight() = 0;
|
||||
};
|
||||
|
||||
class StoryText:public StoryGraphicalElement {
|
||||
class StoryText:public StoryDialogElement {
|
||||
public :
|
||||
string text;
|
||||
int align;
|
||||
StoryText(string text, float mX, float mY, string align = "center");
|
||||
int font;
|
||||
StoryText(string text, float mX, float mY, string align = "center", int font = 0, int id = 0);
|
||||
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
float getHeight();
|
||||
};
|
||||
class StoryImage:public StoryGraphicalElement {
|
||||
class StoryImage:public StoryDialogElement {
|
||||
public :
|
||||
string img;
|
||||
StoryImage(string img, float mX, float mY);
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
float getHeight();
|
||||
};
|
||||
|
||||
class StoryChoice:public JGuiObject {
|
||||
class StoryChoice:public StoryText {
|
||||
public:
|
||||
string pageId;
|
||||
string text;
|
||||
float mX;
|
||||
float mY;
|
||||
|
||||
bool mHasFocus;
|
||||
float mScale;
|
||||
float mTargetScale;
|
||||
StoryChoice(string id, string text, int JGOid, float mX, float mY, bool hasFocus);
|
||||
StoryChoice(string id, string text, int JGOid, float mX, float mY, string _align, int _font, bool hasFocus);
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
|
||||
@@ -55,11 +61,12 @@ public:
|
||||
bool ButtonPressed();
|
||||
bool hasFocus();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
float getHeight();
|
||||
};
|
||||
|
||||
class StoryFlow;
|
||||
class StoryPage {
|
||||
public:
|
||||
public:
|
||||
StoryFlow * mParent;
|
||||
StoryPage(StoryFlow * mParent);
|
||||
virtual void Update(float dt)=0;
|
||||
@@ -69,15 +76,18 @@ public:
|
||||
|
||||
class StoryDialog:public StoryPage, public JGuiListener,public JGuiController {
|
||||
private:
|
||||
vector<StoryGraphicalElement *>graphics;
|
||||
vector<StoryDialogElement *>graphics;
|
||||
string safeAttribute(TiXmlElement* element, string attribute);
|
||||
|
||||
void RenderElement(StoryDialogElement * elmt);
|
||||
public:
|
||||
StoryDialog(TiXmlElement* el,StoryFlow * mParent);
|
||||
~StoryDialog();
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
void ButtonPressed(int,int);
|
||||
|
||||
static float currentY;
|
||||
static float previousY;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user