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

Imgui: Remember position of movable overlays #13331

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dentomologist
Copy link
Contributor

(The first commit is just #13330. Making this a draft until that gets merged, but this PR is ready for review)

Remember the position of various moveable overlays so users don't have to move them every time they start a new game.

Window data is stored in Config/ImGui.ini.

Affected overlays:

  • All of the performance metric and statistics overlays in the Graphics->Advanced tab
  • Movie statistics
  • Scissor Rectangles
  • NetPlay Chat
  • NetPlay Golf

I've tested everything except NetPlay Chat, but given that it uses the same ImGuiCond_FirstUseEver flag as the others I'd be surprised if it didn't work.

Allow users to move the FPS, VPS, Speed, and Performance Graph overlays.
Remember the position of various moveable overlays so users don't have
to move them every time they start a new game.

Window data is stored in Config/ImGui.ini.

Affected overlays:
- NetPlay Chat
- NetPlay Golf
- Movie statistics
- All of the overlays in the Graphics->Advanced tab
- Scissor Rectangles
@iwubcode
Copy link
Contributor

iwubcode commented Feb 3, 2025

Been considering this for a long time because it's immensely useful for my editor but didn't know if we hadn't enabled it in our main widgets for some reason. Happy to see this. Thanks!

@MayImilae
Copy link
Contributor

MayImilae commented Feb 3, 2025

I have a few quibblers with this. Can the player reset the window positions back to default? What happens if the windows are taken off-screen (due to resizing of the window or something)?

@iwubcode
Copy link
Contributor

iwubcode commented Feb 3, 2025

Can the player reset the window positions back to default?

A quick search seems to indicate they would have to delete the config file. We could add a dedicated method but seems like this problem is no different than our other configs. Maybe it'd be better to wait to have a generic solution for all?

What happens if the windows are taken off-screen (due to resizing of the window or something)?

The windows are currently bound to the render area. So if you resized the app window to be across multiple monitors, you'd have that whole space to move these windows around.

@Dentomologist
Copy link
Contributor Author

As iwubcode mentioned, deleting the .ini file will revert the positions to their defaults. If you wanted to reset just one overlay you could delete only that section, and if you want to place the overlays really precisely you can manually edit their positions.

Having a UI option for resetting the overlays would be nice, but the Advanced tab is rather crowded as it is so I don't know how you'd want to handle that.

As for overlays going off-screen, I've gone into that here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants