J :
* Grab the keyboard and display the grabbed key. * Include a tentative interface for the initial message. It's ugly.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef _GAME_STATE_OPTIONS_H_
|
||||
#define _GAME_STATE_OPTIONS_H_
|
||||
|
||||
#include <JGE.h>
|
||||
#include <JGui.h>
|
||||
#include "../include/GameState.h"
|
||||
|
||||
@@ -12,17 +13,21 @@ class WGuiTabMenu;
|
||||
class SimpleMenu;
|
||||
class SimplePad;
|
||||
|
||||
class GameStateOptions: public GameState, public JGuiListener
|
||||
{
|
||||
struct KeybGrabber {
|
||||
virtual void KeyPressed(LocalKeySym) = 0;
|
||||
};
|
||||
|
||||
class GameStateOptions: public GameState, public JGuiListener {
|
||||
private:
|
||||
float timer;
|
||||
bool mReload;
|
||||
KeybGrabber* grabber;
|
||||
|
||||
public:
|
||||
SimpleMenu * optionsMenu;
|
||||
WGuiTabMenu * optionsTabs;
|
||||
int mState;
|
||||
|
||||
|
||||
GameStateOptions(GameApp* parent);
|
||||
virtual ~GameStateOptions();
|
||||
|
||||
@@ -30,6 +35,8 @@ private:
|
||||
virtual void End();
|
||||
virtual void Update(float dt);
|
||||
virtual void Render();
|
||||
virtual void GrabKeyboard(KeybGrabber*);
|
||||
virtual void UngrabKeyboard(const KeybGrabber*);
|
||||
void ButtonPressed(int controllerId, int ControlId);
|
||||
|
||||
string newProfile;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "../include/GameApp.h"
|
||||
#include "../include/GameStateOptions.h"
|
||||
#include "../include/GameOptions.h"
|
||||
#include "../include/WFilter.h"
|
||||
#include "../include/WDataSrc.h"
|
||||
@@ -132,11 +133,18 @@ private:
|
||||
size_t initialValue;
|
||||
};
|
||||
|
||||
class OptionKey : public WGuiItem {
|
||||
class OptionKey : public WGuiItem, public KeybGrabber {
|
||||
public:
|
||||
OptionKey(LocalKeySym, JButton);
|
||||
OptionKey(GameStateOptions* g, LocalKeySym, JButton);
|
||||
LocalKeySym from;
|
||||
JButton to;
|
||||
virtual void Render();
|
||||
virtual void Overlay();
|
||||
virtual bool CheckUserInput(JButton key);
|
||||
virtual void KeyPressed(LocalKeySym key);
|
||||
virtual bool isModal();
|
||||
protected:
|
||||
bool grabbed;
|
||||
GameStateOptions* g;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define _WGUI_H_
|
||||
|
||||
class hgeDistortionMesh;
|
||||
class GameStateOptions;
|
||||
|
||||
class WGuiColor{
|
||||
public:
|
||||
@@ -486,10 +487,11 @@ struct WLFiltersSort{
|
||||
|
||||
class WGuiKeyBinder : public WGuiList {
|
||||
public:
|
||||
WGuiKeyBinder(string name);
|
||||
WGuiKeyBinder(string name, GameStateOptions* parent);
|
||||
virtual bool isModal();
|
||||
virtual bool CheckUserInput(JButton);
|
||||
protected:
|
||||
GameStateOptions* parent;
|
||||
bool modal;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user