Added zone requirement display
This commit is contained in:
@@ -12,6 +12,7 @@ import io.anuke.mindustry.game.EventType.UnlockEvent;
|
||||
import io.anuke.mindustry.type.ContentType;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.Zone;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@@ -26,6 +27,22 @@ public class GlobalData{
|
||||
Core.settings.setSerializer(Item.class, (stream, t) -> stream.writeUTF(t.name), stream -> content.getByName(ContentType.item, stream.readUTF()));
|
||||
}
|
||||
|
||||
public void updateWaveScore(Zone zone, int wave){
|
||||
int value = Core.settings.getInt(zone.name + "-wave", 0);
|
||||
if(value < wave){
|
||||
Core.settings.put(zone.name + "-wave", wave);
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getWaveScore(Zone zone){
|
||||
return Core.settings.getInt(zone.name + "-wave", 0);
|
||||
}
|
||||
|
||||
public boolean isCompleted(Zone zone){
|
||||
return getWaveScore(zone) >= zone.conditionWave;
|
||||
}
|
||||
|
||||
public void addItem(Item item, int amount){
|
||||
modified = true;
|
||||
items.getAndIncrement(item, 0, amount);
|
||||
|
||||
Reference in New Issue
Block a user