Fixed many various map bugs
This commit is contained in:
@@ -6,6 +6,8 @@ import io.anuke.mindustry.type.ItemStack;
|
||||
|
||||
/** An item image with text. */
|
||||
public class ItemDisplay extends Table{
|
||||
public final Item item;
|
||||
public final int amount;
|
||||
|
||||
public ItemDisplay(Item item){
|
||||
this(item, 0);
|
||||
@@ -14,5 +16,8 @@ public class ItemDisplay extends Table{
|
||||
public ItemDisplay(Item item, int amount){
|
||||
add(new ItemImage(new ItemStack(item, amount))).size(8 * 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. */
|
||||
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){
|
||||
this.liquid = liquid;
|
||||
this.amount = amount;
|
||||
this.perSecond = perSecond;
|
||||
|
||||
add(new Stack(){{
|
||||
add(new Image(liquid.getContentIcon()));
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ import io.anuke.mindustry.ui.BorderImage;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class CustomGameDialog extends FloatingDialog{
|
||||
public class
|
||||
CustomGameDialog extends FloatingDialog{
|
||||
private MapPlayDialog dialog = new MapPlayDialog();
|
||||
|
||||
public CustomGameDialog(){
|
||||
|
||||
@@ -16,7 +16,7 @@ public class MapPlayDialog extends FloatingDialog{
|
||||
Difficulty difficulty = Difficulty.normal;
|
||||
CustomRulesDialog dialog = new CustomRulesDialog();
|
||||
Rules rules;
|
||||
Gamemode selectedGamemode;
|
||||
Gamemode selectedGamemode = Gamemode.survival;
|
||||
|
||||
public MapPlayDialog(){
|
||||
super("");
|
||||
@@ -28,6 +28,8 @@ public class MapPlayDialog extends FloatingDialog{
|
||||
cont.clearChildren();
|
||||
rules = map.rules();
|
||||
|
||||
rules = selectedGamemode.apply(map.rules());
|
||||
|
||||
Table selmode = new Table();
|
||||
selmode.add("$level.mode").colspan(4);
|
||||
selmode.row();
|
||||
@@ -43,8 +45,8 @@ public class MapPlayDialog extends FloatingDialog{
|
||||
}
|
||||
|
||||
modes.addButton(mode.toString(), "toggle", () -> {
|
||||
selectedGamemode = selectedGamemode == mode ? null : mode;
|
||||
rules = selectedGamemode == null ? map.rules() : mode.apply(map.rules());
|
||||
selectedGamemode = mode;
|
||||
rules = mode.apply(map.rules());
|
||||
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f);
|
||||
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("chatopacity", 100, 0, 100, 5, s -> s + "%");
|
||||
|
||||
|
||||
if(!mobile){
|
||||
graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b));
|
||||
graphics.checkPref("fullscreen", false, b -> {
|
||||
@@ -221,6 +220,22 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
graphics.checkPref("animatedshields", !mobile);
|
||||
graphics.checkPref("lasers", true);
|
||||
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(){
|
||||
|
||||
Reference in New Issue
Block a user