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

Pegasus theme development general

Scheduled Pinned Locked Moved Ideas and Development
pegasusqmltheme makingtheme help
156 Posts 16 Posters 50.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.
  • P
    PlayingKarrde
    last edited by 7 Oct 2019, 04:04

    @fluffypillow A long time ago I asked you about the ability to get which button is assigned to which actions (ie getting the button that is assigned to cancel). I feel like I recall you adding that but I can't seem to find that information anywhere. I suspect that info is held within api.keys but I'm not entirely sure what to query to get it. Is this possible at all?

    F 1 Reply Last reply 7 Oct 2019, 11:22 Reply Quote 0
    • F
      fluffypillow @PlayingKarrde
      last edited by 7 Oct 2019, 11:22

      @PlayingKarrde Yes, see the Array column here; the elements have key and modifier fields like QML KeyEvents. At the moment they also have a name() function, but this might change in the future (ie. don't depend on it), and its output also varies depending on platform and language.

      P 1 Reply Last reply 7 Oct 2019, 16:39 Reply Quote 0
      • P
        PlayingKarrde @fluffypillow
        last edited by PlayingKarrde 10 Jul 2019, 17:40 7 Oct 2019, 16:39

        @fluffypillow Thanks. You say not to rely on name() but isn't this exactly what I need? I'm honestly not sure how I can use the model that it provides otherwise as I'm not sure what those values represent. For context this is for making button help.

        1 Reply Last reply Reply Quote 0
        • F
          fluffypillow @PlayingKarrde
          last edited by 7 Oct 2019, 17:17

          @PlayingKarrde It seems there's no built-in way to get the the current locale, so I'll add something for that. In a theme that'd look something like

          • you add a theme option (think a simple dropdown list) for selecting a language out from those that your theme supports
          • on loading/change you set it to the one Pegasus uses or to some fallback

          You can add support for languages not supported by Pegasus, as it'll be just a theme option. Languages have a code like "en-US" and "en-GB", so you'd be able to make a difference or use a general "English" based on that.

          I can also add translations if someone makes them :) I was also thinking about making a translation site, just haven't had the time yet.

          @SinisterSpatula Such slowdown is very interesting, the memory of the Pi shouldn't be that slow. This will need some more debugging. Could you record a video of it?

          As for jumping from the last to the first element, you can use keyNavigationWraps.

          @PlayingKarrde by don't depend, I mean it's not officially part of the Keys yet (ie. undocumented), I think I might change it from being a function to a regular property before first. But yes, that's something you'd use for for actually showing the name of the keys. One shouldn't depend on the the text either, as it may return different names on different languages/platforms (eg. Mac).

          P 1 Reply Last reply 7 Oct 2019, 17:19 Reply Quote 0
          • P
            PlayingKarrde @fluffypillow
            last edited by 7 Oct 2019, 17:19

            @fluffypillow said in Pegasus theme development general:

            by don't depend, I mean it's not officially part of the Keys yet (ie. undocumented), I think I might change it from being a function to a regular property before first. But yes, that's something you'd use for for actually showing the name of the keys. One shouldn't depend on the the text either, as it may return different names on different languages/platforms (eg. Mac).

            Gah ok how can I get something that is consistent and platform agnostic from that then?

            1 Reply Last reply Reply Quote 0
            • F
              fluffypillow
              last edited by 7 Oct 2019, 17:28

              The key and modifier fields should be same across platforms (they are actually just numbers), it's the displayed name that's different, Like Ctrl turns into Option (I think?) on Mac. The list of possible key values is listed here (you can eg, do if (key == Qt.Key_X) //do something ), and modifiers are listed here. Gamepad keys have their own key code, I think I've listed them here somewhere but I'll also document them eventually.

              1 Reply Last reply Reply Quote 0
              • P
                PlayingKarrde
                last edited by 7 Oct 2019, 17:30

                Hmm ok. I will brute force it then. It's not ideal but also not the end of the world since there aren't THAT many controller buttons.

                F 1 Reply Last reply 7 Oct 2019, 17:30 Reply Quote 0
                • F
                  fluffypillow @PlayingKarrde
                  last edited by 7 Oct 2019, 17:30

                  @PlayingKarrde one sec and I'll provide a list :)

                  F 1 Reply Last reply 7 Oct 2019, 17:34 Reply Quote 0
                  • F
                    fluffypillow @fluffypillow
                    last edited by 7 Oct 2019, 17:34

                    @fluffypillow here's the order, the number grows by one on every button after A

                    A = 0x100000,
                    B,
                    X,
                    Y,
                    L1,
                    L2,
                    L3,
                    R1,
                    R2,
                    R3,
                    SELECT,
                    START,
                    GUIDE,
                    
                    P 2 Replies Last reply 7 Oct 2019, 17:35 Reply Quote 0
                    • P
                      PlayingKarrde @fluffypillow
                      last edited by 7 Oct 2019, 17:35

                      @fluffypillow Oh ok that's easier than I thought. Although those aren't the results I was getting in my tests, I'll try them and see. Thanks!

                      1 Reply Last reply Reply Quote 0
                      • P
                        PlayingKarrde @fluffypillow
                        last edited by 7 Oct 2019, 18:14

                        For anyone else that wants to do this, this is the function I made:

                        function processButtonArt(buttonModel) {
                            var i;
                            for (i = 0; buttonModel.length; i++) {
                              if (buttonModel[i].name().includes("Gamepad")) {
                                var buttonValue = buttonModel[i].key.toString(16)
                                return buttonValue.substring(buttonValue.length-1, buttonValue.length);
                              }
                            }
                          }
                        

                        Then passing in the key (ie processButtonArt(api.keys.cancel)) . This obviously isn't super ideal since it's currently relying on name() but it's the only way I could find to discern between a gamepad and key for now (if there's a better way I'm happy to change) but this is working for me for now.

                        1 Reply Last reply Reply Quote 0
                        • A
                          AndersHP
                          last edited by 27 Oct 2019, 14:04

                          How come I have perfect game audio when running the default pegasus theme, but have no audio when switching to other themes?

                          My "Bubble Bobble" Themed Bartop Arcade
                          My Gameboy

                          1 Reply Last reply Reply Quote 0
                          • F
                            fluffypillow
                            last edited by 27 Oct 2019, 19:01

                            @AndersHP Interesting, so you have no audio in-game if the theme is set to something else than the default theme? Does this happen also if Pegasus was launched with the other theme already set or only after you change it in the menu? Does it happen on different devices too? Does it happen with all themes?

                            1 Reply Last reply Reply Quote 0
                            • A
                              AndersHP
                              last edited by 28 Oct 2019, 08:26

                              Just tested.
                              I have tested GPiOS theme and GameOS theme, and there's no ingame sound in any of them. I tried changing theme and rebooting, and also shutting down+restarting, there's no sound no matter what I do.

                              After reverting back to the standard grid theme, the sound is back instantly.

                              My "Bubble Bobble" Themed Bartop Arcade
                              My Gameboy

                              P 1 Reply Last reply 28 Oct 2019, 15:09 Reply Quote 0
                              • P
                                PlayingKarrde @AndersHP
                                last edited by 28 Oct 2019, 15:09

                                @AndersHP But do you mean no sound in the theme or no sound when playing a game?

                                A 1 Reply Last reply 28 Oct 2019, 15:47 Reply Quote 0
                                • A
                                  AndersHP @PlayingKarrde
                                  last edited by 28 Oct 2019, 15:47

                                  @PlayingKarrde
                                  No sound in games at all. Haven't got any video previews so haven't considered if the sound is working in the theme.

                                  My "Bubble Bobble" Themed Bartop Arcade
                                  My Gameboy

                                  1 Reply Last reply Reply Quote 0
                                  • F
                                    fluffypillow
                                    last edited by 28 Oct 2019, 17:35

                                    @AndersHP Does it happen with these two themes too?

                                    A 1 Reply Last reply 30 Oct 2019, 18:57 Reply Quote 1
                                    • A
                                      AndersHP @fluffypillow
                                      last edited by AndersHP 30 Oct 2019, 18:57

                                      @fluffypillow
                                      Strangely enough, these two themes work fine, including backgroundmusic in the 9999999-in-1 theme.

                                      My "Bubble Bobble" Themed Bartop Arcade
                                      My Gameboy

                                      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.

                                        This community forum collects and processes your personal information.
                                        consent.not_received