Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -597,6 +597,7 @@ setting.shadows.name = Shadows
|
|||||||
setting.blockreplace.name = Automatic Block Suggestions
|
setting.blockreplace.name = Automatic Block Suggestions
|
||||||
setting.linear.name = Linear Filtering
|
setting.linear.name = Linear Filtering
|
||||||
setting.hints.name = Hints
|
setting.hints.name = Hints
|
||||||
|
setting.buildautopause.name = Auto-pause Building
|
||||||
setting.animatedwater.name = Animated Water
|
setting.animatedwater.name = Animated Water
|
||||||
setting.animatedshields.name = Animated Shields
|
setting.animatedshields.name = Animated Shields
|
||||||
setting.antialias.name = Antialias[lightgray] (requires restart)[]
|
setting.antialias.name = Antialias[lightgray] (requires restart)[]
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
public @Nullable
|
public @Nullable
|
||||||
String uuid, usid;
|
String uuid, usid;
|
||||||
public boolean isAdmin, isTransferring, isShooting, isBoosting, isMobile, isTyping, isBuilding = true;
|
public boolean isAdmin, isTransferring, isShooting, isBoosting, isMobile, isTyping, isBuilding = true;
|
||||||
|
public boolean buildWasAutoPaused = false;
|
||||||
public float boostHeat, shootHeat, destructTime;
|
public float boostHeat, shootHeat, destructTime;
|
||||||
public boolean achievedFlight;
|
public boolean achievedFlight;
|
||||||
public Color color = new Color();
|
public Color color = new Color();
|
||||||
|
|||||||
@@ -142,6 +142,30 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called when the player taps a block. */
|
||||||
|
public static class TapEvent{
|
||||||
|
public final Tile tile;
|
||||||
|
public final Player player;
|
||||||
|
|
||||||
|
public TapEvent(Tile tile, Player player){
|
||||||
|
this.tile = tile;
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called when the player sets a specific block. */
|
||||||
|
public static class TapConfigEvent{
|
||||||
|
public final Tile tile;
|
||||||
|
public final Player player;
|
||||||
|
public final int value;
|
||||||
|
|
||||||
|
public TapConfigEvent(Tile tile, Player player, int value){
|
||||||
|
this.tile = tile;
|
||||||
|
this.player = player;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class GameOverEvent{
|
public static class GameOverEvent{
|
||||||
public final Team winner;
|
public final Team winner;
|
||||||
|
|
||||||
|
|||||||
@@ -267,6 +267,12 @@ public class DesktopInput extends InputHandler{
|
|||||||
int cursorY = tileY(Core.input.mouseY());
|
int cursorY = tileY(Core.input.mouseY());
|
||||||
int rawCursorX = world.toTile(Core.input.mouseWorld().x), rawCursorY = world.toTile(Core.input.mouseWorld().y);
|
int rawCursorX = world.toTile(Core.input.mouseWorld().x), rawCursorY = world.toTile(Core.input.mouseWorld().y);
|
||||||
|
|
||||||
|
// automatically pause building if the current build queue is empty
|
||||||
|
if(Core.settings.getBool("buildautopause") && player.isBuilding && !player.isBuilding()){
|
||||||
|
player.isBuilding = false;
|
||||||
|
player.buildWasAutoPaused = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(!selectRequests.isEmpty()){
|
if(!selectRequests.isEmpty()){
|
||||||
int shiftX = rawCursorX - schematicX, shiftY = rawCursorY - schematicY;
|
int shiftX = rawCursorX - schematicX, shiftY = rawCursorY - schematicY;
|
||||||
|
|
||||||
@@ -337,6 +343,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
|
|
||||||
if(Core.input.keyTap(Binding.pause_building)){
|
if(Core.input.keyTap(Binding.pause_building)){
|
||||||
player.isBuilding = !player.isBuilding;
|
player.isBuilding = !player.isBuilding;
|
||||||
|
player.buildWasAutoPaused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((cursorX != lastLineX || cursorY != lastLineY) && isPlacing() && mode == placing){
|
if((cursorX != lastLineX || cursorY != lastLineY) && isPlacing() && mode == placing){
|
||||||
|
|||||||
@@ -145,12 +145,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
if(tile == null || player == null) return;
|
if(tile == null || player == null) return;
|
||||||
if(!Units.canInteract(player, tile)) return;
|
if(!Units.canInteract(player, tile)) return;
|
||||||
tile.block().tapped(tile, player);
|
tile.block().tapped(tile, player);
|
||||||
|
Core.app.post(() -> Events.fire(new TapEvent(tile, player)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
||||||
public static void onTileConfig(Player player, Tile tile, int value){
|
public static void onTileConfig(Player player, Tile tile, int value){
|
||||||
if(tile == null || !Units.canInteract(player, tile)) return;
|
if(tile == null || !Units.canInteract(player, tile)) return;
|
||||||
tile.block().configured(tile, player, value);
|
tile.block().configured(tile, player, value);
|
||||||
|
Core.app.post(() -> Events.fire(new TapConfigEvent(tile, player, value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Eachable<BuildRequest> allRequests(){
|
public Eachable<BuildRequest> allRequests(){
|
||||||
|
|||||||
@@ -228,6 +228,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
game.checkPref("blockreplace", true);
|
game.checkPref("blockreplace", true);
|
||||||
game.checkPref("conveyorpathfinding", true);
|
game.checkPref("conveyorpathfinding", true);
|
||||||
game.checkPref("hints", true);
|
game.checkPref("hints", true);
|
||||||
|
if(!mobile){
|
||||||
|
game.checkPref("buildautopause", false);
|
||||||
|
}
|
||||||
|
|
||||||
if(steam && !Version.modifier.contains("beta")){
|
if(steam && !Version.modifier.contains("beta")){
|
||||||
game.checkPref("publichost", false, i -> {
|
game.checkPref("publichost", false, i -> {
|
||||||
|
|||||||
@@ -144,6 +144,9 @@ public class BuildBlock extends Block{
|
|||||||
|
|
||||||
//if the target is constructible, begin constructing
|
//if the target is constructible, begin constructing
|
||||||
if(entity.cblock != null){
|
if(entity.cblock != null){
|
||||||
|
if(player.buildWasAutoPaused && !player.isBuilding){
|
||||||
|
player.isBuilding = true;
|
||||||
|
}
|
||||||
//player.clearBuilding();
|
//player.clearBuilding();
|
||||||
player.addBuildRequest(new BuildRequest(tile.x, tile.y, tile.rotation(), entity.cblock), false);
|
player.addBuildRequest(new BuildRequest(tile.x, tile.y, tile.rotation(), entity.cblock), false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user