tips 0006 keypattern update - cwtickle/danoniplus-docs GitHub Wiki

English | Japanese

| < How to create a custom key type | Overwrite key pattern of regular key types | How to display background > |

Overwrite key pattern of regular key types

Caution

  • Overwriting regular key types settings may cause unexpected problems depending on the setting method.
  • Please confirm the operation in your own work before implementing it.

Usage

  • In either method, it is recommended to describe the settings in a common settings file such as "danoni_setting.js".
  • If you want to apply it only to a specific piece, describe it in the chart file, and if it cannot be set in that file, describe it in your own custom Js.

Method 1: Add a key pattern

  • Add to an regular key pattern using |appendX=true| (where X is the key type), which has been used since v27.6.0.
  • Since v30.5.0, it is possible to specify a reference (12_(0)) to the added key pattern definition.
|minWidth12=675|
|append12=true|
|keyCtrl12=F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12$Q,W,E,R,T,Y,U,I,O,P,Ja-@,Ja-[|
|chara12=oni,left,leftdia,down,sleft,sdown,sup,sright,space,up,rightdia,right$12_(0)|
|color12=1,0,1,0,3,3,3,3,0,1,0,1$12_(0)|
|stepRtn12=45,0,-45,-90,giko,onigiri,iyo,c,90,135,180,225$12_(0)|
|blank12=50$12_(0)|
|shuffle12=0,0,0,0,1,1,1,1,2,2,2,2$12_(0)|
|scroll12=Cross::1,1,1,1,-,-,-,-,1,1,1,1/Split::1,1,1,1,1,1,-,-,-,-,-,-$12_(0)|
|transKey12=12i$12i|

Method 2: Change some of the regular key patterns

  • The basic method is to define a key number with a different name (e.g., 12X) and change the name of that key number to the original key number (e.g., 12).
    In the example, you can use |keyName12X=12| to set this up.
  • However, if there are many existing works, it is troublesome to change all the key numbers. For this reason, the following solution is used.

Definition in danoni_setting.js

  • Using g_keyObj.keyTransPattern, set the alternative key.
g_keyObj.keyTransPattern['12'] = `12X`; // If the key type in difData is 12key, read as "12Xkey"
  • Redefine 12key as 12Xkey by means of a definition of custom key types.
    The 12key work will read the key settings as a 12Xkey work, but will remain 12key on the display because of the |keyName12X=12|.
g_presetObj.keysData = `

|keyName12X=12|
|minWidth12X=675|
|chara12X=12_0$12_1$12_2$12_3$oni,left,leftdia,down,sleft,sdown,sup,sright,space,up,rightdia,right$12X_4|
|color12X=12_0$12_1$12_2$12_3$1,0,1,0,3,3,3,3,0,1,0,1$12X_4|
|pos12X=12_0$12_1$12_2$12_3$0,1,2,3,4,5,6,7,8,9,10,11$12X_4|
|div12X=5$5$5$5$12$12|
|stepRtn12X=12_0$12_1$12_2$12_3$45,0,-45,-90,giko,onigiri,iyo,c,90,135,180,225$12X_4|
|keyCtrl12X=12_0$12_1$12_2$12_3$112/0,113/0,114/0,115/0,116/0,117/0,118/0,119/0,120/0,121/0,122/0,123/0$81/0,87/0,69/0,82/0,84/0,89/0,85/0,73/0,79/0,80/0,192/0,219/0|
|shuffle12X=12_0$12_1$12_2$12_3$0,0,0,0,1,1,1,1,2,2,2,2$12X_4|
|blank12X=55$55$55$55$50$50|
|scroll12X=12_0$12_0$12_0$12_0$Cross::1,1,1,1,-1,-1,-1,-1,1,1,1,1/Split::1,1,1,1,1,1,-1,-1,-1,-1,-1,-1$12X_4|
|transKey12X=$$$$12i$12i|

`;

Related pages

| < How to create a custom key type | Overwrite key pattern of regular key types | How to display background > |