Where to define default color value

Everything about development and the OpenMW source code.
User avatar
jirka642
Posts: 117
Joined: 23 Aug 2014, 11:39
Location: Czech Republic
Contact:

Where to define default color value

Post by jirka642 »

I was looking around if I could expand my previous pull request and while I managed to figure out how to tint tooltips when pointing on owned object, I needed to hardcode new background colour because I have no clue where are "fontcolour" colours defined.

From what I figured out the colours are read from user's openmw.cfg, but from what I understand that openmw.cfg is created from Morrowind.ini, so the the new colour would also need to exist in Morrowind.ini?

Can anybody tell where could I define default value for this new colour?

TL;DR
I have this: (in openmw_windows.skin.xml)

Code: Select all

<Property key="Colour" value="0.2 0 0 1"/>
I would like to change it to something like this:

Code: Select all

<Property key="Colour" value="#{fontcolour=background_owned}"/>
Where do I define default value for "background_owned" colour?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Where to define default color value

Post by scrawl »

openmw.cfg is created from Morrowind.ini
The fallback= lines are imported from Morrowind.ini. The rest of openmw.cfg is basic install configuration set by the Launcher.

I don't think openmw.cfg is the right place for what you're trying to do. The fallback lines are strictly for legacy settings (we will move some of these to the ESM files eventually). For new settings we already have the settings.cfg file.

Perhaps we could add a new MyGUI syntax for retrieving from settings.cfg, like this:

#{setting=SETTING_NAME}

would be replaced by the value of SETTING_NAME in the user's settings.cfg. You would need to add the setting retrieval code to the WindowManager::onRetrieveTag function.
User avatar
jirka642
Posts: 117
Joined: 23 Aug 2014, 11:39
Location: Czech Republic
Contact:

Re: Where to define default color value

Post by jirka642 »

Thanks, that makes sense.
Do I understand it right that I will need to create new "[MyGUI]" section in settings-default.cfg?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Where to define default color value

Post by scrawl »

Hm, either that, or include the category in syntax:

Code: Select all

#{setting=CATEGORY_NAME,SETTING_NAME}
Both approaches are fine with me.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Where to define default color value

Post by Zini »

Should these really go into settings? I would expect UI modifications to be part of the content file data.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Where to define default color value

Post by scrawl »

Fair point, although it's difficult to draw the line on what a "UI modification" is. The original game does include "UI modifications" such as a scrollbar for menu transparency, and a toggle option for the crosshair and subtitles. These are really user preferences, not content preferences.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Where to define default color value

Post by Zini »

The difference between what you listed here and the colour in question is that the former are primarily functional UI aspects while the later is purely aesthetic. I think the line here is relatively clear.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Where to define default color value

Post by scrawl »

the former are primarily functional UI aspects while the later is purely aesthetic.
The setting for menu transparency is kinda aesthetic as well, isn't it?

Well, this discussion is pointless IMO. Content files don't have the capability yet to modify UI (and won't for a long time). We haven't yet designed a system for post-1.0 UI modifications. Until we know what that process is going to look like, we shouldn't make any assumptions.

The settings file is the only option for now. We can still move the setting elsewhere later.
User avatar
jirka642
Posts: 117
Joined: 23 Aug 2014, 11:39
Location: Czech Republic
Contact:

Re: Where to define default color value

Post by jirka642 »

User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Where to define default color value

Post by Zini »

The setting for menu transparency is kinda aesthetic as well, isn't it?
I would argue, no. At least not primarily. Transparency allows the user to choose a compromise between getting enough contrast to read the test in the windows properly and not having the windows completely obscuring his view of the scene. But we are starting to get into hair splitting territory here.
Well, this discussion is pointless IMO. Content files don't have the capability yet to modify UI.
In this case the default decision should be to just not implement the configuration option yet and wait until we can properly support it.
But since we already have an implementation, I am not opposed to merging it.
Post Reply