Save window locations?

Describe your experience with the latest version of FreeOrion to help us improve it.
Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
ghealy
Space Kraken
Posts: 127
Joined: Sat Jun 06, 2015 2:06 pm

Save window locations?

#1 Post by ghealy » Wed Jul 20, 2016 12:57 am

I have a certain way I like to setup/place the various windows in the game, i.e. the Message window, the SitRep window, and the Fleet window. After I place and resize these three windows at the start of a game in the latest version, they remember their place or each subsequent game I play using that version.

My issue is that each time I update FreeOrion to the latest release which can be as often as weekly, these windows return to their default location.

Is there an easy way to save the window location and reinstate it with each new release? Is there a single file somewhere that contains the info required that I could backup and simply copy back after I've done an upgrade?

This is no game breaking issue, but does get a bit annoying.

Appreciate any help.

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Save window locations?

#2 Post by dbenage-cx » Wed Jul 20, 2016 2:30 am

You can create a persistent config file, copying over your window settings.

ghealy
Space Kraken
Posts: 127
Joined: Sat Jun 06, 2015 2:06 pm

Re: Save window locations?

#3 Post by ghealy » Wed Jul 20, 2016 3:10 am

That sounds like what I want. Where would I find the windows setting to copy over from?

Appreciate the help. Thanks

- Gene

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Save window locations?

#4 Post by dbenage-cx » Wed Jul 20, 2016 12:43 pm

e.g. Research control window:

Code: Select all

<?xml version="1.0"?>
<XMLDoc>
  <UI>
    <windows>
      <research>
        <tech-controls>
          <height>1</height>
          <height-windowed>736</height-windowed>
          <left>-2147483648</left>
          <left-windowed>1324</left-windowed>
          <minimized>0</minimized>
          <pinned>0</pinned>
          <top>-2147483648</top>
          <top-windowed>31</top-windowed>
          <visible>0</visible>
          <width>1</width>
          <width-windowed>62</width-windowed>
        </tech-controls>
      </research>
    </windows>
  </UI>
</XMLDoc>
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.

User avatar
Ouaz
Dyson Forest
Posts: 215
Joined: Wed Aug 13, 2014 7:21 pm
Location: France

Re: Save window locations?

#5 Post by Ouaz » Thu Jul 21, 2016 4:35 pm

ghealy wrote:That sounds like what I want. Where would I find the windows setting to copy over from?

- Gene
If you mean the file which contains the windows settings, it's in the config.xml file, located in C:\Users\User_Name\AppData\Roaming\FreeOrion (Windows 7)

Then open the file with Notepad++ or Notepad 2, search for <UI>, and select/copy everything that is between <UI> and </UI> tags.
Paste the whole selection in the persistent config file, like in dbenage-cx's example above.

Note: it will copy all your UI preferences (windows settings, but also font sizes, colors, etc.). If you want to only select your windows settings, copy everything that is between <windows> and </windows>.
I release every updated file under the CC-BY-SA 3.0 license.

User avatar
Vezzra
Release Manager, Design
Posts: 4606
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Save window locations?

#6 Post by Vezzra » Thu Jul 21, 2016 4:49 pm

Ouaz wrote:If you want to only select your windows settings, copy everything that is between <windows> and </windows>.
Well, he'll need all the enclosing tags too, so it's probably easier to copy the entire <UI>...</UI> section and then delete everything besides the <windows>...</windows> subsection. Getting that right will require some basic understanding of XML... ;)

ghealy
Space Kraken
Posts: 127
Joined: Sat Jun 06, 2015 2:06 pm

Re: Save window locations?

#7 Post by ghealy » Thu Jul 21, 2016 5:12 pm

First: Thanks to dbenage-cx, Ouaz and Vezzra for their help.

For an old Noob, they actually made sense :D

I do like Vezzra's suggestion of copying the entire <UI> ...</UI> section as I often change font sizes and the research window's menu bar location. So this should help not having to change them each time their is an update.

I am curious. How likely will there be changes to the UI that might make an install crash if I have this persistent config file? Guessing if it ever does become an issue, I could trouble shoot by renaming it to something else and try re-installing just to rule it out as the cause.

Again, Thank you guys, for your help.

I'm off to lose a couple more hours of my life as I get engrossed in this game. :D :D :D

- Gene

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Save window locations?

#8 Post by dbenage-cx » Thu Jul 21, 2016 5:43 pm

ghealy wrote:I am curious. How likely will there be changes to the UI that might make an install crash if I have this persistent config file? Guessing if it ever does become an issue, I could trouble shoot by renaming it to something else and try re-installing just to rule it out as the cause.
If you stick with only the window entries, you will probably be ok (never keep version-string).

For troubleshooting: renaming/deleting the persistent_config and config files should be plenty. On launch the game will create a new config.xml file if needed (no need to re-install).

ghealy
Space Kraken
Posts: 127
Joined: Sat Jun 06, 2015 2:06 pm

Re: Save window locations?

#9 Post by ghealy » Thu Jul 21, 2016 5:51 pm

Thanks, dbenage-cx. Will give it a try later today.

- Gene

User avatar
Bromstarzan
Dyson Forest
Posts: 203
Joined: Sun Feb 28, 2016 9:56 pm
Location: Sweden

Re: Save window locations?

#10 Post by Bromstarzan » Thu Oct 27, 2016 4:01 pm

I have tried the persistent_config.xml method without success.
Game reverts back to original small window and throws all the sub-windows around, even though I deleted the config and have a persistent config file with my preferred values.
Not sure what I'm doing wrong. Will investigate and try some more. And yes, I'm quite used to writing xml.

[EDIT]: It is the Borderless gaming application (SRWE) that destroys the persistent_config.xml? If I leave the SRWE out of the equation, the persistent_config.xml works. I guess I'll have to skip the fullscreen play and go back to windowed, which is a pitty. I really like the fullscreen across multiple monitors. I'll experiment a little bit more and see if I come up with a solution.
| i7 2600K quad@3.40Ghz | GTX 560 Ti | RAM: 16GB | PSU: 750w | W7 x64 | LG1680x1050+Acer 1280x1024 |

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Save window locations?

#11 Post by dbenage-cx » Thu Oct 27, 2016 10:05 pm

and throws all the sub-windows around
Back to their default positions (e.g. with no config or persistent config files), or in different places?

Is this the SRWE you mention?

I suspect the game believes your settings are invalid, since they wont fit in the designated monitor.

I haven't looked at SRWE much, if it defines a fake monitor ID you might be able to set that as the fullscreen monitor.
If it is not set, try the "fake resolution change" option as well.
Barring either of those, you probably need a toggle to skip the relevant config validation checks and maybe other constraints.

User avatar
Bromstarzan
Dyson Forest
Posts: 203
Joined: Sun Feb 28, 2016 9:56 pm
Location: Sweden

Re: Save window locations?

#12 Post by Bromstarzan » Fri Oct 28, 2016 7:45 pm

dbenage-cx wrote:
and throws all the sub-windows around
Back to their default positions (e.g. with no config or persistent config files), or in different places?
Back to default, yes, sorry for being non-specific.
Is this the SRWE you mention?
Yes, that's the one.
I suspect the game believes your settings are invalid, since they wont fit in the designated monitor.
Yep, that is most likely the case.
I haven't looked at SRWE much, if it defines a fake monitor ID you might be able to set that as the fullscreen monitor. If it is not set, try the "fake resolution change" option as well.
Barring either of those, you probably need a toggle to skip the relevant config validation checks and maybe other constraints.
Some good ideas here, thanks. I'll try.

[EDIT]: And now my config got messed up again? I can not understand why it is not persistent, even in windowed mode? :lol: Should I delete the config.xml once I have a persistent_config.xml (in same location). As I understand it, both should be there as persistent_config.xml only overrides the config whith the lines stated in the persistent file.
I'll probably go back to borderless gaming (SRWE) and just take the time to adjust all the windows everytime I do a session. After all, it only takes 3-4 minutes.
| i7 2600K quad@3.40Ghz | GTX 560 Ti | RAM: 16GB | PSU: 750w | W7 x64 | LG1680x1050+Acer 1280x1024 |

User avatar
Bromstarzan
Dyson Forest
Posts: 203
Joined: Sun Feb 28, 2016 9:56 pm
Location: Sweden

Re: Save window locations?

#13 Post by Bromstarzan » Sun Apr 09, 2017 8:21 am

Just to let you know; I've got it all working now:
  • - Persistent windows, and
    - SRWE (borderless gaming)
Free Orion shines in all its glory. Thanks for an awesome game and community!
Really exiting to follow all the ideas and updates!

cheers,
Broms
| i7 2600K quad@3.40Ghz | GTX 560 Ti | RAM: 16GB | PSU: 750w | W7 x64 | LG1680x1050+Acer 1280x1024 |

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Save window locations?

#14 Post by dbenage-cx » Sun Apr 09, 2017 7:25 pm

Great to hear Bromstarzan. If you find the time (and remember them), some future reader might be interested in the setup details.
As I understand it, both should be there as persistent_config.xml only overrides the config whith the lines stated in the persistent file.
Yes, but if the config.xml is not there or for a different build it will be (re)created.

User avatar
Bromstarzan
Dyson Forest
Posts: 203
Joined: Sun Feb 28, 2016 9:56 pm
Location: Sweden

Re: Save window locations?

#15 Post by Bromstarzan » Fri Apr 14, 2017 9:33 am

dbenage-cx wrote:Great to hear Bromstarzan. If you find the time (and remember them), some future reader might be interested in the setup details.
Of course!
Remember that the below details are specific for my personal hardware config and layout taste. :D

My 2 displays are 1680x1050 + 1280x1024, so it is not optimal but it turns out to work well.
1. I use Windowed mode in FO and drag FO main window across both displays to cover the entire desktop.
2. Start SRWE and choose application and window size + hit the "Remove borders" button.
Image
3. Arrange all windows in FO!
4. Alt-Tab out and copy config.xml to persistent_config.xml (I think I played a couple of turns before this although I don't think that is necessary)
Image
(C:\Users\xxxx\AppData\Roaming\FreeOrion)
5. Done!

So, everytime I start FO, I only start SRWE and load recent profile and hit "Remove borders". Done!
Image
| i7 2600K quad@3.40Ghz | GTX 560 Ti | RAM: 16GB | PSU: 750w | W7 x64 | LG1680x1050+Acer 1280x1024 |

Post Reply