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 35.7k 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
      Thanks, obvious really if I'd thought about it.
      I've changed all instances of ${system.name} to ${system.theme}. Thanks for the advise.

      SNES mini/Nes mini/Famicom mini theme developer.

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

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

        @ruckage I have implemented default image support. I ended up naming the new field default since that was what video was already using.

        <image>
          <path>./${system.name}.png</path>
          <default>./default.png</default>
        </image>
        

        It also occurred to me that this could work well for the missing.png you use. You could set it as the default for md_image and then it would only show if the selected game does not have an image.

        Windows build available here:
        https://ci.appveyor.com/project/jrassa/emulationstation/build/2.6.4-201746011746/artifacts

        Get latest build of EmulationStation for Windows here

        ruckageR E 2 Replies Last reply Reply Quote 3
        • ruckageR
          ruckage @jdrassa
          last edited by ruckage

          @jdrassa

          That's great, I'll give it a test. Is this part of the main branch yet?
          edit: Yes it definately would be perfect for the missing .png. It's currently removed as it was sometimes visible when not needed so this would fix that.

          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
          • E
            EctoOne @jdrassa
            last edited by EctoOne

            @jdrassa Is the default thing also possible within the carousel?
            It seems stupid to cover the text for unthemed systems but since we can pull the system name with system.Fullname and format it like we want, i can see some use for it.

            Edit: Nvm, i totally forgot that it's based around the image tag, so it should be possible. For some reason i thought that the logos were defined by the carousel tag.

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

              @ectoone The carousel is a bit of a special case. There is logic there that determines if it should show the image vs. text. I did not make any changes to that logic, so the default image doesn't currently work for the carousel. I am not sure that I see the use case where a default image would be better then text, since the user wouldn't be able to tell what system it.

              Get latest build of EmulationStation for Windows here

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

                @jdrassa Oh, thanks for the answer.
                My Invaders Theme would be an example where text would break the design and that uses <text>${system.fullName}</text> to show which system is selected.
                So there are cases where it would be useful, but it depends on the Theme creator to avoid confusion. So i understand why you didn't change that.

                1 Reply Last reply Reply Quote 1
                • ruckageR
                  ruckage @jdrassa
                  last edited by

                  @jdrassa
                  Regarding the default carousel image I agree with @EctoOne , it's something that could be useful in certain circumstances so I think it would be worth adding. For my theme I had considered it as having just text breaks the look of my theme as well - however in my case it wouldn't be ideal as you couldn't tell what system was selected so instead I'm going to generate basic icons/logos for every supported system and use the default image option for the backgrounds.

                  I've tested the default images in the version you posted and all seems to be working perfectly. Thanks for all your hard work.

                  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 2
                  • J
                    jdrassa
                    last edited by

                    @ruckage @EctoOne default images is now in the main branch. Also I did implement default images support for the carousel logos as well.

                    Get latest build of EmulationStation for Windows here

                    ruckageR 2 Replies Last reply Reply Quote 2
                    • ruckageR
                      ruckage @jdrassa
                      last edited by

                      @jdrassa
                      Thanks, that's great news.

                      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
                      • ruckageR
                        ruckage @jdrassa
                        last edited by

                        @jdrassa
                        Hi. I just tried you latest continuous build for windows and the automatic variable system.theme isn't working so my snes mini theme no longer displays any icons/backgrounds. Has something changed or is this a bug?

                        The version I was using previously was from 1st October (I think when you added default image support) and the variables all work perfectly in that version.

                        Thanks in advance for your help.

                        SNES mini/Nes mini/Famicom mini theme developer.

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

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

                          @ruckage Looks like a recent change introduced a bug where only the first variable is being resolved. Should have a fix out in a day or two.

                          Get latest build of EmulationStation for Windows here

                          ruckageR 1 Reply Last reply Reply Quote 1
                          • ruckageR
                            ruckage @jdrassa
                            last edited by

                            @jdrassa said in Variable Support in Themes in EmulationStation:

                            @ruckage Looks like a recent change introduced a bug where only the first variable is being resolved. Should have a fix out in a day or two.

                            That's good, thanks in advance for fixing it.

                            SNES mini/Nes mini/Famicom mini theme developer.

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

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

                              @ruckage Latest build should have the fix.

                              Get latest build of EmulationStation for Windows here

                              ruckageR 1 Reply Last reply Reply Quote 1
                              • ruckageR
                                ruckage @jdrassa
                                last edited by

                                @jdrassa
                                Perfect, working again now. Thanks for fixing it so quickly :) .

                                Was this something just affecting your build or was it a problem in the main branch as well?

                                SNES mini/Nes mini/Famicom mini theme developer.

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

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

                                  @ruckage It was a problem on the main branch as well (or would have been). RetroPie's repository now uses 2 branches, master and stable. RetroPie-Setup now has an ES dev module that pulls from master, while the main ES module pulls from stable. The change was present on master, but hadn't made it to stable yet.

                                  Get latest build of EmulationStation for Windows here

                                  darkniorD 1 Reply Last reply Reply Quote 1
                                  • A12C4A
                                    A12C4
                                    last edited by A12C4

                                    @jdrassa I created a theme from scratch to better see how it work, and one thing that annoy me is there is no way to perform basic math operations on variables. For example, right now I position the metadata labels and values like this :

                                    	<variables>
                                    		<!-- POSITIONS AND SIZES -->
                                    		<PosHoriMetadataLabel>0.012</PosHoriMetadataLabel>
                                    		<PosHoriMetadataValue>0.024</PosHoriMetadataValue>
                                    	</variables>
                                    
                                    	<view name="detailed, grid">
                                    		<text name="md_lbl_players">
                                    			<pos>${PosHoriMetadataLabel} 0.24</pos>
                                    		</text>
                                    		
                                    		<text name="md_players">
                                    			<pos>${PosHoriMetadataValue} 0.28</pos>
                                    		</text>
                                    		
                                    		<text name="md_lbl_genre">
                                    			<pos>${PosHoriMetadataLabel} 0.34</pos>
                                    		</text>
                                    		
                                    		<text name="md_genre">
                                    			<pos>${PosHoriMetadataValue} 0.38</pos>
                                    		</text>
                                    		
                                    		...
                                    	</view>
                                    

                                    As you can see, I can easily change the horizontal position of metadata labels and values just by changing one of the 2 variables accordingly.

                                    But why not pushing it farther ? Why can't we do the same with vertical positions like this :

                                    	<variables>
                                    		<!-- POSITIONS AND SIZES -->
                                    		<PosHoriMetadataLabel>0.012</PosHoriMetadataLabel>
                                    		<PosHoriMetadataValue>0.024</PosHoriMetadataValue>
                                    
                                    		<!-- Position at which the metadata start -->
                                    		<PosVertMetadataStart>0.024</PosVertMetadataStart>
                                    		<!-- Spacing between 2 metadata labels -->
                                    		<SpacingMetadata>0.010</SpacingMetadata>
                                    		<!-- Spacing between a metadata label and its value -->
                                    		<SpacingMetadataValue>0.004</SpacingMetadataValue>
                                    	</variables>
                                    
                                    	<view name="detailed, grid">
                                    		<text name="md_lbl_players">
                                    			<pos>${PosHoriMetadataLabel} (${PosVertMetadataStart} + 0 * ${SpacingMetadata})</pos>
                                    		</text>
                                    		
                                    		<text name="md_players">
                                    			<pos>${PosHoriMetadataValue} (${PosVertMetadataStart} + 0 * ${SpacingMetadata} + ${SpacingMetadataValue})</pos>
                                    		</text>
                                    		
                                    		<text name="md_lbl_genre">
                                    			<pos>${PosHoriMetadataLabel} (${PosVertMetadataStart} + 1 * ${SpacingMetadata})</pos>
                                    		</text>
                                    		
                                    		<text name="md_genre">
                                    			<pos>${PosHoriMetadataValue} (${PosVertMetadataStart} + 1 * ${SpacingMetadata} + ${SpacingMetadataValue})</pos>
                                    		</text>
                                    		
                                    		...
                                    	</view>
                                    

                                    That way it is a bit harder to setup, but once it's done you can quickly change all the metadata order, it's spacing, it's position, etc ... just by changing one variable's value. Do you think more people would use that or I'm just overcomplicating things ? Would it require huge changes to EmulationStation's theme parsing code ?

                                    Grid view wiki

                                    1 Reply Last reply Reply Quote 1
                                    • darkniorD
                                      darknior
                                      last edited by darknior

                                      Hi every one :)
                                      I have try to use this VARIABLE feature to make my theme and nothing working for me :(

                                      <theme>
                                      
                                      	<formatVersion>4</formatVersion>
                                      
                                      	<variables>
                                      		<selectColor>1f9be7</selectColor>
                                      		<textColor>4c5058</testColor>
                                      	</variables>
                                      	
                                      	<view name="system, basic, detailed, grid, video">
                                      ...
                                      

                                      And when i had these var to my skin ES don't want to load it.
                                      I'm using the emulationstation-dev from retropie-setup

                                      Using ${system.theme} not working but not break my skin.

                                      Is it the correct version plase ?
                                      Thansk

                                      Life is game, just play it !

                                      1 Reply Last reply Reply Quote 0
                                      • ruckageR
                                        ruckage
                                        last edited by ruckage

                                        @darknior
                                        It may be related to the problem reported a while ago (see here: Post 78 )
                                        @jdrassa said the bug was present in the dev version (which you're using) but not in the stable version.

                                        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

                                          Sorry for the VARIABLE bug it's my fault :(

                                          I write <textColor>4c5058</testColor> and replace X by S ... stupid guy :p

                                          @jdrassa said in Variable Support in Themes in EmulationStation:

                                          @ruckage It was a problem on the main branch as well (or would have been). RetroPie's repository now uses 2 branches, master and stable. RetroPie-Setup now has an ES dev module that pulls from master, while the main ES module pulls from stable. The change was present on master, but hadn't made it to stable yet.

                                          @ruckage Thanks ... but if i understand fine the bug was removed from the DEV branch (Master). I'm not using the Stable one.
                                          If my english is so bad and i don't understand fine, i wish @jdrassa will fix it to in dev branch. Dev branch has many update not in Stable one, like now Thumbnail preview if no video that working fine :)
                                          But with a SIZE bug for the moment :p

                                          Life is game, just play it !

                                          ruckageR 1 Reply Last reply Reply Quote 0
                                          • ruckageR
                                            ruckage @darknior
                                            last edited by

                                            @darknior said in Variable Support in Themes in EmulationStation:

                                            @ruckage Thanks ... but if i understand fine the bug was removed from the DEV branch (Master). I'm not using the Stable one.
                                            If my english is so bad and i don't understand fine, i wish @jdrassa will fix it to in dev branch. Dev branch has many update not in Stable one, like now Thumbnail preview if no video that working fine :)
                                            But with a SIZE bug for the moment :p

                                            No, it was the other way around, the bug was in the Dev branch (Master) but hadn't made it into stable I believe. Hopefully if the Dev branch hasn't been corrected yet it will be in the future (otherwise it will end up in the stable version as well).

                                            The bug stopped built in variables such ${system.theme} from working so it sounds like the bug is still present in the dev version you're using - have you updated it recently?

                                            SNES mini/Nes mini/Famicom mini theme developer.

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

                                            darkniorD 1 Reply Last reply Reply Quote 0
                                            • 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.