small fix
This commit is contained in:
parent
1cc26a6b10
commit
fe5cab0db0
@ -40,7 +40,6 @@ PagesControl* GUI::getMenu() {
|
||||
}
|
||||
|
||||
void GUI::actMouse(float delta) {
|
||||
|
||||
auto hover = container->getAt(Events::cursor, nullptr);
|
||||
if (this->hover && this->hover != hover) {
|
||||
this->hover->hover(false);
|
||||
@ -53,7 +52,7 @@ void GUI::actMouse(float delta) {
|
||||
}
|
||||
this->hover = hover;
|
||||
|
||||
if (Events::jclicked(0)) {
|
||||
if (Events::jclicked(mousecode::BUTTON_1)) {
|
||||
if (pressed == nullptr && this->hover) {
|
||||
pressed = hover;
|
||||
pressed->click(this, Events::cursor.x, Events::cursor.y);
|
||||
@ -73,6 +72,14 @@ void GUI::actMouse(float delta) {
|
||||
pressed->mouseRelease(this, Events::cursor.x, Events::cursor.y);
|
||||
pressed = nullptr;
|
||||
}
|
||||
|
||||
if (hover) {
|
||||
for (int i = mousecode::BUTTON_1; i < mousecode::BUTTON_1+12; i++) {
|
||||
if (Events::jclicked(i)) {
|
||||
hover->clicked(this, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::act(float delta) {
|
||||
@ -100,13 +107,6 @@ void GUI::act(float delta) {
|
||||
if (Events::clicked(mousecode::BUTTON_1)) {
|
||||
focus->mouseMove(this, Events::cursor.x, Events::cursor.y);
|
||||
}
|
||||
if (prevfocus == focus){
|
||||
for (int i = mousecode::BUTTON_1; i < mousecode::BUTTON_1+12; i++) {
|
||||
if (Events::jclicked(i)) {
|
||||
focus->clicked(this, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,4 +278,4 @@ void PagesControl::reset() {
|
||||
Container::remove(current_.panel);
|
||||
current_ = Page{nullptr};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@ bool ChunksController::loadVisible(){
|
||||
if (surrounding == MIN_SURROUNDING && !chunk->isLighted()) {
|
||||
if (!chunk->isLoadedLights()) {
|
||||
lighting->buildSkyLight(chunk->x, chunk->z);
|
||||
lighting->onChunkLoaded(chunk->x, chunk->z);
|
||||
}
|
||||
lighting->onChunkLoaded(chunk->x, chunk->z);
|
||||
chunk->setLighted(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user