Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -7,8 +7,7 @@ buildscript{
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
//note that later versions, like alpha05, fail to work correctly
|
classpath 'com.android.tools.build:gradle:7.0.1'
|
||||||
classpath 'com.android.tools.build:gradle:7.1.0-alpha02'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 158 B |
BIN
core/assets-raw/sprites/statuses/status-shielded.png
Normal file
BIN
core/assets-raw/sprites/statuses/status-shielded.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 B |
@@ -395,6 +395,11 @@ waves.load = Load from Clipboard
|
|||||||
waves.invalid = Invalid waves in clipboard.
|
waves.invalid = Invalid waves in clipboard.
|
||||||
waves.copied = Waves copied.
|
waves.copied = Waves copied.
|
||||||
waves.none = No enemies defined.\nNote that empty wave layouts will automatically be replaced with the default layout.
|
waves.none = No enemies defined.\nNote that empty wave layouts will automatically be replaced with the default layout.
|
||||||
|
waves.sort = Sort By
|
||||||
|
waves.sort.reverse = Reverse Sort
|
||||||
|
waves.sort.begin = Begin
|
||||||
|
waves.sort.health = Health
|
||||||
|
waves.sort.type = Type
|
||||||
|
|
||||||
#these are intentionally in lower case
|
#these are intentionally in lower case
|
||||||
wavemode.counts = counts
|
wavemode.counts = counts
|
||||||
@@ -650,6 +655,7 @@ status.sapped.name = Sapped
|
|||||||
status.electrified.name = Electrified
|
status.electrified.name = Electrified
|
||||||
status.spore-slowed.name = Spore Slowed
|
status.spore-slowed.name = Spore Slowed
|
||||||
status.tarred.name = Tarred
|
status.tarred.name = Tarred
|
||||||
|
status.overdrive.name = Overdrive
|
||||||
status.overclock.name = Overclock
|
status.overclock.name = Overclock
|
||||||
status.shocked.name = Shocked
|
status.shocked.name = Shocked
|
||||||
status.blasted.name = Blasted
|
status.blasted.name = Blasted
|
||||||
|
|||||||
@@ -127,3 +127,4 @@ WilloIzCitron
|
|||||||
SAMBUYYA
|
SAMBUYYA
|
||||||
genNAowl
|
genNAowl
|
||||||
TranquillyUnpleasant
|
TranquillyUnpleasant
|
||||||
|
Darkness6030
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
|||||||
Fonts.loadDefaultFont();
|
Fonts.loadDefaultFont();
|
||||||
|
|
||||||
//load fallback atlas if max texture size is below 4096
|
//load fallback atlas if max texture size is below 4096
|
||||||
assets.load(new AssetDescriptor<>(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class)).loaded = t -> atlas = (TextureAtlas)t;
|
assets.load(new AssetDescriptor<>(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class)).loaded = t -> atlas = t;
|
||||||
assets.loadRun("maps", Map.class, () -> maps.loadPreviews());
|
assets.loadRun("maps", Map.class, () -> maps.loadPreviews());
|
||||||
|
|
||||||
Musics.load();
|
Musics.load();
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ public class WaveSpawner{
|
|||||||
unit.add();
|
unit.add();
|
||||||
unit.unloaded();
|
unit.unloaded();
|
||||||
|
|
||||||
|
Events.fire(new UnitSpawnEvent(unit));
|
||||||
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public abstract class UnlockableContent extends MappableContent{
|
|||||||
public boolean alwaysUnlocked = false;
|
public boolean alwaysUnlocked = false;
|
||||||
/** Whether to show the description in the research dialog preview. */
|
/** Whether to show the description in the research dialog preview. */
|
||||||
public boolean inlineDescription = true;
|
public boolean inlineDescription = true;
|
||||||
|
/** Whether details of blocks are hidden in custom games if they haven't been unlocked in campaign mode. */
|
||||||
|
public boolean hideDetails = true;
|
||||||
/** Special logic icon ID. */
|
/** Special logic icon ID. */
|
||||||
public int iconId = 0;
|
public int iconId = 0;
|
||||||
/** Icon of the content to use in UI. */
|
/** Icon of the content to use in UI. */
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package mindustry.editor;
|
package mindustry.editor;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.scene.event.*;
|
import arc.scene.event.*;
|
||||||
|
import arc.scene.style.*;
|
||||||
import arc.scene.ui.*;
|
import arc.scene.ui.*;
|
||||||
import arc.scene.ui.TextField.*;
|
import arc.scene.ui.TextField.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
@@ -29,6 +31,8 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
private Table table;
|
private Table table;
|
||||||
private int start = 0;
|
private int start = 0;
|
||||||
private UnitType lastType = UnitTypes.dagger;
|
private UnitType lastType = UnitTypes.dagger;
|
||||||
|
private Sort sort = Sort.begin;
|
||||||
|
private boolean reverseSort = false;
|
||||||
private float updateTimer, updatePeriod = 1f;
|
private float updateTimer, updatePeriod = 1f;
|
||||||
private WaveGraph graph = new WaveGraph();
|
private WaveGraph graph = new WaveGraph();
|
||||||
|
|
||||||
@@ -41,6 +45,27 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
addCloseListener();
|
addCloseListener();
|
||||||
|
|
||||||
onResize(this::setup);
|
onResize(this::setup);
|
||||||
|
buttons.button(Icon.filter, () -> {
|
||||||
|
BaseDialog dialog = new BaseDialog("@waves.sort");
|
||||||
|
dialog.setFillParent(false);
|
||||||
|
dialog.cont.table(Tex.button, t -> {
|
||||||
|
for(Sort s : Sort.all){
|
||||||
|
t.button("@waves.sort." + s, Styles.clearTogglet, () -> {
|
||||||
|
sort = s;
|
||||||
|
dialog.hide();
|
||||||
|
buildGroups();
|
||||||
|
}).size(150f, 60f).checked(s == sort);
|
||||||
|
}
|
||||||
|
}).row();
|
||||||
|
dialog.cont.check("@waves.sort.reverse", b -> {
|
||||||
|
reverseSort = b;
|
||||||
|
buildGroups();
|
||||||
|
}).padTop(4).checked(reverseSort).padBottom(8f);
|
||||||
|
dialog.addCloseButton();
|
||||||
|
dialog.show();
|
||||||
|
buildGroups();
|
||||||
|
}).size(60f, 64f);
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
|
|
||||||
buttons.button("@waves.edit", () -> {
|
buttons.button("@waves.edit", () -> {
|
||||||
@@ -165,7 +190,8 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
table.margin(10f);
|
table.margin(10f);
|
||||||
|
|
||||||
if(groups != null){
|
if(groups != null){
|
||||||
groups.sort(g -> g.begin);
|
groups.sort(sort.sort);
|
||||||
|
if(reverseSort) groups.reverse();
|
||||||
|
|
||||||
for(SpawnGroup group : groups){
|
for(SpawnGroup group : groups){
|
||||||
table.table(Tex.button, t -> {
|
table.table(Tex.button, t -> {
|
||||||
@@ -179,6 +205,11 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
|
|
||||||
b.label(() -> (group.begin + 1) + "").color(Color.lightGray).minWidth(45f).labelAlign(Align.left).left();
|
b.label(() -> (group.begin + 1) + "").color(Color.lightGray).minWidth(45f).labelAlign(Align.left).left();
|
||||||
|
|
||||||
|
b.button(group.effect != null && group.effect != StatusEffects.none ?
|
||||||
|
new TextureRegionDrawable(group.effect.uiIcon) :
|
||||||
|
Icon.logicSmall,
|
||||||
|
Styles.emptyi, () -> showEffect(group)).pad(-6).size(46f);
|
||||||
|
|
||||||
b.button(Icon.unitsSmall, Styles.emptyi, () -> showUpdate(group)).pad(-6).size(46f);
|
b.button(Icon.unitsSmall, Styles.emptyi, () -> showUpdate(group)).pad(-6).size(46f);
|
||||||
b.button(Icon.cancel, Styles.emptyi, () -> {
|
b.button(Icon.cancel, Styles.emptyi, () -> {
|
||||||
groups.remove(group);
|
groups.remove(group);
|
||||||
@@ -269,7 +300,10 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
a.add("@waves.shields").padLeft(4);
|
a.add("@waves.shields").padLeft(4);
|
||||||
}).row();
|
}).row();
|
||||||
|
|
||||||
t.check("@waves.guardian", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f);
|
t.check("@waves.guardian", b -> {
|
||||||
|
group.effect = (b ? StatusEffects.boss : null);
|
||||||
|
buildGroups();
|
||||||
|
}).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f);
|
||||||
}
|
}
|
||||||
}).width(340f).pad(8);
|
}).width(340f).pad(8);
|
||||||
|
|
||||||
@@ -306,6 +340,53 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showEffect(SpawnGroup group){
|
||||||
|
BaseDialog dialog = new BaseDialog("");
|
||||||
|
dialog.setFillParent(true);
|
||||||
|
dialog.cont.pane(p -> {
|
||||||
|
int i = 0;
|
||||||
|
for(StatusEffect effect : content.statusEffects()){
|
||||||
|
if(effect != StatusEffects.none && (effect.isHidden() || effect.reactive)) continue;
|
||||||
|
|
||||||
|
p.button(t -> {
|
||||||
|
t.left();
|
||||||
|
if(effect.uiIcon != null && effect != StatusEffects.none){
|
||||||
|
t.image(effect.uiIcon).size(8 * 4).scaling(Scaling.fit).padRight(2f);
|
||||||
|
}else{
|
||||||
|
t.image(Icon.none).size(8 * 4).scaling(Scaling.fit).padRight(2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(effect != StatusEffects.none){
|
||||||
|
t.add(effect.localizedName);
|
||||||
|
}else{
|
||||||
|
t.add("@settings.resetKey");
|
||||||
|
}
|
||||||
|
}, () -> {
|
||||||
|
group.effect = effect;
|
||||||
|
dialog.hide();
|
||||||
|
buildGroups();
|
||||||
|
}).pad(2).margin(12f).fillX();
|
||||||
|
if(++i % 3 == 0) p.row();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.addCloseButton();
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Sort{
|
||||||
|
begin(g -> g.begin),
|
||||||
|
health(g -> g.type.health),
|
||||||
|
type(g -> g.type.id);
|
||||||
|
|
||||||
|
static final Sort[] all = values();
|
||||||
|
|
||||||
|
final Floatf<SpawnGroup> sort;
|
||||||
|
|
||||||
|
Sort(Floatf<SpawnGroup> sort){
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateWaves(){
|
void updateWaves(){
|
||||||
graph.groups = groups;
|
graph.groups = groups;
|
||||||
graph.from = start;
|
graph.from = start;
|
||||||
|
|||||||
@@ -465,8 +465,8 @@ public class Damage{
|
|||||||
for(int dx = -trad; dx <= trad; dx++){
|
for(int dx = -trad; dx <= trad; dx++){
|
||||||
for(int dy = -trad; dy <= trad; dy++){
|
for(int dy = -trad; dy <= trad; dy++){
|
||||||
Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy);
|
Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy);
|
||||||
if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && Mathf.dst(dx, dy) <= trad){
|
if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad){
|
||||||
tile.build.damage(damage);
|
tile.build.damage(team, damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import mindustry.entities.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class RailBulletType extends BulletType{
|
public class RailBulletType extends BulletType{
|
||||||
|
//for calculating the furthest point
|
||||||
|
static float furthest = 0;
|
||||||
|
|
||||||
public Effect pierceEffect = Fx.hitBulletSmall, updateEffect = Fx.none;
|
public Effect pierceEffect = Fx.hitBulletSmall, updateEffect = Fx.none;
|
||||||
/** Multiplier of damage decreased per health pierced. */
|
/** Multiplier of damage decreased per health pierced. */
|
||||||
public float pierceDamageFactor = 1f;
|
public float pierceDamageFactor = 1f;
|
||||||
@@ -47,6 +50,11 @@ public class RailBulletType extends BulletType{
|
|||||||
|
|
||||||
//subtract health from each consecutive pierce
|
//subtract health from each consecutive pierce
|
||||||
b.damage -= Math.min(b.damage, sub);
|
b.damage -= Math.min(b.damage, sub);
|
||||||
|
|
||||||
|
//bullet was stopped, decrease furthest distance
|
||||||
|
if(b.damage <= 0f){
|
||||||
|
furthest = Math.min(furthest, b.dst(pos));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -54,8 +62,9 @@ public class RailBulletType extends BulletType{
|
|||||||
super.init(b);
|
super.init(b);
|
||||||
|
|
||||||
b.fdata = length;
|
b.fdata = length;
|
||||||
|
furthest = length;
|
||||||
Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false);
|
Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false);
|
||||||
float resultLen = b.fdata;
|
float resultLen = furthest;
|
||||||
|
|
||||||
Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor();
|
Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor();
|
||||||
for(float i = 0; i <= resultLen; i += updateEffectSeg){
|
for(float i = 0; i <= resultLen; i += updateEffectSeg){
|
||||||
|
|||||||
@@ -133,8 +133,9 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
int x = x0f, dx = Math.abs(x1 - x), sx = x < x1 ? 1 : -1;
|
int x = x0f, dx = Math.abs(x1 - x), sx = x < x1 ? 1 : -1;
|
||||||
int y = y0f, dy = Math.abs(y1 - y), sy = y < y1 ? 1 : -1;
|
int y = y0f, dy = Math.abs(y1 - y), sy = y < y1 ? 1 : -1;
|
||||||
int e2, err = dx - dy;
|
int e2, err = dx - dy;
|
||||||
|
int ww = world.width(), wh = world.height();
|
||||||
|
|
||||||
while(true){
|
while(x >= 0 && y >= 0 && x < ww && y < wh){
|
||||||
Building build = world.build(x, y);
|
Building build = world.build(x, y);
|
||||||
if(build != null && isAdded() && build.collide(self()) && type.testCollision(self(), build)
|
if(build != null && isAdded() && build.collide(self()) && type.testCollision(self(), build)
|
||||||
&& !build.dead() && (type.collidesTeam || build.team != team) && !(type.pierceBuilding && hasCollided(build.id))){
|
&& !build.dead() && (type.collidesTeam || build.team != team) && !(type.pierceBuilding && hasCollided(build.id))){
|
||||||
|
|||||||
@@ -428,6 +428,15 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called when a unit is spawned by wave. */
|
||||||
|
public static class UnitSpawnEvent{
|
||||||
|
public final Unit unit;
|
||||||
|
|
||||||
|
public UnitSpawnEvent(Unit unit) {
|
||||||
|
this.unit = unit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when a unit is dumped from any payload block. */
|
/** Called when a unit is dumped from any payload block. */
|
||||||
public static class UnitUnloadEvent{
|
public static class UnitUnloadEvent{
|
||||||
public final Unit unit;
|
public final Unit unit;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class Waves{
|
|||||||
spacing = 5;
|
spacing = 5;
|
||||||
unitAmount = 1;
|
unitAmount = 1;
|
||||||
unitScaling = 3;
|
unitScaling = 3;
|
||||||
effect = StatusEffects.shielded;
|
shields = 640f;
|
||||||
max = 25;
|
max = 25;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
|||||||
@@ -236,7 +236,6 @@ public class PlanetRenderer implements Disposable{
|
|||||||
Tmp.c1.set(from).lerp(to, (f+ Time.globalTime /timeScale)%1f);
|
Tmp.c1.set(from).lerp(to, (f+ Time.globalTime /timeScale)%1f);
|
||||||
batch.color(Tmp.c1);
|
batch.color(Tmp.c1);
|
||||||
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f));
|
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f));
|
||||||
|
|
||||||
}
|
}
|
||||||
batch.flush(Gl.lineStrip);
|
batch.flush(Gl.lineStrip);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ public class FileMapGenerator implements WorldGenerator{
|
|||||||
this.preset = preset;
|
this.preset = preset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FileMapGenerator(Map map, SectorPreset preset){
|
||||||
|
this.map = map;
|
||||||
|
this.preset = preset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** If you use this constructor, make sure to override generate()! */
|
||||||
|
public FileMapGenerator(SectorPreset preset){
|
||||||
|
this(emptyMap, preset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Tiles tiles){
|
public void generate(Tiles tiles){
|
||||||
if(map == null) throw new RuntimeException("Generator has null map, cannot be used.");
|
if(map == null) throw new RuntimeException("Generator has null map, cannot be used.");
|
||||||
|
|||||||
@@ -225,6 +225,10 @@ public class Mods implements Loadable{
|
|||||||
var shadow = Core.atlas;
|
var shadow = Core.atlas;
|
||||||
//dummy texture atlas that returns the 'shadow' regions; used for mod loading
|
//dummy texture atlas that returns the 'shadow' regions; used for mod loading
|
||||||
Core.atlas = new TextureAtlas(){
|
Core.atlas = new TextureAtlas(){
|
||||||
|
{
|
||||||
|
//needed for the correct operation of the found() method in the TextureRegion
|
||||||
|
error = shadow.find("error");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AtlasRegion find(String name){
|
public AtlasRegion find(String name){
|
||||||
|
|||||||
@@ -162,7 +162,9 @@ public class ArcNetProvider implements NetProvider{
|
|||||||
client.connect(5000, ip, port, port);
|
client.connect(5000, ip, port, port);
|
||||||
success.run();
|
success.run();
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
net.handleException(e);
|
if(netClient.isConnecting()){
|
||||||
|
net.handleException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class BeControl{
|
|||||||
public BeControl(){
|
public BeControl(){
|
||||||
if(active()){
|
if(active()){
|
||||||
Timer.schedule(() -> {
|
Timer.schedule(() -> {
|
||||||
if(Vars.clientLoaded && checkUpdates && !mobile){
|
if((Vars.clientLoaded || headless) && checkUpdates && !mobile){
|
||||||
checkUpdate(t -> {});
|
checkUpdate(t -> {});
|
||||||
}
|
}
|
||||||
}, updateInterval, updateInterval);
|
}, updateInterval, updateInterval);
|
||||||
|
|||||||
@@ -196,12 +196,12 @@ public class Fonts{
|
|||||||
size = 18;
|
size = 18;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = (Font)t;
|
Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = t;
|
||||||
|
|
||||||
Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{
|
Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{
|
||||||
size = 18;
|
size = 18;
|
||||||
}})).loaded = f -> {
|
}})).loaded = f -> {
|
||||||
Fonts.tech = (Font)f;
|
Fonts.tech = f;
|
||||||
Fonts.tech.getData().down *= 1.5f;
|
Fonts.tech.getData().down *= 1.5f;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class ContentInfoDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(content.details != null){
|
if(content.details != null){
|
||||||
table.add("[gray]" + (content.unlocked() ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX();
|
table.add("[gray]" + (content.unlocked() || !content.hideDetails ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class JoinDialog extends BaseDialog{
|
|||||||
|
|
||||||
refreshLocal();
|
refreshLocal();
|
||||||
refreshRemote();
|
refreshRemote();
|
||||||
refreshGlobal();
|
refreshCommunity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupRemote(){
|
void setupRemote(){
|
||||||
@@ -331,7 +331,7 @@ public class JoinDialog extends BaseDialog{
|
|||||||
if(eye){
|
if(eye){
|
||||||
name.button(Icon.eyeSmall, Styles.emptyi, () -> {
|
name.button(Icon.eyeSmall, Styles.emptyi, () -> {
|
||||||
showHidden = !showHidden;
|
showHidden = !showHidden;
|
||||||
refreshGlobal();
|
refreshCommunity();
|
||||||
}).update(i -> i.getStyle().imageUp = (showHidden ? Icon.eyeSmall : Icon.eyeOffSmall))
|
}).update(i -> i.getStyle().imageUp = (showHidden ? Icon.eyeSmall : Icon.eyeOffSmall))
|
||||||
.size(40f).right().padRight(3).tooltip("@servers.showhidden");
|
.size(40f).right().padRight(3).tooltip("@servers.showhidden");
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,7 @@ public class JoinDialog extends BaseDialog{
|
|||||||
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void refreshGlobal(){
|
void refreshCommunity(){
|
||||||
int cur = refreshes;
|
int cur = refreshes;
|
||||||
|
|
||||||
global.clear();
|
global.clear();
|
||||||
|
|||||||
@@ -375,8 +375,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(selectAlpha > 0.001f){
|
if(selectAlpha > 0.001f){
|
||||||
|
|
||||||
|
|
||||||
for(Sector sec : planet.sectors){
|
for(Sector sec : planet.sectors){
|
||||||
if(sec.hasBase()){
|
if(sec.hasBase()){
|
||||||
for(Sector enemy : sec.near()){
|
for(Sector enemy : sec.near()){
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class LoadingFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void show(String text){
|
public void show(String text){
|
||||||
|
button.visible = false;
|
||||||
nameLabel.setColor(Color.white);
|
nameLabel.setColor(Color.white);
|
||||||
bar.visible = false;
|
bar.visible = false;
|
||||||
table.clearActions();
|
table.clearActions();
|
||||||
|
|||||||
@@ -850,6 +850,10 @@ public class Block extends UnlockableContent{
|
|||||||
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
||||||
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(buildVisibility == BuildVisibility.sandboxOnly){
|
||||||
|
hideDetails = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class PayloadBlock extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canControlSelect(Player player){
|
public boolean canControlSelect(Player player){
|
||||||
return !player.unit().spawnedByCore && this.payload == null && acceptUnitPayload(player.unit()) && player.tileOn().build == this;
|
return !player.unit().spawnedByCore && this.payload == null && acceptUnitPayload(player.unit()) && player.tileOn() != null && player.tileOn().build == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -174,9 +174,9 @@ public class PowerGraph{
|
|||||||
return Math.min(excess, capacity);
|
return Math.min(excess, capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void distributePower(float needed, float produced){
|
public void distributePower(float needed, float produced, boolean charged){
|
||||||
//distribute even if not needed. this is because some might be requiring power but not using it; it updates consumers
|
//distribute even if not needed. this is because some might be requiring power but not using it; it updates consumers
|
||||||
float coverage = Mathf.zero(needed) && Mathf.zero(produced) ? 0f : Mathf.zero(needed) ? 1f : Math.min(1, produced / needed);
|
float coverage = Mathf.zero(needed) && Mathf.zero(produced) && !charged ? 0f : Mathf.zero(needed) ? 1f : Math.min(1, produced / needed);
|
||||||
for(Building consumer : consumers){
|
for(Building consumer : consumers){
|
||||||
Consumers consumes = consumer.block.consumes;
|
Consumers consumes = consumer.block.consumes;
|
||||||
if(consumes.hasPower()){
|
if(consumes.hasPower()){
|
||||||
@@ -233,6 +233,7 @@ public class PowerGraph{
|
|||||||
energyDelta = 0f;
|
energyDelta = 0f;
|
||||||
|
|
||||||
if(!(consumers.size == 0 && producers.size == 0 && batteries.size == 0)){
|
if(!(consumers.size == 0 && producers.size == 0 && batteries.size == 0)){
|
||||||
|
boolean charged = false;
|
||||||
|
|
||||||
if(!Mathf.equal(powerNeeded, powerProduced)){
|
if(!Mathf.equal(powerNeeded, powerProduced)){
|
||||||
if(powerNeeded > powerProduced){
|
if(powerNeeded > powerProduced){
|
||||||
@@ -240,11 +241,12 @@ public class PowerGraph{
|
|||||||
powerProduced += powerBatteryUsed;
|
powerProduced += powerBatteryUsed;
|
||||||
lastPowerProduced += powerBatteryUsed;
|
lastPowerProduced += powerBatteryUsed;
|
||||||
}else if(powerProduced > powerNeeded){
|
}else if(powerProduced > powerNeeded){
|
||||||
|
charged = true;
|
||||||
powerProduced -= chargeBatteries(powerProduced - powerNeeded);
|
powerProduced -= chargeBatteries(powerProduced - powerNeeded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
distributePower(powerNeeded, powerProduced);
|
distributePower(powerNeeded, powerProduced, charged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class Drill extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canMine(Tile tile){
|
public boolean canMine(Tile tile){
|
||||||
if(tile == null) return false;
|
if(tile == null || tile.block().isStatic()) return false;
|
||||||
Item drops = tile.drop();
|
Item drops = tile.drop();
|
||||||
return drops != null && drops.hardness <= tier;
|
return drops != null && drops.hardness <= tier;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,12 +39,15 @@ public class UnitFactory extends UnitBlock{
|
|||||||
rotate = true;
|
rotate = true;
|
||||||
|
|
||||||
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
|
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
|
||||||
|
if(tile.currentPlan == i) return;
|
||||||
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
|
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
|
||||||
tile.progress = 0;
|
tile.progress = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
|
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
|
||||||
tile.currentPlan = plans.indexOf(p -> p.unit == val);
|
int next = plans.indexOf(p -> p.unit == val);
|
||||||
|
if(tile.currentPlan == next) return;
|
||||||
|
tile.currentPlan = next;
|
||||||
tile.progress = 0;
|
tile.progress = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,15 @@ import mindustry.world.blocks.production.GenericCrafter.*;
|
|||||||
public class DrawRotator extends DrawBlock{
|
public class DrawRotator extends DrawBlock{
|
||||||
public TextureRegion rotator, top;
|
public TextureRegion rotator, top;
|
||||||
public boolean drawSpinSprite = false;
|
public boolean drawSpinSprite = false;
|
||||||
|
public float spinSpeed = 2f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(GenericCrafterBuild build){
|
public void draw(GenericCrafterBuild build){
|
||||||
Draw.rect(build.block.region, build.x, build.y);
|
Draw.rect(build.block.region, build.x, build.y);
|
||||||
if(drawSpinSprite){
|
if(drawSpinSprite){
|
||||||
Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * 2f);
|
Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * spinSpeed);
|
||||||
}else{
|
}else{
|
||||||
Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f);
|
Draw.rect(rotator, build.x, build.y, build.totalProgress * spinSpeed);
|
||||||
}
|
}
|
||||||
if(top.found()) Draw.rect(top, build.x, build.y);
|
if(top.found()) Draw.rect(top, build.x, build.y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
http.socketTimeout=80000
|
http.socketTimeout=80000
|
||||||
http.connectionTimeout=80000
|
http.connectionTimeout=80000
|
||||||
archash=7e96b986053ce489aae161aa6bcbb5d921c609d4
|
archash=dd43cacc5c5a68bd7160234a97b4fd48d9a816d7
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"address": "be.mindustry.nydus.app:6567"
|
"address": "be.mindustry.nydus.app:6567"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address": "mindustry.pl:7777"
|
"address": "46.105.36.238:7777"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address": "v7.mindurka.tk:9999"
|
"address": "v7.mindurka.tk:9999"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Omega",
|
"name": "Omega",
|
||||||
"address": ["yeet.mindustry.me:6567", "yeet.mindustry.me:2345", "n3.mindustry.me:4444","n2.mindustry.me:4040", "n2.mindustry.me:4002", "n2.mindustry.me:4001"]
|
"address": ["yeet.mindustry.me", "yeet.mindustry.me:2345", "n3.mindustry.me:4444","n2.mindustry.me:4040", "n2.mindustry.me:4002", "n2.mindustry.me:4001", "n3.mindustry.me", "n2.mindustry.me:4004"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MeowLand",
|
"name": "MeowLand",
|
||||||
|
|||||||
Reference in New Issue
Block a user