dimension limits
This commit is contained in:
@@ -1087,6 +1087,7 @@ ability.stat.minspeed = [stat]{0} tiles/sec[lightgray] min speed
|
|||||||
ability.stat.duration = [stat]{0} sec[lightgray] duration
|
ability.stat.duration = [stat]{0} sec[lightgray] duration
|
||||||
ability.stat.buildtime = [stat]{0} sec[lightgray] build time
|
ability.stat.buildtime = [stat]{0} sec[lightgray] build time
|
||||||
|
|
||||||
|
bar.displaytoolarge = Dimensions too large\n(Max: {0}x{0})
|
||||||
bar.onlycoredeposit = Only Core Depositing Allowed
|
bar.onlycoredeposit = Only Core Depositing Allowed
|
||||||
bar.drilltierreq = Better Drill Required
|
bar.drilltierreq = Better Drill Required
|
||||||
bar.noresources = Missing Resources
|
bar.noresources = Missing Resources
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package mindustry.world.blocks.logic;
|
package mindustry.world.blocks.logic;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.graphics.gl.*;
|
import arc.graphics.gl.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
@@ -15,6 +17,9 @@ public class TileableLogicDisplay extends LogicDisplay{
|
|||||||
protected static final Seq<TileableLogicDisplayBuild> displays = new Seq<>();
|
protected static final Seq<TileableLogicDisplayBuild> displays = new Seq<>();
|
||||||
protected static final IntSet processed = new IntSet();
|
protected static final IntSet processed = new IntSet();
|
||||||
|
|
||||||
|
//in tiles
|
||||||
|
public int maxDisplayDimensions = 12;
|
||||||
|
|
||||||
public TileableLogicDisplay(String name){
|
public TileableLogicDisplay(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
@@ -79,6 +84,15 @@ public class TileableLogicDisplay extends LogicDisplay{
|
|||||||
//size of display area
|
//size of display area
|
||||||
public int tilesWidth = 1, tilesHeight = 1, originX, originY;
|
public int tilesWidth = 1, tilesHeight = 1, originX, originY;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(Table table){
|
||||||
|
super.display(table);
|
||||||
|
|
||||||
|
if(tilesWidth > maxDisplayDimensions || tilesHeight > maxDisplayDimensions){
|
||||||
|
table.row().add(Core.bundle.format("bar.displaytoolarge", maxDisplayDimensions, maxDisplayDimensions)).color(Color.scarlet).growX().wrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
Draw.rect(block.region, x, y);
|
Draw.rect(block.region, x, y);
|
||||||
@@ -88,9 +102,8 @@ public class TileableLogicDisplay extends LogicDisplay{
|
|||||||
|
|
||||||
if(isRoot()){
|
if(isRoot()){
|
||||||
Draw.draw(Draw.z(), () -> {
|
Draw.draw(Draw.z(), () -> {
|
||||||
if(buffer == null){
|
if(buffer == null && tilesWidth <= maxDisplayDimensions && tilesHeight <= maxDisplayDimensions){
|
||||||
buffer = new FrameBuffer(32 * tilesWidth, 32 * tilesHeight);
|
buffer = new FrameBuffer(32 * tilesWidth, 32 * tilesHeight);
|
||||||
Log.info("create " + buffer.getWidth() + " " + buffer.getHeight());
|
|
||||||
//clear the buffer - some OSs leave garbage in it
|
//clear the buffer - some OSs leave garbage in it
|
||||||
buffer.begin(Pal.darkerMetal);
|
buffer.begin(Pal.darkerMetal);
|
||||||
buffer.end();
|
buffer.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user