Skip to content

Commit

Permalink
v1.12 UI optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamToki committed Nov 29, 2024
1 parent 24d5758 commit 455ef18
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 40 deletions.
23 changes: 12 additions & 11 deletions PROJECT/Yamanobo-Ryou/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="icon" type="image/png" href="images/Favicon.png" />
<title>山田凉上山</title>
<meta name="author" content="SAM TOKI STUDIO" />
<meta name="version" content="v1.11 (2024/11/28). Since 2024/10/13." />
<meta name="version" content="v1.12 (2024/11/29). Since 2024/10/13." />
<meta name="description" content="「孤独摇滚!」同人打字训练游戏。屑凉被讨债的波奇酱追上山,开始无尽的逃亡。" />
<meta name="keywords" content="Sam Toki, SAM TOKI STUDIO, 山田凉上山, Yamanobo-Ryou, 山登リョウ, 孤独摇滚, Bocchi the Rock, 打字训练, 打字游戏, Typing game" />
<meta name="copyright" content="(C) 2024 SAM TOKI STUDIO" />
Expand Down Expand Up @@ -892,6 +892,16 @@ <h1 class="SectionTitle">设定</h1>
<fieldset id="Fieldset_SettingsDifficulty">
<legend>难度</legend>
<ul class="CtrlGroup">
<li class="Ctrl">
<label for="Combobox_SettingsChaserSpeedPreset">
<span>预设:</span>
<select class="Combobox" id="Combobox_SettingsChaserSpeedPreset" onchange="SetChaserSpeedPreset()">
<option value="Western" selected>西文</option>
<option value="CJK">中日韩</option>
<option value="ZenMode">禅境模式</option>
</select>
</label>
</li>
<li class="Ctrl">
<label for="Textbox_SettingsChaserSpeedInitial">
<span>追逐者速度:从</span>
Expand All @@ -901,15 +911,6 @@ <h1 class="SectionTitle">设定</h1>
<span>字符/分钟</span>
</label>
</li>
<li class="Ctrl WidthDividedBy3">
<button class="Button Active" id="Button_SettingsChaserSpeedWestern" onclick="SetChaserSpeedWestern()">西文</button>
</li>
<li class="Ctrl WidthDividedBy3">
<button class="Button" id="Button_SettingsChaserSpeedCJK" onclick="SetChaserSpeedCJK()">中日韩</button>
</li>
<li class="Ctrl WidthDividedBy3">
<button class="Button" id="Button_SettingsChaserSpeedZenMode" onclick="SetChaserSpeedZenMode()">禅境模式</button>
</li>
<li class="Ctrl">
<label for="Textbox_SettingsMaxSeparation">
<span>最大间距:</span>
Expand Down Expand Up @@ -1179,7 +1180,7 @@ <h4>图标</h4>
<legend>关于</legend>
<p>山田凉上山</p>
<p>by SAM TOKI STUDIO</p>
<p>版本 v1.11 (<time datetime="2024-11-28" pubdate="pubdate">2024/11/28</time>)<br />
<p>版本 v1.12 (<time datetime="2024-11-29" pubdate="pubdate">2024/11/29</time>)<br />
始于 2024/10/13</p>
<p class="GreenText Hidden" id="Label_HelpPWANewVersionReady">新版本已就绪,将在下次启动时生效。</p>
<ul class="CtrlGroup BelowParagraph">
Expand Down
2 changes: 1 addition & 1 deletion PROJECT/Yamanobo-Ryou/script_ServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Declare variables
"use strict";
// Unsaved
const CacheName = "Yamanobo-Ryou_v1.11";
const CacheName = "Yamanobo-Ryou_v1.12";

