Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trees GUI improvements #8234

Merged
merged 3 commits into from Dec 27, 2020
Merged

Trees GUI improvements #8234

merged 3 commits into from Dec 27, 2020

Conversation

nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Jun 22, 2020

Mostly a code change, but has the neat side effect of not drawing more buttons than are tree types in the current climate. Also fixes some scaling margin issues on 2x and 4x GUI scale.
Future proofing for maybe making NewGRF trees one day.

Later goal: Better tree painting modes for scenario editor.

image
image

src/tree_gui.cpp Outdated Show resolved Hide resolved
@nielsmh
Copy link
Contributor Author

nielsmh commented Jun 23, 2020

Well, I scrapped the NWID_MATRIX based code again, turns out it's really hard to get that to size well, individual buttons actually is easier. Now just generating the buttons instead of having a fixed layout.

@nielsmh
Copy link
Contributor Author

nielsmh commented Jun 26, 2020

Now it looks like this:
image

Planting a "grove" results in something like this:
image

Planting a "forest" results in something like this:
image

@TrueBrain TrueBrain added candidate: yes This Pull Request is a candidate for being merged size: large This Pull Request is large in size; review will take a while labels Dec 14, 2020
@TrueBrain
Copy link
Member

22:49:18 <TrueBrain> nielsm: I really really really like your Trees GUI improvements
22:49:20 <TrueBrain> it looks so cute!
...
22:51:16 *** nielsm has quit IRC (Ping timeout: 480 seconds)

:D

@TrueBrain
Copy link
Member

Rebased your work and fixed a variable that was unused. Going to test it out now :D

@TrueBrain TrueBrain added the preview This PR is receiving preview builds label Dec 15, 2020
@DorpsGek DorpsGek temporarily deployed to preview-pr-8234 December 15, 2020 15:40 Inactive
Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

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

This is really an upgrade :)

The only thing that is now slightly more apparent, the "Random trees" button. You don't expect it to work like that with all the other buttons around.

Not something that needs fixing in this PR, tbh, as it was already weird. It is just now only highlighted more :D

Awesome work!

Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

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

Awh, testing found a bug .. tooltip say you can drag small and large forest, but you cannot :( I will see if I can discover why not myself too, but if you are interested in solving it, feel welcome :)

@2TallTyler
Copy link
Member

This is very nice. Is there a reason it's restricted to Scenario Editor and we can't have it in-game?

@TrueBrain TrueBrain added the work: minor details This Pull Request has some minor details left to do label Dec 15, 2020
@TrueBrain
Copy link
Member

2020-12-26.15-15-53.mp4

Rate how awesome this is on a scale from 1 to 10 plz :D

@DorpsGek DorpsGek temporarily deployed to preview-pr-8234 December 26, 2020 14:29 Inactive
@TrueBrain
Copy link
Member

I hope @nielsm doesn't mind, but I hijacked his PR and implemented real dragging of trees; it was easier than trying to figure out how to do selections thingy :D

Let me know what you guys think of this, if it is usable etc :)

@TrueBrain
Copy link
Member

TrueBrain commented Dec 26, 2020

@2TallTyler

This is very nice. Is there a reason it's restricted to Scenario Editor and we can't have it in-game?

In this implementation it is only possible to do this in the SE, as it would otherwise fire so many DoCommands in MultiPlayer it will effectively DDoS the server :P That is what you get for pretty things :D

@TrueBrain TrueBrain removed the work: minor details This Pull Request has some minor details left to do label Dec 26, 2020
@LordAro
Copy link
Member

LordAro commented Dec 26, 2020

If I open up the tree window in the scenario editor and click once (place trees in a single spot), the cursor changes from a dot to a square.

@TrueBrain
Copy link
Member

TrueBrain commented Dec 26, 2020

@LordAro

If I open up the tree window in the scenario editor and click once (place trees in a single spot), the cursor changes from a dot to a square.

I cannot reproduce this issue. Do you have a screenshot for me?

Nevermind, found it: build a road first, after that, build trees. Fixed now :)

@DorpsGek DorpsGek temporarily deployed to preview-pr-8234 December 26, 2020 19:17 Inactive
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

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

:o

@TrueBrain TrueBrain merged commit 2d9fa81 into OpenTTD:master Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: yes This Pull Request is a candidate for being merged preview This PR is receiving preview builds size: large This Pull Request is large in size; review will take a while
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants