Lime-3DS-Emulator icon indicating copy to clipboard operation
Lime-3DS-Emulator copied to clipboard

Custom Backgrounds/Skins

Open Bluekomadori opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What feature are you suggesting?

Adding the ability to set custom backgrounds/skins to fill borders and the blank space while in landscape. A global layout option for all games or current game option could be helpful options.

Why would this feature be useful?

It would provide customization options for the community and improve the aesthetics while using the emulator.

Bluekomadori avatar Jun 18 '24 23:06 Bluekomadori

This is a good idea. However there might be some possible limitations because we would have to use the styling/theming system that Qt uses.

BlurrySquire avatar Jun 24 '24 08:06 BlurrySquire

It's been a while but I did some looking into it and I found some Qt features that would maybe allow us to do this.

  • This is a Qt forum post that discusses a very similar idea to custom themes. However the post is for Qt5. This is an example of stylesheets, which we should be able to do as we can load it in from a file. The stylesheets are a bit more limited as I don't believe you can do things like change layouts, only changing colours and styles of UI objects.

When looking at /dist/qt_themes/colorful_dark in the Lime3DS source tree. there is a qrc (Qt resource collection) file which contains a list of icons specific to that theme. There is also a qss (Qt stylesheet) file referenced at the bottom of the resource file.

    <qresource prefix="colorful_dark">
        <file alias="style.qss">../qdarkstyle/style.qss</file>
    </qresource>

Overall, I believe it may be possible to have custom themes using a Qt resource collection file and Qt stylesheet file. The only unsolved problem is loading these files. I also wonder where Lime3DS stores the stylesheets as you would assume them to be in /dist/qt_themes/colorful_dark with the resource collection file.

Edit: I found where the UI theme is updated which will be useful if this feature is implemented. /src/lime-qt/main.cpp@L3390 titled GMainWindow::UpdateUITheme.

BlurrySquire avatar Jul 31 '24 06:07 BlurrySquire

I found this issue searching for "Custom Skins" and I think you might have misinterpreted the original request, BlurrySquire. I don't think this is a request for styling the QT interface, but rather for putting a background image or transparent foreground image on top of the screens themselves, like Delta skins or overlays in Retroarch.

I would like to propose a way of implementing the spirit of the original request which would require the following steps:

  • [ ] Figure out how to overlay a png image on top of or behind the screens using the various renderers (or maybe just doing it in the SDL layer would be enough?) I don't have any expertise in vulkan, openGL, OR SDL so that would be the hardest part for me personally.
  • [ ] Create a "background-image" setting that would allow a user to specify a png file to overlay, perhaps also with a setting with various scaling options (stretch, resize-window-to-image, center, etc)

That alone, combined with the custom layout settings, could allow users to start building custom skins on their own, but would require quite a bit of tweaking by the individual. Still a good start. But to push it further, the following could be implemented:

  • [ ] Enable a "skin" file format that is essentially a zip file that contains an image (or images) and one or more .ini files that specify the appropriate settings for a skin which could include (1) The background / foreground image itself, (2) custom layout settings for the screens (normalized to the image size), (3) touch screen control positions (android only obviously), and (4) touch screen control opacity (android only). If a skin is specified, those settings would override the global settings. Skins could be landscape/desktop only, portrait only, or both.

If anybody out there wants to take a stab at the first part and figure out how to render static images either above or below the screens (utilizing transparency for the "above" option to make the screens visible), I could spend some time picking away at the remaining bits.

DavidRGriswold avatar Aug 22 '24 12:08 DavidRGriswold

You can use the open source waylus exactly for that feature. Create a second screen open that with weylus on the phone or tablet.

Papermanzero avatar Aug 23 '24 21:08 Papermanzero