Misc. bugfixes
This commit is contained in:
@@ -5,7 +5,7 @@ page id=1 file="square2.png"
|
|||||||
page id=2 file="square3.png"
|
page id=2 file="square3.png"
|
||||||
chars count=11449
|
chars count=11449
|
||||||
char id=13 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
|
char id=13 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
|
||||||
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=16 page=0 chnl=0
|
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=8 page=0 chnl=0
|
||||||
char id=33 x=2039 y=147 width=7 height=23 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0
|
char id=33 x=2039 y=147 width=7 height=23 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0
|
||||||
char id=34 x=147 y=2032 width=15 height=11 xoffset=-1 yoffset=4 xadvance=16 page=0 chnl=0
|
char id=34 x=147 y=2032 width=15 height=11 xoffset=-1 yoffset=4 xadvance=16 page=0 chnl=0
|
||||||
char id=36 x=7 y=0 width=23 height=31 xoffset=-1 yoffset=0 xadvance=24 page=0 chnl=0
|
char id=36 x=7 y=0 width=23 height=31 xoffset=-1 yoffset=0 xadvance=24 page=0 chnl=0
|
||||||
|
|||||||
@@ -26,10 +26,7 @@ import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
|||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.entities.EntityQuery;
|
import io.anuke.ucore.entities.EntityQuery;
|
||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
import io.anuke.ucore.util.Atlas;
|
import io.anuke.ucore.util.*;
|
||||||
import io.anuke.ucore.util.Bundles;
|
|
||||||
import io.anuke.ucore.util.Strings;
|
|
||||||
import io.anuke.ucore.util.Timer;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -397,7 +394,7 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(!state.is(State.paused) || Net.active()){
|
if(!state.isPaused()){
|
||||||
Timers.update();
|
Timers.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.mindustry.game.EventType.*;
|
|||||||
import io.anuke.mindustry.game.GameMode;
|
import io.anuke.mindustry.game.GameMode;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.game.Teams;
|
import io.anuke.mindustry.game.Teams;
|
||||||
|
import io.anuke.mindustry.gen.Call;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
@@ -21,7 +22,6 @@ import io.anuke.ucore.entities.EntityQuery;
|
|||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import io.anuke.mindustry.gen.Call;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logic module.
|
* Logic module.
|
||||||
@@ -159,16 +159,13 @@ public class Logic extends Module{
|
|||||||
|
|
||||||
if(!state.is(State.menu)){
|
if(!state.is(State.menu)){
|
||||||
|
|
||||||
if(!state.is(State.paused) || Net.active()){
|
|
||||||
Timers.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!Net.client() && !world.isInvalidMap()){
|
if(!Net.client() && !world.isInvalidMap()){
|
||||||
updateSectors();
|
updateSectors();
|
||||||
checkGameOver();
|
checkGameOver();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!state.is(State.paused) || Net.active()){
|
if(!state.isPaused()){
|
||||||
|
Timers.update();
|
||||||
|
|
||||||
if(!state.mode.disableWaveTimer && !state.mode.disableWaves){
|
if(!state.mode.disableWaveTimer && !state.mode.disableWaves){
|
||||||
state.wavetime -= Timers.delta();
|
state.wavetime -= Timers.delta();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.function.Supplier;
|
import io.anuke.ucore.function.Supplier;
|
||||||
import io.anuke.ucore.scene.ui.Image;
|
import io.anuke.ucore.scene.ui.Image;
|
||||||
import io.anuke.ucore.scene.ui.layout.Stack;
|
import io.anuke.ucore.scene.ui.layout.Stack;
|
||||||
@@ -14,7 +15,7 @@ public class ItemImage extends Stack{
|
|||||||
public ItemImage(TextureRegion region, Supplier<CharSequence> text){
|
public ItemImage(TextureRegion region, Supplier<CharSequence> text){
|
||||||
Table t = new Table().left().bottom();
|
Table t = new Table().left().bottom();
|
||||||
|
|
||||||
t.label(text).color(Color.DARK_GRAY).padBottom(-20).get().setFontScale(Unit.dp.scl(0.5f));
|
t.label(text).color(Color.DARK_GRAY).padBottom(-Core.skin.font().getData().capHeight * 2).get().setFontScale(Unit.dp.scl(0.5f));
|
||||||
t.row();
|
t.row();
|
||||||
t.label(text).get().setFontScale(Unit.dp.scl(0.5f));
|
t.label(text).get().setFontScale(Unit.dp.scl(0.5f));
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ public class ItemImage extends Stack{
|
|||||||
public ItemImage(ItemStack stack){
|
public ItemImage(ItemStack stack){
|
||||||
Table t = new Table().left().bottom();
|
Table t = new Table().left().bottom();
|
||||||
|
|
||||||
t.add(stack.amount + "").color(Color.DARK_GRAY).padBottom(-20).get().setFontScale(Unit.dp.scl(0.5f));
|
t.add(stack.amount + "").color(Color.DARK_GRAY).padBottom(-Core.skin.font().getData().capHeight * 2).get().setFontScale(Unit.dp.scl(0.5f));
|
||||||
t.row();
|
t.row();
|
||||||
t.add(stack.amount + "").get().setFontScale(Unit.dp.scl(0.5f));
|
t.add(stack.amount + "").get().setFontScale(Unit.dp.scl(0.5f));
|
||||||
|
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ public abstract class BaseBlock extends MappableContent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**Returns the amount of items this block can accept.*/
|
||||||
* Returns the amount of items this block can accept.
|
|
||||||
*/
|
|
||||||
public int acceptStack(Item item, int amount, Tile tile, Unit source){
|
public int acceptStack(Item item, int amount, Tile tile, Unit source){
|
||||||
if(acceptItem(item, tile, tile) && hasItems && (source == null || source.getTeam() == tile.getTeam())){
|
if(acceptItem(item, tile, tile) && hasItems && (source == null || source.getTeam() == tile.getTeam())){
|
||||||
return Math.min(getMaximumAccepted(tile, item), amount);
|
return Math.min(getMaximumAccepted(tile, item), amount);
|
||||||
@@ -52,12 +50,10 @@ public abstract class BaseBlock extends MappableContent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getMaximumAccepted(Tile tile, Item item){
|
public int getMaximumAccepted(Tile tile, Item item){
|
||||||
return itemCapacity - (tile.entity.items.total() - tile.entity.items.get(item));
|
return itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**Remove a stack from this inventory, and return the amount removed.*/
|
||||||
* Remove a stack from this inventory, and return the amount removed.
|
|
||||||
*/
|
|
||||||
public int removeStack(Tile tile, Item item, int amount){
|
public int removeStack(Tile tile, Item item, int amount){
|
||||||
tile.entity.noSleep();
|
tile.entity.noSleep();
|
||||||
tile.entity.items.remove(item, amount);
|
tile.entity.items.remove(item, amount);
|
||||||
@@ -88,7 +84,8 @@ public abstract class BaseBlock extends MappableContent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
return tile.entity != null && consumes.has(ConsumeItem.class) && consumes.item() == item && tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
return tile.entity != null && consumes.has(ConsumeItem.class) && consumes.item() == item &&
|
||||||
|
tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class ForceProjector extends Block {
|
|||||||
|
|
||||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
||||||
|
|
||||||
if(!entity.broken && entity.timer.get(timerUse, phaseUseTime) && entity.items.total() > 0){
|
if(entity.cons.valid() && !entity.broken && entity.timer.get(timerUse, phaseUseTime) && entity.items.total() > 0){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.items.remove(consumes.item(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class MendProjector extends Block{
|
|||||||
|
|
||||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
||||||
|
|
||||||
if(entity.timer.get(timerUse, useTime) && entity.items.total() > 0){
|
if(entity.cons.valid() && entity.timer.get(timerUse, useTime) && entity.items.total() > 0){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.items.remove(consumes.item(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class PowerSmelter extends PowerBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumAccepted(Tile tile, Item item){
|
public int getMaximumAccepted(Tile tile, Item item){
|
||||||
return itemCapacity - tile.entity.items.get(item);
|
return itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class Smelter extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumAccepted(Tile tile, Item item){
|
public int getMaximumAccepted(Tile tile, Item item){
|
||||||
return itemCapacity - tile.entity.items.get(item);
|
return itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user