Added freebuild / Power system fix / Net packet pool fix / Crash fixes
This commit is contained in:
@@ -4,19 +4,20 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import io.anuke.mindustry.game.Difficulty;
|
||||
import io.anuke.mindustry.game.EventType.ResizeEvent;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.io.Map;
|
||||
import io.anuke.mindustry.ui.BorderImage;
|
||||
import io.anuke.ucore.core.Events;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.scene.event.Touchable;
|
||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||
import io.anuke.ucore.scene.ui.ImageButton;
|
||||
import io.anuke.ucore.scene.ui.ScrollPane;
|
||||
import io.anuke.ucore.scene.ui.TextButton;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.scene.utils.Cursors;
|
||||
import io.anuke.ucore.scene.utils.Elements;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class LevelDialog extends FloatingDialog{
|
||||
|
||||
int maxwidth = (Gdx.graphics.getHeight() > Gdx.graphics.getHeight() ? 2 : 4);
|
||||
|
||||
/*Table selmode = new Table();
|
||||
Table selmode = new Table();
|
||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||
selmode.add("$text.level.mode").padRight(15f);
|
||||
|
||||
@@ -50,14 +51,13 @@ public class LevelDialog extends FloatingDialog{
|
||||
TextButton[] b = {null};
|
||||
b[0] = Elements.newButton("$mode." + mode.name() + ".name", "toggle", () -> state.mode = mode);
|
||||
b[0].update(() -> b[0].setChecked(state.mode == mode));
|
||||
b[0].setDisabled(true);
|
||||
group.add(b[0]);
|
||||
selmode.add(b[0]).size(130f, 54f);
|
||||
}
|
||||
selmode.addButton("?", this::displayGameModeHelp).size(50f, 54f).padLeft(18f);
|
||||
|
||||
content().add(selmode);
|
||||
content().row();*/
|
||||
content().row();
|
||||
|
||||
Difficulty[] ds = Difficulty.values();
|
||||
|
||||
|
||||
@@ -181,6 +181,8 @@ public class BlockInventoryFragment extends Fragment {
|
||||
|
||||
@Remote(called = Loc.server, targets = Loc.both, in = In.blocks, forward = true)
|
||||
public static void requestItem(Player player, Tile tile, Item item, int amount){
|
||||
if(player == null) return;
|
||||
|
||||
int removed = tile.block().removeStack(tile, item, amount);
|
||||
|
||||
player.inventory.addItem(item, removed);
|
||||
|
||||
@@ -185,7 +185,7 @@ public class DebugFragment extends Fragment {
|
||||
result.append(player.id);
|
||||
result.append("\n");
|
||||
result.append(" cid: ");
|
||||
result.append(player.con.id);
|
||||
result.append(player.con == null ? -1 : player.con.id);
|
||||
result.append("\n");
|
||||
result.append(" dead: ");
|
||||
result.append(player.isDead());
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.badlogic.gdx.math.Interpolation;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import io.anuke.mindustry.ui.IntFormat;
|
||||
@@ -288,10 +289,11 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
private String getEnemiesRemaining() {
|
||||
if(state.enemies == 1) {
|
||||
return Bundles.format("text.enemies.single", state.enemies);
|
||||
int enemies = unitGroups[Team.red.ordinal()].size();
|
||||
if(enemies == 1) {
|
||||
return Bundles.format("text.enemies.single", enemies);
|
||||
} else {
|
||||
return Bundles.format("text.enemies", state.enemies);
|
||||
return Bundles.format("text.enemies", enemies);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +312,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
row();
|
||||
|
||||
new label(() -> state.enemies > 0 ?
|
||||
new label(() -> unitGroups[Team.red.ordinal()].size() > 0 && state.mode.disableWaveTimer ?
|
||||
getEnemiesRemaining() :
|
||||
(state.mode.disableWaveTimer) ? "$text.waiting"
|
||||
: timef.get((int) (state.wavetime / 60f)))
|
||||
@@ -333,10 +335,9 @@ public class HudFragment extends Fragment{
|
||||
}).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padLeft(-15).padRight(-10).width(40f).update(l->{
|
||||
boolean vis = state.mode.disableWaveTimer && (Net.server() || !Net.active());
|
||||
boolean paused = state.is(State.paused) || !vis;
|
||||
|
||||
l.setVisible(vis);
|
||||
|
||||
l.getStyle().imageUp = Core.skin.getDrawable(vis ? "icon-play" : "clear");
|
||||
l.setTouchable(!paused ? Touchable.enabled : Touchable.disabled);
|
||||
});
|
||||
}).visible(() -> state.mode.disableWaveTimer && (Net.server() || !Net.active()) && unitGroups[Team.red.ordinal()].size() == 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user