-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add looping minimap viewport if worldwrap enabled #5349
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
Conversation
The viewport now also appears on the other side of the minimap when viewing the border of the world with worldwrap enabled.
I don't know how the code for drawing the minimap works, but I assume that somewhere the width of the minimap viewport is calculated, which can then be compared with the width of the entire minimap. If it's larger, you know the edges are going to overlap, and then can stop drawing the minimap viewport entirely? |
Hey, first of all: 👍 good idea (had it a while ago, too, but was too lazy to find out how), and 👍 for actually pulling it off, no matter if there's room for improvement. |
Nice! |
What I meant is I don't know how to only draw the top & bottom of the viewport (leaving out the sides). The rectangle is currently just an image which is scaled to the proper size. Personally I would want to impelement it as an actual rectangle built from lines (instead of a PNG), making it easier to leave out some lines. I would have to look into how drawing works using Kotlin though. I don't think we should stop drawing the viewport whenever it overlaps. This will probably just create confusion since people will think the minimap glitches when the viewport overlay suddenly disappears. |
It's not kotlin you have to watch out for, it's OpenGL. See ImageGetter.getLine or its use in Diplomacy Overview or Tech tree? |
This is already an improvement on the current state, I'm merging this and if you change to a "draw lines" approach that can be a separate PR :) |
The viewport now also appears on the other side of the minimap when viewing the border of the world with worldwrap enabled.