dolda2000 / hafen-client

Haven & Hearth client
Other
35 stars 185 forks source link

Scalable UI #11

Closed elsid closed 4 years ago

elsid commented 4 years ago

Implements UI scale factor. Users are able to change in via video settings window. In general it scales all images that are part of the UI on the rendering level ignoring images containing text and scales font size. Scaling is done as close as possible to the source of data. Multiple new wrapper types are introduced for this. The most routine set of changes are hardcoded constants. But interface composition is redone in some places to avoid usage of constants or constructions like y += 15 by using a new type Composer. Temporary widgets are used to divide complex composition into a sequence of independent steps that are optimized out after composition is done. Widgets that are not stored locally scaled through a change of decompiled code. I don't suggest merging these specific changes but they can be an example of how it can be done. Only 3 fetched widgets are scaled so the PR is not complete. However I think it demonstrates the approach and is ready to be reviewed. Also I enjoy myself playing the default client with these changes. On my hardware playing without UI scaling is a constant pain.

dolda2000 commented 4 years ago

Just noticed this pull request only now.

I'll certainly consider this. Some things, like the Composer, are similar to things that I've considered myself, so it doesn't seem to be too far from my own way of doing things, which is a good start. Please keep in mind, however, that it will probably take me quite some time to go through all of this, especially as I already have quite a few other things on my table.

Thanks for working on this!

dolda2000 commented 4 years ago

This request should be merged now, however since, again, I had to rebase it a bit, GitHub doesn't seem to recognize that, so I'm closing it.

Thanks a lot for submitting it!