How our settings system work?

Involved development of the OpenMW construction set.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

How our settings system work?

Post by sirherrbatka »

…or at least where are the files with configuration located.

This is silly question. I spend around hour trying to figuer out how things works (it surely been a moment) but came to conclusion that I have no idea where are the files that are supposed to be parsed by the user settings object located. Small input would be very usefull.
User avatar
DanielCoffey
Posts: 43
Joined: 20 Jun 2015, 11:14
Location: Edinburgh, UK

Re: How our settings system work?

Post by DanielCoffey »

Are you referring to (on Windows at least) Documents \ My Games \ OpenMW \ openmw.cfg (and settings.cfg in the same folder)?
User avatar
jirka642
Posts: 117
Joined: 23 Aug 2014, 11:39
Location: Czech Republic
Contact:

Re: How our settings system work?

Post by jirka642 »

Aren't all settings files located in standard paths https://wiki.openmw.org/index.php?title=Paths ?
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: How our settings system work?

Post by cc9cii »

Have a look at

components/config
components/settings
components/files/configurationmanager.cpp
apps/launcher/maindialog.cpp
apps/opencs/editor.cpp
etc
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How our settings system work?

Post by sirherrbatka »

Thanks.

PS
I guess i was tired. Everything i need at the moment is in the usersettings file.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How our settings system work?

Post by sirherrbatka »

One additional question. From what I seen, currently opencs lack settings that is suitable for adding complex types to the settings file. That's the case with filter page, however. We need to be able create new filter entry and for each entry specify applicable table plus list of columns that are supposed to be handled. Initially i thought that i should do this with the current framework, and simply extend it if that's required, however; i need to be sure before procedding any further. Could you please answer me, zini?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How our settings system work?

Post by Zini »

The whole setting system needs a bit of a renovation (it had lots of problems initially and all the fixes I added later are of a makeshift nature). But I don't think that it should affect your task noticeably. You should get away with writing your own Page class (view) and then insert an instance of it in CSVSettings::Dialog::buildPages. It should be possible to extend/re-use at least parts of the existing model (updating and settings storage maybe) and then add whatever is needed.
Sorry, that's all I got for now.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How our settings system work?

Post by sirherrbatka »

That's enough. I think I know what needs to be done, but will be able to do something next week and nothing this week. Also, TOME is seriously addictive game. Stay away of it.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How our settings system work?

Post by sirherrbatka »

Sorry that it takes so much time. Somehow i couldn't really motivate myself to work on this.

Anyway:

Graffy, could you please provide some hints on how you suggest to create nested settings models with the current code? I decided that the best way to handle this is to have 3 level tree (root, category, boolean values for each column). However CSMSetting appears to be flat by design. Am I mistaken? If not should i proceed and rebuild settings to reflect my needs (i don't think i can do this, i don't fully understand design goals of current framework) or perhaps i should simply attach some label to each value and filter with it (ugly, but at least should work).

PS
I probabbly should reread this topic before asking new question.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How our settings system work?

Post by Zini »

Not sure if Graffy is still around.

Its no wonder that you have problems with understanding the design goals, because the current implementation missed the design goals. Partially my fault, I guess. Apparently I failed to communicate the idea to graffy correctly and when accepting the code, I didn't look deep enough to identify the scope of the problem.

Most of the view part is already slated for rewrite. If you wish to re-do the whole thing (view and model), I am okay with that. But it would be a lot of work.

I don't have the time to elaborate on the intended design for the settings system right now. But if you are interested I can do a write-up later this week.
Post Reply