feat: polish camp and progression interactions
This commit is contained in:
@@ -80,6 +80,7 @@ export class StoryScene extends Phaser.Scene {
|
||||
private portraitDivider?: Phaser.GameObjects.Rectangle;
|
||||
private nameText?: Phaser.GameObjects.Text;
|
||||
private bodyText?: Phaser.GameObjects.Text;
|
||||
private progressBackground?: Phaser.GameObjects.Rectangle;
|
||||
private progressText?: Phaser.GameObjects.Text;
|
||||
private loadingText?: Phaser.GameObjects.Text;
|
||||
private cutsceneLayer?: Phaser.GameObjects.Container;
|
||||
@@ -98,6 +99,9 @@ export class StoryScene extends Phaser.Scene {
|
||||
|
||||
getDebugState() {
|
||||
const page = this.pages[this.pageIndex];
|
||||
const progressBounds = this.progressText?.active ? this.progressText.getBounds() : undefined;
|
||||
const progressPanelBounds = this.progressBackground?.active ? this.progressBackground.getBounds() : undefined;
|
||||
const isLastPage = this.pageIndex >= this.pages.length - 1;
|
||||
|
||||
return {
|
||||
scene: this.scene.key,
|
||||
@@ -111,6 +115,15 @@ export class StoryScene extends Phaser.Scene {
|
||||
activeTexture: this.background?.texture.key ?? null,
|
||||
portraitKey: page ? this.pagePortraitKey(page) ?? null : null,
|
||||
portraitTextureKey: this.portrait?.visible ? this.portrait.texture.key : null,
|
||||
progressLabel: this.progressText?.text ?? '',
|
||||
progressBounds: progressBounds
|
||||
? { x: progressBounds.x, y: progressBounds.y, width: progressBounds.width, height: progressBounds.height }
|
||||
: null,
|
||||
progressPanelBounds: progressPanelBounds
|
||||
? { x: progressPanelBounds.x, y: progressPanelBounds.y, width: progressPanelBounds.width, height: progressPanelBounds.height }
|
||||
: null,
|
||||
isLastPage,
|
||||
advanceHint: isLastPage ? 'continue' : 'next',
|
||||
cutsceneKind: page?.cutscene?.kind ?? null,
|
||||
cutsceneActors: page?.cutscene?.actors?.map((actor) => actor.unitId) ?? []
|
||||
};
|
||||
@@ -299,11 +312,21 @@ export class StoryScene extends Phaser.Scene {
|
||||
});
|
||||
this.bodyText.setDepth(dialogDepth + 2);
|
||||
|
||||
this.progressText = this.add.text(width - ui(220), panelY + panelH + ui(20), '', {
|
||||
fontFamily: '"Segoe UI", sans-serif',
|
||||
fontSize: uiPx(15),
|
||||
color: '#9aa3ad'
|
||||
const progressX = width - ui(174);
|
||||
const progressY = panelY + panelH + ui(20);
|
||||
this.progressBackground = this.add.rectangle(progressX, progressY, ui(300), ui(34), cutsceneUiColors.ink, 0.82);
|
||||
this.progressBackground.setStrokeStyle(ui(1), palette.gold, 0.42);
|
||||
this.progressBackground.setDepth(dialogDepth + 1);
|
||||
|
||||
this.progressText = this.add.text(progressX, progressY, '', {
|
||||
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
||||
fontSize: uiPx(14),
|
||||
color: '#d8b15f',
|
||||
fontStyle: '700',
|
||||
align: 'center',
|
||||
fixedWidth: ui(276)
|
||||
});
|
||||
this.progressText.setOrigin(0.5);
|
||||
this.progressText.setDepth(dialogDepth + 2);
|
||||
}
|
||||
|
||||
@@ -379,7 +402,10 @@ export class StoryScene extends Phaser.Scene {
|
||||
|
||||
this.nameText?.setText(page.speaker ?? '나레이션');
|
||||
this.bodyText?.setText(page.text);
|
||||
this.progressText?.setText(`${this.pageIndex + 1} / ${this.pages.length} SPACE / ENTER`);
|
||||
const isLastPage = this.pageIndex >= this.pages.length - 1;
|
||||
this.progressText?.setText(
|
||||
`${this.pageIndex + 1} / ${this.pages.length} · 클릭 / 스페이스·엔터 · ${isLastPage ? '계속' : '다음'}`
|
||||
);
|
||||
}
|
||||
|
||||
private pagePortraitKey(page: StoryPage) {
|
||||
@@ -1065,6 +1091,7 @@ export class StoryScene extends Phaser.Scene {
|
||||
this.portraitDivider,
|
||||
this.nameText,
|
||||
this.bodyText,
|
||||
this.progressBackground,
|
||||
this.progressText,
|
||||
this.cutsceneLayer
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user