Appliance interaction menu is no longer cut off at the bottom #78353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfixes "Appliance interaction menu is no longer cut off at the bottom"
Purpose of change
Fixes #78177
Describe the solution
Let
uilist
do the sizing instead of trying to re-calculate the needed height in appliance interaction menu code.Describe alternatives you've considered
Unlike the diff proposed by @ZhilkinSerg, I decided to leave the width of the input as it was - way wider than it needs to be - because
I didn't see Serg's comment at the time of my commitI think it looks a bit better that way.I think ideal solution would be to migrate the "header" of the interaction menu to imgui as well, but that's a bit beyond me for now.
Testing
tiles
smol tiles
curses
Additional context
two minor drive-by changes (i probably don't need to write this out but hey):
ImVec2 title_size = {};
creates uninitialized (rather than zeroed) value which might be UB and might be bad. So I changed those toImVec2 title_size = ImVec2();
(sinceImVec2
conveniently has a nice zero constructor like that). There is no change in behaviour, but the locals in the debugger look a bit less confusing now.imenu.setup();
inveh_app_interact::populate_app_actions()
. The latter is only ever called inveh_app_interact::init_ui_windows()
, and is always followed byimenu.setup();
anyway, so what's the point doing it twice.