Skip to content

Commit

Permalink
Merge pull request #335 from cwtickle/develop
Browse files Browse the repository at this point in the history
 [ver5.10.0] フリーズアロー許容フレーム数、タイトルバック・リトライキーの変更を譜面ヘッダーより制御する設定を追加
  • Loading branch information
cwtickle authored Jun 9, 2019
2 parents 0fbea31 + 6b90036 commit 2947c16
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions js/danoni_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* https://github.com/cwtickle/danoniplus
*/
const g_version = `Ver 5.9.0`;
const g_version = `Ver 5.10.0`;
const g_revisedDate = `2019/06/09`;
const g_alphaVersion = ``;

Expand Down Expand Up @@ -183,6 +183,10 @@ g_workObj.dividePos = [];
const C_FRM_AFTERFADE = 420;
const C_FRM_FRZATTEMPT = 5;

/** ショートカットキー */
const C_KEY_RETRY = 8;
const C_KEY_TITLEBACK = 46;

/** 判定系共通オブジェクト */
const g_judgObj = {
arrowJ: [2, 4, 6, 8, 8],
Expand Down Expand Up @@ -389,7 +393,7 @@ for (let j = 0; j < 255; j++) {
g_kCd[j] = ``;
}
g_kCd[0] = `×`;
g_kCd[8] = `BS`;
g_kCd[8] = `BackSpace`;
g_kCd[9] = `Tab`;
g_kCd[12] = `Clear`;
g_kCd[13] = `Enter`;
Expand Down Expand Up @@ -2481,6 +2485,14 @@ function headerConvert(_dosObj) {
g_speeds = [...Array((obj.maxSpeed - obj.minSpeed) * 4 + 1).keys()].map(i => obj.minSpeed + i / 4);


// プレイ中のショートカットキー
obj.keyRetry = setVal(_dosObj.keyRetry, C_KEY_RETRY, `number`);
obj.keyTitleBack = setVal(_dosObj.keyTitleBack, C_KEY_TITLEBACK, `number`);

// フリーズアローの許容フレーム数設定
obj.frzAttempt = setVal(_dosObj.frzAttempt, C_FRM_FRZATTEMPT, `number`);


// 譜面情報
if (_dosObj.difData !== undefined && _dosObj.difData !== ``) {
const difs = _dosObj.difData.split(`$`);
Expand Down Expand Up @@ -4194,8 +4206,14 @@ function keyConfigInit() {
g_keyObj.blank = g_keyObj.blank_def;
}

// ショートカットキーメッセージ
const scMsg = createDivLabel(`scMsg`, 0, g_sHeight - 45, g_sWidth, 20, 14, `#cccccc`,
`プレイ中ショートカット:「${g_kCd[g_headerObj.keyTitleBack]}」タイトルバック / 「${g_kCd[g_headerObj.keyRetry]}」リトライ`);
scMsg.style.align = C_ALIGN_CENTER;
divRoot.appendChild(scMsg);

// 別キーモード警告メッセージ
const kcMsg = createDivLabel(`kcMsg`, 0, g_sHeight - 35, g_sWidth, 20, 14, `#ffff99`,
const kcMsg = createDivLabel(`kcMsg`, 0, g_sHeight - 25, g_sWidth, 20, 14, `#ffff99`,
``);
kcMsg.style.align = C_ALIGN_CENTER;
divRoot.appendChild(kcMsg);
Expand Down Expand Up @@ -6283,13 +6301,13 @@ function MainInit() {
eval(`mainKeyDownAct${g_stateObj.autoPlay}`)(setKey);

// 曲中リトライ、タイトルバック
if (setKey === 8) {
if (setKey === g_headerObj.keyRetry) {
g_audio.pause();
clearTimeout(g_timeoutEvtId);
clearWindow();
musicAfterLoaded();

} else if (setKey === 46) {
} else if (setKey === g_headerObj.keyTitleBack) {
g_audio.pause();
clearTimeout(g_timeoutEvtId);
setTimeout(_ => {
Expand Down Expand Up @@ -6674,7 +6692,7 @@ function MainInit() {
if (!keyDownFlg && g_stateObj.autoPlay === C_FLG_OFF) {
frzRoot.setAttribute(`frzAttempt`, ++frzAttempt);

if (frzAttempt > C_FRM_FRZATTEMPT) {
if (frzAttempt > g_headerObj.frzAttempt) {

// フリーズアローを離したとき
if (frzRoot.getAttribute(`judgEndFlg`) === `false`) {
Expand Down

0 comments on commit 2947c16

Please sign in to comment.