Minor bugfixes all around

This commit is contained in:
Anuken 2017-08-08 13:04:07 -04:00
parent eabdc3d27d
commit de22d72c51
7 changed files with 25 additions and 25 deletions

BIN
core/lib/ucore.jar Normal file

Binary file not shown.

View File

@ -135,13 +135,6 @@ public class Renderer{
Draw.color(valid ? Color.PURPLE : Color.SCARLET);
Draw.thickness(2f);
Draw.square(x, y, tilesize / 2 + MathUtils.sin(Timers.time() / 6f) + 1);
if(android){
//TODO
Draw.thickness(1f);
Draw.color(Color.ORANGE);
Draw.square(x + tilesize/2, y + tilesize/2, tilesize/4);
}
if(player.recipe.result.rotate){
Draw.color("orange");

View File

@ -38,7 +38,7 @@ public class UI extends SceneModule{
Table itemtable, weapontable, tools, loadingtable;
SettingsDialog prefs;
KeybindDialog keys;
Dialog about, menu, restart, tutorial, levels, upgrades;
Dialog about, menu, restart, tutorial, levels, upgrades, load;
Tooltip tooltip;
VisibilityProvider play = () -> !GameState.is(State.menu);
@ -114,6 +114,8 @@ public class UI extends SceneModule{
public void init(){
//TODO just move these dialogs to different files
load = new LoadDialog();
upgrades = new UpgradeDialog();
levels = new LevelDialog();
@ -393,12 +395,18 @@ public class UI extends SceneModule{
new table(){{
new table("button"){{
defaults().size(Unit.dp.inPixels(220), Unit.dp.inPixels(50));
defaults().size(220, 50);
new button("Play", () -> {
levels.show();
});
row();
new button("Load Game", () -> {
load.show();
});
row();
new button("Settings", () -> {
@ -455,7 +463,7 @@ public class UI extends SceneModule{
new table("button"){{
new label("[yellow]Loading..."){{
get().setName("namelabel");
}}.scale(1).pad(10);
}}.scale(1).pad(Unit.dp.inPixels(10));
}}.end();
}}.end().get();

View File

@ -12,9 +12,7 @@ import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.TimeUtils;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import io.anuke.mindustry.Inventory;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.World;
import io.anuke.mindustry.*;
import io.anuke.mindustry.entities.Weapon;
import io.anuke.mindustry.entities.enemies.*;
import io.anuke.mindustry.resource.Item;
@ -313,6 +311,7 @@ public class SaveIO{
int tiles = stream.readInt();
World.loadMap(mapid, seed);
Renderer.clearTiles();
for(int x = 0; x < World.width(); x ++){
for(int y = 0; y < World.height(); y ++){

View File

@ -23,22 +23,22 @@ public class LoadDialog extends Dialog{
getButtonTable().addButton("Back", ()->{
hide();
}).pad(8).size(180, 50);
}).pad(2).size(180, 44).units(Unit.dp);
}
private void setup(){
content().clear();
content().add("Select a save slot.").padBottom(4);
content().add("Select a save slot.").padBottom(2);
content().row();
for(int i = 0; i < Vars.saveSlots; i ++){
final int slot = i;
TextButton button = new TextButton("[yellow]Slot " + i);
TextButton button = new TextButton("[yellow]Slot " + (i+1));
button.getLabelCell().top().left().growX();
button.row();
button.pad(12);
button.pad(Unit.dp.inPixels(10));
button.add("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Last Saved: " + SaveIO.getTimeString(i)));
button.getLabel().setFontScale(1f);
button.setDisabled(!SaveIO.isSaveValid(i) );
@ -59,7 +59,7 @@ public class LoadDialog extends Dialog{
}
});
content().add(button).size(400, 90).units(Unit.dp).pad(10);
content().add(button).size(400, 75).units(Unit.dp).pad(2);
content().row();
}

View File

@ -23,22 +23,22 @@ public class SaveDialog extends Dialog{
getButtonTable().addButton("Back", ()->{
hide();
}).pad(8).size(180, 50);
}).pad(2).size(180, 44).units(Unit.dp);
}
private void setup(){
content().clear();
content().add("Select a save slot.").padBottom(4);
content().add("Select a save slot.").padBottom(2);
content().row();
for(int i = 0; i < Vars.saveSlots; i ++){
final int slot = i;
TextButton button = new TextButton("[yellow]Slot " + i);
TextButton button = new TextButton("[yellow]Slot " + (i+1));
button.getLabelCell().top().left().growX();
button.row();
button.pad(12);
button.pad(Unit.dp.inPixels(10));
button.add((!SaveIO.isSaveValid(i) ? "[gray]<empty>" : "[LIGHT_GRAY]Last Saved: " + SaveIO.getTimeString(i)));
button.getLabel().setFontScale(1f);
@ -49,14 +49,14 @@ public class SaveDialog extends Dialog{
}){{
content().pad(16);
for(Cell<?> cell : getButtonTable().getCells())
cell.size(110, 45).pad(4);
cell.size(110, 45).pad(4).units(Unit.dp);
}}.show();
}else{
save(slot);
}
});
content().add(button).size(400, 90).units(Unit.dp).pad(8);
content().add(button).size(400, 75).units(Unit.dp).pad(2);
content().row();
}
}
@ -71,7 +71,7 @@ public class SaveDialog extends Dialog{
hide();
Vars.ui.hideLoading();
}
}, 2f/60f);
}, 8f/60f);
}
}

Binary file not shown.