Partial fix of editor multiblock undo/redo
This commit is contained in:
@@ -1191,7 +1191,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phaseFabric, 25, Items.plastanium, 75, Items.thorium, 50));
|
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phaseFabric, 25, Items.plastanium, 75, Items.thorium, 50));
|
||||||
size = 2;
|
size = 2;
|
||||||
powerProduction = 4.5f;
|
powerProduction = 4.5f;
|
||||||
itemDuration = 60 * 18f;
|
itemDuration = 60 * 15f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
solarPanel = new SolarGenerator("solar-panel"){{
|
solarPanel = new SolarGenerator("solar-panel"){{
|
||||||
@@ -1991,8 +1991,8 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
illuminator = new LightBlock("illuminator"){{
|
illuminator = new LightBlock("illuminator"){{
|
||||||
requirements(Category.effect, BuildVisibility.lightingOnly, with(Items.graphite, 12, Items.silicon, 8));
|
requirements(Category.effect, BuildVisibility.lightingOnly, with(Items.graphite, 12, Items.silicon, 8));
|
||||||
brightness = 0.67f;
|
brightness = 0.75f;
|
||||||
radius = 140f;
|
radius = 160f;
|
||||||
consumes.power(0.06f);
|
consumes.power(0.06f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -1290,7 +1290,7 @@ public class UnitTypes implements ContentList{
|
|||||||
collides = false;
|
collides = false;
|
||||||
|
|
||||||
healPercent = 15f;
|
healPercent = 15f;
|
||||||
splashDamage = 320f;
|
splashDamage = 240f;
|
||||||
splashDamageRadius = 120f;
|
splashDamageRadius = 120f;
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
|
|||||||
@@ -50,9 +50,19 @@ public class EditorTile extends Tile{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isCenter()){
|
||||||
|
EditorTile cen = (EditorTile)build.tile;
|
||||||
|
cen.op(OpType.rotation, (byte)build.rotation);
|
||||||
|
cen.op(OpType.team, (byte)build.team.id);
|
||||||
|
cen.op(OpType.block, block.id);
|
||||||
|
update();
|
||||||
|
}else{
|
||||||
|
if(build != null) op(OpType.rotation, (byte)build.rotation);
|
||||||
|
if(build != null) op(OpType.team, (byte)build.team.id);
|
||||||
op(OpType.block, block.id);
|
op(OpType.block, block.id);
|
||||||
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
|
||||||
if(team != Team.derelict) op(OpType.team, (byte)team.id);
|
}
|
||||||
|
|
||||||
super.setBlock(type, team, rotation);
|
super.setBlock(type, team, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public class MapEditor{
|
|||||||
boolean hasOverlap(int x, int y){
|
boolean hasOverlap(int x, int y){
|
||||||
Tile tile = world.tile(x, y);
|
Tile tile = world.tile(x, y);
|
||||||
//allow direct replacement of blocks of the same size
|
//allow direct replacement of blocks of the same size
|
||||||
if(tile != null && tile.isCenter() && tile.block() != drawBlock && tile.block().size == drawBlock.size){
|
if(tile != null && tile.isCenter() && tile.block() != drawBlock && tile.block().size == drawBlock.size && tile.x == x && tile.y == y){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,6 @@ public class MapEditor{
|
|||||||
for(int dy = 0; dy < drawBlock.size; dy++){
|
for(int dy = 0; dy < drawBlock.size; dy++){
|
||||||
int worldx = dx + offsetx + x;
|
int worldx = dx + offsetx + x;
|
||||||
int worldy = dy + offsety + y;
|
int worldy = dy + offsety + y;
|
||||||
if(!(worldx == x && worldy == y)){
|
|
||||||
Tile other = world.tile(worldx, worldy);
|
Tile other = world.tile(worldx, worldy);
|
||||||
|
|
||||||
if(other != null && other.block().isMultiblock()){
|
if(other != null && other.block().isMultiblock()){
|
||||||
@@ -176,7 +175,6 @@ public class MapEditor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
|||||||
//assign entity and type to blocks, so they act as proxies for this one
|
//assign entity and type to blocks, so they act as proxies for this one
|
||||||
other.build = entity;
|
other.build = entity;
|
||||||
other.block = block;
|
other.block = block;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=f316225521c91df6c132b13fa2044d969ec39231
|
archash=aac5351b3ebb9f598e02af6dcc1aaaa31994fa9b
|
||||||
|
|||||||
Reference in New Issue
Block a user