mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
dasdasdasdas
This commit is contained in:
parent
95c713bc4d
commit
4d281ff03b
8 changed files with 64 additions and 77 deletions
|
|
@ -40,10 +40,8 @@ PagesControl* GUI::getMenu() {
|
|||
}
|
||||
|
||||
void GUI::actMouse(float delta) {
|
||||
int mx = Events::x;
|
||||
int my = Events::y;
|
||||
|
||||
auto hover = container->getAt(vec2(mx, my), nullptr);
|
||||
auto hover = container->getAt(Events::cursor, nullptr);
|
||||
if (this->hover && this->hover != hover) {
|
||||
this->hover->hover(false);
|
||||
}
|
||||
|
|
@ -58,7 +56,7 @@ void GUI::actMouse(float delta) {
|
|||
if (Events::jclicked(0)) {
|
||||
if (pressed == nullptr && this->hover) {
|
||||
pressed = hover;
|
||||
pressed->click(this, mx, my);
|
||||
pressed->click(this, Events::cursor.x, Events::cursor.y);
|
||||
if (focus && focus != pressed) {
|
||||
focus->defocus();
|
||||
}
|
||||
|
|
@ -72,7 +70,7 @@ void GUI::actMouse(float delta) {
|
|||
focus = nullptr;
|
||||
}
|
||||
} else if (pressed) {
|
||||
pressed->mouseRelease(this, mx, my);
|
||||
pressed->mouseRelease(this, Events::cursor.x, Events::cursor.y);
|
||||
pressed = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
@ -100,9 +98,7 @@ void GUI::act(float delta) {
|
|||
|
||||
if (!Events::_cursor_locked) {
|
||||
if (Events::clicked(mousecode::BUTTON_1)) {
|
||||
int mx = Events::x;
|
||||
int my = Events::y;
|
||||
focus->mouseMove(this, mx, my);
|
||||
focus->mouseMove(this, Events::cursor.x, Events::cursor.y);
|
||||
}
|
||||
if (prevfocus == focus){
|
||||
for (int i = mousecode::BUTTON_1; i < mousecode::BUTTON_1+12; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue