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

Migrate uilist to ImGui #73045

Closed
wants to merge 36 commits into from

Commits on Apr 15, 2024

  1. wip make uilist use imgui

    Mostly in pretty good shape.
    
    * the loading progress indicators don’t look right
    * imgui layer doesn’t properly handle a ui_adaptor that is supposed to
    hide all other ui
    * a uilist that is reset doesn’t show any options
    * no second column text is drawn
    * uilist is now an imgui window with a title, so the "text" of the
    list has been split into a title and a help text; most just have a
    title with no help text
    * maybe other things
    db48x authored and katemonster33 committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    9a9eb72 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0781a9d View commit details
    Browse the repository at this point in the history
  3. Taking a different approach with imgui uilist, going to try to make t…

    …his smaller, we can refactor uilist in a different PR
    katemonster33 committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    d5abe30 View commit details
    Browse the repository at this point in the history
  4. progress woo

    katemonster33 committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    91f87f3 View commit details
    Browse the repository at this point in the history
  5. fixed compile errors

    katemonster33 committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    2fedf29 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2b6d797 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6b2bf55 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. clean up some minor errors

    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    5c8c964 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22b97aa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4a8eff3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7487b55 View commit details
    Browse the repository at this point in the history
  5. move draw_colored_text to the cataimgui namespace

    There’s no need for it to be a method of cataimgui::window, since it
    accesses no state on the window. This will allow callers that are not
    derived classes.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    55e71af View commit details
    Browse the repository at this point in the history
  6. make foldstring wrap each line separately

    This shouldn’t change the output except in the case where no wrapping
    is actually happening. When width was zero, the input was not actually
    being broken into lines at all, causing confusion later on.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    53033b1 View commit details
    Browse the repository at this point in the history
  7. rewrite pocket_favorite_callback (advanced inventory) to use ImGui

    This uilist is supposed to fill the screen, but for some reason it is
    too short. Also, the title has a color tag in it; probably that should
    be moved to the help text.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    6df2bed View commit details
    Browse the repository at this point in the history
  8. make astyle

    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ab939f1 View commit details
    Browse the repository at this point in the history
  9. remove mention of ui_adaptor from users of uilist

    The uilist_impl derives from cataimgui::window, which creates and
    manages the ui_adaptor for us.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    bf8f720 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    41c0d2a View commit details
    Browse the repository at this point in the history
  11. remove app_uilist_handler

    It was purely aesthetic. All it did was tweak the border of the uilist
    so that it blends more seamlessly with some other UI already on the
    screen, which is now unnecessary.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ef0cf55 View commit details
    Browse the repository at this point in the history
  12. rewrite teleporter_callback to use ImGui

    Drawing the map needed more work than I expected. It traverses the map
    in an odd order, causing it to be flipped or rotated 180° when printed
    naively. Thus both the original and the new implementation for ImGui
    calculate the position of each character and reposition the cursor for
    each one.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    582c7d8 View commit details
    Browse the repository at this point in the history
  13. appease astyle

    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d03ef9d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c8dd700 View commit details
    Browse the repository at this point in the history
  15. uilist should allow the choices to scroll, not the whole window

    Now actually measure the menu items to find their width, and size the
    window reliably to fit without growing larger than the screen. (Will
    need to be tweaked when I fix the title bar though.)
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d75d0b1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    b351e9e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    15ae4e3 View commit details
    Browse the repository at this point in the history
  18. Rewrite the wish_item_callback to use ImGui, but imperfectly

    There are some niggling little bugs left that I am too tired to work
    out at the moment.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    c885ab4 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    cfe4df4 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    60631ff View commit details
    Browse the repository at this point in the history
  21. remove color stack and wrap width from cataimgui::draw_colored_text

    ImGui already has stacks for those. Of course, it's still not working
    perfectly.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ab41c11 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    d9a01bd View commit details
    Browse the repository at this point in the history
  23. finally remove all mention of catacurses from the uilist

    and a bunch of useless commented–out code that we have replaced.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    6735c49 View commit details
    Browse the repository at this point in the history
  24. uilist uses Selectable correctly to handle mouse events

    Actually clicking to select an item doesn’t work for unknown reasons,
    however. It always selects the wrong item.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    57536be View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    5c192b5 View commit details
    Browse the repository at this point in the history
  26. fix a missing include

    it must have been brought in by a transitive include
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    2340525 View commit details
    Browse the repository at this point in the history
  27. appease astyle yet again

    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    5c308e7 View commit details
    Browse the repository at this point in the history
  28. mouse input actually works correctly in uilists

    The selected menu item is now updated on hover, and the correct menu
    item now is activated on click. Really all that was missing was that
    parent.selected was not being updated.
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    e4aa53f View commit details
    Browse the repository at this point in the history
  29. appease astyle yet again

    oops, forgot about it again
    db48x authored and katemonster33 committed May 2, 2024
    Configuration menu
    Copy the full SHA
    a0b0e23 View commit details
    Browse the repository at this point in the history