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
SUMMARY: Interface "Minor uilist code clean-up"
Purpose of change
Clean up uilist related code a bit.
Describe the solution
Removed
class ui_container
and merged its members intouilist
. This class probably was intended to act as a super class of all in-game menus, but unfortunately it seems that never happened.Removed
uilist::redraw
anduilist_callback::redraw
. The former one has already been fully incorporated intouilist::show
, while the latter one was never used anywhere.Removed
uilist::refresh
and incorporated its code intouilist::show
where it was called.Changed all
uilist_callback::select
overrides touilist_callback::refresh
overrides. To be honest, I cannot for the life of me fathom whyuilist_callback::select
was used as a redraw callback, nor whyuilist_callback::select
itself was called in the display code of uilist. Its name suggests that it is a callback that fires when the selection of uilist changes, while its implementation acted like a redraw callback, so this was either a misnomer of the callback function or an extremely poor implementation of the functionality.Changed
uilist_callback::select
to fire when the selection actually changes instead of on each redraw. It is not removed because the callback is still useful in future migration of some UIs toui_adatpor
.Finally, reordered and removed some member fields and functions of uilist to improve memory alignment and reduce bloat.
Testing
Every menu that uses the affected callback classes was tested and working as intended.