Show save slot metadata on title
This commit is contained in:
@@ -205,7 +205,7 @@ export class TitleScene extends Phaser.Scene {
|
|||||||
const canContinue = hasCampaignSave();
|
const canContinue = hasCampaignSave();
|
||||||
const campaign = canContinue ? loadCampaignState() : undefined;
|
const campaign = canContinue ? loadCampaignState() : undefined;
|
||||||
const isEndingComplete = campaign?.step === 'ending-complete';
|
const isEndingComplete = campaign?.step === 'ending-complete';
|
||||||
const plateHeight = campaign ? 324 : 252;
|
const plateHeight = campaign ? 348 : 252;
|
||||||
|
|
||||||
const plate = this.add.rectangle(menuX, menuY, 250, plateHeight, 0x111821, 0.66);
|
const plate = this.add.rectangle(menuX, menuY, 250, plateHeight, 0x111821, 0.66);
|
||||||
plate.setStrokeStyle(1, palette.gold, 0.45);
|
plate.setStrokeStyle(1, palette.gold, 0.45);
|
||||||
@@ -228,30 +228,39 @@ export class TitleScene extends Phaser.Scene {
|
|||||||
isEndingComplete: boolean
|
isEndingComplete: boolean
|
||||||
) {
|
) {
|
||||||
const badge = this.add.container(x, y);
|
const badge = this.add.container(x, y);
|
||||||
const background = this.add.rectangle(0, 0, 210, 58, 0x21180f, 0.92);
|
const background = this.add.rectangle(0, 0, 216, 78, 0x21180f, 0.92);
|
||||||
background.setStrokeStyle(1, palette.gold, 0.52);
|
background.setStrokeStyle(1, palette.gold, 0.52);
|
||||||
|
|
||||||
const title = this.add.text(0, -14, isEndingComplete ? '완결 저장' : '진행 저장', {
|
const title = this.add.text(0, -24, isEndingComplete ? '완결 저장' : '진행 저장', {
|
||||||
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
||||||
fontSize: '18px',
|
fontSize: '18px',
|
||||||
color: '#f6e6bd',
|
color: '#f6e6bd',
|
||||||
fontStyle: '700',
|
fontStyle: '700',
|
||||||
fixedWidth: 190,
|
fixedWidth: 198,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
padding: { top: 3, bottom: 3 }
|
padding: { top: 3, bottom: 3 }
|
||||||
});
|
});
|
||||||
title.setOrigin(0.5);
|
title.setOrigin(0.5);
|
||||||
|
|
||||||
const detail = this.add.text(0, 14, this.campaignSaveDetail(campaign, isEndingComplete), {
|
const detail = this.add.text(0, 0, this.campaignSaveDetail(campaign, isEndingComplete), {
|
||||||
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
color: '#d8b15f',
|
color: '#d8b15f',
|
||||||
fixedWidth: 190,
|
fixedWidth: 198,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
});
|
});
|
||||||
detail.setOrigin(0.5);
|
detail.setOrigin(0.5);
|
||||||
|
|
||||||
badge.add([background, title, detail]);
|
const meta = this.add.text(0, 24, this.campaignSaveMeta(campaign), {
|
||||||
|
fontFamily: '"Malgun Gothic", "Noto Sans KR", sans-serif',
|
||||||
|
fontSize: '12px',
|
||||||
|
color: '#9fb0bf',
|
||||||
|
fixedWidth: 198,
|
||||||
|
align: 'center'
|
||||||
|
});
|
||||||
|
meta.setOrigin(0.5);
|
||||||
|
|
||||||
|
badge.add([background, title, detail, meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private campaignSaveDetail(campaign: ReturnType<typeof loadCampaignState>, isEndingComplete: boolean) {
|
private campaignSaveDetail(campaign: ReturnType<typeof loadCampaignState>, isEndingComplete: boolean) {
|
||||||
@@ -284,6 +293,23 @@ export class TitleScene extends Phaser.Scene {
|
|||||||
return label.length > 19 ? `${label.slice(0, 18)}...` : label;
|
return label.length > 19 ? `${label.slice(0, 18)}...` : label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private campaignSaveMeta(campaign: ReturnType<typeof loadCampaignState>) {
|
||||||
|
return `슬롯 ${campaign.activeSaveSlot} · ${this.formatSaveUpdatedAt(campaign.updatedAt)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private formatSaveUpdatedAt(updatedAt: string) {
|
||||||
|
const date = new Date(updatedAt);
|
||||||
|
if (Number.isNaN(date.getTime())) {
|
||||||
|
return '저장 시각 미상';
|
||||||
|
}
|
||||||
|
|
||||||
|
const month = date.getMonth() + 1;
|
||||||
|
const day = date.getDate();
|
||||||
|
const hour = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minute = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
return `${month}/${day} ${hour}:${minute}`;
|
||||||
|
}
|
||||||
|
|
||||||
private createMenuButton(
|
private createMenuButton(
|
||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
|
|||||||
Reference in New Issue
Block a user