AlmasB / FXGL

Java / JavaFX / Kotlin Game Library (Engine)
http://almasb.github.io/FXGL/
MIT License
4.45k stars 555 forks source link

How can we customize the UI elements created by the UIFactoryService & the DialogService #1326

Open AlmasB opened 11 months ago

AlmasB commented 11 months ago

Discussed in https://github.com/AlmasB/FXGL/discussions/1317

Originally posted by **DeathPhoenix22** November 5, 2023 Hi all, I'd like to know how to customize these services. If I try to replace them, I get an error saying that these services names are already loaded. If I try to extend them, they're not Open, so I can't. If I add a custom service that fullfill the UI Services, FXGL will not use them and always rely on those that he registered. In short, I'm currently unable to customize the UI elements generated by these Factories. Note that FXML CSS customization isn't flexible enough to perform the changes that I need to do. The only solution I have for now is to fully rewrite a side UI Factory system and avoid calling default Scene methods such as "fireExitToMainMenu" which will automatically prompt a default "confirmationDialog" that I can't customize, since the factories are not open. I'm I missing something? Thanks,