1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-11 08:15:35 +03:00

Added some new block types, fixed some save dialog issues

This commit is contained in:
Anuken 2017-12-29 23:05:52 -05:00
parent 54662ee83f
commit d628600657
8 changed files with 53 additions and 10 deletions

5
.gitignore vendored
View File

@ -9,8 +9,8 @@
/desktop/mindustry-maps/
/desktop/gifexport/
/core/lib/
/core/assets/mindustry-saves/
/core/assets/mindustry-maps/
/android/assets/mindustry-maps/
/android/assets/mindustry-saves/
/core/assets/gifexport/
*.gif
@ -129,3 +129,4 @@ gradle-app.setting
## OS Specific
.DS_Store
Thumbs.db
android/libs/

View File

@ -16,6 +16,7 @@ text.tutorial.next=Next >
text.save.new=New Save
text.save.overwrite=Are you sure you want to overwrite\nthis save slot?
text.overwrite=Overwrite
text.save.none=No saves found!
text.saveload=[accent]Saving...
text.savefail=Failed to save game!
text.save.delete.confirm=Are you sure you want to delete this save?

View File

@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.I18NBundle;
import io.anuke.mindustry.core.*;
import io.anuke.mindustry.entities.Player;
import io.anuke.ucore.UCore;
import io.anuke.ucore.scene.ui.layout.Unit;
public class Vars{
@ -30,9 +31,11 @@ public class Vars{
//discord group URL
public static final String discordURL = "https://discord.gg/r8BkXNd";
//directory for user-created map data
public static final FileHandle customMapDirectory = gwt ? null : Gdx.files.local("mindustry-maps/");
public static final FileHandle customMapDirectory = gwt ? null : UCore.isAssets ?
Gdx.files.local("../../desktop/mindustry-maps") : Gdx.files.local("mindustry-maps/");
//save file directory
public static final FileHandle saveDirectory = gwt ? null : Gdx.files.local("mindustry-saves/");
public static final FileHandle saveDirectory = gwt ? null : UCore.isAssets ?
Gdx.files.local("../../desktop/mindustry-saves") : Gdx.files.local("mindustry-saves/");
//scale of the font
public static float fontscale = Math.max(Unit.dp.scl(1f)/2f, 0.5f);
//camera zoom displayed on startup

View File

@ -151,6 +151,15 @@ public class LoadDialog extends FloatingDialog{
content().add(pane);
addSetup();
}
public void addSetup(){
if(Vars.control.getSaves().getSaveSlots().size != 0) return;
slots.row();
slots.addButton("$text.save.none", "clear", ()->{})
.disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
}
public void modifyButton(TextButton button, SaveSlot slot){

View File

@ -20,10 +20,7 @@ public class SaveDialog extends LoadDialog{
super("$text.savegame");
}
@Override
protected void setup(){
super.setup();
public void addSetup(){
if(!Vars.control.getSaves().canAddSave()){
return;
}
@ -34,10 +31,9 @@ public class SaveDialog extends LoadDialog{
Vars.control.getSaves().addSave(text);
setup();
});
}).fillX().margin(10f).height(70f).pad(4f).padRight(-4);
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
}
@Override
public void modifyButton(TextButton button, SaveSlot slot){
button.clicked(() -> {

View File

@ -63,6 +63,19 @@ public class ProductionBlocks{
health = 70;
}
},
//TODO
/*siliconextractor = new LiquidCrafter("siliconextractor"){
{
input = Item.sand;
inputAmount = 5;
inputLiquid = Liquid.water;
liquidAmount = 18.99f;
output = Item.silicon;
health = 50;
purifyTime = 50;
}
},*/
oilrefinery = new LiquidCrafter("oilrefinery"){
{

View File

@ -0,0 +1,10 @@
package io.anuke.mindustry.world.blocks.types.logic;
import io.anuke.mindustry.world.Block;
public class LogicBlock extends Block{
public LogicBlock(String name) {
super(name);
}
}

View File

@ -0,0 +1,10 @@
package io.anuke.mindustry.world.blocks.types.production;
import io.anuke.mindustry.world.Block;
public class LiquidDrill extends Block {
public LiquidDrill(String name) {
super(name);
}
}