- Reworked the testsuite to be able to work multithreaded. This is deactivated by default everywhere except in QT_CONFIG as one testcase still refuses to pass in multithreaded mode. On my 4 cores linux desktop, the 650 tests passes now in 4 seconds (1 fails). - Replaced usage of CardSelectorSingleton by a card selector per game observer. - Modified the resource manager to be optionnal and per game observer instance instead of being a singleton. Two reasons here : threading AND Open Gl access. I only updated the crashing parts called from the game observer, so most of the code is still using the single instance. Beware of copy-paste concerning resources ... - Cleaned up the game observer constructors - Fixed several problems in action logging code while testing proliferate decks - Cleaned up Threading implementation based on QThread
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(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
|