mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Fixed power distributors connecting to generators, wrong save extension
This commit is contained in:
parent
89ddbfc83d
commit
f4c9645d73
Binary file not shown.
Before Width: | Height: | Size: 262 B |
@ -88,6 +88,11 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 150), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 100));
|
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 150), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 100));
|
||||||
|
|
||||||
//UNITS
|
//UNITS
|
||||||
|
|
||||||
|
//bodies
|
||||||
|
//new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
|
||||||
|
|
||||||
|
//actual unit related stuff
|
||||||
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
|
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
|
||||||
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
|
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20));
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package io.anuke.mindustry.io;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.async.AsyncExecutor;
|
import com.badlogic.gdx.utils.async.AsyncExecutor;
|
||||||
import io.anuke.mindustry.Vars;
|
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.game.Difficulty;
|
import io.anuke.mindustry.game.Difficulty;
|
||||||
import io.anuke.mindustry.game.GameMode;
|
import io.anuke.mindustry.game.GameMode;
|
||||||
@ -169,8 +168,8 @@ public class Saves {
|
|||||||
|
|
||||||
public void exportFile(FileHandle file) throws IOException{
|
public void exportFile(FileHandle file) throws IOException{
|
||||||
try{
|
try{
|
||||||
if(!file.extension().equals("mins")){
|
if(!file.extension().equals(saveExtension)){
|
||||||
file = file.parent().child(file.nameWithoutExtension() + "." + Vars.saveExtension);
|
file = file.parent().child(file.nameWithoutExtension() + "." + saveExtension);
|
||||||
}
|
}
|
||||||
SaveIO.fileFor(index).copyTo(file);
|
SaveIO.fileFor(index).copyTo(file);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
@ -95,7 +95,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false)));
|
ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false)));
|
||||||
}
|
}
|
||||||
}, false, "mins");
|
}, false, saveExtension);
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
FileHandle file = Gdx.files.local("save-" + slot.getName() + "." + Vars.saveExtension);
|
FileHandle file = Gdx.files.local("save-" + slot.getName() + "." + Vars.saveExtension);
|
||||||
@ -162,7 +162,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
}else{
|
}else{
|
||||||
ui.showError("$text.save.import.invalid");
|
ui.showError("$text.save.import.invalid");
|
||||||
}
|
}
|
||||||
}, true, "mins");
|
}, true, saveExtension);
|
||||||
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
|
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import io.anuke.mindustry.world.Tile;
|
|||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
|
||||||
public class OreBlock extends Floor {
|
public class OreBlock extends Floor {
|
||||||
protected Floor base;
|
public Floor base;
|
||||||
|
|
||||||
public OreBlock(Item ore, Floor base){
|
public OreBlock(Item ore, Floor base){
|
||||||
super("ore-" + ore.name + "-" + base.name);
|
super("ore-" + ore.name + "-" + base.name);
|
||||||
|
@ -253,7 +253,8 @@ public class PowerDistributor extends PowerBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean linkValid(Tile tile, Tile link){
|
protected boolean linkValid(Tile tile, Tile link){
|
||||||
if(!(tile != link && link != null && link.block().hasPower)) return false;
|
if(!(tile != link && link != null && link.block().hasPower)
|
||||||
|
|| link.block() instanceof PowerGenerator) return false;
|
||||||
|
|
||||||
if(link.block() instanceof PowerDistributor){
|
if(link.block() instanceof PowerDistributor){
|
||||||
DistributorEntity oe = link.entity();
|
DistributorEntity oe = link.entity();
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package io.anuke.mindustry;
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Mech;
|
import io.anuke.mindustry.type.Mech;
|
||||||
import io.anuke.mindustry.type.Upgrade;
|
import io.anuke.mindustry.type.Upgrade;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
|
import io.anuke.mindustry.world.blocks.OreBlock;
|
||||||
|
|
||||||
public class Generators {
|
public class Generators {
|
||||||
|
|
||||||
@ -56,6 +58,19 @@ public class Generators {
|
|||||||
image.save("mech-icon-" + mech.name);
|
image.save("mech-icon-" + mech.name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
context.generate("ore-icons", () -> {
|
||||||
|
for(Block block : Block.all()){
|
||||||
|
if(!(block instanceof OreBlock)) continue;
|
||||||
|
|
||||||
|
OreBlock ore = (OreBlock)block;
|
||||||
|
Item item = ore.drops.item;
|
||||||
|
Block base = ore.base;
|
||||||
|
|
||||||
|
//get base image to draw on
|
||||||
|
Image image = context.get(base.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user