Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -78,8 +78,8 @@ public class RegionPart extends DrawPart{
|
|||||||
mx += move.x * p;
|
mx += move.x * p;
|
||||||
my += move.y * p;
|
my += move.y * p;
|
||||||
mr += move.rot * p;
|
mr += move.rot * p;
|
||||||
gx += move.gx;
|
gx += move.gx * p;
|
||||||
gy += move.gy;
|
gy += move.gy * p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ public class RegionPart extends DrawPart{
|
|||||||
//can be null
|
//can be null
|
||||||
var region = drawRegion ? regions[Math.min(i, regions.length - 1)] : null;
|
var region = drawRegion ? regions[Math.min(i, regions.length - 1)] : null;
|
||||||
float sign = (i == 0 ? 1 : -1) * params.sideMultiplier;
|
float sign = (i == 0 ? 1 : -1) * params.sideMultiplier;
|
||||||
Tmp.v1.set((x + mx) * sign * Draw.xscl, (y + my) * Draw.yscl).rotateRadExact((params.rotation - 90) * Mathf.degRad);
|
Tmp.v1.set((x + mx) * sign, y + my).rotateRadExact((params.rotation - 90) * Mathf.degRad);
|
||||||
|
|
||||||
float
|
float
|
||||||
rx = params.x + Tmp.v1.x,
|
rx = params.x + Tmp.v1.x,
|
||||||
|
|||||||
@@ -257,13 +257,13 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when the player configures a specific building. */
|
/** Called when a specific building has its configuration changed. */
|
||||||
public static class ConfigEvent{
|
public static class ConfigEvent{
|
||||||
public final Building tile;
|
public final Building tile;
|
||||||
public final Player player;
|
public final @Nullable Player player;
|
||||||
public final Object value;
|
public final Object value;
|
||||||
|
|
||||||
public ConfigEvent(Building tile, Player player, Object value){
|
public ConfigEvent(Building tile, @Nullable Player player, Object value){
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
@@ -473,6 +473,18 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class BuildRotateEvent{
|
||||||
|
public final Building build;
|
||||||
|
public final @Nullable Unit unit;
|
||||||
|
public final int previous;
|
||||||
|
|
||||||
|
public BuildRotateEvent(Building build, @Nullable Unit unit, int previous){
|
||||||
|
this.build = build;
|
||||||
|
this.unit = unit;
|
||||||
|
this.previous = previous;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player or drone begins building something.
|
* Called when a player or drone begins building something.
|
||||||
* This does not necessarily happen when a new ConstructBlock is created.
|
* This does not necessarily happen when a new ConstructBlock is created.
|
||||||
|
|||||||
@@ -464,10 +464,12 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(player != null) build.lastAccessed = player.name;
|
if(player != null) build.lastAccessed = player.name;
|
||||||
|
int previous = build.rotation;
|
||||||
build.rotation = Mathf.mod(build.rotation + Mathf.sign(direction), 4);
|
build.rotation = Mathf.mod(build.rotation + Mathf.sign(direction), 4);
|
||||||
build.updateProximity();
|
build.updateProximity();
|
||||||
build.noSleep();
|
build.noSleep();
|
||||||
Fx.rotateBlock.at(build.x, build.y, build.block.size);
|
Fx.rotateBlock.at(build.x, build.y, build.block.size);
|
||||||
|
Events.fire(new BuildRotateEvent(build, player.unit(), previous));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
||||||
|
|||||||
@@ -77,10 +77,12 @@ public class Build{
|
|||||||
//auto-rotate the block to the correct orientation and bail out
|
//auto-rotate the block to the correct orientation and bail out
|
||||||
if(tile.team() == team && tile.block == result && tile.build != null && tile.block.quickRotate){
|
if(tile.team() == team && tile.block == result && tile.build != null && tile.block.quickRotate){
|
||||||
if(unit != null && unit.getControllerName() != null) tile.build.lastAccessed = unit.getControllerName();
|
if(unit != null && unit.getControllerName() != null) tile.build.lastAccessed = unit.getControllerName();
|
||||||
|
int previous = tile.build.rotation;
|
||||||
tile.build.rotation = Mathf.mod(rotation, 4);
|
tile.build.rotation = Mathf.mod(rotation, 4);
|
||||||
tile.build.updateProximity();
|
tile.build.updateProximity();
|
||||||
tile.build.noSleep();
|
tile.build.noSleep();
|
||||||
Fx.rotateBlock.at(tile.build.x, tile.build.y, tile.build.block.size);
|
Fx.rotateBlock.at(tile.build.x, tile.build.y, tile.build.block.size);
|
||||||
|
Events.fire(new BuildRotateEvent(tile.build, unit, previous));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user