Skip to content

Commit 56b5de3

Browse files
Refac
1 parent ac716a4 commit 56b5de3

File tree

18 files changed

+119
-120
lines changed

18 files changed

+119
-120
lines changed

pacman-app-arcade-mspacman/src/main/java/de/amr/pacmanfx/arcade/ms_pacman/ArcadeMsPacMan_UIConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public GameScene selectGameScene(GameContext gameContext) {
276276
int cutSceneNumber = gameContext.theGame().<Integer>getProperty("intermissionTestNumber");
277277
yield SCENE_ID_CUT_SCENE_N_2D.formatted(cutSceneNumber);
278278
}
279-
default -> GameUI.property3DEnabled.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
279+
default -> GameUI.PROPERTY_3D_ENABLED.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
280280
};
281281
return scenesByID.get(sceneID);
282282
}

pacman-app-arcade-pacman/src/main/java/de/amr/pacmanfx/arcade/pacman/ArcadePacMan_UIConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public GameScene selectGameScene(GameContext gameContext) {
264264
int cutSceneNumber = gameContext.theGame().<Integer>getProperty("intermissionTestNumber");
265265
yield SCENE_ID_CUT_SCENE_N_2D.formatted(cutSceneNumber);
266266
}
267-
default -> GameUI.property3DEnabled.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
267+
default -> GameUI.PROPERTY_3D_ENABLED.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
268268
};
269269
return scenesByID.get(sceneID);
270270
}

pacman-app-arcade-pacman/src/main/java/de/amr/pacmanfx/arcade/pacman/scenes/ArcadeCommon_PlayScene2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public List<MenuItem> supplyContextMenuItems(ContextMenuEvent contextMenuEvent,
119119
miImmunity.selectedProperty().bindBidirectional(gameContext().theGameController().propertyImmunity());
120120

121121
var miMuted = new CheckMenuItem(ui.theAssets().text("muted"));
122-
miMuted.selectedProperty().bindBidirectional(GameUI.propertyMuted);
122+
miMuted.selectedProperty().bindBidirectional(GameUI.PROPERTY_MUTED);
123123

124124
var miQuit = new MenuItem(ui.theAssets().text("quit"));
125125
miQuit.setOnAction(e -> ACTION_QUIT_GAME_SCENE.executeIfEnabled(ui));

pacman-app-arcade-pacmanxxl/src/main/java/de/amr/pacmanfx/arcade/pacman_xxl/PacManXXL_Common_StartPageMenu.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public String selectedValueText() {
196196
@Override
197197
protected void onValueChanged(int index) {
198198
state.play3D = selectedValue();
199-
GameUI.property3DEnabled.set(state.play3D);
199+
GameUI.PROPERTY_3D_ENABLED.set(state.play3D);
200200
logState();
201201
}
202202

@@ -293,7 +293,7 @@ public void syncMenuState() {
293293
mapSelector.loadAllMaps();
294294
final boolean customMapsExist = !mapSelector.customMaps().isEmpty();
295295

296-
state.play3D = GameUI.property3DEnabled.get();
296+
state.play3D = GameUI.PROPERTY_3D_ENABLED.get();
297297
state.cutScenesEnabled = game.areCutScenesEnabled();
298298
state.mapOrder = mapSelector.mapSelectionMode();
299299
logState();

pacman-app-arcade-pacmanxxl/src/main/java/de/amr/pacmanfx/arcade/pacman_xxl/PacManXXL_MsPacMan_UIConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public GameScene selectGameScene(GameContext gameContext) {
276276
int cutSceneNumber = gameContext.theGame().<Integer>getProperty("intermissionTestNumber");
277277
yield SCENE_ID_CUT_SCENE_N_2D.formatted(cutSceneNumber);
278278
}
279-
default -> GameUI.property3DEnabled.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
279+
default -> GameUI.PROPERTY_3D_ENABLED.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
280280
};
281281
return scenesByID.get(sceneID);
282282
}

pacman-app-arcade-pacmanxxl/src/main/java/de/amr/pacmanfx/arcade/pacman_xxl/PacManXXL_PacMan_UIConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public GameScene selectGameScene(GameContext gameContext) {
258258
int cutSceneNumber = gameContext.theGame().<Integer>getProperty("intermissionTestNumber");
259259
yield SCENE_ID_CUT_SCENE_N_2D.formatted(cutSceneNumber);
260260
}
261-
default -> GameUI.property3DEnabled.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
261+
default -> GameUI.PROPERTY_3D_ENABLED.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
262262
};
263263
return scenesByID.get(sceneID);
264264
}

pacman-app-tengen-mspacman/src/main/java/de/amr/pacmanfx/tengen/ms_pacman/TengenMsPacMan_UIConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public TengenMsPacMan_SpriteSheet spriteSheet() {
305305
@Override
306306
public TengenMsPacMan_GameRenderer createGameRenderer(Canvas canvas) {
307307
var renderer = new TengenMsPacMan_GameRenderer(ui.theAssets(), spriteSheet(), mapRepository, canvas);
308-
renderer.backgroundColorProperty().bind(GameUI.propertyCanvasBackgroundColor);
308+
renderer.backgroundColorProperty().bind(GameUI.PROPERTY_CANVAS_BACKGROUND_COLOR);
309309
return renderer;
310310
}
311311

@@ -426,7 +426,7 @@ public GameScene selectGameScene(GameContext gameContext) {
426426
int cutSceneNumber = gameContext.theGame().<Integer>getProperty("intermissionTestNumber");
427427
yield SCENE_ID_CUT_SCENE_N_2D.formatted(cutSceneNumber);
428428
}
429-
default -> GameUI.property3DEnabled.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
429+
default -> GameUI.PROPERTY_3D_ENABLED.get() ? SCENE_ID_PLAY_SCENE_3D : SCENE_ID_PLAY_SCENE_2D;
430430
};
431431
return scenesByID.get(sceneID);
432432
}

pacman-app-tengen-mspacman/src/main/java/de/amr/pacmanfx/tengen/ms_pacman/scenes/TengenMsPacMan_GameLevel3D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private void addGameInfoView() {
3333
int scaling = 5; // for better snapshot resolution
3434

3535
var canvas = new Canvas(scaling * width, scaling * height);
36-
fillCanvas(canvas, GameUI.property3DFloorColor.get());
36+
fillCanvas(canvas, GameUI.PROPERTY_3D_FLOOR_COLOR.get());
3737

3838
var renderer = (TengenMsPacMan_GameRenderer) ui.theConfiguration().createGameRenderer(canvas);
3939
renderer.ctx().setImageSmoothing(false); // important for sharp image!

pacman-app-tengen-mspacman/src/main/java/de/amr/pacmanfx/tengen/ms_pacman/scenes/TengenMsPacMan_PlayScene2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public List<MenuItem> supplyContextMenuItems(ContextMenuEvent menuEvent, Context
212212
miImmunity.selectedProperty().bindBidirectional(theGameContext().theGameController().propertyImmunity());
213213

214214
var miMuted = new CheckMenuItem(ui.theAssets().text("muted"));
215-
miMuted.selectedProperty().bindBidirectional(GameUI.propertyMuted);
215+
miMuted.selectedProperty().bindBidirectional(GameUI.PROPERTY_MUTED);
216216

217217
var miQuit = new MenuItem(ui.theAssets().text("quit"));
218218
miQuit.setOnAction(e -> ACTION_QUIT_GAME_SCENE.executeIfEnabled(ui));

pacman-ui/src/main/java/de/amr/pacmanfx/ui/GameUI.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ public interface GameUI {
3737

3838
static GameUI theUI() { return PacManGames_UI_Impl.THE_ONE; }
3939

40-
ObjectProperty<Color> propertyCanvasBackgroundColor = new SimpleObjectProperty<>(Color.BLACK);
41-
BooleanProperty propertyCanvasFontSmoothing = new SimpleBooleanProperty(false);
42-
ObjectProperty<GameScene> propertyCurrentGameScene = new SimpleObjectProperty<>();
43-
ObjectProperty<PacManGames_View> propertyCurrentView = new SimpleObjectProperty<>();
44-
BooleanProperty propertyCanvasImageSmoothing = new SimpleBooleanProperty(false);
45-
BooleanProperty propertyDebugInfoVisible = new SimpleBooleanProperty(false);
46-
IntegerProperty propertyMiniViewHeight = new SimpleIntegerProperty(400);
47-
BooleanProperty propertyMiniViewOn = new SimpleBooleanProperty(false);
48-
IntegerProperty propertyMiniViewOpacityPercent = new SimpleIntegerProperty(69);
49-
BooleanProperty propertyMuted = new SimpleBooleanProperty(false);
50-
IntegerProperty propertySimulationSteps = new SimpleIntegerProperty(1);
51-
BooleanProperty property3DAxesVisible = new SimpleBooleanProperty(false);
52-
ObjectProperty<DrawMode> property3DDrawMode = new SimpleObjectProperty<>(DrawMode.FILL);
53-
BooleanProperty property3DEnabled = new SimpleBooleanProperty(false);
54-
BooleanProperty property3DEnergizerExplodes = new SimpleBooleanProperty(true);
55-
ObjectProperty<Color> property3DFloorColor = new SimpleObjectProperty<>(Color.rgb(20,20,20));
56-
ObjectProperty<Color> property3DLightColor = new SimpleObjectProperty<>(Color.WHITE);
57-
ObjectProperty<PerspectiveID> property3DPerspective = new SimpleObjectProperty<>(PerspectiveID.TRACK_PLAYER);
58-
DoubleProperty property3DWallHeight = new SimpleDoubleProperty();
59-
DoubleProperty property3DWallOpacity = new SimpleDoubleProperty(1.0);
40+
ObjectProperty<Color> PROPERTY_CANVAS_BACKGROUND_COLOR = new SimpleObjectProperty<>(Color.BLACK);
41+
BooleanProperty PROPERTY_CANVAS_FONT_SMOOTHING = new SimpleBooleanProperty(false);
42+
ObjectProperty<GameScene> PROPERTY_CURRENT_GAME_SCENE = new SimpleObjectProperty<>();
43+
ObjectProperty<PacManGames_View> PROPERTY_CURRENT_VIEW = new SimpleObjectProperty<>();
44+
BooleanProperty PROPERTY_CANVAS_IMAGE_SMOOTHING = new SimpleBooleanProperty(false);
45+
BooleanProperty PROPERTY_DEBUG_INFO_VISIBLE = new SimpleBooleanProperty(false);
46+
IntegerProperty PROPERTY_MINI_VIEW_HEIGHT = new SimpleIntegerProperty(400);
47+
BooleanProperty PROPERTY_MINI_VIEW_ON = new SimpleBooleanProperty(false);
48+
IntegerProperty PROPERTY_MINI_VIEW_OPACITY_PERCENT = new SimpleIntegerProperty(69);
49+
BooleanProperty PROPERTY_MUTED = new SimpleBooleanProperty(false);
50+
IntegerProperty PROPERTY_SIMULATION_STEPS = new SimpleIntegerProperty(1);
51+
BooleanProperty PROPERTY_3D_AXES_VISIBLE = new SimpleBooleanProperty(false);
52+
ObjectProperty<DrawMode> PROPERTY_3D_DRAW_MODE = new SimpleObjectProperty<>(DrawMode.FILL);
53+
BooleanProperty PROPERTY_3D_ENABLED = new SimpleBooleanProperty(false);
54+
BooleanProperty PROPERTY_3D_ENERGIZER_EXPLODES = new SimpleBooleanProperty(true);
55+
ObjectProperty<Color> PROPERTY_3D_FLOOR_COLOR = new SimpleObjectProperty<>(Color.rgb(20,20,20));
56+
ObjectProperty<Color> PROPERTY_3D_LIGHT_COLOR = new SimpleObjectProperty<>(Color.WHITE);
57+
ObjectProperty<PerspectiveID> PROPERTY_3D_PERSPECTIVE = new SimpleObjectProperty<>(PerspectiveID.TRACK_PLAYER);
58+
DoubleProperty PROPERTY_3D_WALL_HEIGHT = new SimpleDoubleProperty();
59+
DoubleProperty PROPERTY_3D_WALL_OPACITY = new SimpleDoubleProperty(1.0);
6060

6161
List<ActionBinding> DEFAULT_ACTION_BINDINGS = List.of(
6262
new ActionBinding(ACTION_ARCADE_INSERT_COIN, nude(KeyCode.DIGIT5), nude(KeyCode.NUMPAD5)),

0 commit comments

Comments
 (0)