Fix mouse support in menus and first screen
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ public:
|
|||||||
virtual bool ButtonPressed(); // action button pressed, return false to ignore
|
virtual bool ButtonPressed(); // action button pressed, return false to ignore
|
||||||
|
|
||||||
// Used for mouse support so that the GUI engine can found out which Object was selected
|
// Used for mouse support so that the GUI engine can found out which Object was selected
|
||||||
virtual bool getTopLeft(int& top, int& left)
|
virtual bool getTopLeft(float& top, float& left)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -162,7 +162,7 @@ bool JGuiController::CheckUserInput(JButton key)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < mCount; i++)
|
for (int i = 0; i < mCount; i++)
|
||||||
{
|
{
|
||||||
int top, left;
|
float top, left;
|
||||||
if (mObjects[i]->getTopLeft(top, left))
|
if (mObjects[i]->getTopLeft(top, left))
|
||||||
{
|
{
|
||||||
distance2 = (top - y) * (top - y) + (left - x) * (left - x);
|
distance2 = (top - y) * (top - y) + (left - x) * (left - x);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class PlayGuiObject: public JGuiObject, public JGuiListener, public Pos{
|
|||||||
PlayGuiObject(float desiredHeight, float x, float y, bool hasFocus);
|
PlayGuiObject(float desiredHeight, float x, float y, bool hasFocus);
|
||||||
PlayGuiObject(float desiredHeight, const Pos& ref, bool hasFocus);
|
PlayGuiObject(float desiredHeight, const Pos& ref, bool hasFocus);
|
||||||
virtual void ButtonPressed(int controllerId, int controlId){};
|
virtual void ButtonPressed(int controllerId, int controlId){};
|
||||||
virtual bool getTopLeft(int& top, int& left) {top = static_cast<int>(actY); left = static_cast<int>(actX); return true;};
|
virtual bool getTopLeft(float& top, float& left) {top = actY; left = actX; return true;};
|
||||||
virtual ~PlayGuiObject(){};
|
virtual ~PlayGuiObject(){};
|
||||||
vector<Effect*> effects;
|
vector<Effect*> effects;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ bool CardDisplay::CheckUserInput(int x, int y)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < mCount; i++)
|
for (int i = 0; i < mCount; i++)
|
||||||
{
|
{
|
||||||
int top, left;
|
float top, left;
|
||||||
if (mObjects[i]->getTopLeft(top, left))
|
if (mObjects[i]->getTopLeft(top, left))
|
||||||
{
|
{
|
||||||
distance2 = (top - y) * (top - y) + (left - x) * (left - x);
|
distance2 = (top - y) * (top - y) + (left - x) * (left - x);
|
||||||
|
|||||||
Reference in New Issue
Block a user