Minor bugfixes all around
This commit is contained in:
Binary file not shown.
@@ -135,13 +135,6 @@ public class Renderer{
|
|||||||
Draw.color(valid ? Color.PURPLE : Color.SCARLET);
|
Draw.color(valid ? Color.PURPLE : Color.SCARLET);
|
||||||
Draw.thickness(2f);
|
Draw.thickness(2f);
|
||||||
Draw.square(x, y, tilesize / 2 + MathUtils.sin(Timers.time() / 6f) + 1);
|
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){
|
if(player.recipe.result.rotate){
|
||||||
Draw.color("orange");
|
Draw.color("orange");
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class UI extends SceneModule{
|
|||||||
Table itemtable, weapontable, tools, loadingtable;
|
Table itemtable, weapontable, tools, loadingtable;
|
||||||
SettingsDialog prefs;
|
SettingsDialog prefs;
|
||||||
KeybindDialog keys;
|
KeybindDialog keys;
|
||||||
Dialog about, menu, restart, tutorial, levels, upgrades;
|
Dialog about, menu, restart, tutorial, levels, upgrades, load;
|
||||||
Tooltip tooltip;
|
Tooltip tooltip;
|
||||||
|
|
||||||
VisibilityProvider play = () -> !GameState.is(State.menu);
|
VisibilityProvider play = () -> !GameState.is(State.menu);
|
||||||
@@ -114,6 +114,8 @@ public class UI extends SceneModule{
|
|||||||
public void init(){
|
public void init(){
|
||||||
//TODO just move these dialogs to different files
|
//TODO just move these dialogs to different files
|
||||||
|
|
||||||
|
load = new LoadDialog();
|
||||||
|
|
||||||
upgrades = new UpgradeDialog();
|
upgrades = new UpgradeDialog();
|
||||||
|
|
||||||
levels = new LevelDialog();
|
levels = new LevelDialog();
|
||||||
@@ -393,12 +395,18 @@ public class UI extends SceneModule{
|
|||||||
new table(){{
|
new table(){{
|
||||||
|
|
||||||
new table("button"){{
|
new table("button"){{
|
||||||
defaults().size(Unit.dp.inPixels(220), Unit.dp.inPixels(50));
|
defaults().size(220, 50);
|
||||||
|
|
||||||
new button("Play", () -> {
|
new button("Play", () -> {
|
||||||
levels.show();
|
levels.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
row();
|
||||||
|
|
||||||
|
new button("Load Game", () -> {
|
||||||
|
load.show();
|
||||||
|
});
|
||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
new button("Settings", () -> {
|
new button("Settings", () -> {
|
||||||
@@ -455,7 +463,7 @@ public class UI extends SceneModule{
|
|||||||
new table("button"){{
|
new table("button"){{
|
||||||
new label("[yellow]Loading..."){{
|
new label("[yellow]Loading..."){{
|
||||||
get().setName("namelabel");
|
get().setName("namelabel");
|
||||||
}}.scale(1).pad(10);
|
}}.scale(1).pad(Unit.dp.inPixels(10));
|
||||||
}}.end();
|
}}.end();
|
||||||
}}.end().get();
|
}}.end().get();
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ import com.badlogic.gdx.utils.ObjectMap;
|
|||||||
import com.badlogic.gdx.utils.TimeUtils;
|
import com.badlogic.gdx.utils.TimeUtils;
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.Vars;
|
|
||||||
import io.anuke.mindustry.World;
|
|
||||||
import io.anuke.mindustry.entities.Weapon;
|
import io.anuke.mindustry.entities.Weapon;
|
||||||
import io.anuke.mindustry.entities.enemies.*;
|
import io.anuke.mindustry.entities.enemies.*;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
@@ -313,6 +311,7 @@ public class SaveIO{
|
|||||||
int tiles = stream.readInt();
|
int tiles = stream.readInt();
|
||||||
|
|
||||||
World.loadMap(mapid, seed);
|
World.loadMap(mapid, seed);
|
||||||
|
Renderer.clearTiles();
|
||||||
|
|
||||||
for(int x = 0; x < World.width(); x ++){
|
for(int x = 0; x < World.width(); x ++){
|
||||||
for(int y = 0; y < World.height(); y ++){
|
for(int y = 0; y < World.height(); y ++){
|
||||||
|
|||||||
@@ -23,22 +23,22 @@ public class LoadDialog extends Dialog{
|
|||||||
|
|
||||||
getButtonTable().addButton("Back", ()->{
|
getButtonTable().addButton("Back", ()->{
|
||||||
hide();
|
hide();
|
||||||
}).pad(8).size(180, 50);
|
}).pad(2).size(180, 44).units(Unit.dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setup(){
|
private void setup(){
|
||||||
content().clear();
|
content().clear();
|
||||||
|
|
||||||
content().add("Select a save slot.").padBottom(4);
|
content().add("Select a save slot.").padBottom(2);
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
for(int i = 0; i < Vars.saveSlots; i ++){
|
for(int i = 0; i < Vars.saveSlots; i ++){
|
||||||
final int slot = 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.getLabelCell().top().left().growX();
|
||||||
button.row();
|
button.row();
|
||||||
button.pad(12);
|
button.pad(Unit.dp.inPixels(10));
|
||||||
button.add("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Last Saved: " + SaveIO.getTimeString(i)));
|
button.add("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Last Saved: " + SaveIO.getTimeString(i)));
|
||||||
button.getLabel().setFontScale(1f);
|
button.getLabel().setFontScale(1f);
|
||||||
button.setDisabled(!SaveIO.isSaveValid(i) );
|
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();
|
content().row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,22 +23,22 @@ public class SaveDialog extends Dialog{
|
|||||||
|
|
||||||
getButtonTable().addButton("Back", ()->{
|
getButtonTable().addButton("Back", ()->{
|
||||||
hide();
|
hide();
|
||||||
}).pad(8).size(180, 50);
|
}).pad(2).size(180, 44).units(Unit.dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setup(){
|
private void setup(){
|
||||||
content().clear();
|
content().clear();
|
||||||
|
|
||||||
content().add("Select a save slot.").padBottom(4);
|
content().add("Select a save slot.").padBottom(2);
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
for(int i = 0; i < Vars.saveSlots; i ++){
|
for(int i = 0; i < Vars.saveSlots; i ++){
|
||||||
final int slot = 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.getLabelCell().top().left().growX();
|
||||||
button.row();
|
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.add((!SaveIO.isSaveValid(i) ? "[gray]<empty>" : "[LIGHT_GRAY]Last Saved: " + SaveIO.getTimeString(i)));
|
||||||
button.getLabel().setFontScale(1f);
|
button.getLabel().setFontScale(1f);
|
||||||
|
|
||||||
@@ -49,14 +49,14 @@ public class SaveDialog extends Dialog{
|
|||||||
}){{
|
}){{
|
||||||
content().pad(16);
|
content().pad(16);
|
||||||
for(Cell<?> cell : getButtonTable().getCells())
|
for(Cell<?> cell : getButtonTable().getCells())
|
||||||
cell.size(110, 45).pad(4);
|
cell.size(110, 45).pad(4).units(Unit.dp);
|
||||||
}}.show();
|
}}.show();
|
||||||
}else{
|
}else{
|
||||||
save(slot);
|
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();
|
content().row();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ public class SaveDialog extends Dialog{
|
|||||||
hide();
|
hide();
|
||||||
Vars.ui.hideLoading();
|
Vars.ui.hideLoading();
|
||||||
}
|
}
|
||||||
}, 2f/60f);
|
}, 8f/60f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user