I would like to tackle that subject:
- serialize popup window's size & location at game quit
- restore them at game start / load time
Where should I start ?
Serialize popup window size and location
Moderator: Committer
Serialize popup window size and location
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Serialize popup window size and location
Set up a bunch of options in the OptionsDB, in the source file where the relevant windows are created. When re-creating them at startup, select their positions by querying the OptionsDB. Also set up some signalling so that when the windows are moved (or perhaps when pinned?), their positions are written to the OptionsDB.
Re: Serialize popup window size and location
Serializing would fit as part of saving the info in the saved game file, so that individual games could have different persistent locations for those windows.
As Geoff just suggested, I think we'd be better off instead saving the info to the options file. That wouldn't mean that it would have to have a control widget in the options window, it's simply a place to store the info so that it is consistent across games. Perhaps take a look at the main window resolution handling (skipping the control widget).
As Geoff just suggested, I think we'd be better off instead saving the info to the options file. That wouldn't mean that it would have to have a control widget in the options window, it's simply a place to store the info so that it is consistent across games. Perhaps take a look at the main window resolution handling (skipping the control widget).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Serialize popup window size and location
Also, for window positions, there needs to be some checks in place so windows don't get put off the screen where the user can't access them due to changes in main window size. At the least, a "reset to default window positions" button needs to be avaiable somewhere always-accessible.