-
Notifications
You must be signed in to change notification settings - Fork 85
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
Use XML to save/load options. #562
Comments
The fact that there is a lot of repeated code around is not helping the cause. Encapsulation can reduce a lot of such redundancies. |
Yes, I would love this, and it's something users have asked for many times over the years.
If we adopt something similar to what Real Time does, it has a central method that deals with config version compatibility so it's really clear what changes from version to version. I guess the big chore will be making it backwards compatible (ie. load old versions of TM:PE settings that would be completely different format, and there are several old versions of settings). @kvakvs recently split the mod options in to separate files for the various tabs as part of multiple massive code clean-ups, so he probably knows most about the current system if you need infos on that. |
@aubergine10
is there any issue regarding this. I didn't manage to find any. I'd like to @kvakvs code. EDIT: Wait are you taking about the code that is already in master/origin ? |
Yes, the code that is already in I was meaning that if you have any questions on any of the config stuff, kvakvs is probably best person to ask as he had to pick through a lot of that stuff during the code cleanup. |
@aubergine10 lets move the discussion #1267 to here:
that sounds unreasonable. Is this a bug?
Providing support for alternate translation is no big deal. I can give the option for user to enter the translated label or provide translation delegate. but first we need to see if we really need it.
@krzychu124 @kvakvs @DaEgi01 Do you think we should put all option translations under options.csv or do you think some options should be under speed limit csv? |
@aubergine10 some stuff about the
As for global VS in-game: some options are global only. In future if we change in game options from main menu it should be used as basis for new game. |
The speed limits option was used in both Options tab, and in Speed limits UI. This might be not true anymore. But the hassle of moving string with all translations... doing that via CSV editor instead of Crowdin... If its still used in both places the only solution that would fix your concern, would be duplicating string in both files. If its now only used in options, then you can safely move it, no problem. |
is it really that hard? I mean if there is a valid reason for this then that is OK but if this is just a bug then I think its better to solve it rather than to find work around. |
IMO, all translations relating to options should be in I'm currently working on porting all the options to the new UI format (eg. For persistency, there's 3 tangible situations:
(A fourth would be Savegame-only but I can't see any situation where that would be required) Tagging: #1268 , #1262 , #1240 , #813 , #689 , #659 , #363 , #281 , #190 , #69 , #62 |
So, I've been chipping away at a mock of how things might look if we approched settings the same way as Real Time mod, and I don't think that's going to work for us:
My suggestion would be an attribute that specifies persistence type (no attribute = no persistance), for example: [OptionPersistance(Persist.GlobalAndSavegame)]
public bool someSetting { get; set; } If UI updates that option via in-game pause menu, the change only gets stored in save game on next save / autosave. If they change it via main menu, it would immediately persist to global config. If the setting were Persistance would generally be triggered by UI which handles the change. The UI should be separate, eg. each tab in mod options has it's own file using the new UI stuff such as Does that match more or less what you were thinking? |
I don't think our code should look like real-time mod. just that we should have the functionality to set options for new game. |
Yup, like I said in previous comment, I don't think the Real Time approach will work for us. |
I think it would be more organised to save/load data not by index but rather by dictionary keys (eg use XML). We should also have a class for backward compatibility to load from old saves.
Also It would be nice if we add a button to 'use current values for new games' like the real time mode (#363):
The text was updated successfully, but these errors were encountered: