Please help with including other xml files in theme
-
Hey everyone, I'm having an issue with a theme I'm creating.
The problem is that if I move parts of the theme to another xml file, and then include that xml file in the main theme.xml, only parts of the theme are shown.
For example, lets say I move the whole details view into details.xml... anything from theme.xml works fine like the background image (as it should) and anything that is kinda hard coded in ES shows from details.xml. I can see the gamelist, metadata, and boxart. What I CAN'T see is any image or text that is called from details.xml.
At first I thought it was details not seeing some variables, but the gamelist calls variables for font, size and color so that's not it. Also, details.xml is not nested in another folder, it is with theme.xml so when I call an image, I didn't change anything.
I've attached screenshots of what it looks like when everything is in theme.xml, and another screenshot of what happens when I try separating different elements into multiple xml files.
Any help would be appreciated, thanks in advance!
-
Hi @pjmcphizzle, it would be nice to see how you call the include in the theme.xml... just to validate that you're setting the proper path to your details.xml in it.
If you're doing
<include>details.xml</include>
Try maybe
<include>./details.xml</include>
Also, make sure that you're actually including the tags only once.
An example of both xml's would be nice in any case.
-
hey @kiro , thanks for the reply. I guess I should have included some code in my original post.
Here is the start of my theme.xml file:
<theme> <formatVersion>4</formatVersion> <include>./views.xml</include> <include>./helpsystem.xml</include> <variables> <fontMain>./assets/fonts/Roboto-Regular.ttf</fontMain> <fontSizeLarge>0.045</fontSizeLarge> <fontSizeRegular>0.035</fontSizeRegular> <fontSizeSmall>0.032</fontSizeSmall> <fontSizeSystemName>0.04</fontSizeSystemName> <scrollingSound>./assets/sounds/tick.wav</scrollingSound> <bgColor>2D2D2D</bgColor> <textColor>FFFFFF</textColor> <textColorAlt>A2A2A2</textColorAlt> <highlightColor>42C1FFFF</highlightColor> <highlightColorAlt>00FFC5FF</highlightColorAlt> <systemInfoBGColor>FF973F</systemInfoBGColor> <carouselColor>00000000</carouselColor> <carouselInfoColor>9D9D9D11</carouselInfoColor> </variables> <view name="system, basic, detailed, video, gridview"> <image name="background" extra="true"> <origin>0 0</origin> <pos>0 0</pos> <size>1 1</size> <path>./assets/images/blank.png</path> <tile>true</tile> <color>${bgColor}</color> </image>
all of this works fine. Now if I put either of these in that same theme.xml file, it works as well:
<text name="labelPublisher" extra="true"> <origin>0 0.75</origin> <pos>0.681 0.264</pos> <fontSize>${fontSizeSmall}</fontSize> <alignment>left</alignment> <fontPath>${fontMain}</fontPath> <color>${textColorAlt}</color> <text>Publisher:</text> </text> <image name="boxartbg" extra="true"> <origin>0.5 0.5</origin> <pos>0.543 0.332</pos> <maxSize>0.203 0.361</maxSize> <path>./assets/images/artbg.png</path> </image>
But if I put these in the views.xml that is included, they don't display at all. It's just so odd, because the label I create for the publisher won't display, but the md_publisher will, and there are no real differences between them, besides one being a part of ES internally.
Edit: Not sure if it matters, but I'm using v2.10.0RP-DEV for Windows, and v2.10.3RP on the pi itself. The problem exists in both.
-
@pjmcphizzle shouldn't the include be inside the <view name="system, basic, detailed, video, gridview"> tag??
such as:
<view name="system, basic, detailed, video, gridview"> <include>./views.xml</include> </view>
Just wondering if you're including outside the tag defining the views ... ???
-
@kiro I tried that and it broke the theme. I'm just copying what others have done in their themes.
The difference with my theme, is that I don't want to have a folder for every single system inside the theme folder. I'm just trying to streamline everything, much like @lilbud has done with his Switch theme. I could have swore I had this working a year or so ago when I was last working on themes, but I no longer have a copy of my old theme, nor do I have an older version of ES that I can use to test my theory.
The theme I'm comparing to has xml files in folders, and then uses ./../assets to find the images, maybe I'll try that as a workaround.
-
@pjmcphizzle been looking at the themes I have in my setup, and the include has the <view name='detail'> tag in it, which is not showing in the second bit of your xml, maybe try that?
For example main theme:
theme> <formatVersion>3</formatVersion> <include>./../carbon.xml</include> <view name="system"> <image name="ControllerOverlay" extra="true"> <tile>false</tile> <pos>0.5 0.2</pos> <origin>0.5 0.5</origin> <size>0.3 0</size> <path>./art/controller.svg</path> <!--<color>8b0000</color>--> </image> <image name="logo"> <path>./art/system.svg</path> </image> </view>
./../carbon.xml:
<theme> <formatVersion>3</formatVersion> <view name="system"> <image name="background" extra="true"> <tile>true</tile> <size>1 1</size> <pos>0 0</pos> <origin>0 0</origin> <path>./art/carbon_fiber.png</path> </image> <helpsystem name="help"> <textColor>7d7d7d</textColor> <iconColor>7d7d7d</iconColor> </helpsystem> <image name="CenterFade" extra="true"> <tile>false</tile> <size>1 0.5</size> <pos>0.5 0.5</pos> <origin>0.5 0.5</origin> <path>./art/centerfade.png</path> <color>8b000050</color> </image>
Both xml is just a piece of the total xml...
-
@kiro Thank you for the help! The problem is that I just don't understand what I'm doing.
So up top I have my variables listed in theme.xml, but that's just to avoid confusion here. In reality, I have my variables in variables.xml, with I have included in theme.xml. It should do the same thing, or so I thought.
Viewing the code to carbon, I noticed the include tags are in carbon.xml, not theme.xml.
In my theme I included variables.xml to views.xml and it seemed to have fixed everything. I don't understand why though, you think it would need to be added to the main xml the theme loads so that way all xmls inherit the variables. I have a helpsystem.xml just like the views.xml, but I only included the variables to views.xml and it fixed the helpsystem... I just... don't understand...
Anyway, thanks for the help, I'm going to go cry in a corner and question if I should even continue haha.
-
If you just have something like the following in your views.xml, EmulationStation does not know where to use it:
<text name="labelPublisher" extra="true"> <origin>0 0.75</origin> <pos>0.681 0.264</pos> <fontSize>${fontSizeSmall}</fontSize> <alignment>left</alignment> <fontPath>${fontMain}</fontPath> <color>${textColorAlt}</color> <text>Publisher:</text> </text>
So, it needs to be inside a view tag:
<view type="detailed, video"> <text name="labelPublisher" extra="true"> <origin>0 0.75</origin> <pos>0.681 0.264</pos> <fontSize>${fontSizeSmall}</fontSize> <alignment>left</alignment> <fontPath>${fontMain}</fontPath> <color>${textColorAlt}</color> <text>Publisher:</text> </text> </view>
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.