Add precision to some tooltips and prepare for the fast/accurate block placement feature.

This commit is contained in:
LambdAurora
2020-02-05 13:28:23 +01:00
parent 47b0cfdad4
commit e13569b71d
7 changed files with 27 additions and 10 deletions

View File

@@ -21,13 +21,14 @@ import java.util.Optional;
* Represents a feature.
*
* @author LambdAurora
* @version 1.1.0
* @version 1.1.1
* @since 1.1.0
*/
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);
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 final String key;
private final boolean defaultAllowed;
@@ -155,5 +156,6 @@ public class LambdaControlsFeature implements Nameable
static {
FEATURES.add(FRONT_BLOCK_PLACING);
FEATURES.add(FAST_BLOCK_PLACEMENT);
}
}

View File

@@ -41,6 +41,7 @@ public class LambdaControlsConfig
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;
// Controller
@@ -84,6 +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));
// 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);
@@ -132,6 +134,7 @@ public class LambdaControlsConfig
this.setHudSide(DEFAULT_HUD_SIDE);
// Gameplay
this.setFrontBlockPlacing(DEFAULT_FRONT_BLOCK_PLACING);
this.setFastBlockInteract(DEFAULT_FAST_BLOCK_INTERACT);
this.setFlyDrifting(DEFAULT_FLY_DRIFTING);
this.setFlyVerticalDrifting(DEFAULT_FLY_VERTICAL_DRIFTING);
// Controller
@@ -257,6 +260,16 @@ 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

@@ -105,8 +105,8 @@
"lambdacontrols.tooltip.controller_type": "The controller type to display the correct buttons.",
"lambdacontrols.tooltip.controls_mode": "The controls mode.",
"lambdacontrols.tooltip.dead_zone": "The dead zone for the controller's analogue sticks.",
"lambdacontrols.tooltip.fly_drifting": "While flying, enables drifting/inertia.",
"lambdacontrols.tooltip.fly_drifting_vertical": "While flying, enables vertical drifting/intertia.",
"lambdacontrols.tooltip.fly_drifting": "While flying, enables Vanilla drifting/inertia.",
"lambdacontrols.tooltip.fly_drifting_vertical": "While flying, enables Vanilla vertical drifting/intertia.",
"lambdacontrols.tooltip.front_block_placing": "Enables front block placing, §cmight be considered cheating on some servers§r.",
"lambdacontrols.tooltip.hud_enable": "Toggles the on-screen controller button indicator.",
"lambdacontrols.tooltip.hud_side": "The position of the HUD.",

View File

@@ -105,8 +105,8 @@
"lambdacontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"lambdacontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"lambdacontrols.tooltip.dead_zone": "Zone morte des axes de la manette.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"lambdacontrols.tooltip.front_block_placing": "Active le placement avant de blocs, §cpeut être considérer comme de la trice sur certains serveurs§r.",
"lambdacontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"lambdacontrols.tooltip.hud_side": "Change la position du HUD.",

View File

@@ -105,8 +105,8 @@
"lambdacontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"lambdacontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"lambdacontrols.tooltip.dead_zone": "Zone morte des axes de la manette.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"lambdacontrols.tooltip.front_block_placing": "Active le placement avant de blocs, §cpeut être considérer comme de la trice sur certains serveurs§r.",
"lambdacontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"lambdacontrols.tooltip.hud_side": "Change la position du HUD.",

View File

@@ -15,6 +15,8 @@ auto_switch_mode = false
[gameplay]
# 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.

View File

@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.7.6+build.180
# Mod Properties
mod_version = 1.1.0
mod_version = 1.1.1
maven_group = me.lambdaurora
archives_base_name = lambdacontrols