Skip to content

Commit

Permalink
PlayerConfig : add 10key PlayModeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
exch-bms2 committed Dec 10, 2018
1 parent 9f23ab6 commit 2a6dc4c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
35 changes: 35 additions & 0 deletions src/bms/player/beatoraja/PlayModeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ public void setKeyAssign(Mode mode, boolean enable) {
Keys.CONTROL_LEFT };
break;
case BEAT_10K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
break;
case BEAT_14K:
default:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Expand Down Expand Up @@ -306,6 +309,9 @@ public void setKeyAssign(Mode mode, int player, boolean enable) {
BMKeys.BUTTON_5, BMKeys.LEFT, BMKeys.UP, BMKeys.DOWN };
break;
case BEAT_10K:
keys = new int[]{ BMKeys.BUTTON_4, BMKeys.BUTTON_7, BMKeys.BUTTON_3, BMKeys.BUTTON_8, BMKeys.BUTTON_2,
BMKeys.UP, BMKeys.DOWN, -1,-1,-1,-1,-1,-1,-1 };
break;
case BEAT_14K:
keys = new int[]{ BMKeys.BUTTON_4, BMKeys.BUTTON_7, BMKeys.BUTTON_3, BMKeys.BUTTON_8, BMKeys.BUTTON_2,
BMKeys.BUTTON_5, BMKeys.LEFT, BMKeys.UP, BMKeys.DOWN, -1,-1,-1,-1,-1,-1,-1,-1,-1 };
Expand All @@ -332,6 +338,9 @@ public void setKeyAssign(Mode mode, int player, boolean enable) {
Arrays.fill(keys, -1);
break;
case BEAT_10K:
keys = new int[]{-1,-1,-1,-1,-1,-1,-1,BMKeys.BUTTON_4, BMKeys.BUTTON_7, BMKeys.BUTTON_3, BMKeys.BUTTON_8, BMKeys.BUTTON_2,
BMKeys.UP, BMKeys.DOWN};
break;
case BEAT_14K:
keys = new int[]{-1,-1,-1,-1,-1,-1,-1,-1,-1,BMKeys.BUTTON_4, BMKeys.BUTTON_7, BMKeys.BUTTON_3, BMKeys.BUTTON_8, BMKeys.BUTTON_2,
BMKeys.BUTTON_5, BMKeys.LEFT, BMKeys.UP, BMKeys.DOWN};
Expand Down Expand Up @@ -466,6 +475,16 @@ public Input getKeyAssign(int index) {
public void setKeyAssign(Mode mode, boolean enable) {
switch (mode) {
case BEAT_5K:
// 5keys
keys = new Input[7];
for (int i = 0; i < 5; i++) {
keys[i] = new Input(Input.Type.NOTE, 53 + i);
}
keys[5] = new Input(Input.Type.NOTE, 49);
keys[6] = new Input(Input.Type.NOTE, 51);
start = new Input(Input.Type.NOTE, 47);
select = new Input(Input.Type.NOTE, 48);
break;
case BEAT_7K:
default:
// 7keys
Expand All @@ -479,6 +498,22 @@ public void setKeyAssign(Mode mode, boolean enable) {
select = new Input(Input.Type.NOTE, 48);
break;
case BEAT_10K:
keys = new Input[14];
for (int i = 0; i < 5; i++) {
// 1P keys
keys[i] = new Input(Input.Type.NOTE, 53 + i);
// 2P keys
keys[7 + i] = new Input(Input.Type.NOTE, 65 + i);
}
// 1P turntables
keys[5] = new Input(Input.Type.NOTE, 49);
keys[6] = new Input(Input.Type.NOTE, 51);
// 2P turntables
keys[12] = new Input(Input.Type.NOTE, 73);
keys[13] = new Input(Input.Type.NOTE, 75);
start = new Input(Input.Type.NOTE, 47);
select = new Input(Input.Type.NOTE, 48);
break;
case BEAT_14K:
keys = new Input[18];
for (int i = 0; i < 7; i++) {
Expand Down
22 changes: 21 additions & 1 deletion src/bms/player/beatoraja/PlayerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public class PlayerConfig {

private PlayModeConfig mode7 = new PlayModeConfig(Mode.BEAT_7K);

private PlayModeConfig mode10 = new PlayModeConfig(Mode.BEAT_10K);

private PlayModeConfig mode14 = new PlayModeConfig(Mode.BEAT_14K);

private PlayModeConfig mode9 = new PlayModeConfig(Mode.POPN_9K);
Expand Down Expand Up @@ -290,6 +292,7 @@ public PlayModeConfig getPlayConfig(Mode modeId) {
case BEAT_7K:
return getMode7();
case BEAT_10K:
return getMode10();
case BEAT_14K:
return getMode14();
case POPN_9K:
Expand All @@ -310,8 +313,9 @@ public PlayModeConfig getPlayConfig(int modeId) {
case 5:
return getMode5();
case 14:
case 10:
return getMode14();
case 10:
return getMode10();
case 9:
return getMode9();
case 25:
Expand Down Expand Up @@ -339,6 +343,18 @@ public void setMode7(PlayModeConfig mode7) {
this.mode7 = mode7;
}

public PlayModeConfig getMode10() {
if(mode10 == null || mode10.getController().length < 2) {
mode10 = new PlayModeConfig(Mode.BEAT_10K);
Logger.getGlobal().warning("mode10のPlayConfigを再構成");
}
return mode10;
}

public void setMode10(PlayModeConfig mode10) {
this.mode10 = mode10;
}

public PlayModeConfig getMode14() {
if(mode14 == null || mode14.getController().length < 2) {
mode14 = new PlayModeConfig(Mode.BEAT_14K);
Expand Down Expand Up @@ -592,6 +608,9 @@ public void validate() {
if(mode14 == null) {
mode14 = new PlayModeConfig(Mode.BEAT_14K);
}
if(mode10 == null) {
mode10 = new PlayModeConfig(Mode.BEAT_10K);
}
if(mode9 == null) {
mode9 = new PlayModeConfig(Mode.POPN_9K);
}
Expand All @@ -603,6 +622,7 @@ public void validate() {
}
mode5.validate(7);
mode7.validate(9);
mode10.validate(14);
mode14.validate(18);
mode9.validate(9);
mode24.validate(26);
Expand Down
10 changes: 8 additions & 2 deletions src/bms/player/beatoraja/config/KeyConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ public class KeyConfiguration extends MainState {

private BitmapFont titlefont;

private static final String[] MODE = { "5 KEYS", "7 KEYS", "9 KEYS", "14 KEYS", "24 KEYS", "24 KEYS DOUBLE" };
private static final Mode[] MODE_HINT = { Mode.BEAT_5K,Mode.BEAT_7K, Mode.POPN_9K, Mode.BEAT_14K, Mode.KEYBOARD_24K,
private static final String[] MODE = { "5 KEYS", "7 KEYS", "9 KEYS", "10 KEYS", "14 KEYS", "24 KEYS", "24 KEYS DOUBLE" };
private static final Mode[] MODE_HINT = { Mode.BEAT_5K,Mode.BEAT_7K, Mode.POPN_9K, Mode.BEAT_10K, Mode.BEAT_14K, Mode.KEYBOARD_24K,
Mode.KEYBOARD_24K_DOUBLE };

private static final String[][] KEYS = {
{ "1 KEY", "2 KEY", "3 KEY", "4 KEY", "5 KEY", "F-SCR", "R-SCR", "START", "SELECT" },
{ "1 KEY", "2 KEY", "3 KEY", "4 KEY", "5 KEY", "6 KEY", "7 KEY", "F-SCR", "R-SCR", "START", "SELECT" },
{ "1 KEY", "2 KEY", "3 KEY", "4 KEY", "5 KEY", "6 KEY", "7 KEY", "8 KEY", "9 KEY", "START", "SELECT" },
{ "1P-1 KEY", "1P-2 KEY", "1P-3 KEY", "1P-4 KEY", "1P-5 KEY", "1P-F-SCR",
"1P-R-SCR", "2P-1 KEY", "2P-2 KEY", "2P-3 KEY", "2P-4 KEY", "2P-5 KEY",
"2P-F-SCR", "2P-R-SCR", "START", "SELECT" },
{ "1P-1 KEY", "1P-2 KEY", "1P-3 KEY", "1P-4 KEY", "1P-5 KEY", "1P-6 KEY", "1P-7 KEY", "1P-F-SCR",
"1P-R-SCR", "2P-1 KEY", "2P-2 KEY", "2P-3 KEY", "2P-4 KEY", "2P-5 KEY", "2P-6 KEY", "2P-7 KEY",
"2P-F-SCR", "2P-R-SCR", "START", "SELECT" },
Expand All @@ -59,6 +62,7 @@ public class KeyConfiguration extends MainState {
private static final int[][] KEYSA = { { 0, 1, 2, 3, 4, 5, 6, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
Expand All @@ -67,6 +71,7 @@ public class KeyConfiguration extends MainState {
private static final int[][] BMKEYSA = { { 0, 1, 2, 3, 4, 5, 6, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
Expand All @@ -76,6 +81,7 @@ public class KeyConfiguration extends MainState {
{ 0, 1, 2, 3, 4, 5, 6, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -2 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
Expand Down
6 changes: 4 additions & 2 deletions src/bms/player/beatoraja/launcher/PlayConfigurationView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,10 @@ protected void updateItem(Integer arg0, boolean arg1) {
}

enum PlayMode {
BEAT_7K("5/7KEYS"),
BEAT_14K("10/14KEYS"),
BEAT_5K("5KEYS"),
BEAT_7K("7KEYS"),
BEAT_10K("10KEYS"),
BEAT_14K("14KEYS"),
POPN_9K("9KEYS"),
KEYBOARD_24K("24KEYS"),
KEYBOARD_24K_DOUBLE("24KEYS DOUBLE");
Expand Down
6 changes: 3 additions & 3 deletions src/bms/player/beatoraja/play/LaneProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public LaneProperty(Mode mode) {
scratchToKey = new int[][] { {7,8} };
break;
case BEAT_10K:
keyToLane = new int[] { 0, 1, 2, 3, 4, -1, -1, 5, 5, 6, 7, 8, 9, 10, -1, -1, 11, 11 };
laneToKey = new int[][] { {0}, {1}, {2}, {3}, {4}, {7,8}, {9}, {10}, {11}, {12}, {13}, {16,17} };
keyToLane = new int[] { 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 11 };
laneToKey = new int[][] { {0}, {1}, {2}, {3}, {4}, {5,6}, {7}, {8}, {9}, {10}, {11}, {12,13} };
laneToScratch = new int[] { -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 1 };
laneToSkinOffset = new int[] { 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0 };
scratchToKey = new int[][] { {7,8}, {16,17} };
scratchToKey = new int[][] { {5,6}, {12,13} };
break;
case BEAT_14K:
keyToLane = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15 };
Expand Down

0 comments on commit 2a6dc4c

Please sign in to comment.