Config pick (#11073)

* Pick Configs

* Fix character overlay picking

* More descriptive method name
This commit is contained in:
MEEPofFaith
2025-07-28 09:56:55 -04:00
committed by GitHub
parent efccaeb7fc
commit 4938bcaeb1
5 changed files with 21 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ public enum EditorTool{
Tile tile = editor.tile(x, y);
editor.drawBlock = tile.block() == Blocks.air || !tile.block().inEditor ? tile.overlay() == Blocks.air ? tile.floor() : tile.overlay() : tile.block();
editor.drawBlock.editorPicked(tile);
}
},
line(KeyCode.l, "replace", "orthogonal"){

View File

@@ -963,6 +963,11 @@ public class Block extends UnlockableContent implements Senseable{
}
/** Called when pick blocked in the editor. */
public void editorPicked(Tile tile){
}
public boolean isFloor(){
return this instanceof Floor;
}

View File

@@ -80,6 +80,11 @@ public class CharacterOverlay extends OverlayFloor{
tile.overlayData = CharOverlayData.get(data, (byte)rotation);
}
@Override
public void editorPicked(Tile tile){
lastConfig = (int)CharOverlayData.character(tile.overlayData);
}
public static byte charToData(char c){
int index = chars.indexOf(Character.toUpperCase(c));
return index == -1 ? 0 : (byte)index;

View File

@@ -180,6 +180,11 @@ public class ColoredFloor extends Floor{
}
}
@Override
public void editorPicked(Tile tile){
lastConfig = tile.extraData;
}
@Override
public void drawPlanRegion(BuildPlan plan, Eachable<BuildPlan> list){
if(plan.config instanceof Integer i){

View File

@@ -64,6 +64,11 @@ public class ColoredWall extends StaticWall{
}
}
@Override
public void editorPicked(Tile tile){
lastConfig = tile.extraData;
}
@Override
public void drawPlanRegion(BuildPlan plan, Eachable<BuildPlan> list){
if(plan.config instanceof Integer i){