Skip to content

Commit

Permalink
展示用モードを実装
Browse files Browse the repository at this point in the history
  • Loading branch information
3w36zj6 committed Feb 29, 2024
1 parent c63eb6a commit 51261c1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 23 deletions.
42 changes: 26 additions & 16 deletions src/scene/CreditScene.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isExhibitionMode } from "../lib/exhibitionMode"

export class CreditScene extends Phaser.Scene {
constructor() {
super("credit")
Expand Down Expand Up @@ -113,14 +115,18 @@ export class CreditScene extends Phaser.Scene {
.setScale(0.5)
.setDepth(1)
.setAlpha(0)
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
if (window.open("https://tus-ricora.com/", "_blank") == null) {
location.href = "https://tus-ricora.com/"
}
})

if (!isExhibitionMode()) {
link1
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
if (window.open("https://tus-ricora.com/", "_blank") == null) {
location.href = "https://tus-ricora.com/"
}
})
}

const linkLabel2 = this.add
.text(width / 2 - 260, height / 2 - 180 + 330, "View on GitHub", {
Expand All @@ -142,14 +148,18 @@ export class CreditScene extends Phaser.Scene {
.setScale(0.5)
.setDepth(1)
.setAlpha(0)
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
if (window.open("https://github.com/RICORA/ricora-beats/", "_blank") == null) {
location.href = "https://github.com/RICORA/ricora-beats/"
}
})

if (!isExhibitionMode()) {
link2
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
if (window.open("https://github.com/RICORA/ricora-beats/", "_blank") == null) {
location.href = "https://github.com/RICORA/ricora-beats/"
}
})
}

const closeLabel = this.add
.text(width / 2, height / 2 - 180 + 360 * 1.15, "閉じる", {
Expand Down
26 changes: 19 additions & 7 deletions src/scene/SelectScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { User } from "../class/User"

import { retryFetch } from "../lib/retryFetch"

import { isExhibitionMode } from "../lib/exhibitionMode"

type DIFFICULTY = 1 | 2 | 3 | 4
type KEY = 4 | 5 | 6 | 7

Expand Down Expand Up @@ -431,13 +433,21 @@ export class SelectScene extends Phaser.Scene {
.image(830 + 400 * 0.5, 640, "icon-ir")
.setOrigin(0.5, 0.5)
.setDepth(1)
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
this.sound.play("select")
this.scene.run("login")
})

if (isExhibitionMode()) {
this.loginIcon.setAlpha(0.5)
this.loginLabel.setAlpha(0.5)
} else {
this.loginIcon
.setInteractive({
useHandCursor: true,
})
.on("pointerdown", () => {
this.sound.play("select")
this.scene.run("login")
})
}

this.add
.text(830 + 400 * 0.8, 680, "クレジット", {
fontFamily: "Noto Sans JP",
Expand All @@ -463,6 +473,7 @@ export class SelectScene extends Phaser.Scene {
.setOrigin(0, 0)
.setAlpha(0.5)
.setDepth(1)
.setVisible(!isExhibitionMode())
.setInteractive({
useHandCursor: true,
})
Expand All @@ -483,6 +494,7 @@ export class SelectScene extends Phaser.Scene {
.setOrigin(1, 0)
.setAlpha(0.5)
.setDepth(1)
.setVisible(!isExhibitionMode())
.setInteractive({
useHandCursor: true,
})
Expand Down

0 comments on commit 51261c1

Please sign in to comment.