danoniplus 28.0.1 → 28.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2022/08/21
7
+ * Revised : 2022/10/02
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 28.0.1`;
12
- const g_revisedDate = `2022/08/21`;
11
+ const g_version = `Ver 28.1.1`;
12
+ const g_revisedDate = `2022/10/02`;
13
13
  const g_alphaVersion = ``;
14
14
 
15
15
  // カスタム用バージョン (danoni_custom.js 等で指定可)
@@ -2402,6 +2402,11 @@ const preheaderConvert = _dosObj => {
2402
2402
  // 背景・マスクモーションのパス指定方法を他の設定に合わせる設定
2403
2403
  obj.syncBackPath = setBoolVal(_dosObj.syncBackPath ?? g_presetObj.syncBackPath);
2404
2404
 
2405
+ [`color`, `shuffle`].forEach(type => {
2406
+ const tmpName = Object.keys(g_keyObj).filter(val => val.startsWith(type) && val.endsWith(`_0`));
2407
+ tmpName.forEach(property => g_dfKeyObj[property] = structuredClone(g_keyObj[property]));
2408
+ });
2409
+
2405
2410
  return obj;
2406
2411
  };
2407
2412
 
@@ -2906,9 +2911,8 @@ const headerConvert = _dosObj => {
2906
2911
  g_stateObj[setting] = g_localStorage[setting]);
2907
2912
  if (g_localStorage.colorType !== undefined) {
2908
2913
  g_colorType = g_localStorage.colorType;
2909
- const typeNum = g_keycons.colorTypes.findIndex(value => value === g_colorType);
2910
2914
  if (obj.colorUse) {
2911
- g_stateObj.d_color = g_keycons.colorDefs[typeNum];
2915
+ g_stateObj.d_color = g_keycons.colorDefTypes.findIndex(val => val === g_colorType) !== -1 ? C_FLG_ON : C_FLG_OFF;
2912
2916
  }
2913
2917
  }
2914
2918
 
@@ -3001,6 +3005,30 @@ const headerConvert = _dosObj => {
3001
3005
  return obj;
3002
3006
  };
3003
3007
 
3008
+ /**
3009
+ * カラーセットの格納
3010
+ * @param {object} obj
3011
+ */
3012
+ const resetColorType = ({ _from = ``, _to = ``, _fromObj = g_headerObj, _toObj = g_headerObj } = {}) => {
3013
+ _toObj[`setColor${_to}`] = structuredClone(_fromObj[`setColor${_from}`]);
3014
+ _toObj[`setShadowColor${_to}`] = structuredClone(_fromObj[`setShadowColor${_from}`]);
3015
+ _toObj[`frzColor${_to}`] = structuredClone(_fromObj[`frzColor${_from}`]);
3016
+ _toObj[`frzShadowColor${_to}`] = structuredClone(_fromObj[`frzShadowColor${_from}`]);
3017
+ };
3018
+
3019
+ /**
3020
+ * 配列にデータを先頭に追加
3021
+ * @param {array} _arr
3022
+ * @param {string} _target
3023
+ * @returns
3024
+ */
3025
+ const addValtoArray = (_arr, _target) => {
3026
+ if (!_arr.includes(_target)) {
3027
+ _arr.unshift(_target);
3028
+ }
3029
+ return _arr;
3030
+ };
3031
+
3004
3032
  /**
3005
3033
  * 曲名(1行)の取得
3006
3034
  * @param {string} _musicName
@@ -4886,8 +4914,6 @@ const createOptionWindow = _sprite => {
4886
4914
 
4887
4915
  // ---------------------------------------------------
4888
4916
  // 1. キーコンフィグ設定 (KeyConfig)
4889
-
4890
-
4891
4917
  g_keyObj.currentKey = g_headerObj.keyLabels[g_stateObj.scoreId];
4892
4918
  const isNotSameKey = (g_keyObj.prevKey !== g_keyObj.currentKey);
4893
4919
 
@@ -4905,49 +4931,78 @@ const createOptionWindow = _sprite => {
4905
4931
  if ((g_canLoadDifInfoFlg && (isNotSameKey && g_stateObj.dataSaveFlg)) || _initFlg) {
4906
4932
 
4907
4933
  if (isNotSameKey && g_keyObj.prevKey !== `Dummy`) {
4908
- // キーパターン、シャッフルグループ初期化
4934
+ // キーパターン初期化
4909
4935
  g_keyObj.currentPtn = 0;
4910
- g_keycons.shuffleGroupNum = 0;
4911
4936
  }
4912
4937
  const hasKeyStorage = localStorage.getItem(`danonicw-${g_keyObj.currentKey}k`);
4938
+ let storageObj, addKey = ``;
4913
4939
 
4914
- if (g_stateObj.extraKeyFlg) {
4915
-
4916
- // 特殊キーの場合は作品毎のローカルストレージから取得
4917
- if (isNotSameKey) {
4918
- getKeyReverse(g_localStorage, g_keyObj.currentKey);
4919
-
4920
- // キーコンフィグ初期値設定
4921
- if (g_localStorage[`keyCtrlPtn${g_keyObj.currentKey}`] === undefined) {
4922
- g_localStorage[`keyCtrlPtn${g_keyObj.currentKey}`] = 0;
4923
- }
4924
- getKeyCtrl(g_localStorage, g_keyObj.currentKey);
4925
- }
4926
-
4927
- } else {
4940
+ if (!g_stateObj.extraKeyFlg) {
4928
4941
 
4929
4942
  // キー別のローカルストレージの初期設定 ※特殊キーは除く
4930
4943
  g_localKeyStorage = hasKeyStorage ? JSON.parse(hasKeyStorage) : {
4931
4944
  reverse: C_FLG_OFF,
4932
4945
  keyCtrl: [[]],
4933
4946
  keyCtrlPtn: 0,
4947
+ setColor: [],
4934
4948
  };
4949
+ storageObj = g_localKeyStorage;
4950
+
4951
+ } else {
4952
+ storageObj = g_localStorage;
4953
+ addKey = g_keyObj.currentKey;
4954
+ }
4955
+ if (isNotSameKey) {
4956
+ getKeyReverse(storageObj, addKey);
4957
+
4958
+ // キーコンフィグ初期値設定
4959
+ if (storageObj[`keyCtrlPtn${addKey}`] === undefined) {
4960
+ storageObj[`keyCtrlPtn${addKey}`] = 0;
4961
+ }
4962
+ getKeyCtrl(storageObj, addKey);
4935
4963
 
4936
- if (isNotSameKey) {
4937
- getKeyReverse(g_localKeyStorage);
4964
+ // カラーセット初期値設定
4965
+ if (storageObj[`setColor${addKey}`] === undefined) {
4966
+ storageObj[`setColor${addKey}`] = [];
4967
+ }
4968
+ if (storageObj[`setColor${addKey}`].length > 0) {
4969
+ g_keycons.colorTypes = addValtoArray(g_keycons.colorTypes, g_keycons.colorSelf);
4970
+ resetColorType({ _fromObj: storageObj, _from: addKey, _to: g_keycons.colorSelf });
4971
+ resetColorType({ _fromObj: storageObj, _from: addKey, _toObj: g_dfColorObj, _to: g_keycons.colorSelf });
4938
4972
 
4939
- // キーコンフィグ初期値設定
4940
- if (g_localKeyStorage.keyCtrlPtn === undefined) {
4941
- g_localKeyStorage.keyCtrlPtn = 0;
4973
+ } else {
4974
+ if (g_localStorage.colorType === g_keycons.colorSelf) {
4975
+ g_colorType = `Default`;
4942
4976
  }
4943
- getKeyCtrl(g_localKeyStorage);
4977
+ g_keycons.colorTypes = g_keycons.colorTypes.filter(val => val !== g_keycons.colorSelf);
4944
4978
  }
4945
4979
 
4980
+ const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
4981
+
4982
+ // カラーグループ、シャッフルグループの設定
4983
+ [`color`, `shuffle`].forEach(type => {
4984
+ let k = 1;
4985
+ g_keycons[`${type}Groups`] = [0];
4986
+ while (g_keyObj[`${type}${keyCtrlPtn}_${k}`] !== undefined) {
4987
+ g_keycons[`${type}Groups`].push(k);
4988
+ k++;
4989
+ }
4990
+
4991
+ if (g_keyObj.currentPtn === -1) {
4992
+ if (storageObj[`${type}${g_keyObj.currentKey}_-1_-1`] !== undefined) {
4993
+ resetGroupList(type);
4994
+ g_keyObj[`${type}${g_keyObj.currentKey}_-1`] = structuredClone(storageObj[`${type}${g_keyObj.currentKey}_-1_-1`]);
4995
+ }
4996
+ g_keyObj[`${type}${g_keyObj.currentKey}_-1_-1`] = structuredClone(g_keyObj[`${type}${g_keyObj.currentKey}_-1`]);
4997
+ } else {
4998
+ resetGroupList(type);
4999
+ g_keyObj[`${type}${keyCtrlPtn}`] = structuredClone(g_keyObj[`${type}${keyCtrlPtn}_0`]);
5000
+ }
5001
+ });
5002
+
4946
5003
  }
5004
+
4947
5005
  const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
4948
- if (g_keyObj[`shuffle${keyCtrlPtn}_1`] !== undefined) {
4949
- g_keyObj[`shuffle${keyCtrlPtn}`] = g_keyObj[`shuffle${keyCtrlPtn}_${g_keycons.shuffleGroupNum}`].concat();
4950
- }
4951
5006
  if (g_headerObj.keyRetryDef === C_KEY_RETRY) {
4952
5007
  g_headerObj.keyRetry = setIntVal(g_keyObj[`keyRetry${keyCtrlPtn}`], g_headerObj.keyRetryDef);
4953
5008
  }
@@ -5296,6 +5351,20 @@ const makeMiniCssButton = (_id, _directionFlg, _heightPos, _func, { dx = 0, dy =
5296
5351
  }, g_cssObj.button_Mini);
5297
5352
  };
5298
5353
 
5354
+ /**
5355
+ * カラーグループ、シャッフルグループの再設定
5356
+ * @param {string} _type
5357
+ */
5358
+ const resetGroupList = (_type) => {
5359
+ if (g_keyObj.currentPtn === -1) {
5360
+ g_keycons[`${_type}GroupNum`] = -1;
5361
+ g_keycons[`${_type}Groups`] = addValtoArray(g_keycons[`${_type}Groups`], -1);
5362
+ } else {
5363
+ g_keycons[`${_type}GroupNum`] = 0;
5364
+ g_keycons[`${_type}Groups`] = g_keycons[`${_type}Groups`].filter(val => val !== -1);
5365
+ }
5366
+ };
5367
+
5299
5368
  /*-----------------------------------------------------------*/
5300
5369
  /* Scene : SETTINGS-DISPLAY [lemon] */
5301
5370
  /*-----------------------------------------------------------*/
@@ -5539,6 +5608,9 @@ const keyConfigInit = (_kcType = g_kcType) => {
5539
5608
  const maxLeftPos = Math.max(divideCnt, posMax - divideCnt - 2) / 2;
5540
5609
  const maxLeftX = Math.min(0, (kWidth - C_ARW_WIDTH) / 2 - maxLeftPos * g_keyObj.blank);
5541
5610
 
5611
+ // カラーグループ、シャッフルグループの再設定
5612
+ [`color`, `shuffle`].forEach(type => resetGroupList(type));
5613
+
5542
5614
  /**
5543
5615
  * keyconSpriteのスクロール位置調整
5544
5616
  * @param {number} _targetX
@@ -5726,25 +5798,17 @@ const keyConfigInit = (_kcType = g_kcType) => {
5726
5798
  */
5727
5799
  const viewGroup = _type => {
5728
5800
  if (g_headerObj[`${_type}Use`]) {
5729
- if (g_keyObj[`${_type}${keyCtrlPtn}_1`] !== undefined) {
5730
- document.getElementById(`lnk${toCapitalize(_type)}Group`).textContent =
5731
- getStgDetailName(`${g_keycons[`${_type}GroupNum`] + 1}`);
5801
+ const num = g_keycons[`${_type}GroupNum`] === -1 ? g_keycons.groupSelf : g_keycons[`${_type}GroupNum`] + 1;
5802
+ if (document.getElementById(`lnk${toCapitalize(_type)}Group`) !== null) {
5803
+ document.getElementById(`lnk${toCapitalize(_type)}Group`).textContent = getStgDetailName(num);
5732
5804
  }
5733
5805
  viewGroupObj[_type](`_${g_keycons[`${_type}GroupNum`]}`);
5734
5806
  }
5735
5807
  };
5736
5808
  const setGroup = (_type, _scrollNum = 1) => {
5737
- const tmpNum = g_keycons[`${_type}GroupNum`] + _scrollNum;
5738
- if (g_keyObj[`${_type}${keyCtrlPtn}_${tmpNum}`] !== undefined) {
5739
- g_keycons[`${_type}GroupNum`] = tmpNum;
5740
- } else {
5741
- let j = 0;
5742
- while (g_keyObj[`${_type}${keyCtrlPtn}_${j}`] !== undefined) {
5743
- j -= _scrollNum;
5744
- }
5745
- g_keycons[`${_type}GroupNum`] = j + _scrollNum;
5746
- }
5747
- g_keyObj[`${_type}${keyCtrlPtn}`] = [...g_keyObj[`${_type}${keyCtrlPtn}_${g_keycons[`${_type}GroupNum`]}`]];
5809
+ const groupNum = g_keycons[`${_type}GroupNum`];
5810
+ g_keycons[`${_type}GroupNum`] = g_keycons[`${_type}Groups`][getNextNum(_scrollNum, `${_type}Groups`, groupNum)];
5811
+ g_keyObj[`${_type}${keyCtrlPtn}`] = structuredClone(g_keyObj[`${_type}${keyCtrlPtn}_${groupNum}`]);
5748
5812
  viewGroup(_type);
5749
5813
  };
5750
5814
 
@@ -5796,11 +5860,12 @@ const keyConfigInit = (_kcType = g_kcType) => {
5796
5860
  * @param {object} obj (baseX)
5797
5861
  */
5798
5862
  const makeGroupButton = (_type, { baseX = g_sWidth * 5 / 6 - 20, cssName } = {}) => {
5799
- if (g_headerObj[`${_type}Use`] && g_keyObj[`${_type}${keyCtrlPtn}_1`] !== undefined) {
5863
+ if (g_headerObj[`${_type}Use`] && g_keycons[`${_type}Groups`].length > 1) {
5800
5864
  const typeName = toCapitalize(_type);
5865
+ const num = g_keycons[`${_type}GroupNum`] === -1 ? g_keycons.groupSelf : g_keycons[`${_type}GroupNum`] + 1;
5801
5866
  multiAppend(divRoot,
5802
5867
  makeKCButtonHeader(`lbl${_type}Group`, `${typeName}Group`, { x: baseX - 10, y: 37 }, cssName),
5803
- makeKCButton(`lnk${typeName}Group`, `${g_keycons[`${_type}GroupNum`] + 1}`, _ => setGroup(_type), {
5868
+ makeKCButton(`lnk${typeName}Group`, `${num}`, _ => setGroup(_type), {
5804
5869
  x: baseX, y: 50, w: g_sWidth / 18, title: g_msgObj[`${_type}Group`], cxtFunc: _ => setGroup(_type, -1),
5805
5870
  }),
5806
5871
  makeMiniKCButton(`lnk${typeName}Group`, `L`, _ => setGroup(_type, -1), { x: baseX - 10, y: 50 }),
@@ -5952,7 +6017,7 @@ const keyConfigInit = (_kcType = g_kcType) => {
5952
6017
  const nextNum = getNextNum(_scrollNum, `colorTypes`, g_colorType);
5953
6018
  g_colorType = g_keycons.colorTypes[nextNum];
5954
6019
  if (g_headerObj.colorUse) {
5955
- g_stateObj.d_color = g_keycons.colorDefs[nextNum];
6020
+ g_stateObj.d_color = g_keycons.colorDefTypes.findIndex(val => val === g_colorType) !== -1 ? C_FLG_ON : C_FLG_OFF;
5956
6021
  }
5957
6022
  changeSetColor();
5958
6023
  viewGroupObj.color(`_${g_keycons.colorGroupNum}`);
@@ -7847,25 +7912,44 @@ const getArrowSettings = _ => {
7847
7912
  g_localStorage.adjustment = g_stateObj.adjustment;
7848
7913
  g_localStorage.volume = g_stateObj.volume;
7849
7914
  g_localStorage.colorType = g_colorType;
7915
+
7850
7916
  g_storeSettings.forEach(setting => g_localStorage[setting] = g_stateObj[setting]);
7851
7917
 
7852
- // ローカルストレージ(キー別)へデータ保存 ※特殊キーは除く
7918
+ let storageObj = g_localKeyStorage;
7919
+ let addKey = ``;
7920
+
7921
+ // リバース、キーコンフィグの保存(キー別)
7922
+ if (g_stateObj.extraKeyFlg) {
7923
+ storageObj = g_localStorage;
7924
+ addKey = g_keyObj.currentKey;
7925
+ }
7926
+ storageObj[`reverse${addKey}`] = g_stateObj.reverse;
7927
+ storageObj[`keyCtrl${addKey}`] = setKeyCtrl(g_localKeyStorage, keyNum, keyCtrlPtn);
7928
+ if (g_keyObj.currentPtn !== -1) {
7929
+ storageObj[`keyCtrlPtn${addKey}`] = g_keyObj.currentPtn;
7930
+ g_keyObj[`keyCtrl${keyCtrlPtn}`] = copyArray2d(g_keyObj[`keyCtrl${keyCtrlPtn}d`]);
7931
+ }
7932
+
7933
+ // カラーセットの保存(キー別)
7934
+ if (!g_keycons.colorDefTypes.includes(g_colorType)) {
7935
+
7936
+ resetColorType({ _toObj: storageObj, _to: addKey });
7937
+ resetColorType({ _from: g_colorType, _to: g_colorType, _fromObj: g_dfColorObj });
7938
+
7939
+ g_colorType = g_keycons.colorSelf;
7940
+ g_localStorage.colorType = g_keycons.colorSelf;
7941
+ g_keycons.colorTypes = addValtoArray(g_keycons.colorTypes, g_keycons.colorSelf);
7942
+ resetColorType({ _to: g_keycons.colorSelf });
7943
+ }
7944
+
7945
+ [`color`, `shuffle`].forEach(type => {
7946
+ const groupNum = g_keycons[`${type}GroupNum`];
7947
+ storageObj[`${type}${g_keyObj.currentKey}_-1_-1`] = structuredClone(g_keyObj[`${type}${keyCtrlPtn}_${groupNum}`]); g_keyObj[`${type}${g_keyObj.currentKey}_-1_${groupNum}`] = structuredClone(g_dfKeyObj[`${type}${keyCtrlPtn}_${groupNum}`]);
7948
+ g_keyObj[`${type}${keyCtrlPtn}_${groupNum}`] = structuredClone(g_dfKeyObj[`${type}${keyCtrlPtn}_${groupNum}`]);
7949
+ });
7950
+
7853
7951
  if (!g_stateObj.extraKeyFlg) {
7854
- g_localKeyStorage.reverse = g_stateObj.reverse;
7855
- g_localKeyStorage.keyCtrl = setKeyCtrl(g_localKeyStorage, keyNum, keyCtrlPtn);
7856
- if (g_keyObj.currentPtn !== -1) {
7857
- g_localKeyStorage.keyCtrlPtn = g_keyObj.currentPtn;
7858
- g_keyObj[`keyCtrl${keyCtrlPtn}`] = copyArray2d(g_keyObj[`keyCtrl${keyCtrlPtn}d`]);
7859
- }
7860
7952
  localStorage.setItem(`danonicw-${g_keyObj.currentKey}k`, JSON.stringify(g_localKeyStorage));
7861
-
7862
- } else {
7863
- g_localStorage[`reverse${g_keyObj.currentKey}`] = g_stateObj.reverse;
7864
- g_localStorage[`keyCtrl${g_keyObj.currentKey}`] = setKeyCtrl(g_localKeyStorage, keyNum, keyCtrlPtn);
7865
- if (g_keyObj.currentPtn !== -1) {
7866
- g_localStorage[`keyCtrlPtn${g_keyObj.currentKey}`] = g_keyObj.currentPtn;
7867
- g_keyObj[`keyCtrl${keyCtrlPtn}`] = copyArray2d(g_keyObj[`keyCtrl${keyCtrlPtn}d`]);
7868
- }
7869
7953
  }
7870
7954
  localStorage.setItem(g_localStorageUrl, JSON.stringify(g_localStorage));
7871
7955
  g_canLoadDifInfoFlg = true;
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2022/08/21 (v28.0.1)
8
+ * Revised : 2022/10/02 (v28.1.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -819,14 +819,19 @@ const g_keycons = {
819
819
  configTypeNum: 0,
820
820
 
821
821
  colorTypes: [`Default`, `Type0`, `Type1`, `Type2`, `Type3`, `Type4`],
822
- colorDefs: [C_FLG_ON, C_FLG_ON, C_FLG_OFF, C_FLG_OFF, C_FLG_OFF, C_FLG_OFF],
822
+ colorDefTypes: [`Default`, `Type0`],
823
823
  colorTypeNum: 0,
824
+ colorSelf: `TypeS`,
824
825
 
825
826
  imgTypes: [],
826
827
  imgTypeNum: 0,
827
828
 
829
+ colorGroups: [0],
828
830
  colorGroupNum: 0,
831
+
832
+ shuffleGroups: [0],
829
833
  shuffleGroupNum: 0,
834
+ groupSelf: `S`,
830
835
  };
831
836
 
832
837
  let g_displays = [`stepZone`, `judgment`, `fastSlow`, `lifeGauge`, `score`, `musicInfo`, `filterLine`,
@@ -1413,6 +1418,8 @@ const g_cssObj = {
1413
1418
  flex_centering: `flex_centering`,
1414
1419
  };
1415
1420
 
1421
+ const g_dfKeyObj = {};
1422
+
1416
1423
  // キー別の設定(一旦ここで定義)
1417
1424
  // ステップゾーンの位置関係は自動化を想定
1418
1425
  const g_keyObj = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "28.0.1",
3
+ "version": "28.1.1",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {