RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Variable Support in Themes in EmulationStation

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstationthemes
    111 Posts 13 Posters 37.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ruckageR
      ruckage @jdrassa
      last edited by

      @jdrassa Good to hear from you. That's great news, it definately will be useful in certain cases. I'll give it test later.

      SNES mini/Nes mini/Famicom mini theme developer.

      If you'd like to support my work you can donate here: Donate

      1 Reply Last reply Reply Quote 0
      • darkniorD
        darknior @jdrassa
        last edited by

        @jdrassa Good news, thanks a lot for it :)

        Life is game, just play it !

        1 Reply Last reply Reply Quote 0
        • E
          EctoOne
          last edited by

          I just tried this version and using my own variables for includes worked:

           <variables>
            <var1>shortcut1</var1>
           </variables>
           <include>./${shortcut1}.xml</include>
          

          But I wasn't able to get system variables to work:

          <include>./path/${system.theme}.xml</include>
          

          I tried that to remove all system folders, but the settings from the renamed/moved system/theme.xml didn't show up in the theme.

          J 1 Reply Last reply Reply Quote 0
          • J
            jdrassa @EctoOne
            last edited by

            @EctoOne I think it is loading, I am pretty sure that the theme will fail to load if it can't find and include. Do you have settings in your base theme.xml that could be overriding the settings in /path/${system.theme}.xml? The way theme files are parsed is that first all includes are processed, before moving on to the main content of the the file.

            Previously, ./system/theme.xml included ./theme.xmlso theme.xml would be parsed first and then ./system/theme.xmlwould be parsed and override any settings previously parsed.

            Now you have ./theme.xml including ./path/${system.theme}.xml so ./path/${system.theme}.xmlwould be parsed first and then ./theme.xml would be parsed and override any settings previously parsed.

            I haven't actually tested to confirm, but I am pretty sure that is what is happening.

            Depending on how your theme is setup, what you may need to do is move most (all?) of the main content from theme.xml to something like common.xml or base.xml and then have theme.xml just have includes. That way you can control the order they are parsed.

            Get latest build of EmulationStation for Windows here

            E 1 Reply Last reply Reply Quote 1
            • E
              EctoOne @jdrassa
              last edited by EctoOne

              @jdrassa Ah that would make sense. Because yes, I tried that with my Flatline theme which only uses ./system/theme.xml to format some of the system names and with your explanation they would be overwritten by the default ${system.name} I'm using in the main xml.

              Using a theme.xml with includes only worked. Thanks!

              BTW: Are you going to update the windows build any time soon? It appears that this version has not the new datetime component and from what I've seen on github both changes have been merged into the dev version already.

              J 1 Reply Last reply Reply Quote 0
              • J
                jdrassa @EctoOne
                last edited by

                @EctoOne windows build is updated now. It should be automated, but I have been testing out a new method for keeping my repo synced with the RetroPie one and for some reason it didn't work this time.

                Get latest build of EmulationStation for Windows here

                E 1 Reply Last reply Reply Quote 0
                • E
                  EctoOne @jdrassa
                  last edited by EctoOne

                  @jdrassa Oh, I noticed an updated version on your github like over 24 hours ago and assumed that was the build you pushed after my question. I used it for quite some time and noticed no errors (I even tried the new <datetime> component with <lastplayed> this time) for the new stuff.

                  There is one thing I noticed though. <video name="md_video"> supports <rotation> but that doesn't apply to the thumb that's shown before the video or when no video is available. It would be great if that can be added and maybe rotation support for <textlist name="gamelist">and <text name="md_description">.
                  Those are basically my last requests when it comes to theming. Besides the options to theme the ES GUI (including the <helpsystem> buttons) and the method to select <includes> from the GUI that the recalbox version has and I already mentioned here.

                  Anyway, I appreciate the work you guys are doing.

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jdrassa @EctoOne
                    last edited by

                    @EctoOne said in Variable Support in Themes in EmulationStation:

                    There is one thing I noticed though. <video name="md_video"> supports <rotation> but that doesn't apply to the thumb that's shown before the video or when no video is available.

                    This sounds like a bug/oversight when rotation support was added. I'll check it out.

                    It would be great if that can be added and maybe rotation support for <textlist name="gamelist">and <text name="md_description">.

                    Unfortunately, for these, it is not a simple task to implement rotation due to how the scrolling is implemented.

                    Get latest build of EmulationStation for Windows here

                    E 2 Replies Last reply Reply Quote 1
                    • E
                      EctoOne @jdrassa
                      last edited by

                      @jdrassa said in Variable Support in Themes in EmulationStation:

                      @EctoOne said in Variable Support in Themes in EmulationStation:

                      It would be great if that can be added and maybe rotation support for <textlist name="gamelist">and <text name="md_description">.

                      Unfortunately, for these, it is not a simple task to implement rotation due to how the scrolling is implemented.

                      Yeah I thought so. There still is that one comic wallpaper I would love to turn into a theme but with straight lines it just looks wrong.
                      Although, was it you who was trying to implement the carousel as gamelist replacement? And if, is that still a thing? Because that would actually look nice with some rotation magic. Assuming it would support all the options from the system carousel.

                      1 Reply Last reply Reply Quote 0
                      • E
                        EctoOne @jdrassa
                        last edited by EctoOne

                        @jdrassa I just encountered a big flaw while using ${system.theme} in an <include> tag.
                        If it can't find the specific file, e.g. if someone uses an custom collection, it breaks the whole theme for that selection. All theme settings are suddenly ignored.

                        I had the idea to create some sort of external metadata library for systems that could be simply used by theme makers just by including a single file which further imports the metadata from ${system.theme}.xml files and also provides labels. It also imports a file which is used to theme those text elements.

                        I integrated that into my Flatline Theme here for testing purposes and noticed that behaviour.

                        To make the process clear again:

                        • theme.xml includes _assets/mds_include.xml
                        • mds_include.xml includes mds_data/${system.theme}.xml and mds_style.xml

                        It would be great if you could take a look at it and tell me if I made something wrong or if that is unavoidable for now. I mean I know that ES will fall back to the default theme if it can't find an include file. Maybe there's an way to ignore that error.

                        Edit: I just had another idea, would it be possible that ${system.theme} returns default if an unknown system is selected? Then we could use files like default.jpg or default.xml.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post

                        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.