Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hooks into the GUI2 theming system #8825

Open
CelticMinstrel opened this issue Apr 29, 2024 · 7 comments
Open

Add hooks into the GUI2 theming system #8825

CelticMinstrel opened this issue Apr 29, 2024 · 7 comments
Labels
Enhancement Issues that are requests for new features or changes to existing ones. UI User interface issues, including both back-end and front-end issues. WML Issues involving the WML engine or WML APIs.

Comments

@CelticMinstrel
Copy link
Member

GUI2 has a built-in theming system that can in principle be used to reskin the entire game, but at present there's a number of obstacles to actually using it.

First of all, custom themes can only be added by editing the game data right now. There should be some way of loading themes from addons.

Secondly, while there is a preference to change the preferred theme (I'm not sure if it's an advanced preference or a hidden preference), there's no way for a scenario to request switching to a particular theme.

There's likely other issues as well that make the system unusable for anything beyond making a mobile theme for the iOS/Android versions.

@CelticMinstrel CelticMinstrel added Enhancement Issues that are requests for new features or changes to existing ones. UI User interface issues, including both back-end and front-end issues. WML Issues involving the WML engine or WML APIs. labels Apr 29, 2024
@ProditorMagnus
Copy link
Contributor

@CelticMinstrel
Copy link
Member Author

Not even slightly related. That's the in-game theme (ThemeWML), while this is GUI2.

@babaissarkar
Copy link
Contributor

babaissarkar commented Apr 30, 2024

Would be good to have a list of specifications here, that is, the things that people would like to be customizable.
Things that I can remember :
1. The titlescreen appearance and layout along with the background image
2. Appearance of in game UI controls
3. Any kind of color/position variables that are currently hardcoded. (I saw quite a few of them in here)
Only when the particular add-on is active.

@CelticMinstrel Can this be related to porting ThemeWML to GUI2?

@CelticMinstrel
Copy link
Member Author

Can this be related to porting ThemeWML to GUI2?

I wouldn't say it's related.

The titlescreen appearance and layout along with the background image

Though this could be a possibility, it might be worth limiting custom themes to be used only in-game (ie, dialogs that are shown during the course of a scenario). Otherwise, someone could install a broken theme that renders the game completely unplayable.

Another thing: if I recall correctly, I think switching the GUI2 theme requires restarting Wesnoth at the moment, which is obviously a problem if we want to be able to use custom themes in scenarios.

@hladkyjakub
Copy link

hladkyjakub commented Apr 30, 2024

Would be good to have a list of specifications here, that is, the things that people would like to be customizable.
Things that I can remember :

I was thinking about option to use custom

Though this could be a possibility, it might be worth limiting custom themes to be used only in-game (ie, dialogs that are shown during the course of a scenario). Otherwise, someone could install a broken theme that renders the game completely unplayable.

I do partly agree.
You should be able to edit any dialog while your add-on is active (in-game wiki, preferences, dialogs ...)
(As long as it's only while add-on is active, it shouldn't be able to break the game.

I'm not developer but I thought it could be done using cpp equivalent of
Theme = CustomTheme or DefaultTheme ... maybe?

@Vultraz
Copy link
Member

Vultraz commented Apr 30, 2024

I really don’t think this is worth it for anything beyond the in-game UI. Besides the amount of work required to support it, it doesn’t really make sense to allow people to skin the whole UI.

@CelticMinstrel
Copy link
Member Author

CelticMinstrel commented Apr 30, 2024

it doesn’t really make sense to allow people to skin the whole UI

Though I kind of agree on this, it does make sense to allow people to skin such dialogs as the story screen or the narration dialog.

I really don’t think this is worth it for anything beyond the in-game UI.

The in-game UI is (probably) a completely separate situation, as it must be built to tie into the reports system.

As long as it's only while add-on is active, it shouldn't be able to break the game.

There are probably ways to break the game even then, but we'd maybe have a blacklist of dialogs you're not allowed to touch.

For example, no customization of the "do you want to quit" dialog is allowed, and reskinning the menus is also not permitted.

Could also do the reverse, a whitelist of dialogs you are allowed to touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issues that are requests for new features or changes to existing ones. UI User interface issues, including both back-end and front-end issues. WML Issues involving the WML engine or WML APIs.
Projects
None yet
Development

No branches or pull requests

5 participants