This commit is contained in:
Anuken 2020-10-25 15:55:23 -04:00
parent 6c3372e71c
commit 59b5d809db
9 changed files with 18 additions and 13 deletions

View File

@ -726,6 +726,7 @@ setting.blockreplace.name = Automatic Block Suggestions
setting.linear.name = Linear Filtering
setting.hints.name = Hints
setting.flow.name = Display Resource Flow Rate
setting.backgroundpause.name = Pause In Background
setting.buildautopause.name = Auto-Pause Building
setting.animatedwater.name = Animated Surfaces
setting.animatedshields.name = Animated Shields

View File

@ -412,13 +412,15 @@ public class Control implements ApplicationListener, Loadable{
@Override
public void pause(){
wasPaused = state.is(State.paused);
if(state.is(State.playing)) state.set(State.paused);
if(settings.getBool("backgroundpause", true)){
wasPaused = state.is(State.paused);
if(state.is(State.playing)) state.set(State.paused);
}
}
@Override
public void resume(){
if(state.is(State.paused) && !wasPaused){
if(state.is(State.paused) && !wasPaused && settings.getBool("backgroundpause", true)){
state.set(State.playing);
}
}

View File

@ -378,6 +378,7 @@ public class UI implements ApplicationListener, Loadable{
cont.add(text).pad(2f).growX().wrap().get().setAlignment(Align.center);
cont.row();
cont.button("@ok", this::hide).size(120, 50).pad(4);
closeOnBack();
}}.show();
}
@ -405,6 +406,7 @@ public class UI implements ApplicationListener, Loadable{
cont.button("@ok", this::hide).size(110, 50).fillX().left();
cont.row();
cont.add(col).colspan(2).pad(2);
closeOnBack();
}}.show();
}
@ -420,6 +422,7 @@ public class UI implements ApplicationListener, Loadable{
cont.add(text).width(400f).wrap().get().setAlignment(align, align);
cont.row();
buttons.button("@ok", this::hide).size(110, 50).pad(4);
closeOnBack();
}}.show();
}
@ -427,6 +430,7 @@ public class UI implements ApplicationListener, Loadable{
new Dialog(titleText){{
cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left);
buttons.button("@ok", this::hide).size(110, 50).pad(4);
closeOnBack();
}}.show();
}
@ -436,6 +440,7 @@ public class UI implements ApplicationListener, Loadable{
titleTable.row();
titleTable.image().color(Pal.accent).height(3f).growX().pad(2f);
buttons.button("@ok", this::hide).size(110, 50).pad(4);
closeOnBack();
}}.show();
}

View File

@ -869,7 +869,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public void placed(){
if(net.client()) return;
if((block.consumesPower && !block.outputsPower) || (!block.consumesPower && block.outputsPower)){
if(block.consumesPower || block.outputsPower){
int range = 10;
tempTiles.clear();
Geometry.circle(tileX(), tileY(), range, (x, y) -> {

View File

@ -197,7 +197,7 @@ public class Universe{
if(!sector.isAttacked() && turn > invasionGracePeriod){
//invasion chance depends on # of nearby bases
if(Mathf.chance(baseInvasionChance * sector.near().count(Sector::hasEnemyBase))){
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : 0) + Mathf.random(2, 5) * 5;
int waveMax = Math.max(sector.info.winWave, state.wave) + Mathf.random(2, 5) * 5;
//assign invasion-related things
if(sector.isBeingPlayed()){

View File

@ -1,7 +1,6 @@
package mindustry.ui.dialogs;
import arc.*;
import arc.input.*;
import arc.scene.ui.*;
import arc.util.*;
import mindustry.core.GameState.*;
@ -54,11 +53,7 @@ public class BaseDialog extends Dialog{
}
public void addCloseListener(){
keyDown(key -> {
if(key == KeyCode.escape || key == KeyCode.back){
Core.app.post(this::hide);
}
});
closeOnBack();
}
@Override

View File

@ -281,7 +281,9 @@ public class SettingsMenuDialog extends SettingsDialog{
game.checkPref("blockreplace", true);
game.checkPref("conveyorpathfinding", true);
game.checkPref("hints", true);
if(!mobile){
game.checkPref("backgroundpause", true);
game.checkPref("buildautopause", false);
}

View File

@ -617,7 +617,7 @@ public class Block extends UnlockableContent{
public ItemStack[] researchRequirements(){
ItemStack[] out = new ItemStack[requirements.length];
for(int i = 0; i < out.length; i++){
int quantity = 40 + Mathf.round(Mathf.pow(requirements[i].amount, 1.15f) * 20 * researchCostMultiplier, 10);
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.15f) * 20 * researchCostMultiplier, 10);
out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity));
}

View File

@ -183,7 +183,7 @@ public class PowerNode extends PowerBlock{
protected void getPotentialLinks(Tile tile, Cons<Building> others){
Boolf<Building> valid = other -> other != null && other.tile() != tile && other.power != null &&
((!other.block.outputsPower && other.block.consumesPower) || (other.block.outputsPower && !other.block.consumesPower) || other.block instanceof PowerNode) &&
(other.block.outputsPower || other.block.consumesPower || other.block instanceof PowerNode) &&
overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team == player.team()
&& !other.proximity.contains(e -> e.tile == tile) && !graphs.contains(other.power.graph);