Display Date of Files in save/load GUI

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Wurzel
Engineer
Engineer
Posts: 2
Joined: 18 May 2012 19:08

Display Date of Files in save/load GUI

Post by Wurzel »

Hi everyone,

I want to get started contributing to openttd. I thought I pick the "Display Date of Files in save/load GUI" from http://wiki.openttd.org/Todo_list. I am not sure whether this should display the date of the file in the filesystem or get it from the savegame. The second makes more sense in my eyes, because otherwise moving a file (e.g. from a backup) would change the date. However, I did not find the date stored in the savegame file. Did I just miss it? What should be done? Display the date from the filesystem? Add it to the savegames?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Display Date of Files in save/load GUI

Post by Alberth »

Both make sense I think. the program puts the game-date in the filename already, so that seems less useful (the game date does get saved in the game, ever noticed the status bar at the bottom after a load, it also knows the date :) ). Reading it from a savegame is a bit more complicated than just same values at some offset. You should be able to find out how it is done by following how it gets the list of newgrfs and the list of AI players from the game.

Problems like "the file date may be wrong" is not a big problem, a user that cares for his time stamps will copy the files such that the time stamp is not messed up (eg 'cp -p' in Unix). In addition, not many people actually play games from a backup I think.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Display Date of Files in save/load GUI

Post by frosch »

Ok, apparently we need to extend the TODO list with some more details. This task was actually only about this:

The saveload GUI currently has buttons to sort the files by name or by date, ascending or descending. However, while you can see the name in the list, you cannot see the date you are sorting for. So this is actually not about adding more information to the right panel, but about adding it to the filelist.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Wurzel
Engineer
Engineer
Posts: 2
Joined: 18 May 2012 19:08

Re: Display Date of Files in save/load GUI

Post by Wurzel »

Ok, I understood that wrong. I will change it and provide a new patch. However I like the display in the right panel.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 4 guests