Rework input system
This commit is contained in:
@@ -300,14 +300,13 @@ void update(float dt, void *userData) {
|
||||
bzUISetCaptureMouse(UI, !io->WantCaptureMouse);
|
||||
bzUISetCaptureKeyboard(UI, !io->WantCaptureKeyboard);
|
||||
|
||||
input->canUseMouse = !io->WantCaptureMouse && !bzUICapturedMouse(UI);
|
||||
input->canUseKeyboard = !io->WantCaptureKeyboard && !bzUICapturedKeyboard(UI);
|
||||
updateInputState(input, game->camera, dt);
|
||||
|
||||
switch (game->screen) {
|
||||
case SCREEN_GAME:
|
||||
updatePlayerInput();
|
||||
if (IsKeyReleased(input->mapping.backBtn)) {
|
||||
game->screen = SCREEN_PAUSE_MENU;
|
||||
}
|
||||
break;
|
||||
case SCREEN_PAUSE_MENU:
|
||||
if (IsKeyReleased(input->mapping.backBtn)) {
|
||||
@@ -709,7 +708,8 @@ void imguiRender(float dt, void *userData) {
|
||||
if (igCollapsingHeader_TreeNodeFlags("Selection", 0)) {
|
||||
switch (input->state) {
|
||||
case INPUT_SELECTED_UNITS:
|
||||
case INPUT_SELECTED_OBJECT: {
|
||||
case INPUT_SELECTED_OBJECT:
|
||||
case INPUT_SELECTED_BUILDING: {
|
||||
ecs_defer_begin(ECS);
|
||||
ecs_iter_t it = ecs_query_iter(ECS, input->queries.selected);
|
||||
while (ecs_iter_next(&it)) {
|
||||
|
||||
Reference in New Issue
Block a user