Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to configure START+SELECT hold duration to exit #580

Merged
merged 2 commits into from Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/bms/player/beatoraja/PlayerConfig.java
Expand Up @@ -143,6 +143,11 @@ public class PlayerConfig {
*/
private int sevenToNineType = 0;

/**
* START+SELECTを押すと終了するまでの時間
*/
private int exitPressDuration = 1000;

/**
* Guide SE
*/
Expand Down Expand Up @@ -584,6 +589,14 @@ public void setSevenToNineType(int sevenToNineType) {
this.sevenToNineType = sevenToNineType;
}

public int getExitPressDuration() {
return exitPressDuration;
}

public void setExitPressDuration(int exitPressDuration) {
this.exitPressDuration = exitPressDuration;
}

public boolean isGuideSE() {
return isGuideSE;
}
Expand Down Expand Up @@ -714,6 +727,7 @@ public void validate() {
hranThresholdBPM = MathUtils.clamp(hranThresholdBPM, 1, 1000);
sevenToNinePattern = MathUtils.clamp(sevenToNinePattern, 0, 6);
sevenToNineType = MathUtils.clamp(sevenToNineType, 0, 2);
exitPressDuration = MathUtils.clamp(exitPressDuration, 0, 100000);

scrollMode = MathUtils.clamp(scrollMode, 0, ScrollSpeedModifier.Mode.values().length);
longnoteMode = MathUtils.clamp(longnoteMode, 0, LongNoteModifier.Mode.values().length);
Expand Down
6 changes: 6 additions & 0 deletions src/bms/player/beatoraja/launcher/PlayConfigurationView.fxml
Expand Up @@ -296,6 +296,12 @@
<ComboBox fx:id="seventoninepattern" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="%SEVEN_TO_NINE_TYPE" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<ComboBox fx:id="seventoninetype" GridPane.columnIndex="3" GridPane.rowIndex="4" />
<Label text="%EXIT_PRESS_DURATION" GridPane.columnIndex="0" GridPane.rowIndex="5" />
<NumericSpinner fx:id="exitpressduration" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="5">
<valueFactory>
<SpinnerValueFactory.IntegerSpinnerValueFactory amountToStepBy="1" initialValue="1000" max="2000" min="0" />
</valueFactory>
</NumericSpinner>
</GridPane>
</VBox>
</content>
Expand Down
4 changes: 4 additions & 0 deletions src/bms/player/beatoraja/launcher/PlayConfigurationView.java
Expand Up @@ -170,6 +170,8 @@ public class PlayConfigurationView implements Initializable {
@FXML
private ComboBox<Integer> seventoninetype;
@FXML
private Spinner<Integer> exitpressduration;
@FXML
private CheckBox guidese;
@FXML
private CheckBox windowhold;
Expand Down Expand Up @@ -418,6 +420,7 @@ public void updatePlayer() {
doubleop.getSelectionModel().select(player.getDoubleoption());
seventoninepattern.getSelectionModel().select(player.getSevenToNinePattern());
seventoninetype.getSelectionModel().select(player.getSevenToNineType());
exitpressduration.getValueFactory().setValue(player.getExitPressDuration());
guidese.setSelected(player.isGuideSE());
windowhold.setSelected(player.isWindowHold());
gaugeop.getSelectionModel().select(player.getGauge());
Expand Down Expand Up @@ -514,6 +517,7 @@ public void commitPlayer() {
player.setDoubleoption(doubleop.getValue());
player.setSevenToNinePattern(seventoninepattern.getValue());
player.setSevenToNineType(seventoninetype.getValue());
player.setExitPressDuration(getValue(exitpressduration));
player.setGuideSE(guidese.isSelected());
player.setWindowHold(windowhold.isSelected());
player.setGauge(gaugeop.getValue());
Expand Down
6 changes: 5 additions & 1 deletion src/bms/player/beatoraja/play/ControlInputProcessor.java
Expand Up @@ -23,6 +23,8 @@ public class ControlInputProcessor {
private long laneCoverStartTiming = Long.MIN_VALUE;
private long exitpressedtime;

private final long exitPressDuration;

private boolean enableControl = true;
private boolean enableCursor = true;

Expand All @@ -48,6 +50,8 @@ public ControlInputProcessor(BMSPlayer player, PlayMode autoplay) {
coverChangeMarginHigh = playConfig.getLanecovermarginhigh();
coverSpeedSwitchDuration = playConfig.getLanecoverswitchduration();

exitPressDuration = player.main.getPlayerConfig().getExitPressDuration();

switch (this.player.getMode()) {
case POPN_9K:
processStart = () -> processStart9key();
Expand Down Expand Up @@ -143,7 +147,7 @@ public void input() {
}
}
long now = System.currentTimeMillis();
if((input.startPressed() && input.isSelectPressed() && now - exitpressedtime > 1000 )||
if((input.startPressed() && input.isSelectPressed() && now - exitpressedtime > exitPressDuration )||
(player.isNoteEnd() && (input.startPressed() || input.isSelectPressed()))){
input.startChanged(false);
input.setSelectPressed(false);
Expand Down
1 change: 1 addition & 0 deletions src/resources/UIResources.properties
Expand Up @@ -51,6 +51,7 @@ SEVEN_TO_NINE_TYPE=SC Type
SEVEN_TO_NINE_OFF=1 Lane
SEVEN_TO_NINE_NO_MASHING=No Mashing (Assist Option)
SEVEN_TO_NINE_ALTERNATION=Alternation (Assist Option)
EXIT_PRESS_DURATION=START+SELECT Exit Delay
GUIDE_SE=GUIDE SE
WINDOW_HOLD=WINDOW HOLD
RANDOM_SELECT=RANDOM SELECT
Expand Down
1 change: 1 addition & 0 deletions src/resources/UIResources_ja_JP.properties
Expand Up @@ -49,6 +49,7 @@ SEVEN_TO_NINE_TYPE=SC\u30bf\u30a4\u30d7
SEVEN_TO_NINE_OFF=1\u30ec\u30fc\u30f3
SEVEN_TO_NINE_NO_MASHING=\u9023\u6253\u6642\u4ea4\u4e92(\u30a2\u30b7\u30b9\u30c8\u30aa\u30d7\u30b7\u30e7\u30f3)
SEVEN_TO_NINE_ALTERNATION=\u5e38\u6642\u4ea4\u4e92(\u30a2\u30b7\u30b9\u30c8\u30aa\u30d7\u30b7\u30e7\u30f3)
EXIT_PRESS_DURATION=START+SELECT\u7d42\u4e86\u307e\u3067\u6642\u9593
GUIDE_SE=GUIDE SE
WINDOW_HOLD=WINDOW HOLD
RANDOM_SELECT=RANDOM SELECT
Expand Down