// Listeners
// Service worker (https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/#step-5---add-a-service-worker)
Expand Down
63 changes: 35 additions & 28 deletions PROJECT/Yamanobo-Ryou/scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Declare variables
"use strict";
// Unsaved
const CurrentVersion = 1.11;
const CurrentVersion = 1.12;
var Game0 = {
Terrain: {
WalkedWidth: 0,
Expand Down Expand Up @@ -936,20 +936,22 @@
ChangeValue("Textbox_SettingsAltitude", Game.Progressing.Altitude);

// Difficulty
switch(true) {
case Game.Difficulty.ChaserSpeed.Initial == 180 && Game.Difficulty.ChaserSpeed.Final == 240:
ChangeValue("Combobox_SettingsChaserSpeedPreset", "Western");
break;
case Game.Difficulty.ChaserSpeed.Initial == 40 && Game.Difficulty.ChaserSpeed.Final == 60:
ChangeValue("Combobox_SettingsChaserSpeedPreset", "CJK");
break;
case Game.Difficulty.ChaserSpeed.Initial == 10 && Game.Difficulty.ChaserSpeed.Final == 10:
ChangeValue("Combobox_SettingsChaserSpeedPreset", "ZenMode");
break;
default:
ChangeValue("Combobox_SettingsChaserSpeedPreset", "");
break;
}
ChangeValue("Textbox_SettingsChaserSpeedInitial", Game.Difficulty.ChaserSpeed.Initial);
ChangeValue("Textbox_SettingsChaserSpeedFinal", Game.Difficulty.ChaserSpeed.Final);
RemoveClass("Button_SettingsChaserSpeedWestern", "Active");
RemoveClass("Button_SettingsChaserSpeedCJK", "Active");
RemoveClass("Button_SettingsChaserSpeedZenMode", "Active");
if(Game.Difficulty.ChaserSpeed.Initial == 180 && Game.Difficulty.ChaserSpeed.Final == 240) {
AddClass("Button_SettingsChaserSpeedWestern", "Active");
}
if(Game.Difficulty.ChaserSpeed.Initial == 40 && Game.Difficulty.ChaserSpeed.Final == 60) {
AddClass("Button_SettingsChaserSpeedCJK", "Active");
}
if(Game.Difficulty.ChaserSpeed.Initial == 10 && Game.Difficulty.ChaserSpeed.Final == 10) {
AddClass("Button_SettingsChaserSpeedZenMode", "Active");
}
ChangeValue("Textbox_SettingsMaxSeparation", Game.Difficulty.MaxSeparation);

// Custom characters
Expand Down Expand Up @@ -1377,6 +1379,26 @@
}

// Difficulty
function SetChaserSpeedPreset() {
switch(ReadValue("Combobox_SettingsChaserSpeedPreset")) {
case "Western":
Game.Difficulty.ChaserSpeed.Initial = 180;
Game.Difficulty.ChaserSpeed.Final = 240;
break;
case "CJK":
Game.Difficulty.ChaserSpeed.Initial = 40;
Game.Difficulty.ChaserSpeed.Final = 60;
break;
case "ZenMode":
Game.Difficulty.ChaserSpeed.Initial = 10;
Game.Difficulty.ChaserSpeed.Final = 10;
break;
default:
AlertSystemError("The value of ReadValue(\"Combobox_SettingsChaserSpeedPreset\") \"" + ReadValue("Combobox_SettingsChaserSpeedPreset") + "\" in function SetChaserSpeedPreset is invalid.");
break;
}
RefreshGame();
}
function SetChaserSpeedInitial() {
Game.Difficulty.ChaserSpeed.Initial = parseInt(Number(ReadValue("Textbox_SettingsChaserSpeedInitial")));
if(Game.Difficulty.ChaserSpeed.Initial < 10) {
Expand Down Expand Up @@ -1409,21 +1431,6 @@
}
RefreshGame();
}
function SetChaserSpeedWestern() {
Game.Difficulty.ChaserSpeed.Initial = 180;
Game.Difficulty.ChaserSpeed.Final = 240;
RefreshGame();
}
function SetChaserSpeedCJK() {
Game.Difficulty.ChaserSpeed.Initial = 40;
Game.Difficulty.ChaserSpeed.Final = 60;
RefreshGame();
}
function SetChaserSpeedZenMode() {
Game.Difficulty.ChaserSpeed.Initial = 10;
Game.Difficulty.ChaserSpeed.Final = 10;
RefreshGame();
}
function SetMaxSeparation() {
Game.Difficulty.MaxSeparation = parseInt(Number(ReadValue("Textbox_SettingsMaxSeparation")));
if(Game.Difficulty.MaxSeparation < 10) {
Expand Down

0 comments on commit 455ef18

Please sign in to comment.