-
May 25th, 2020, 12:58 #1
[SOLVED] How to change calendar days/months font color?
Please see post: #14 for the solution .
FGU latest public release
5E Ruleset
Gregorian Calendar
Hey there,
while working on a theme, I stumbled across a problem that I wasn't able to solve for 2 weeks now and searching the forum didn't provide any results related to this:
I absolutely can't figure out how to change the font color (to white or something else) for the days and months in the calendar.
Font_Issue.png
Calendar_Colors.png
I figured that the xml entries below should do the trick, but this didn't work. I found that at least some colors can be influenced by using the utility_calendar.xml,
but I'd like to avoid having too many xml files included in the theme.
Does anyone have a clue what I'm missing?
The fonts are correctly placed within the fonts folder and all paths are correct.
Here the fonts.xml entries I thought should work, but don't:
<!-- Calendar -->
<font name="calendarday">
<fgffile name="graphics/fonts/regular-10.fgf" />
<ttf file="graphics/fonts/Roboto-Regular.ttf" name="Roboto" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarday-b">
<fgffile name="graphics/fonts/regular-10.fgf" />
<ttf file="graphics/fonts/Roboto-Regular.ttf" name="Roboto" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarday-bi">
<fgffile name="graphics/fonts/regular-10.fgf" />
<ttf file="graphics/fonts/Roboto-Regular.ttf" name="Roboto" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarbold">
<fgffile name="graphics/fonts/bold-10.fgf" />
<ttf file="graphics/fonts/Roboto-Bold.ttf" name="Roboto-Bold" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarselecttitle">
<fgffile name="graphics/fonts/bold-10.fgf" />
<ttf file="graphics/fonts/Roboto-Bold.ttf" name="Roboto-Bold" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarselectbody">
<fgffile name="graphics/fonts/regular-10.fgf" />
<ttf file="graphics/fonts/Roboto-Regular.ttf" name="Roboto" size="16" />
<color value="#DDDDDD" />
</font>
<font name="calendarmessage">
<fgffile name="graphics/fonts/italic-10.fgf" />
<ttf file="graphics/fonts/Roboto-Italic.ttf" name="Roboto-Italic" size="16" />
<color value="#DDDDDD" />
</font>
Thanks in advance!
SirMotteLast edited by SirMotte; May 30th, 2020 at 20:39.
I support ORC(L) and #opendnd!
Check out my Extensions and Materials for FGU!
Dark Theme: Sir Motte's Magnificent Darkness - Hearth Edition.
Custom GM Icon: Sir Motte's GM Icon Replacer.
Midjourney Art: AI generated images for my campaign.
-
May 25th, 2020, 14:41 #2
check corerpg
\utility\utility_calendar.xml
Code:<stringcontrol name="viewdate"> <anchored to="dateframe" height="20"> <right anchor="center" offset="-80" /> <top offset="25" /> </anchored> <color>5A1E33</color> <font>calendarbold</font> <nodrag /> <nodragselect /> <readonly /> </stringcontrol> <label_fieldtop> <anchored to="viewdate" /> <static textres="calendar_label_date" /> </label_fieldtop> <basicnumber name="currentyear" source="current.year"> <anchored to="dateframe" width="40" height="20"> <left anchor="center" offset="-70" /> <top offset="25" /> </anchored> <color>5A1E33</color> <hideonvalue>0</hideonvalue> <delaykeyupdate /> <script> function onValueChanged() window.onYearChanged(); end </script> </basicnumber>
-
May 25th, 2020, 14:52 #3
Hey damned thank you for the reply!
The core utility_calendar.xml is what I currently use to define the colors at the calendar top (see image above). Unfortunately the entries there do not seem to affect the day number columns in any way.
Also shouldn't the graphics_fonts.xml affect those aswell, as they change the parameters of eg. "calendarbold"?
Thanks
SirMotte
Edit: Okay, I just deleted the color entries in the utility_calendar.xml to see if the #DDDDDD color definition in my graphics_fonts.xml would work at all. And it does. That means I am missing the proper "font name =" definition for the calendar days font?
Font_Issue_no_utility_calendar_definition.pngLast edited by SirMotte; May 25th, 2020 at 15:01.
I support ORC(L) and #opendnd!
Check out my Extensions and Materials for FGU!
Dark Theme: Sir Motte's Magnificent Darkness - Hearth Edition.
Custom GM Icon: Sir Motte's GM Icon Replacer.
Midjourney Art: AI generated images for my campaign.
-
May 25th, 2020, 15:10 #4
No.
The fonts are defined first.
The templates are defined next.
The file above is running last and it has a color code in it.
You will need to merge your changes into the calendar file Im pretty sure.
-
May 25th, 2020, 16:24 #5
You are right in regard to loadorder. Please see attached picture on what I found out about what affects the colors in the calendar.
Calendar_Colors.png
As you can see I can influence some entries with the graphics_fonts.xml if I delete the corresponding color definition inside the utility_calendar.xml. Ultimately I prefer to use the fonts.xml, as I don't like to have things scattered around when changing colors. Other areas are defined directly inside the .lua files.
Yet I still wasn't able to find out how to change the day colums to another color as there doesn't seem to be an entry anywhere, at least I wasn't able to find it.
Thank you for your patience!
Cheers
SirMotteLast edited by SirMotte; May 27th, 2020 at 14:28.
I support ORC(L) and #opendnd!
Check out my Extensions and Materials for FGU!
Dark Theme: Sir Motte's Magnificent Darkness - Hearth Edition.
Custom GM Icon: Sir Motte's GM Icon Replacer.
Midjourney Art: AI generated images for my campaign.
-
May 27th, 2020, 14:16 #6
So... it would be nice if everything used a set entry in graphics_fonts.xml and nothing else.
For whatever reason some definitions are re-used but the color code is modified in the xml at the point where the font is used.
In those cases you will need to use merge="join" code to overwrite those settings.
-
May 27th, 2020, 14:34 #7
Fonts all take up resources in the FG client. The more font definitions you have, the more resources you're using. This may not have a massive effect overall, but it is still better to define a resource like this once and then, if you don't want to use the default colour from the <font> resource definition, change the colour when it's used within a control.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
May 27th, 2020, 14:44 #8
Thanks for both your answers. Now this isn't really about where to define what, I simply cant figure out where to define the calendar day columns font at all. Please see the picture below.
issue.png
Please keep in mind, that I can't even be considered a novice in terms of any kind of programming language, so this might be a little over my head already?Last edited by SirMotte; May 27th, 2020 at 14:49.
I support ORC(L) and #opendnd!
Check out my Extensions and Materials for FGU!
Dark Theme: Sir Motte's Magnificent Darkness - Hearth Edition.
Custom GM Icon: Sir Motte's GM Icon Replacer.
Midjourney Art: AI generated images for my campaign.
-
May 27th, 2020, 15:52 #9
I think the script you are looking for is in utility\scripts\calendar_day.lua in the setState() function.
Code:function setState(bCurrDay, bSelDay, bHoliday, nodeEvent) if bCurrDay then setBackColor("000000"); label_day.setColor("FFFFFF"); else setBackColor(); if bHoliday then label_day.setColor("333399"); else label_day.setColor("000000"); end end if bSelDay then setFrame("calendarhighlight"); else setFrame(nil); end if bHoliday then label_day.setFont("calendarday-bi"); label_day.setUnderline(true); else label_day.setFont("calendarday"); label_day.setUnderline(false); end
For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
May 27th, 2020, 15:57 #10
Last edited by SirMotte; May 29th, 2020 at 23:18.
I support ORC(L) and #opendnd!
Check out my Extensions and Materials for FGU!
Dark Theme: Sir Motte's Magnificent Darkness - Hearth Edition.
Custom GM Icon: Sir Motte's GM Icon Replacer.
Midjourney Art: AI generated images for my campaign.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks