WIP editor color stuff support (broken)
This commit is contained in:
@@ -47,7 +47,7 @@ public enum EditorTool{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//the "under liquid" rendering is too buggy to make public
|
//the "under liquid" rendering is too buggy to make public
|
||||||
pencil(KeyCode.b, "replace", "square", "drawteams"/*, "underliquid"*/){
|
pencil(KeyCode.b, "replace", "square", "drawteams", "underliquid"){
|
||||||
{
|
{
|
||||||
edit = true;
|
edit = true;
|
||||||
draggable = true;
|
draggable = true;
|
||||||
|
|||||||
@@ -155,13 +155,16 @@ public class MapEditor{
|
|||||||
|
|
||||||
Cons<Tile> drawer = tile -> {
|
Cons<Tile> drawer = tile -> {
|
||||||
if(!tester.get(tile)) return;
|
if(!tester.get(tile)) return;
|
||||||
|
boolean changed = false;
|
||||||
|
|
||||||
if(isFloor){
|
if(isFloor){
|
||||||
if(forceOverlay){
|
if(forceOverlay){
|
||||||
tile.setOverlay(drawBlock.asFloor());
|
tile.setOverlay(drawBlock.asFloor());
|
||||||
|
changed = true;
|
||||||
}else{
|
}else{
|
||||||
if(!(drawBlock.asFloor().wallOre && !tile.block().solid)){
|
if(!(drawBlock.asFloor().wallOre && !tile.block().solid)){
|
||||||
tile.setFloor(drawBlock.asFloor());
|
tile.setFloor(drawBlock.asFloor());
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!(tile.block().isMultiblock() && !drawBlock.isMultiblock())){
|
}else if(!(tile.block().isMultiblock() && !drawBlock.isMultiblock())){
|
||||||
@@ -170,11 +173,17 @@ public class MapEditor{
|
|||||||
}
|
}
|
||||||
|
|
||||||
tile.setBlock(drawBlock, drawTeam, rotation);
|
tile.setBlock(drawBlock, drawTeam, rotation);
|
||||||
|
changed = !drawBlock.synthetic();
|
||||||
|
|
||||||
if(drawBlock.synthetic()){
|
if(drawBlock.synthetic()){
|
||||||
addTileOp(TileOp.get(tile.x, tile.y, DrawOperation.opTeam, (byte)drawTeam.id));
|
addTileOp(TileOp.get(tile.x, tile.y, DrawOperation.opTeam, (byte)drawTeam.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(changed && drawBlock.saveConfig){
|
||||||
|
drawBlock.placeEnded(tile, null, editor.rotation, drawBlock.lastConfig);
|
||||||
|
renderer.updateStatic(tile.x, tile.y);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(square){
|
if(square){
|
||||||
|
|||||||
@@ -787,6 +787,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Table[] configTable = {null};
|
||||||
|
Block[] lastBlock = {null};
|
||||||
|
|
||||||
cont.table(search -> {
|
cont.table(search -> {
|
||||||
search.image(Icon.zoom).padRight(8);
|
search.image(Icon.zoom).padRight(8);
|
||||||
search.field("", this::rebuildBlockSelection).growX()
|
search.field("", this::rebuildBlockSelection).growX()
|
||||||
@@ -795,6 +798,19 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
cont.row();
|
cont.row();
|
||||||
cont.table(Tex.underline, extra -> extra.labelWrap(() -> editor.drawBlock.localizedName).width(200f).center()).growX();
|
cont.table(Tex.underline, extra -> extra.labelWrap(() -> editor.drawBlock.localizedName).width(200f).center()).growX();
|
||||||
cont.row();
|
cont.row();
|
||||||
|
cont.collapser(t -> {
|
||||||
|
configTable[0] = t;
|
||||||
|
}, () -> editor.drawBlock != null && editor.drawBlock.editorConfigurable).with(c -> c.setEnforceMinSize(true)).update(col -> {
|
||||||
|
|
||||||
|
if(lastBlock[0] != editor.drawBlock){
|
||||||
|
configTable[0].clear();
|
||||||
|
if(editor.drawBlock != null){
|
||||||
|
editor.drawBlock.buildEditorConfig(configTable[0]);
|
||||||
|
col.invalidateHierarchy();
|
||||||
|
}
|
||||||
|
lastBlock[0] = editor.drawBlock;
|
||||||
|
}
|
||||||
|
}).growX().row();
|
||||||
cont.add(pane).expandY().growX().top().left();
|
cont.add(pane).expandY().growX().top().left();
|
||||||
|
|
||||||
rebuildBlockSelection("");
|
rebuildBlockSelection("");
|
||||||
|
|||||||
Reference in New Issue
Block a user