Skip to content

Migrate mission UI to imGUI - #73134

Merged
Maleclypse merged 19 commits into
CleverRaven:masterfrom
RenechCDDA:no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
May 5, 2024
Merged

Migrate mission UI to imGUI#73134
Maleclypse merged 19 commits into
CleverRaven:masterfrom
RenechCDDA:no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

Conversation

@RenechCDDA

Copy link
Copy Markdown
Member

Summary

Interface "Mission UI migrated to imGUI"

Purpose of change

Continuing the move to imGUI.

Describe the solution

Migrate it.

Describe alternatives you've considered

N/A

Testing

(Still very WIP)

2024-04-19.14-48-10.mp4

Additional context

@github-actions github-actions Bot added Info / User Interface Game - player communication, menus, etc. Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 19, 2024
@RenechCDDA
RenechCDDA force-pushed the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch 4 times, most recently from fed8a4a to c90db6d Compare April 24, 2024 01:09
@RenechCDDA
RenechCDDA force-pushed the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch from c90db6d to ad8e434 Compare April 24, 2024 02:29
@RenechCDDA

Copy link
Copy Markdown
Member Author

I've gotten most of the kinks worked out at this point, but I still need to add deadline information and "likely rewards". I've never actually seen them displayed on the old window, but we have code support for it, so the imGUI version will too.

After that it's just a matter of plugging in the correct function calls to make the windows resize to fit terminal size.

@RenechCDDA
RenechCDDA force-pushed the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch from ad8e434 to e169946 Compare April 24, 2024 02:36
Comment thread src/mission_ui.cpp Outdated
RenechCDDA and others added 6 commits April 26, 2024 08:00
Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>
Mission giver display
Mission target/destination information
Don't remember mouse clicks (derp)
@RenechCDDA

Copy link
Copy Markdown
Member Author

Now I am pretty sure the only thing left to do is figure out how to handle window sizing and then ship it.

@RenechCDDA
RenechCDDA marked this pull request as ready for review April 28, 2024 21:18
@RenechCDDA
RenechCDDA force-pushed the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch from c566b64 to b58a984 Compare April 28, 2024 22:46
@github-actions github-actions Bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 29, 2024
@RenechCDDA
RenechCDDA force-pushed the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch from b58a984 to fa83535 Compare April 30, 2024 04:27

@db48x db48x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see adoption :)

Comment thread src/cursesdef.h Outdated
Comment thread src/mission_ui.cpp
Comment thread src/mission_ui.cpp
Comment thread src/mission_ui.cpp Outdated
@RenechCDDA
RenechCDDA marked this pull request as draft April 30, 2024 14:24
@RenechCDDA

Copy link
Copy Markdown
Member Author

I realized that I dropped the ability to set a mission as 'active' (target OMT shows up on the overmap, if you have a target) so that needs to be resolved. Marking as draft until then...

@RenechCDDA
RenechCDDA marked this pull request as ready for review May 2, 2024 20:39
@RenechCDDA

Copy link
Copy Markdown
Member Author

I changed the UI-shown language around the player's "active mission" to "(current) objective" because there is both the "active mission" and your "active missions", and that is... terribly unnecessary.
If anyone has some opinion on this, this PR is your chance to raise it!

@RenechCDDA

RenechCDDA commented May 2, 2024

Copy link
Copy Markdown
Member Author

I'm proud to say that this is fully mouse-compatible, and you can switch between mouse and keyboard as desired. Setting your current objective ("active mission" as it used to be known) with the mouse is accomplished by double clicking. As far as I can tell this is neither remappable nor shown in the keybindings menu, but it exists. The normal keyboard input to do so is "CONFIRM" (enter/return), same as before.

And yes the current objective is no longer highlighted green, but instead displayed at the top of the missions window. I expect to receive angry letters over this.

@github-actions github-actions Bot added Map / Mapgen Overmap, Mapgen, Map extras, Map display and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 2, 2024
@db48x

db48x commented May 2, 2024

Copy link
Copy Markdown
Contributor

I just ran it and got an assertion from ImGui:

cataclysm-tiles: src/third-party/imgui/imgui_tables.cpp:1464: void ImGui::TableSetupColumn(const char*, ImGuiTableColumnFlags, float, ImGuiID): Assertion `init_width_or_weight <= 0.0f && "Can only specify width/weight if sizing policy is set explicitly in either Table or Column."' failed.

This is when calling TableSetupColumn for the Description column. It’s also on a fresh game with no missions, if that matters.

@db48x

db48x commented May 3, 2024

Copy link
Copy Markdown
Contributor

I changed that column to ImGuiTableColumnFlags_WidthFixed and it works fine. Overall the UI works really well, but it is odd that the mission list is not as tall as the whole window. I guess that’s not technically important, but personally I’d fix it before committing.

@RenechCDDA

Copy link
Copy Markdown
Member Author

but it is odd that the mission list is not as tall as the whole window.

This is actually a regression, currently the window size is being set by its contents (the size of the table) and the size of the table is extending downwards outside of the actually visible listbox.

(Not pushed) Calls to ImGui::SetNextWindowSizeConstraints() are not being heeded. I was going to overcome this by allowing the window to be resizable but even if I exclude the bit flag it's always set upstream, and I don't want to expand this PR too much.

I can set the window to always resize(via flag) or force the same thing by calling ImGui::SetWindowSize(ImVec2(0,0)) at the start of every draw_controls(), but then the window will resize itself as you switch between tabs.

I'm investigating a better way to handle the sizing.

Comment thread src/mission_ui.cpp Outdated
@github-actions github-actions Bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 3, 2024
@Maleclypse
Maleclypse merged commit 0b51522 into CleverRaven:master May 5, 2024
@RenechCDDA
RenechCDDA deleted the no_redraw_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE branch May 5, 2024 02:43
@CEHA

CEHA commented May 5, 2024

Copy link
Copy Markdown

On Android I'm can choose only first or last mission in list (((

@RenechCDDA

Copy link
Copy Markdown
Member Author

On Android I'm can choose only first or last mission in list (((

Please make a bug report (and elaborate there)

SurFlurer added a commit to SurFlurer/Cataclysm-DDA that referenced this pull request Aug 26, 2024
…w_THREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"

This reverts commit 0b51522, reversing
changes made to 19d58b0.
this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants