mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 17:50:42 +02:00
Merge branch 'master' of https://github.com/worklist/hifi
This commit is contained in:
commit
66a8e40712
2 changed files with 29 additions and 4 deletions
|
@ -1896,12 +1896,36 @@ glm::vec3 getGravity(glm::vec3 pos) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menuDisplayed = false;
|
||||||
void mouseFunc(int button, int state, int x, int y) {
|
void mouseFunc(int button, int state, int x, int y) {
|
||||||
//catch mouse actions on the menu
|
bool menuFound = menu.mouseClick(x, y);
|
||||||
bool menuClickedOrUnclicked = menu.mouseClick(x, y);
|
|
||||||
|
|
||||||
if (!menuClickedOrUnclicked) {
|
// If we didn't previously have the menu displayed, and we did just click on the menu, then
|
||||||
|
// go into menuDisplayed mode....
|
||||||
|
if (!::menuDisplayed && menuFound) {
|
||||||
|
::menuDisplayed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the menu was displayed, and we're not over a menu, then leave menu mode
|
||||||
|
if (::menuDisplayed && !menuFound) {
|
||||||
|
::menuDisplayed = false;
|
||||||
|
menu.hidePopupMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
// In menu displayed mode use old logic
|
||||||
|
if (::menuDisplayed) {
|
||||||
|
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
|
||||||
|
if (state == GLUT_DOWN && !menu.mouseClick(x, y)) {
|
||||||
|
mouseX = x;
|
||||||
|
mouseY = y;
|
||||||
|
mousePressed = 1;
|
||||||
|
} else if (state == GLUT_UP) {
|
||||||
|
mouseX = x;
|
||||||
|
mouseY = y;
|
||||||
|
mousePressed = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (button == GLUT_LEFT_BUTTON) {
|
if (button == GLUT_LEFT_BUTTON) {
|
||||||
mouseX = x;
|
mouseX = x;
|
||||||
mouseY = y;
|
mouseY = y;
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
void render(int screenwidth, int screenheight);
|
void render(int screenwidth, int screenheight);
|
||||||
void renderColumn(int i);
|
void renderColumn(int i);
|
||||||
MenuColumn* addColumn(const char *columnName);
|
MenuColumn* addColumn(const char *columnName);
|
||||||
|
void hidePopupMenu() { currentColumn = -1; };
|
||||||
private:
|
private:
|
||||||
std::vector<MenuColumn> columns;
|
std::vector<MenuColumn> columns;
|
||||||
int currentColumn;
|
int currentColumn;
|
||||||
|
|
Loading…
Reference in a new issue