Skip to content

Create Source Generator for all options in UI - #457

Merged
initsu merged 10 commits into
Ellendar:5.3from
initsu:ui-source-gen
Oct 21, 2026
Merged

initsu merged 10 commits into
Ellendar:5.3from
initsu:ui-source-gen

Conversation

@initsu

@initsu initsu commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

This generates controls for every flag (and most non-flag checkboxes) in RandomizerConfiguration.

There was a lot of duplicate definitions in the UI, and it relied a lot on reflection. Now we can just write:

            <gen:GpStyle Grid.Column="0" Grid.Row="1" VerticalAlignment="Top" />
            <gen:GpLength Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" />
            <gen:DarkLinkMinDistance Grid.Column="2" Grid.Row="1" VerticalAlignment="Top" />
  1. This should make it a lot easier for someone to redesign the UI in the future. If someone wants to re-organize everything into mobile-friendly views (a more responsive UI).
  2. It is also a step on the way to make us rely less on reflection. I believe since Avalonia 12 and newer versions of ReactiveUI we don't have to use reflection.

Also I can now re-use the controls in my preset diff:
image
(when you ask yourself if you could, but not if you should)

I also made Vanilla the new default preset, which I believe jroweboy intended to do but never did, or it got lost.

Target: 5.3 probably. Maybe 5.2 but would prefer some feedback first.

@initsu
initsu force-pushed the ui-source-gen branch 2 times, most recently from a6a22c3 to 48f1b75 Compare October 11, 2026 17:02
@initsu
initsu marked this pull request as draft October 16, 2026 09:51
@initsu
initsu marked this pull request as ready for review October 17, 2026 17:56
@initsu
initsu merged commit 4978db1 into Ellendar:5.3 Oct 21, 2026
1 check passed
@initsu
initsu deleted the ui-source-gen branch October 21, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants