- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it. - Various cleanup/refactor of the game observer. - Added a gameObserver == operator to compare two games - Added player mode to the player serialization - Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1. - Refactored random generator class to use list intead of queue - Defined a specific type for interrupt decision instead of int
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
/*
|
|
A class for very simple menus structure
|
|
*/
|
|
#ifndef _SIMPLEMENU_H_
|
|
#define _SIMPLEMENU_H_
|
|
|
|
#include <string>
|
|
#include <JGui.h>
|
|
#include "WFont.h"
|
|
#include "hge/hgeparticle.h"
|
|
|
|
#include "WResource_Fwd.h"
|
|
|
|
class SimpleMenu: public JGuiController
|
|
{
|
|
private:
|
|
float mHeight, mWidth, mX, mY;
|
|
int fontId;
|
|
std::string title;
|
|
int displaytitle;
|
|
int maxItems, startId;
|
|
float selectionT, selectionY;
|
|
float timeOpen;
|
|
bool mClosed;
|
|
|
|
bool mCenterHorizontal;
|
|
bool mCenterVertical;
|
|
|
|
static JQuadPtr spadeR, spadeL, jewel, side;
|
|
static JTexture *spadeRTex, *spadeLTex, *jewelTex, *sideTex;
|
|
hgeParticleSystem* stars;
|
|
|
|
inline void MogrifyJewel();
|
|
void drawHorzPole(float x, float y, float width);
|
|
void drawVertPole(float x, float y, float height);
|
|
|
|
public:
|
|
bool autoTranslate;
|
|
bool isMultipleChoice;
|
|
SimpleMenu(JGE*, int id, JGuiListener* listener, int fontId, float x, float y, const char * _title = "", int _maxItems = 7, bool centerHorizontal = true, bool centerVertical = true);
|
|
virtual ~SimpleMenu();
|
|
void Render();
|
|
void Update(float dt);
|
|
void Add(int id, const char * Text, string desc = "", bool forceFocus = false);
|
|
int getmCurr(){return mCurr;}
|
|
void Close();
|
|
|
|
void RecenterMenu();
|
|
|
|
float selectionTargetY;
|
|
bool isClosed()
|
|
{
|
|
return mClosed;
|
|
}
|
|
static void destroy();
|
|
};
|
|
|
|
#endif
|