🔖 LambdaControls v1.1.1: Add more precision in the fly drifting tooltips.

This commit is contained in:
LambdAurora
2020-02-05 15:39:19 +01:00
parent e13569b71d
commit 1b240b6914
3 changed files with 42 additions and 31 deletions

View File

@@ -26,9 +26,9 @@ import java.util.Optional;
*/
public class LambdaControlsFeature implements Nameable
{
private static final List<LambdaControlsFeature> FEATURES = new ArrayList<>();
public static final LambdaControlsFeature FRONT_BLOCK_PLACING = new LambdaControlsFeature("front_block_placing", true, false);
public static final LambdaControlsFeature FAST_BLOCK_PLACEMENT = new LambdaControlsFeature("fast_block_placement", true, true);
private static final List<LambdaControlsFeature> FEATURES = new ArrayList<>();
public static final LambdaControlsFeature FRONT_BLOCK_PLACING = new LambdaControlsFeature("front_block_placing", true, false);
public static final LambdaControlsFeature FAST_BLOCK_INTERACTION = new LambdaControlsFeature("fast_block_interaction", true, true);
private final String key;
private final boolean defaultAllowed;
@@ -156,6 +156,6 @@ public class LambdaControlsFeature implements Nameable
static {
FEATURES.add(FRONT_BLOCK_PLACING);
FEATURES.add(FAST_BLOCK_PLACEMENT);
FEATURES.add(FAST_BLOCK_INTERACTION);
}
}

View File

@@ -34,22 +34,22 @@ import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y;
public class LambdaControlsConfig
{
// General
private static final ControlsMode DEFAULT_CONTROLS_MODE = ControlsMode.DEFAULT;
private static final boolean DEFAULT_AUTO_SWITCH_MODE = false;
private static final ControlsMode DEFAULT_CONTROLS_MODE = ControlsMode.DEFAULT;
private static final boolean DEFAULT_AUTO_SWITCH_MODE = false;
// HUD
private static final boolean DEFAULT_HUD_ENABLE = true;
private static final HudSide DEFAULT_HUD_SIDE = HudSide.LEFT;
private static final boolean DEFAULT_HUD_ENABLE = true;
private static final HudSide DEFAULT_HUD_SIDE = HudSide.LEFT;
// Gameplay
private static final boolean DEFAULT_FRONT_BLOCK_PLACING = false;
private static final boolean DEFAULT_FAST_BLOCK_INTERACT = true;
private static final boolean DEFAULT_FLY_DRIFTING = false;
private static final boolean DEFAULT_FLY_VERTICAL_DRIFTING = true;
private static final boolean DEFAULT_FRONT_BLOCK_PLACING = false;
private static final boolean DEFAULT_FAST_BLOCK_INTERACTION = true;
private static final boolean DEFAULT_FLY_DRIFTING = false;
private static final boolean DEFAULT_FLY_VERTICAL_DRIFTING = true;
// Controller
private static final ControllerType DEFAULT_CONTROLLER_TYPE = ControllerType.DEFAULT;
private static final double DEFAULT_DEAD_ZONE = 0.25;
private static final double DEFAULT_ROTATION_SPEED = 40.0;
private static final double DEFAULT_MOUSE_SPEED = 25.0;
private static final boolean DEFAULT_UNFOCUSED_INPUT = false;
private static final ControllerType DEFAULT_CONTROLLER_TYPE = ControllerType.DEFAULT;
private static final double DEFAULT_DEAD_ZONE = 0.25;
private static final double DEFAULT_ROTATION_SPEED = 40.0;
private static final double DEFAULT_MOUSE_SPEED = 25.0;
private static final boolean DEFAULT_UNFOCUSED_INPUT = false;
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
@@ -85,7 +85,7 @@ public class LambdaControlsConfig
this.hudSide = HudSide.byId(this.config.getOrElse("hud.side", DEFAULT_HUD_SIDE.getName())).orElse(DEFAULT_HUD_SIDE);
// Gameplay
LambdaControlsFeature.FRONT_BLOCK_PLACING.setEnabled(this.config.getOrElse("gameplay.front_block_placing", DEFAULT_FRONT_BLOCK_PLACING));
LambdaControlsFeature.FAST_BLOCK_INTERACT.setEnabled(this.config.getOrElse("gameplay.fast_block_interact", DEFAULT_FAST_BLOCK_INTERACT));
LambdaControlsFeature.FAST_BLOCK_INTERACTION.setEnabled(this.config.getOrElse("gameplay.fast_block_interaction", DEFAULT_FAST_BLOCK_INTERACTION));
// Controller settings.
this.controllerType = ControllerType.byId(this.config.getOrElse("controller.type", DEFAULT_CONTROLLER_TYPE.getName())).orElse(DEFAULT_CONTROLLER_TYPE);
this.deadZone = this.config.getOrElse("controller.dead_zone", DEFAULT_DEAD_ZONE);
@@ -134,7 +134,7 @@ public class LambdaControlsConfig
this.setHudSide(DEFAULT_HUD_SIDE);
// Gameplay
this.setFrontBlockPlacing(DEFAULT_FRONT_BLOCK_PLACING);
this.setFastBlockInteract(DEFAULT_FAST_BLOCK_INTERACT);
this.setFastBlockInteraction(DEFAULT_FAST_BLOCK_INTERACTION);
this.setFlyDrifting(DEFAULT_FLY_DRIFTING);
this.setFlyVerticalDrifting(DEFAULT_FLY_VERTICAL_DRIFTING);
// Controller
@@ -239,6 +239,27 @@ public class LambdaControlsConfig
Gameplay settings
*/
/**
* Gets whether fast block interaction is enabled or not.
*
* @return True if fast block interaction is enabled, else false.
*/
public boolean hasFastBlockInteraction()
{
return LambdaControlsFeature.FAST_BLOCK_INTERACTION.isEnabled();
}
/**
* Sets whether fast block interaction is enabled or not.
*
* @param enable True if fast block interaction is enabled, else false.
*/
public void setFastBlockInteraction(boolean enable)
{
LambdaControlsFeature.FAST_BLOCK_INTERACTION.setEnabled(enable);
this.config.set("gameplay.fast_block_interaction", enable);
}
/**
* Returns whether front block placing is enabled or not.
*
@@ -260,16 +281,6 @@ public class LambdaControlsConfig
this.config.set("gameplay.front_block_placing", enable);
}
/**
* Gets whether fast block interaction is enabled or not.
*
* @return True if fast block interaction is enabled, else false.
*/
public boolean hasFastBlockPlacement()
{
return LambdaControlsFeature.FAST_BLOCK_PLACEMENT.isEnabled();
}
/**
* Returns whether fly drifting is enabled or not.
*

View File

@@ -13,10 +13,10 @@ auto_switch_mode = false
# Gameplay settings
[gameplay]
# Enables fast block interaction like in Bedrock Edition.
fast_block_interaction = true
# Enables front block placing like in Bedrock Edition.
front_block_placing = false
# Enables fast block interaction like in Bedrock Edition.
fast_block_interact = true
# Fly behaviors
[gameplay.fly]
# Enables fly drifting.