Better.
First a few technical corrections:
- please don't use defines (other than for include guards and conditional compilation)
- mMergeMap should be initialised in the cpp file
- don't manually write every single key into it (there will be too many of them); read it from a const array instead (see StatsWindow in mwgui for an example)
About master/plugin: Importing these should be made optional (command line option, off by default). There can be more than one key of each type. And when you import them, you need to import all of then, e.g. when this function is enabled, if there are any master or plugin keys in the ini, remove all old master and plugin keys from the cfg and use the master/plugin settings from the ini instead. Master and plugin must always be handled together.
Write an Morrowind.ini to openmw.cfg converter
Re: Write an Morrowind.ini to openmw.cfg converter
That doesn't look right. What are EMS files? And we don't use archive settings currently. And master and plugins are handled separately. And somehow you connected bsa files (which should not be handled at all) with plugins.
Edit: And multimaps won't work. For master and plugins the order is important. You have now guarantees about the order of objects with the same key when using a multimap.
Edit: And multimaps won't work. For master and plugins the order is important. You have now guarantees about the order of objects with the same key when using a multimap.
Re: Write an Morrowind.ini to openmw.cfg converter
maybe you should tell me what you mean with master/plugin because it seems like I dont know it
Re: Write an Morrowind.ini to openmw.cfg converter
A master file is an ESM (e.g. Morrowind.esm). A plugin file is an ESP.
Re: Write an Morrowind.ini to openmw.cfg converter
if I understand it correct, then it should work now https://github.com/swick/openmw/commit/ ... 6c9eeaad12
Re: Write an Morrowind.ini to openmw.cfg converter
Very close now. I see two more problems:
1. You are always deleting master and plugin keys from the original cfg. You should only do that when you import master/plugin keys from the ini file.
2. You are storing the cfg file in a std::map<std::string, std::string>. That can't work, because keys can appear more than once. Maybe use a std::map<std::string, std::vector<std::string> > instead (remember: order matters)?
1. You are always deleting master and plugin keys from the original cfg. You should only do that when you import master/plugin keys from the ini file.
2. You are storing the cfg file in a std::map<std::string, std::string>. That can't work, because keys can appear more than once. Maybe use a std::map<std::string, std::vector<std::string> > instead (remember: order matters)?
Re: Write an Morrowind.ini to openmw.cfg converter
should be fixed now.
Re: Write an Morrowind.ini to openmw.cfg converter
It seems there is still the issue of master and plugin settings handled separately. You can't replace one without the other meaningfully.
Since you are replacing them anyway in importGameFiles, I guess you could just drop the if (!esxFiles.empty()) lines.
The rest looks good though. Will test later or tomorrow.
btw. I added a follow up tasktask to the tracker. Interrested? (don't start yet, if the answer is yes; I need to provide a bit more input first).
Since you are replacing them anyway in importGameFiles, I guess you could just drop the if (!esxFiles.empty()) lines.
The rest looks good though. Will test later or tomorrow.
btw. I added a follow up tasktask to the tracker. Interrested? (don't start yet, if the answer is yes; I need to provide a bit more input first).
Re: Write an Morrowind.ini to openmw.cfg converter
done (there was also a bug so that only the first 10 game files were noticed).
Yes to the follow up task
Yes to the follow up task