Moved "cliffs" button into fill tool
This commit is contained in:
@@ -593,6 +593,8 @@ toolmode.fillteams = Fill Teams
|
|||||||
toolmode.fillteams.description = Fill teams instead of blocks.
|
toolmode.fillteams.description = Fill teams instead of blocks.
|
||||||
toolmode.fillerase = Fill Erase
|
toolmode.fillerase = Fill Erase
|
||||||
toolmode.fillerase.description = Erase blocks of the same type.
|
toolmode.fillerase.description = Erase blocks of the same type.
|
||||||
|
toolmode.fillcliffs = Fill Cliffs
|
||||||
|
toolmode.fillcliffs.description = Turns walls into cliffs.
|
||||||
toolmode.drawteams = Draw Teams
|
toolmode.drawteams = Draw Teams
|
||||||
toolmode.drawteams.description = Draw teams instead of blocks.
|
toolmode.drawteams.description = Draw teams instead of blocks.
|
||||||
#unused
|
#unused
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public enum EditorTool{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fill(KeyCode.g, "replaceall", "fillteams", "fillerase"){
|
fill(KeyCode.g, "replaceall", "fillteams", "fillerase", "fillcliffs"){
|
||||||
{
|
{
|
||||||
edit = true;
|
edit = true;
|
||||||
}
|
}
|
||||||
@@ -185,6 +185,27 @@ public enum EditorTool{
|
|||||||
if(setter != null){
|
if(setter != null){
|
||||||
fill(x, y, false, tester, setter);
|
fill(x, y, false, tester, setter);
|
||||||
}
|
}
|
||||||
|
}else if(mode == 3){ //cliff fill
|
||||||
|
if(!tile.block().isStatic() || tile.block() == Blocks.cliff) return;
|
||||||
|
Bits wasStatic = new Bits(editor.width() * editor.height());
|
||||||
|
fill(x, y, false, t -> t.block().isStatic() && t.block() != Blocks.cliff, t -> {
|
||||||
|
int rotation = 0;
|
||||||
|
for(int i = 0; i < 8; i++){
|
||||||
|
Tile other = world.tiles.get(t.x + Geometry.d8[i].x, t.y + Geometry.d8[i].y);
|
||||||
|
if(other != null && !other.block().isStatic() && !wasStatic.get(other.array())){
|
||||||
|
rotation |= (1 << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rotation != 0){
|
||||||
|
t.setBlock(Blocks.cliff);
|
||||||
|
}else{
|
||||||
|
t.setBlock(Blocks.air);
|
||||||
|
wasStatic.set(t.array());
|
||||||
|
}
|
||||||
|
|
||||||
|
t.data = (byte)rotation;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -700,12 +700,6 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
t.button("@editor.center", Icon.move, Styles.flatt, view::center).growX().margin(9f);
|
t.button("@editor.center", Icon.move, Styles.flatt, view::center).growX().margin(9f);
|
||||||
}).growX().top();
|
}).growX().top();
|
||||||
}
|
}
|
||||||
|
|
||||||
mid.row();
|
|
||||||
|
|
||||||
mid.table(t -> {
|
|
||||||
t.button("@editor.cliffs", Icon.terrain, Styles.flatt, editor::addCliffs).growX().margin(9f);
|
|
||||||
}).growX().top();
|
|
||||||
}).margin(0).left().growY();
|
}).margin(0).left().growY();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user