This commit is contained in:
Anuken
2018-11-01 09:09:12 -04:00
parent 9a1bb69cd8
commit 8bf68aa020
4 changed files with 11 additions and 18 deletions

View File

@@ -2,7 +2,6 @@ package io.anuke.mindustry.maps;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntArray;
import io.anuke.annotations.Annotations.Serialize;
import io.anuke.mindustry.game.Saves.SaveSlot;
import io.anuke.mindustry.game.SpawnGroup;
@@ -25,8 +24,6 @@ public class Sector{
public int saveID = -1;
/**Num of missions in this sector that have been completed so far.*/
public int completedMissions;
/**List of links to other sector coords.*/
public IntArray links = new IntArray();
/**Display texture. Needs to be disposed.*/
public transient Texture texture;

View File

@@ -35,7 +35,7 @@ public class Sectors{
private final GridMap<Sector> grid = new GridMap<>();
private final SectorPresets presets = new SectorPresets();
private final Array<Item> allOres = Item.getAllOres();
private AsyncExecutor executor = new AsyncExecutor(6);
private final AsyncExecutor executor = new AsyncExecutor(6);
public void playSector(Sector sector){
if(sector.hasSave() && SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
@@ -109,6 +109,7 @@ public class Sectors{
for(GridPoint2 g : Geometry.d4){
createSector(x + g.x, y + g.y);
Sector other = grid.get(x + g.x, y + g.y);
}
}

View File

@@ -139,42 +139,37 @@ public class SectorsDialog extends FloatingDialog{
float drawY = y + height/2f + sectorY * padSectorSize - offsetY * padSectorSize - panY % padSectorSize + padSectorSize/2f;
Sector sector = world.sectors.get(sectorX, sectorY);
int width = 1;
int height = 1;
if(sector == null || sector.texture == null){
Draw.color(Color.DARK_GRAY);
Draw.rect(Draw.getBlankRegion(), drawX, drawY, sectorSize * width + 1f, sectorSize * height + 1f);
Draw.rect(Draw.getBlankRegion(), drawX, drawY, sectorSize + 1f, sectorSize + 1f);
continue;
}
Draw.colorl(!sector.complete ? 0.3f : 1f);
Draw.rect(sector.texture, drawX, drawY, sectorSize * width + 1f, sectorSize * height + 1f);
Draw.rect(sector.texture, drawX, drawY, sectorSize + 1f, sectorSize + 1f);
if(sector.missions.size == 0) continue;
Draw.color(Color.DARK_GRAY);
Fill.square(drawX, drawY - 5f, Unit.dp.scl(10f), 45f);
Draw.color(Palette.place);
if(sector == selected){
Draw.color(Palette.place);
}else if(Mathf.inRect(mouse.x, mouse.y, drawX - padSectorSize/2f * width, drawY - padSectorSize/2f * height,
drawX + padSectorSize/2f * width, drawY + padSectorSize/2f * height)){
}else if(Mathf.inRect(mouse.x, mouse.y, drawX - padSectorSize / 2f, drawY - padSectorSize / 2f,
drawX + padSectorSize / 2f, drawY + padSectorSize / 2f)){
if(clicked){
selectSector(sector);
}
Draw.color(Palette.remove);
}else if (sector.complete){
}else if(sector.complete){
Draw.color(Palette.accent);
}else{
Draw.color(Color.LIGHT_GRAY);
}
Fill.square(drawX, drawY, Unit.dp.scl(10f), 45f);
//Lines.crect(drawX, drawY, sectorSize * width + paddingx, sectorSize * height + paddingy, 0);
}
}
Draw.color(Color.GRAY);
Lines.stroke(Unit.dp.scl(4f));
//Lines.crect(x + width/2f, y + height/2f, width, height);