From a50f7a7e9bc285ab282c22183fb805392eff1853 Mon Sep 17 00:00:00 2001
From: Piotr 'pwh' Hanusiak
Date: Mon, 25 Apr 2022 14:36:05 +0200
Subject: [PATCH] addressed some of the requests
---
.../Components/CustomizeWoka/CustomWokaPreviewer.ts | 3 +--
front/src/Phaser/Components/Ui/IconButton.ts | 3 ++-
front/src/Phaser/Login/CustomizeScene.ts | 9 +++++----
front/src/Phaser/Login/SelectCharacterScene.ts | 2 ++
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/front/src/Phaser/Components/CustomizeWoka/CustomWokaPreviewer.ts b/front/src/Phaser/Components/CustomizeWoka/CustomWokaPreviewer.ts
index 98836960..1aa3aeb8 100644
--- a/front/src/Phaser/Components/CustomizeWoka/CustomWokaPreviewer.ts
+++ b/front/src/Phaser/Components/CustomizeWoka/CustomWokaPreviewer.ts
@@ -62,8 +62,7 @@ export class CustomWokaPreviewer extends Phaser.GameObjects.Container {
this.turnIcon = this.scene.add
.image(this.background.displayWidth * 0.35, this.background.displayHeight * 0.35, "iconTurn")
.setScale(0.25)
- .setTintFill(0xffffff)
- .setAlpha(0.5);
+ .setAlpha(0.75);
this.drawFrame();
this.setSize(this.SIZE, this.SIZE);
diff --git a/front/src/Phaser/Components/Ui/IconButton.ts b/front/src/Phaser/Components/Ui/IconButton.ts
index 2fdc9cfd..61fa7ca5 100644
--- a/front/src/Phaser/Components/Ui/IconButton.ts
+++ b/front/src/Phaser/Components/Ui/IconButton.ts
@@ -6,6 +6,7 @@ export interface IconButtonConfig {
hover: IconButtonAppearanceConfig;
pressed: IconButtonAppearanceConfig;
selected: IconButtonAppearanceConfig;
+ iconScale?: number;
}
export interface IconButtonAppearanceConfig {
@@ -34,7 +35,7 @@ export class IconButton extends Phaser.GameObjects.Container {
this.config = config;
this.background = this.scene.add.graphics();
- this.icon = this.scene.add.image(0, 0, this.config.iconTextureKey);
+ this.icon = this.scene.add.image(0, 0, this.config.iconTextureKey).setScale(config.iconScale ?? 1);
this.drawBackground(this.config.idle);
this.add([this.background, this.icon]);
diff --git a/front/src/Phaser/Login/CustomizeScene.ts b/front/src/Phaser/Login/CustomizeScene.ts
index 201c4db8..1fd4aae5 100644
--- a/front/src/Phaser/Login/CustomizeScene.ts
+++ b/front/src/Phaser/Login/CustomizeScene.ts
@@ -213,15 +213,16 @@ export class CustomizeScene extends AbstractCharacterScene {
),
[CustomWokaBodyPart.Body]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconBody")),
[CustomWokaBodyPart.Clothes]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconClothes")),
- [CustomWokaBodyPart.Eyes]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconEyes")),
+ [CustomWokaBodyPart.Eyes]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconEyes", 0.7)),
[CustomWokaBodyPart.Hair]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconHair")),
[CustomWokaBodyPart.Hat]: new IconButton(this, 0, 0, this.getDefaultIconButtonConfig("iconHat")),
};
}
- private getDefaultIconButtonConfig(iconTextureKey: string): IconButtonConfig {
+ private getDefaultIconButtonConfig(iconTextureKey: string, iconScale?: number): IconButtonConfig {
return {
iconTextureKey,
+ iconScale,
width: 25,
height: 25,
idle: {
@@ -420,7 +421,7 @@ export class CustomizeScene extends AbstractCharacterScene {
private handleRandomizeButtonOnResize(): void {
const x =
- this.customWokaPreviewer.x +
+ this.customWokaPreviewer.x -
(this.customWokaPreviewer.displayWidth - this.randomizeButton.displayWidth) * 0.5;
const y =
this.customWokaPreviewer.y +
@@ -431,7 +432,7 @@ export class CustomizeScene extends AbstractCharacterScene {
private handleFinishButtonOnResize(): void {
const x =
- this.customWokaPreviewer.x -
+ this.customWokaPreviewer.x +
(this.customWokaPreviewer.displayWidth - this.randomizeButton.displayWidth) * 0.5;
const y =
this.customWokaPreviewer.y +
diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts
index 30323463..4f1316b0 100644
--- a/front/src/Phaser/Login/SelectCharacterScene.ts
+++ b/front/src/Phaser/Login/SelectCharacterScene.ts
@@ -18,6 +18,7 @@ import { DraggableGrid } from "@home-based-studio/phaser3-utils";
import { WokaSlot } from "../Components/SelectWoka/WokaSlot";
import { DraggableGridEvent } from "@home-based-studio/phaser3-utils/lib/utils/gui/containers/grids/DraggableGrid";
import { wokaList } from "../../Messages/JsonMessages/PlayerTextures";
+import { myCameraVisibilityStore } from "../../Stores/MyCameraStoreVisibility";
//todo: put this constants in a dedicated file
export const SelectCharacterSceneName = "SelectCharacterScene";
@@ -133,6 +134,7 @@ export class SelectCharacterScene extends AbstractCharacterScene {
return;
}
this.selectedWoka = null;
+ myCameraVisibilityStore.set(false);
this.scene.sleep(SelectCharacterSceneName);
this.scene.run(CustomizeSceneName);
selectCharacterSceneVisibleStore.set(false);