Fix UI handling
This commit is contained in:
@@ -174,8 +174,7 @@ void updatePlayerInput() {
|
||||
if (IsKeyDown(KEY_E)) game->camera.rotation++;
|
||||
|
||||
if (IsKeyReleased(input->mapping.backBtn)) {
|
||||
i32 selectedCount = ecs_query_entity_count(input->queries.selected);
|
||||
if (selectedCount == 0) {
|
||||
if (input->state == INPUT_NONE) {
|
||||
setScreen(game, SCREEN_PAUSE_MENU);
|
||||
} else {
|
||||
ecs_remove_all(ECS, Selected);
|
||||
@@ -185,12 +184,10 @@ void updatePlayerInput() {
|
||||
}
|
||||
|
||||
}
|
||||
if (!input->canUseMouse)
|
||||
return;
|
||||
|
||||
// https://gamedev.stackexchange.com/questions/9330/zoom-to-cursor-calculation
|
||||
float wheel = GetMouseWheelMove();
|
||||
if (wheel != 0.0f) {
|
||||
if (wheel != 0.0f && input->canUseMouse) {
|
||||
const float zoomIncrement = 0.125f;
|
||||
f32 oldZoom = game->camera.zoom;
|
||||
f32 newZoom = oldZoom + wheel * zoomIncrement;
|
||||
@@ -226,6 +223,9 @@ void updatePlayerInput() {
|
||||
mapHeight - height + game->map.tileHeight + height * 0.5f);
|
||||
}
|
||||
|
||||
if (!input->canUseMouse)
|
||||
return;
|
||||
|
||||
|
||||
BzTileMap *map = &game->map;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user