Fixed many various map bugs
|
Before Width: | Height: | Size: 118 B |
BIN
core/assets-raw/sprites_replacement/blocks/environment/spawn.png
Normal file
|
After Width: | Height: | Size: 221 B |
@@ -426,6 +426,7 @@ category.shooting = Shooting
|
|||||||
category.optional = Optional Enhancements
|
category.optional = Optional Enhancements
|
||||||
setting.landscape.name = Lock Landscape
|
setting.landscape.name = Lock Landscape
|
||||||
setting.shadows.name = Shadows
|
setting.shadows.name = Shadows
|
||||||
|
setting.linear.name = Linear Filtering
|
||||||
setting.animatedwater.name = Animated Water
|
setting.animatedwater.name = Animated Water
|
||||||
setting.animatedshields.name = Animated Shields
|
setting.animatedshields.name = Animated Shields
|
||||||
setting.antialias.name = Antialias[LIGHT_GRAY] (requires restart)[]
|
setting.antialias.name = Antialias[LIGHT_GRAY] (requires restart)[]
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 404 KiB |
|
Before Width: | Height: | Size: 307 KiB After Width: | Height: | Size: 306 KiB |
|
Before Width: | Height: | Size: 293 KiB After Width: | Height: | Size: 293 KiB |
@@ -5,8 +5,7 @@ import io.anuke.arc.collection.IntArray;
|
|||||||
import io.anuke.arc.collection.IntQueue;
|
import io.anuke.arc.collection.IntQueue;
|
||||||
import io.anuke.arc.math.geom.Geometry;
|
import io.anuke.arc.math.geom.Geometry;
|
||||||
import io.anuke.arc.math.geom.Point2;
|
import io.anuke.arc.math.geom.Point2;
|
||||||
import io.anuke.arc.util.Structs;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Time;
|
|
||||||
import io.anuke.mindustry.game.EventType.TileChangeEvent;
|
import io.anuke.mindustry.game.EventType.TileChangeEvent;
|
||||||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import io.anuke.arc.Events;
|
|||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.math.Angles;
|
import io.anuke.arc.math.Angles;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Tmp;
|
|
||||||
import io.anuke.mindustry.content.Blocks;
|
import io.anuke.mindustry.content.Blocks;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
import io.anuke.mindustry.entities.Damage;
|
import io.anuke.mindustry.entities.Damage;
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ public class Blocks implements ContentList{
|
|||||||
}
|
}
|
||||||
|
|
||||||
spawn = new OverlayFloor("spawn"){
|
spawn = new OverlayFloor("spawn"){
|
||||||
|
{
|
||||||
|
variants = 0;
|
||||||
|
}
|
||||||
public void draw(Tile tile){}
|
public void draw(Tile tile){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class EditorTile extends Tile{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(overlayID() == overlay) return;
|
if(overlayID() == overlay) return;
|
||||||
op(OpType.overlay, overlay);
|
op(OpType.overlay, this.overlay);
|
||||||
super.setOverlayID(overlay);
|
super.setOverlayID(overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ public class MapRenderer implements Disposable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
mesh.draw(idxDecal, region,
|
mesh.draw(idxDecal, region,
|
||||||
wx * tilesize + offsetX, wy * tilesize + offsetY,
|
wx * tilesize + offsetX, wy * tilesize + offsetY,
|
||||||
region.getWidth() * Draw.scl, region.getHeight() * Draw.scl);
|
region.getWidth() * Draw.scl, region.getHeight() * Draw.scl);
|
||||||
mesh.setColor(Color.WHITE);
|
mesh.setColor(Color.WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class Teams{
|
|||||||
/** Returns whether a team is active, e.g. whether it has any cores remaining. */
|
/** Returns whether a team is active, e.g. whether it has any cores remaining. */
|
||||||
public boolean isActive(Team team){
|
public boolean isActive(Team team){
|
||||||
//the enemy wave team is always active
|
//the enemy wave team is always active
|
||||||
return (Vars.state.rules.waves && team == Vars.waveTeam) || get(team).cores.size > 0;
|
return team == Vars.waveTeam || get(team).cores.size > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a set of all teams that are enemies of this team. */
|
/** Returns a set of all teams that are enemies of this team. */
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public abstract class SaveVersion extends SaveFileReader{
|
|||||||
state.wavetime = map.getFloat("wavetime", state.rules.waveSpacing);
|
state.wavetime = map.getFloat("wavetime", state.rules.waveSpacing);
|
||||||
state.stats = JsonIO.read(Stats.class, map.get("stats", "{}"));
|
state.stats = JsonIO.read(Stats.class, map.get("stats", "{}"));
|
||||||
state.rules = JsonIO.read(Rules.class, map.get("rules", "{}"));
|
state.rules = JsonIO.read(Rules.class, map.get("rules", "{}"));
|
||||||
|
if(state.rules.spawns.isEmpty()) state.rules.spawns = DefaultWaves.get();
|
||||||
Map worldmap = world.maps.byName(map.get("mapname", "\\\\\\"));
|
Map worldmap = world.maps.byName(map.get("mapname", "\\\\\\"));
|
||||||
world.setMap(worldmap == null ? new Map(StringMap.of(
|
world.setMap(worldmap == null ? new Map(StringMap.of(
|
||||||
"name", map.get("mapname", "Unknown"),
|
"name", map.get("mapname", "Unknown"),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.anuke.arc.collection.StringMap;
|
|||||||
import io.anuke.arc.files.FileHandle;
|
import io.anuke.arc.files.FileHandle;
|
||||||
import io.anuke.arc.graphics.Texture;
|
import io.anuke.arc.graphics.Texture;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.game.DefaultWaves;
|
||||||
import io.anuke.mindustry.game.Rules;
|
import io.anuke.mindustry.game.Rules;
|
||||||
import io.anuke.mindustry.io.JsonIO;
|
import io.anuke.mindustry.io.JsonIO;
|
||||||
|
|
||||||
@@ -57,7 +58,9 @@ public class Map implements Comparable<Map>{
|
|||||||
|
|
||||||
/** This creates a new instance.*/
|
/** This creates a new instance.*/
|
||||||
public Rules rules(){
|
public Rules rules(){
|
||||||
return JsonIO.read(Rules.class, tags.get("rules", "{}"));
|
Rules result = JsonIO.read(Rules.class, tags.get("rules", "{}"));
|
||||||
|
if(result.spawns.isEmpty()) result.spawns = DefaultWaves.get();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Whether this map has a core of the enemy 'wave' team. Default: true.
|
/** Whether this map has a core of the enemy 'wave' team. Default: true.
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import io.anuke.mindustry.type.ItemStack;
|
|||||||
|
|
||||||
/** An item image with text. */
|
/** An item image with text. */
|
||||||
public class ItemDisplay extends Table{
|
public class ItemDisplay extends Table{
|
||||||
|
public final Item item;
|
||||||
|
public final int amount;
|
||||||
|
|
||||||
public ItemDisplay(Item item){
|
public ItemDisplay(Item item){
|
||||||
this(item, 0);
|
this(item, 0);
|
||||||
@@ -14,5 +16,8 @@ public class ItemDisplay extends Table{
|
|||||||
public ItemDisplay(Item item, int amount){
|
public ItemDisplay(Item item, int amount){
|
||||||
add(new ItemImage(new ItemStack(item, amount))).size(8 * 4);
|
add(new ItemImage(new ItemStack(item, amount))).size(8 * 4);
|
||||||
add(item.localizedName()).padLeft(4);
|
add(item.localizedName()).padLeft(4);
|
||||||
|
|
||||||
|
this.item = item;
|
||||||
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,15 @@ import io.anuke.mindustry.world.meta.StatUnit;
|
|||||||
|
|
||||||
/** An ItemDisplay, but for liquids. */
|
/** An ItemDisplay, but for liquids. */
|
||||||
public class LiquidDisplay extends Table{
|
public class LiquidDisplay extends Table{
|
||||||
|
public final Liquid liquid;
|
||||||
|
public final float amount;
|
||||||
|
public final boolean perSecond;
|
||||||
|
|
||||||
public LiquidDisplay(Liquid liquid, float amount, boolean perSecond){
|
public LiquidDisplay(Liquid liquid, float amount, boolean perSecond){
|
||||||
|
this.liquid = liquid;
|
||||||
|
this.amount = amount;
|
||||||
|
this.perSecond = perSecond;
|
||||||
|
|
||||||
add(new Stack(){{
|
add(new Stack(){{
|
||||||
add(new Image(liquid.getContentIcon()));
|
add(new Image(liquid.getContentIcon()));
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import io.anuke.mindustry.ui.BorderImage;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class CustomGameDialog extends FloatingDialog{
|
public class
|
||||||
|
CustomGameDialog extends FloatingDialog{
|
||||||
private MapPlayDialog dialog = new MapPlayDialog();
|
private MapPlayDialog dialog = new MapPlayDialog();
|
||||||
|
|
||||||
public CustomGameDialog(){
|
public CustomGameDialog(){
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
Difficulty difficulty = Difficulty.normal;
|
Difficulty difficulty = Difficulty.normal;
|
||||||
CustomRulesDialog dialog = new CustomRulesDialog();
|
CustomRulesDialog dialog = new CustomRulesDialog();
|
||||||
Rules rules;
|
Rules rules;
|
||||||
Gamemode selectedGamemode;
|
Gamemode selectedGamemode = Gamemode.survival;
|
||||||
|
|
||||||
public MapPlayDialog(){
|
public MapPlayDialog(){
|
||||||
super("");
|
super("");
|
||||||
@@ -28,6 +28,8 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
cont.clearChildren();
|
cont.clearChildren();
|
||||||
rules = map.rules();
|
rules = map.rules();
|
||||||
|
|
||||||
|
rules = selectedGamemode.apply(map.rules());
|
||||||
|
|
||||||
Table selmode = new Table();
|
Table selmode = new Table();
|
||||||
selmode.add("$level.mode").colspan(4);
|
selmode.add("$level.mode").colspan(4);
|
||||||
selmode.row();
|
selmode.row();
|
||||||
@@ -43,8 +45,8 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
modes.addButton(mode.toString(), "toggle", () -> {
|
modes.addButton(mode.toString(), "toggle", () -> {
|
||||||
selectedGamemode = selectedGamemode == mode ? null : mode;
|
selectedGamemode = mode;
|
||||||
rules = selectedGamemode == null ? map.rules() : mode.apply(map.rules());
|
rules = mode.apply(map.rules());
|
||||||
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f);
|
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f);
|
||||||
if(i++ % 2 == 1) modes.row();
|
if(i++ % 2 == 1) modes.row();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s)));
|
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s)));
|
||||||
graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%");
|
graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%");
|
||||||
|
|
||||||
|
|
||||||
if(!mobile){
|
if(!mobile){
|
||||||
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));
|
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));
|
||||||
graphics.checkPref("fullscreen", false, b -> {
|
graphics.checkPref("fullscreen", false, b -> {
|
||||||
@@ -221,6 +220,22 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.checkPref("animatedshields", !mobile);
|
graphics.checkPref("animatedshields", !mobile);
|
||||||
graphics.checkPref("lasers", true);
|
graphics.checkPref("lasers", true);
|
||||||
graphics.checkPref("pixelate", false);
|
graphics.checkPref("pixelate", false);
|
||||||
|
|
||||||
|
//TODO is this necessary?
|
||||||
|
/*
|
||||||
|
graphics.checkPref("linear", false, b -> {
|
||||||
|
for(Texture tex : Core.atlas.getTextures()){
|
||||||
|
TextureFilter filter = b ? TextureFilter.Linear : TextureFilter.Nearest;
|
||||||
|
tex.setFilter(filter, filter);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(Core.settings.getBool("linear")){
|
||||||
|
for(Texture tex : Core.atlas.getTextures()){
|
||||||
|
TextureFilter filter = TextureFilter.Linear;
|
||||||
|
tex.setFilter(filter, filter);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void back(){
|
private void back(){
|
||||||
|
|||||||