Skip to content

Commit ed38503

Browse files
authored
Merge pull request #6 from ut-code/kf76-hack-shooter-offline
[feat] hack-shooterを選択した時、実地でない場合はgithubのリリースを表示するように。
2 parents fcc28a8 + 8384af3 commit ed38503

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/exhibitions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const exhibitions: Exhibition[] = [
9696
},
9797
{
9898
// disabled: true,
99-
offline_only: true,
99+
offline_only: false,
100100
title: "Hack-shooter",
101101
image: {
102102
src: "img/Hackshooter_theme.png",
@@ -105,6 +105,7 @@ export const exhibitions: Exhibition[] = [
105105
description: `
106106
シューティングゲームの裏側をプログラミングすることによって、より簡単に、よりスマートにゲームを攻略しよう!
107107
`,
108+
url: "https://github.com/ut-code/HackShooter/releases/tag/v1.2",
108109
dialog: "タスクバーにあるペンギンのアイコンをクリックしてください。",
109110
isNew: true,
110111
target: "小学生以上におすすめ",

src/pages/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export default function Home(): JSX.Element {
6868
onClick={async () => {
6969
console.log(`clicked ${ex.title}`);
7070
const url = ex.url;
71-
if (url) {
71+
const dialog = ex.dialog;
72+
if (is_offline && dialog) {
73+
alert(dialog);
74+
} else if (url) {
7275
window.open(url, "_blank").focus();
7376
// CORS の関係でエラーが出るが、特に問題ないので放置。
7477
try {
@@ -81,11 +84,6 @@ export default function Home(): JSX.Element {
8184
}),
8285
});
8386
} catch (err) {}
84-
} else {
85-
const dialog = ex.dialog;
86-
if (dialog) {
87-
alert(dialog);
88-
}
8987
}
9088
}}
9189
rel="noreferrer"

0 commit comments

Comments
 (0)