Refactor theme management in G2D controls and introduce new themes

- Updated G2DButtonControlImpl, G2DLabelControlImpl, G2DSliderControlImpl, G2DSwitchControlImpl, G2DTableControlImpl, G2DTextfieldControlImpl, G2DTextfieldControlImpl2, G2DToggleButtonControlImpl, G2DWindowCloseButtonControlImpl, and G2DWindowPanelControlImpl to use G2DThemeManager directly instead of casting from G2DRenderer.
- Added new theme factory beans: BevelDarkThemeFactoryBean, BevelLightThemeFactoryBean, MetroPatternRenderer, and updated existing theme factory beans to improve theme consistency and aesthetics.
- Modified audio settings in DemoModule for improved user experience.
- Adjusted background and foreground colors in various themes for better visibility and aesthetics.
This commit is contained in:
extio-de
2025-12-28 11:47:21 +01:00
parent e87edd27a2
commit 120dd91161
31 changed files with 422 additions and 60 deletions

View File

@@ -87,8 +87,8 @@ public class DemoModule extends AbstractClientModule {
@Override
public void onActivate() {
final var audioOptions = this.audioController.getAudioOptions();
audioOptions.getMusicOptions().setVolume(0.0f);
audioOptions.getSfxOptions().setVolume(0.0f);
audioOptions.getMusicOptions().setVolume(0.8f);
audioOptions.getSfxOptions().setVolume(1.0f);
this.audioController.applyAudioOptions(audioOptions);
this.setupMainWindow();
@@ -120,30 +120,30 @@ public class DemoModule extends AbstractClientModule {
private void onUiControlEvent(final UiControlEvent event) {
switch (event.getId()) {
case "DemoModule_MainWindow_Label_Welcome" -> {
this.audioController.play(new StaticResource(List.of("audio"), "alert0.ogg"));
this.audioController.play(new StaticResource(List.of("audio"), "contact0.ogg"));
this.setupSecondaryWindow();
this.getModuleService().changeActiveState(this.secondaryWindow.getId(), true);
this.getModuleService().changeDisplayState(this.secondaryWindow.getId(), true);
}
case "DemoModule_MainWindow_Label_Start" -> {
this.audioController.play(new StaticResource(List.of("audio"), "alert0.ogg"));
this.audioController.play(new StaticResource(List.of("audio"), "contact0.ogg"));
this.setupThemeSelectionWindow();
this.getModuleService().changeActiveState(this.themeSelectionWindow.getId(), true);
this.getModuleService().changeDisplayState(this.themeSelectionWindow.getId(), true);
}
case "DemoModule_SecondaryWindow_Button_Ok" -> {
this.audioController.play(new StaticResource(List.of("audio"), "alert2.ogg"));
this.audioController.play(new StaticResource(List.of("audio"), "alert0.ogg"));
this.getModuleService().changeActiveState(this.secondaryWindow.getId(), false);
}
default -> {
final var themeName = this.themeSelectionByControlId.get(event.getId());
if (themeName != null) {
this.audioController.play(new StaticResource(List.of("audio"), "alert2.ogg"));
this.audioController.play(new StaticResource(List.of("audio"), "alert0.ogg"));
this.themeManager.setCurrentTheme(themeName);
this.getModuleService().changeActiveState(this.themeSelectionWindow.getId(), false);
// this.getModuleService().changeActiveState(this.themeSelectionWindow.getId(), false);
}
}
}