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

Replay controls widget (gui_replay_controls.lua) misbehaves on ultrawide monitors #5394

Open
ThingsWillCalmUp opened this issue Dec 12, 2024 · 3 comments

Comments

@ThingsWillCalmUp
Copy link

RE: This discussion on discord: https://discord.com/channels/278805140708786177/432874986064052235/1316560761623023638

TL;DR:
The replay controls set the window Y offset based on a value calculated by window width, which causes them to hide beneath the minimap or other elements when ZK is running at ultrawide resolutions.

Someone should probably fix this properly and make the widget able to save its location after being dragged around. For now, I propose the following changes:

gui_replay_controls.lua::L119-120:

	local screenWidth, screenHeight = Spring.GetViewGeometry()
	local windowY = math.floor(screenHeight/8)

This will probably place the widget over the user's playerlist, but it should be draggable from there. Worst case as a dirty hack is to change the window's "right" value to something higher as well, slap it in the middle of the display, and rely on the user to relocate it every time, because it'd at least be somewhere grabbable at that point.

@GoogleFrog
Copy link
Contributor

Sounds like something to fix. Saving the location is a bit worrying since it might end up saved somewhere inaccessible. We'd probably want a type of window that doesn't save if it is too far behind another window.

@ThingsWillCalmUp
Copy link
Author

Well, I think it'd be easy-ish (?) to slap some logic in there when restoring saved locations that compares the widget's current location to the screen geometry (which it already has access to) and clamping it to the inside of the window as a bare min. The widgets for overdrive, wind, and eco efficiency are able to save and restore locations, though I admit I haven't tested how they behave if they're reloaded outside the window...

@ThingsWillCalmUp
Copy link
Author

Okay, I put in a PR to do this. I THINK I did it right? Please let me know if I need to fix/change anything.

#5400

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

No branches or pull requests

2 participants