Dacite decoration block / Environmental renaming

This commit is contained in:
Anuken
2020-09-10 15:17:10 -04:00
parent 88e3022db0
commit 74cefb3ec9
95 changed files with 10486 additions and 10175 deletions

View File

@@ -1,6 +1,7 @@
package mindustry.editor;
import arc.func.*;
import arc.input.*;
import arc.math.*;
import arc.math.geom.*;
import arc.struct.*;
@@ -10,8 +11,8 @@ import mindustry.game.*;
import mindustry.world.*;
public enum EditorTool{
zoom,
pick{
zoom(KeyCode.v),
pick(KeyCode.i){
public void touched(MapEditor editor, int x, int y){
if(!Structs.inBounds(x, y, editor.width(), editor.height())) return;
@@ -19,7 +20,7 @@ public enum EditorTool{
editor.drawBlock = tile.block() == Blocks.air ? tile.overlay() == Blocks.air ? tile.floor() : tile.overlay() : tile.block();
}
},
line("replace", "orthogonal"){
line(KeyCode.l, "replace", "orthogonal"){
@Override
public void touchedLine(MapEditor editor, int x1, int y1, int x2, int y2){
@@ -43,7 +44,7 @@ public enum EditorTool{
});
}
},
pencil("replace", "square", "drawteams"){
pencil(KeyCode.b, "replace", "square", "drawteams"){
{
edit = true;
draggable = true;
@@ -67,7 +68,7 @@ public enum EditorTool{
}
},
eraser("eraseores"){
eraser(KeyCode.e, "eraseores"){
{
edit = true;
draggable = true;
@@ -86,7 +87,7 @@ public enum EditorTool{
});
}
},
fill("replaceall", "fillteams"){
fill(KeyCode.g, "replaceall", "fillteams"){
{
edit = true;
}
@@ -205,7 +206,7 @@ public enum EditorTool{
}
}
},
spray("replace"){
spray(KeyCode.r, "replace"){
final double chance = 0.012;
{
@@ -231,8 +232,12 @@ public enum EditorTool{
}
};
public static final EditorTool[] all = values();
/** All the internal alternate placement modes of this tool. */
public final String[] altModes;
/** Key to activate this tool. */
public KeyCode key = KeyCode.unset;
/** The current alternate placement mode. -1 is the standard mode, no changes.*/
public int mode = -1;
/** Whether this tool causes canvas changes when touched.*/
@@ -244,10 +249,20 @@ public enum EditorTool{
this(new String[]{});
}
EditorTool(KeyCode code){
this(new String[]{});
this.key = code;
}
EditorTool(String... altModes){
this.altModes = altModes;
}
EditorTool(KeyCode code, String... altModes){
this.altModes = altModes;
this.key = code;
}
public void touched(MapEditor editor, int x, int y){}
public void touchedLine(MapEditor editor, int x1, int y1, int x2, int y2){}

View File

@@ -576,22 +576,20 @@ public class MapEditorDialog extends Dialog implements Disposable{
if(Core.input.ctrl()){
//alt mode select
for(int i = 0; i < view.getTool().altModes.length + 1; i++){
if(Core.input.keyTap(KeyCode.valueOf("num" + (i + 1)))){
view.getTool().mode = i - 1;
for(int i = 0; i < view.getTool().altModes.length; i++){
if(i + 1 < KeyCode.numbers.length && Core.input.keyTap(KeyCode.numbers[i + 1])){
view.getTool().mode = i;
}
}
}else{
//tool select
for(int i = 0; i < EditorTool.values().length; i++){
if(Core.input.keyTap(KeyCode.valueOf("num" + (i + 1)))){
view.setTool(EditorTool.values()[i]);
for(EditorTool tool : EditorTool.all){
if(Core.input.keyTap(tool.key)){
view.setTool(tool);
break;
}
}
}
if(Core.input.keyTap(KeyCode.escape)){
if(!menu.isShown()){
menu.show();
@@ -619,7 +617,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
for(int x = 0; x < editor.width(); x++){
for(int y = 0; y < editor.height(); y++){
Tile tile = editor.tile(x, y);
if(tile.block().breakable && tile.block() instanceof Rock){
if(tile.block().breakable && tile.block() instanceof Boulder){
tile.setBlock(Blocks.air);
editor.renderer().updatePoint(x, y);
}