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

PR for Issue #32 - Scroll adjust periodic attack interval while holding the keybind #33

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/main/java/fi/dy/masa/tweakeroo/event/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,50 @@ else if (FeatureToggle.TWEAK_ZOOM.getKeybind().isKeybindHeld() ||
String strValue = String.format("%s%.1f%s", preGreen, Configs.Generic.ZOOM_FOV.getDoubleValue(), rst);
InfoUtils.printActionbarMessage("tweakeroo.message.set_zoom_fov_to", strValue);

return true;
}
else if (FeatureToggle.TWEAK_PERIODIC_ATTACK.getKeybind().isKeybindHeld())
{
int newValue = Configs.Generic.PERIODIC_ATTACK_INTERVAL.getIntegerValue() + (dWheel > 0 ? 1 : -1);
Configs.Generic.PERIODIC_ATTACK_INTERVAL.setIntegerValue(newValue);
KeyCallbackAdjustable.setValueChanged();

String strValue = preGreen + Configs.Generic.PERIODIC_ATTACK_INTERVAL.getIntegerValue() + rst;
InfoUtils.printActionbarMessage("tweakeroo.message.set_periodic_attack_interval_to", strValue);

return true;
}
else if (FeatureToggle.TWEAK_PERIODIC_USE.getKeybind().isKeybindHeld())
{
int newValue = Configs.Generic.PERIODIC_USE_INTERVAL.getIntegerValue() + (dWheel > 0 ? 1 : -1);
Configs.Generic.PERIODIC_USE_INTERVAL.setIntegerValue(newValue);
KeyCallbackAdjustable.setValueChanged();

String strValue = preGreen + Configs.Generic.PERIODIC_USE_INTERVAL.getIntegerValue() + rst;
InfoUtils.printActionbarMessage("tweakeroo.message.set_periodic_use_interval_to", strValue);

return true;
}
else if (FeatureToggle.TWEAK_PERIODIC_HOLD_ATTACK.getKeybind().isKeybindHeld())
{
int newValue = Configs.Generic.PERIODIC_HOLD_ATTACK_INTERVAL.getIntegerValue() + (dWheel > 0 ? 1 : -1);
Configs.Generic.PERIODIC_HOLD_ATTACK_INTERVAL.setIntegerValue(newValue);
KeyCallbackAdjustable.setValueChanged();

String strValue = preGreen + Configs.Generic.PERIODIC_HOLD_ATTACK_INTERVAL.getIntegerValue() + rst;
InfoUtils.printActionbarMessage("tweakeroo.message.set_periodic_hold_attack_interval_to", strValue);

return true;
}
else if (FeatureToggle.TWEAK_PERIODIC_HOLD_USE.getKeybind().isKeybindHeld())
{
int newValue = Configs.Generic.PERIODIC_HOLD_USE_INTERVAL.getIntegerValue() + (dWheel > 0 ? 1 : -1);
Configs.Generic.PERIODIC_HOLD_USE_INTERVAL.setIntegerValue(newValue);
KeyCallbackAdjustable.setValueChanged();

String strValue = preGreen + Configs.Generic.PERIODIC_HOLD_USE_INTERVAL.getIntegerValue() + rst;
InfoUtils.printActionbarMessage("tweakeroo.message.set_periodic_hold_use_interval_to", strValue);

return true;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/assets/tweakeroo/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@
"tweakeroo.message.set_placement_grid_size_to": "Set Placement Grid size to %s",
"tweakeroo.message.set_placement_limit_to": "Set Placement Limit to %s",
"tweakeroo.message.set_placement_restriction_mode_to": "Set Placement Restriction mode to %s",
"tweakeroo.message.set_periodic_attack_interval_to": "Set Periodic Attack Interval to %s",
"tweakeroo.message.set_periodic_use_interval_to": "Set Periodic Use Interval to %s",
"tweakeroo.message.set_periodic_hold_attack_interval_to": "Set Periodic Hold Attack Interval to %s",
"tweakeroo.message.set_periodic_hold_use_interval_to": "Set Periodic Hold Use Interval to %s",
"tweakeroo.message.set_snap_aim_pitch_step_to": "Set Snap Aim pitch step to %s",
"tweakeroo.message.set_snap_aim_yaw_step_to": "Set Snap Aim yaw step to %s",
"tweakeroo.message.set_zoom_fov_to": "Set zoom FOV to %s",
Expand Down
Loading