Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGui uilist does not support HideKB #78755

Open
alef opened this issue Dec 24, 2024 · 3 comments
Open

ImGui uilist does not support HideKB #78755

alef opened this issue Dec 24, 2024 · 3 comments
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@alef
Copy link
Contributor

alef commented Dec 24, 2024

Describe the bug

When the mouse cursor is hidden, the menu entries should not be highlighted like when a mouse pointer is hovering above them.

Attach save file

N/A

Steps to reproduce

  1. Enable HideKB in Options -> Interface -> Mouse control options -> Hide mouse cursor
  2. Position the mouse cursor over your character
  3. In game, press Enter
  4. The menu entry in the middle of the screen is highlighted but there is no mouse cursor visible. See screenshot "5 Inventory ...".
  5. Move the mouse. Now the menu entry is highlighted under a visible mouse cursor

Expected behavior

Step 4. above should not happen. That is, if the mouse is hidden the uilist entry should not be highlighted.

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.5247 (22H2)
  • Game Version: 0.G-15972-g44b38173c6-dirty [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth]
    ]

Additional context

Trying to fix on my own in ui.cpp void uilist_impl::draw_controls(). However, the logic for highlighting is embed into ImGui and quite complex to follow. Hope the ImGui experts can have a look, thanks.

@alef alef added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Dec 24, 2024
@ZhilkinSerg
Copy link
Contributor

HideKB option only hides mouse cursor in our SDL curse implementation. In imgui there ARE ImGui_ImplSDL2_UpdateMouseCursor with SDL_ShowCursor calls.

To hide mouse cursor either ImGuiConfigFlags_NoMouseCursorChange should be set or MouseDrawCursor should be set to false.

You can try to go with the following in cataimgui.cpp:

    ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;

@alef
Copy link
Contributor Author

alef commented Dec 25, 2024

Tried but no luck. The logic to decide when to highlight is inside ImGui::ButtonBehavior, being bool hovered the most candidate. ImGui does not ignore highlighting also when I set ImGuiMouseCursor_None.

@alef
Copy link
Contributor Author

alef commented Dec 31, 2024

Kind of related to #78874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

No branches or pull requests

3 participants
@alef @ZhilkinSerg and others