mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
small fix
This commit is contained in:
parent
1cc26a6b10
commit
fe5cab0db0
3 changed files with 11 additions and 11 deletions
|
|
@ -40,7 +40,6 @@ PagesControl* GUI::getMenu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::actMouse(float delta) {
|
void GUI::actMouse(float delta) {
|
||||||
|
|
||||||
auto hover = container->getAt(Events::cursor, nullptr);
|
auto hover = container->getAt(Events::cursor, nullptr);
|
||||||
if (this->hover && this->hover != hover) {
|
if (this->hover && this->hover != hover) {
|
||||||
this->hover->hover(false);
|
this->hover->hover(false);
|
||||||
|
|
@ -53,7 +52,7 @@ void GUI::actMouse(float delta) {
|
||||||
}
|
}
|
||||||
this->hover = hover;
|
this->hover = hover;
|
||||||
|
|
||||||
if (Events::jclicked(0)) {
|
if (Events::jclicked(mousecode::BUTTON_1)) {
|
||||||
if (pressed == nullptr && this->hover) {
|
if (pressed == nullptr && this->hover) {
|
||||||
pressed = hover;
|
pressed = hover;
|
||||||
pressed->click(this, Events::cursor.x, Events::cursor.y);
|
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->mouseRelease(this, Events::cursor.x, Events::cursor.y);
|
||||||
pressed = nullptr;
|
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) {
|
void GUI::act(float delta) {
|
||||||
|
|
@ -100,13 +107,6 @@ void GUI::act(float delta) {
|
||||||
if (Events::clicked(mousecode::BUTTON_1)) {
|
if (Events::clicked(mousecode::BUTTON_1)) {
|
||||||
focus->mouseMove(this, Events::cursor.x, Events::cursor.y);
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ bool ChunksController::loadVisible(){
|
||||||
if (surrounding == MIN_SURROUNDING && !chunk->isLighted()) {
|
if (surrounding == MIN_SURROUNDING && !chunk->isLighted()) {
|
||||||
if (!chunk->isLoadedLights()) {
|
if (!chunk->isLoadedLights()) {
|
||||||
lighting->buildSkyLight(chunk->x, chunk->z);
|
lighting->buildSkyLight(chunk->x, chunk->z);
|
||||||
lighting->onChunkLoaded(chunk->x, chunk->z);
|
|
||||||
}
|
}
|
||||||
|
lighting->onChunkLoaded(chunk->x, chunk->z);
|
||||||
chunk->setLighted(true);
|
chunk->setLighted(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue