From 7314852f7f418177abcfd9e343a30a0d8b28e3f1 Mon Sep 17 00:00:00 2001 From: Kevin Fischer Date: Thu, 25 Apr 2024 21:56:26 +0200 Subject: [PATCH] Implement changed button logic --- src/phaser/components/ui/range-slider.ts | 3 +-- src/phaser/scenes/minigame/clicker-race-scene.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/phaser/components/ui/range-slider.ts b/src/phaser/components/ui/range-slider.ts index e9c5a18..aaa08cb 100644 --- a/src/phaser/components/ui/range-slider.ts +++ b/src/phaser/components/ui/range-slider.ts @@ -1,5 +1,4 @@ -import {COLOR_CONTRAST, COLOR_PRIMARY} from "@/style.ts"; -import {FONT_STYLE_BUTTON} from "@/phaser/components/ui/button.ts"; +import {COLOR_CONTRAST, COLOR_PRIMARY, FONT_STYLE_BUTTON} from "@/style.ts"; export class AzNopolySlider extends Phaser.GameObjects.Container { diff --git a/src/phaser/scenes/minigame/clicker-race-scene.ts b/src/phaser/scenes/minigame/clicker-race-scene.ts index 46b8085..7bebde3 100644 --- a/src/phaser/scenes/minigame/clicker-race-scene.ts +++ b/src/phaser/scenes/minigame/clicker-race-scene.ts @@ -109,12 +109,12 @@ export default class ClickerRaceScene extends MinigameScene { + this.button = new AzNopolyButton(this, "Race", actionPanel.x + (FRAME_PADDING * 3), actionPanel.y + FRAME_PADDING, actionPanel.width - (FRAME_PADDING * 6)); + this.slider = new AzNopolySlider(this, actionPanel.x + (FRAME_PADDING * 3), actionPanel.y + FRAME_PADDING, actionPanel.width - (FRAME_PADDING * 6), 50, 100, this.onSlider.bind(this)) + this.button.setOnClick(() => { this.controller.onPlayerClick(this.aznopoly.uuid); }); - this.slider = new AzNopolySlider(this, actionPanel.x + (FRAME_PADDING * 3), actionPanel.y + FRAME_PADDING, actionPanel.width - (FRAME_PADDING * 6), 50, 100, this.onSlider.bind(this)) - this.add.existing(this.slider); this.add.existing(this.button);