Map bugfixes / Sprite tweak / Zone loadout moved to dialog
@@ -60,10 +60,6 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity android:name=".DonationsActivity"
|
|
||||||
android:theme="@style/GdxTheme"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -302,7 +302,7 @@ launch.unable = [scarlet]Unable to LAUNCH.[] {0} Enemies.
|
|||||||
launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base.
|
launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base.
|
||||||
uncover = Uncover
|
uncover = Uncover
|
||||||
configure = Configure Loadout
|
configure = Configure Loadout
|
||||||
configure.locked = [LIGHT_GRAY]Unlock configuring loadout:\nWave {0}.
|
configure.locked = [LIGHT_GRAY]Unlock configuring loadout: Wave {0}.
|
||||||
zone.unlocked = [LIGHT_GRAY]{0} unlocked.
|
zone.unlocked = [LIGHT_GRAY]{0} unlocked.
|
||||||
zone.requirement.complete = Wave {0} reached:\n{1} zone requirements met.
|
zone.requirement.complete = Wave {0} reached:\n{1} zone requirements met.
|
||||||
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 501 B |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 401 KiB After Width: | Height: | Size: 400 KiB |
|
Before Width: | Height: | Size: 338 KiB After Width: | Height: | Size: 334 KiB |
@@ -62,7 +62,7 @@ public class WaveSpawner{
|
|||||||
spawning = true;
|
spawning = true;
|
||||||
|
|
||||||
for(SpawnGroup group : state.rules.spawns){
|
for(SpawnGroup group : state.rules.spawns){
|
||||||
int spawned = group.getUnitsSpawned(state.wave);
|
int spawned = group.getUnitsSpawned(state.wave - 1);
|
||||||
|
|
||||||
float spawnX, spawnY;
|
float spawnX, spawnY;
|
||||||
float spread;
|
float spread;
|
||||||
|
|||||||
@@ -205,16 +205,16 @@ public class Zones implements ContentList{
|
|||||||
desolateRift = new Zone("desolateRift", new MapGenerator("desolateRift").dist(2f)){{
|
desolateRift = new Zone("desolateRift", new MapGenerator("desolateRift").dist(2f)){{
|
||||||
loadout = Loadouts.basicNucleus;
|
loadout = Loadouts.basicNucleus;
|
||||||
baseLaunchCost = ItemStack.with();
|
baseLaunchCost = ItemStack.with();
|
||||||
startingItems = ItemStack.list(Items.copper, 1500);
|
startingItems = ItemStack.list(Items.copper, 2000, Items.lead, 2000, Items.graphite, 500, Items.titanium, 500, Items.silicon, 500);
|
||||||
conditionWave = 2;
|
conditionWave = 3;
|
||||||
launchPeriod = 1;
|
launchPeriod = 2;
|
||||||
zoneRequirements = ZoneRequirement.with(tarFields, 20);
|
zoneRequirements = ZoneRequirement.with(tarFields, 20);
|
||||||
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium};
|
||||||
rules = () -> new Rules(){{
|
rules = () -> new Rules(){{
|
||||||
waves = true;
|
waves = true;
|
||||||
waveTimer = true;
|
waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 3.5f;
|
waveSpacing = 60 * 60 * 2.5f;
|
||||||
}};
|
}};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class GlobalData{
|
|||||||
|
|
||||||
/** Returns whether or not this piece of content is unlocked yet. */
|
/** Returns whether or not this piece of content is unlocked yet. */
|
||||||
public boolean isUnlocked(UnlockableContent content){
|
public boolean isUnlocked(UnlockableContent content){
|
||||||
return content.alwaysUnlocked() || unlocked.getOr(content.getContentType(), ObjectSet::new).contains(content.name);
|
return true;//content.alwaysUnlocked() || unlocked.getOr(content.getContentType(), ObjectSet::new).contains(content.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
player.isShooting = false;
|
player.isShooting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap)){
|
if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && !ui.chatfrag.chatOpen()){
|
||||||
if(!ui.minimap.isShown()){
|
if(!ui.minimap.isShown()){
|
||||||
ui.minimap.show();
|
ui.minimap.show();
|
||||||
}else{
|
}else{
|
||||||
@@ -145,8 +145,6 @@ public class DesktopInput extends InputHandler{
|
|||||||
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
//renderer.minimap.zoomBy(-Core.input.axisTap(Binding.zoom_minimap));
|
|
||||||
|
|
||||||
if(player.isDead()){
|
if(player.isDead()){
|
||||||
cursorType = SystemCursor.arrow;
|
cursorType = SystemCursor.arrow;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -108,10 +108,10 @@ public class MapGenerator extends Generator{
|
|||||||
int newX = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x, y) * distortion + x), 0, width - 1);
|
int newX = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x, y) * distortion + x), 0, width - 1);
|
||||||
int newY = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x + 9999, y + 9999) * distortion + y), 0, height - 1);
|
int newY = Mathf.clamp((int)(simplex.octaveNoise2D(1, 1, 1.0 / scl, x + 9999, y + 9999) * distortion + y), 0, height - 1);
|
||||||
|
|
||||||
if((tile.block() instanceof StaticWall
|
if(((tile.block() instanceof StaticWall
|
||||||
&& tiles[newX][newY].block() instanceof StaticWall)
|
&& tiles[newX][newY].block() instanceof StaticWall)
|
||||||
|| (tile.block() == Blocks.air && !tiles[newX][newY].block().synthetic())
|
|| (tile.block() == Blocks.air && !tiles[newX][newY].block().synthetic())
|
||||||
|| (tiles[newX][newY].block() == Blocks.air && tile.block() instanceof StaticWall)){
|
|| (tiles[newX][newY].block() == Blocks.air && tile.block() instanceof StaticWall)) && tiles[newX][newY].block() != Blocks.spawn){
|
||||||
tile.setBlock(tiles[newX][newY].block());
|
tile.setBlock(tiles[newX][newY].block());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public class Zone extends UnlockableContent{
|
|||||||
protected Array<ItemStack> startingItems = new Array<>();
|
protected Array<ItemStack> startingItems = new Array<>();
|
||||||
protected ItemStack[] launchCost = null;
|
protected ItemStack[] launchCost = null;
|
||||||
|
|
||||||
|
private Array<ItemStack> defaultStartingItems = new Array<>();
|
||||||
|
|
||||||
public Zone(String name, Generator generator){
|
public Zone(String name, Generator generator){
|
||||||
super(name);
|
super(name);
|
||||||
this.generator = generator;
|
this.generator = generator;
|
||||||
@@ -60,6 +62,11 @@ public class Zone extends UnlockableContent{
|
|||||||
return startingItems;
|
return startingItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetStartingItems(){
|
||||||
|
startingItems.clear();
|
||||||
|
defaultStartingItems.each(stack -> startingItems.add(new ItemStack(stack.item, stack.amount)));
|
||||||
|
}
|
||||||
|
|
||||||
public void updateWave(int wave){
|
public void updateWave(int wave){
|
||||||
int value = Core.settings.getInt(name + "-wave", 0);
|
int value = Core.settings.getInt(name + "-wave", 0);
|
||||||
if(value < wave){
|
if(value < wave){
|
||||||
@@ -127,6 +134,10 @@ public class Zone extends UnlockableContent{
|
|||||||
generator.init(loadout);
|
generator.init(loadout);
|
||||||
Arrays.sort(resources);
|
Arrays.sort(resources);
|
||||||
|
|
||||||
|
for(ItemStack stack : startingItems){
|
||||||
|
defaultStartingItems.add(new ItemStack(stack.item, stack.amount));
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Array<ItemStack> arr = Core.settings.getObject(name + "-starting-items", Array.class, () -> null);
|
Array<ItemStack> arr = Core.settings.getObject(name + "-starting-items", Array.class, () -> null);
|
||||||
if(arr != null){
|
if(arr != null){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.scene.event.HandCursorListener;
|
import io.anuke.arc.scene.event.HandCursorListener;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.ui.dialogs;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.Button;
|
import io.anuke.arc.scene.ui.Button;
|
||||||
import io.anuke.arc.scene.ui.TextButton;
|
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
@@ -14,6 +13,7 @@ import io.anuke.mindustry.world.Block.Icon;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class ZoneInfoDialog extends FloatingDialog{
|
public class ZoneInfoDialog extends FloatingDialog{
|
||||||
|
private ZoneLoadoutDialog loadout = new ZoneLoadoutDialog();
|
||||||
|
|
||||||
public ZoneInfoDialog(){
|
public ZoneInfoDialog(){
|
||||||
super("");
|
super("");
|
||||||
@@ -103,6 +103,8 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
cont.row();
|
cont.row();
|
||||||
cont.addImage("white").color(Pal.accent).height(3).pad(6).growX();
|
cont.addImage("white").color(Pal.accent).height(3).pad(6).growX();
|
||||||
cont.row();
|
cont.row();
|
||||||
|
cont.addButton(zone.canConfigure() ? "$configure" : Core.bundle.format("configure.locked", zone.configureWave), () -> loadout.show(zone, rebuildItems)).fillX().pad(3).disabled(b -> !zone.canConfigure());
|
||||||
|
cont.row();
|
||||||
cont.table(res -> {
|
cont.table(res -> {
|
||||||
res.add("$zone.resources").padRight(6);
|
res.add("$zone.resources").padRight(6);
|
||||||
if(zone.resources.length > 0){
|
if(zone.resources.length > 0){
|
||||||
@@ -118,75 +120,8 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
cont.row();
|
cont.row();
|
||||||
cont.add(Core.bundle.format("bestwave", zone.bestWave()));
|
cont.add(Core.bundle.format("bestwave", zone.bestWave()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Table load = new Table();
|
|
||||||
//thanks java, absolutely brilliant syntax here
|
|
||||||
Runnable[] rebuildLoadout = {null};
|
|
||||||
rebuildLoadout[0] = () -> {
|
|
||||||
load.clear();
|
|
||||||
float bsize = 40f;
|
|
||||||
int step = 50;
|
|
||||||
|
|
||||||
load.left();
|
|
||||||
for(ItemStack stack : zone.getStartingItems()){
|
|
||||||
load.addButton("x", () -> {
|
|
||||||
zone.getStartingItems().remove(stack);
|
|
||||||
zone.updateLaunchCost();
|
|
||||||
rebuildItems.run();
|
|
||||||
rebuildLoadout[0].run();
|
|
||||||
}).size(bsize).pad(2);
|
|
||||||
|
|
||||||
load.addButton("-", () -> {
|
|
||||||
stack.amount = Math.max(stack.amount - step, 0);
|
|
||||||
zone.updateLaunchCost();
|
|
||||||
rebuildItems.run();
|
|
||||||
}).size(bsize).pad(2);
|
|
||||||
load.addButton("+", () -> {
|
|
||||||
stack.amount = Math.min(stack.amount + step, zone.loadout.core().itemCapacity);
|
|
||||||
zone.updateLaunchCost();
|
|
||||||
rebuildItems.run();
|
|
||||||
}).size(bsize).pad(2);
|
|
||||||
|
|
||||||
load.addImage(stack.item.icon(Item.Icon.medium)).size(8 * 3).padRight(4);
|
|
||||||
load.label(() -> stack.amount + "").left();
|
|
||||||
|
|
||||||
load.row();
|
|
||||||
}
|
|
||||||
|
|
||||||
load.addButton("$add", () -> {
|
|
||||||
FloatingDialog dialog = new FloatingDialog("");
|
|
||||||
dialog.setFillParent(false);
|
|
||||||
for(Item item : content.items().select(item -> data.getItem(item) > 0 && item.type == ItemType.material && zone.getStartingItems().find(stack -> stack.item == item) == null)){
|
|
||||||
TextButton button = dialog.cont.addButton("", () -> {
|
|
||||||
zone.getStartingItems().add(new ItemStack(item, 0));
|
|
||||||
zone.updateLaunchCost();
|
|
||||||
rebuildLoadout[0].run();
|
|
||||||
dialog.hide();
|
|
||||||
}).size(300f, 35f).pad(1).get();
|
|
||||||
button.clearChildren();
|
|
||||||
button.left();
|
|
||||||
button.addImage(item.icon(Item.Icon.medium)).size(8 * 3).pad(4);
|
|
||||||
button.add(item.localizedName);
|
|
||||||
dialog.cont.row();
|
|
||||||
}
|
|
||||||
dialog.show();
|
|
||||||
}).colspan(4).size(100f, bsize).left().disabled(b -> !content.items().contains(item -> data.getItem(item) > 0 && item.type == ItemType.material && !zone.getStartingItems().contains(stack -> stack.item == item)));
|
|
||||||
};
|
|
||||||
|
|
||||||
rebuildLoadout[0].run();
|
|
||||||
|
|
||||||
cont.row();
|
|
||||||
cont.table(zone.canConfigure() ? "button" : "button-disabled", t -> {
|
|
||||||
t.left();
|
|
||||||
t.add(!zone.canConfigure() ? Core.bundle.format("configure.locked", zone.configureWave) : "$configure").growX().wrap();
|
|
||||||
if(zone.canConfigure()){
|
|
||||||
t.row();
|
|
||||||
t.pane(load).pad(2).growX().left();
|
|
||||||
}
|
|
||||||
}).width(300f).pad(4).left();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
Button button = cont.addButton(zone.locked() ? "$uncover" : "$launch", () -> {
|
Button button = cont.addButton(zone.locked() ? "$uncover" : "$launch", () -> {
|
||||||
@@ -200,7 +135,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
hide();
|
hide();
|
||||||
world.playZone(zone);
|
world.playZone(zone);
|
||||||
}
|
}
|
||||||
}).minWidth(150f).margin(13f).padTop(5).disabled(b -> zone.locked() ? !canUnlock(zone) : !data.hasItems(zone.getLaunchCost())).get();
|
}).minWidth(150f).margin(13f).padTop(5).disabled(b -> zone.locked() ? !canUnlock(zone) : !data.hasItems(zone.getLaunchCost())).uniformY().get();
|
||||||
|
|
||||||
button.row();
|
button.row();
|
||||||
button.add(iteminfo);
|
button.add(iteminfo);
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
|
import io.anuke.arc.scene.ui.TextButton;
|
||||||
|
import io.anuke.mindustry.type.*;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.content;
|
||||||
|
import static io.anuke.mindustry.Vars.data;
|
||||||
|
|
||||||
|
public class ZoneLoadoutDialog extends FloatingDialog{
|
||||||
|
private Zone zone;
|
||||||
|
private Runnable hider;
|
||||||
|
|
||||||
|
public ZoneLoadoutDialog(){
|
||||||
|
super("$configure");
|
||||||
|
setFillParent(false);
|
||||||
|
addCloseButton();
|
||||||
|
shown(this::setup);
|
||||||
|
hidden(() -> {
|
||||||
|
if(hider != null){
|
||||||
|
hider.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
buttons.row();
|
||||||
|
buttons.addButton("$settings.reset", () -> {
|
||||||
|
zone.resetStartingItems();
|
||||||
|
zone.updateLaunchCost();
|
||||||
|
setup();
|
||||||
|
}).size(210f, 64f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show(Zone zone, Runnable hider){
|
||||||
|
this.hider = hider;
|
||||||
|
this.zone = zone;
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup(){
|
||||||
|
cont.clear();
|
||||||
|
float bsize = 40f;
|
||||||
|
int step = 50;
|
||||||
|
|
||||||
|
for(ItemStack stack : zone.getStartingItems()){
|
||||||
|
cont.addButton("x", "clear-partial", () -> {
|
||||||
|
zone.getStartingItems().remove(stack);
|
||||||
|
zone.updateLaunchCost();
|
||||||
|
setup();
|
||||||
|
}).size(bsize);
|
||||||
|
|
||||||
|
cont.addButton("-", "clear-partial", () -> {
|
||||||
|
stack.amount = Math.max(stack.amount - step, 0);
|
||||||
|
zone.updateLaunchCost();
|
||||||
|
}).size(bsize);
|
||||||
|
cont.addButton("+", "clear-partial", () -> {
|
||||||
|
stack.amount = Math.min(stack.amount + step, zone.loadout.core().itemCapacity);
|
||||||
|
zone.updateLaunchCost();
|
||||||
|
}).size(bsize);
|
||||||
|
|
||||||
|
cont.addImage(stack.item.icon(Item.Icon.medium)).size(8 * 3).padRight(4);
|
||||||
|
cont.label(() -> stack.amount + "").left();
|
||||||
|
|
||||||
|
cont.row();
|
||||||
|
}
|
||||||
|
|
||||||
|
cont.addButton("$add", () -> {
|
||||||
|
FloatingDialog dialog = new FloatingDialog("");
|
||||||
|
dialog.setFillParent(false);
|
||||||
|
for(Item item : content.items().select(item -> data.getItem(item) > 0 && item.type == ItemType.material && zone.getStartingItems().find(stack -> stack.item == item) == null)){
|
||||||
|
TextButton button = dialog.cont.addButton("", "clear", () -> {
|
||||||
|
zone.getStartingItems().add(new ItemStack(item, 0));
|
||||||
|
zone.updateLaunchCost();
|
||||||
|
setup();
|
||||||
|
dialog.hide();
|
||||||
|
}).size(300f, 36f).get();
|
||||||
|
button.clearChildren();
|
||||||
|
button.left();
|
||||||
|
button.addImage(item.icon(Item.Icon.medium)).size(8 * 3).pad(4);
|
||||||
|
button.add(item.localizedName);
|
||||||
|
dialog.cont.row();
|
||||||
|
}
|
||||||
|
dialog.show();
|
||||||
|
}).colspan(4).size(100f, bsize).left().disabled(b -> !content.items().contains(item -> data.getItem(item) > 0 && item.type == ItemType.material && !zone.getStartingItems().contains(stack -> stack.item == item)));
|
||||||
|
pack();
|
||||||
|
}
|
||||||
|
}
|
||||||