start normally
This commit is contained in:
parent
dae8619a6b
commit
f446918e42
@ -10,6 +10,7 @@ export interface WokaBodyPartSlotConfig {
|
|||||||
offsetX: number;
|
offsetX: number;
|
||||||
offsetY: number;
|
offsetY: number;
|
||||||
bodyImageKey?: string;
|
bodyImageKey?: string;
|
||||||
|
categoryImageKey?: string;
|
||||||
imageKey?: string;
|
imageKey?: string;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
}
|
}
|
||||||
@ -20,6 +21,7 @@ export enum WokaBodyPartSlotEvent {
|
|||||||
|
|
||||||
export class WokaBodyPartSlot extends GridItem {
|
export class WokaBodyPartSlot extends GridItem {
|
||||||
private background: Phaser.GameObjects.Graphics;
|
private background: Phaser.GameObjects.Graphics;
|
||||||
|
private categoryImage?: Phaser.GameObjects.Image;
|
||||||
private bodyImage: Phaser.GameObjects.Image;
|
private bodyImage: Phaser.GameObjects.Image;
|
||||||
private image: Phaser.GameObjects.Image;
|
private image: Phaser.GameObjects.Image;
|
||||||
|
|
||||||
@ -40,6 +42,15 @@ export class WokaBodyPartSlot extends GridItem {
|
|||||||
|
|
||||||
this.background = this.scene.add.graphics();
|
this.background = this.scene.add.graphics();
|
||||||
this.drawBackground();
|
this.drawBackground();
|
||||||
|
this.add(this.background);
|
||||||
|
|
||||||
|
if (this.config.categoryImageKey) {
|
||||||
|
this.categoryImage = this.scene.add
|
||||||
|
.image(this.SIZE / 2 - 1, -this.SIZE / 2 + 1, this.config.categoryImageKey)
|
||||||
|
.setDisplaySize(16, 16)
|
||||||
|
.setOrigin(1, 0);
|
||||||
|
this.add(this.categoryImage);
|
||||||
|
}
|
||||||
|
|
||||||
this.bodyImage = this.scene.add
|
this.bodyImage = this.scene.add
|
||||||
.image(offsetX, offsetY, config.bodyImageKey ?? "")
|
.image(offsetX, offsetY, config.bodyImageKey ?? "")
|
||||||
@ -51,7 +62,7 @@ export class WokaBodyPartSlot extends GridItem {
|
|||||||
|
|
||||||
this.setSize(this.SIZE, this.SIZE);
|
this.setSize(this.SIZE, this.SIZE);
|
||||||
|
|
||||||
this.add([this.background, this.bodyImage, this.image]);
|
this.add([this.bodyImage, this.image]);
|
||||||
|
|
||||||
this.setInteractive({ cursor: "pointer" });
|
this.setInteractive({ cursor: "pointer" });
|
||||||
this.scene.input.setDraggable(this);
|
this.scene.input.setDraggable(this);
|
||||||
|
@ -137,12 +137,30 @@ export class CustomizeScene extends AbstractCharacterScene {
|
|||||||
this.bodyPartsDraggableGridForeground = this.add.graphics();
|
this.bodyPartsDraggableGridForeground = this.add.graphics();
|
||||||
|
|
||||||
this.bodyPartsSlots = {
|
this.bodyPartsSlots = {
|
||||||
[CustomWokaBodyPart.Hair]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
[CustomWokaBodyPart.Hair]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
[CustomWokaBodyPart.Body]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
[CustomWokaBodyPart.Accessory]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
categoryImageKey: "iconTalk",
|
||||||
[CustomWokaBodyPart.Hat]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
}),
|
||||||
[CustomWokaBodyPart.Clothes]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
[CustomWokaBodyPart.Body]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
[CustomWokaBodyPart.Eyes]: new WokaBodyPartSlot(this, 0, 0, this.getDefaultWokaBodyPartSlotConfig()),
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
|
categoryImageKey: "iconTalk",
|
||||||
|
}),
|
||||||
|
[CustomWokaBodyPart.Accessory]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
|
categoryImageKey: "iconTalk",
|
||||||
|
}),
|
||||||
|
[CustomWokaBodyPart.Hat]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
|
categoryImageKey: "iconTalk",
|
||||||
|
}),
|
||||||
|
[CustomWokaBodyPart.Clothes]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
|
categoryImageKey: "iconTalk",
|
||||||
|
}),
|
||||||
|
[CustomWokaBodyPart.Eyes]: new WokaBodyPartSlot(this, 0, 0, {
|
||||||
|
...this.getDefaultWokaBodyPartSlotConfig(),
|
||||||
|
categoryImageKey: "iconTalk",
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.initializeRandomizeButton();
|
this.initializeRandomizeButton();
|
||||||
@ -257,7 +275,7 @@ export class CustomizeScene extends AbstractCharacterScene {
|
|||||||
borderColor: 0x006bb3,
|
borderColor: 0x006bb3,
|
||||||
},
|
},
|
||||||
hover: {
|
hover: {
|
||||||
color: 0x209cee,
|
color: 0x0987db,
|
||||||
textColor: "#ffffff",
|
textColor: "#ffffff",
|
||||||
borderThickness: 3,
|
borderThickness: 3,
|
||||||
borderColor: 0x006bb3,
|
borderColor: 0x006bb3,
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import { gameManager } from "../Game/GameManager";
|
import { gameManager } from "../Game/GameManager";
|
||||||
import { Scene } from "phaser";
|
import { Scene } from "phaser";
|
||||||
import { ErrorScene, ErrorSceneName } from "../Reconnecting/ErrorScene";
|
import { ErrorScene } from "../Reconnecting/ErrorScene";
|
||||||
import { WAError } from "../Reconnecting/WAError";
|
import { WAError } from "../Reconnecting/WAError";
|
||||||
import { waScaleManager } from "../Services/WaScaleManager";
|
import { waScaleManager } from "../Services/WaScaleManager";
|
||||||
import { ReconnectingTextures } from "../Reconnecting/ReconnectingScene";
|
import { ReconnectingTextures } from "../Reconnecting/ReconnectingScene";
|
||||||
import LL from "../../i18n/i18n-svelte";
|
import LL from "../../i18n/i18n-svelte";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
import { localeDetector } from "../../i18n/locales";
|
import { localeDetector } from "../../i18n/locales";
|
||||||
import { CustomizeSceneName } from "./CustomizeScene";
|
|
||||||
import { SelectCharacterSceneName } from "./SelectCharacterScene";
|
|
||||||
|
|
||||||
export const EntrySceneName = "EntryScene";
|
export const EntrySceneName = "EntryScene";
|
||||||
|
|
||||||
@ -46,9 +44,7 @@ export class EntryScene extends Scene {
|
|||||||
// Let's rescale before starting the game
|
// Let's rescale before starting the game
|
||||||
// We can do it at this stage.
|
// We can do it at this stage.
|
||||||
waScaleManager.applyNewSize();
|
waScaleManager.applyNewSize();
|
||||||
// this.scene.start(nextSceneName);
|
this.scene.start(nextSceneName);
|
||||||
this.scene.start(CustomizeSceneName);
|
|
||||||
// this.scene.start(SelectCharacterSceneName);
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
const $LL = get(LL);
|
const $LL = get(LL);
|
||||||
|
Loading…
Reference in New Issue
Block a user