Bugfixes, cleanup, optimization
This commit is contained in:
@@ -12,12 +12,9 @@ public class ItemImage extends Stack {
|
||||
private Image image;
|
||||
|
||||
public ItemImage(TextureRegion region, Supplier<String> text, Color color) {
|
||||
Table t = new Table();
|
||||
t.left().bottom();
|
||||
Table t = new Table().left().bottom();
|
||||
|
||||
t.label(text).color(Color.DARK_GRAY);
|
||||
t.row();
|
||||
t.label(text).padTop(-22);
|
||||
t.label(text).get().setFontScale(0.5f);
|
||||
|
||||
image = new Image(region);
|
||||
image.setColor(color);
|
||||
|
||||
@@ -212,7 +212,7 @@ public class FileChooser extends FloatingDialog {
|
||||
files.row();
|
||||
}
|
||||
|
||||
ButtonGroup<TextButton> group = new ButtonGroup<TextButton>();
|
||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||
group.setMinCheckCount(0);
|
||||
|
||||
for(FileHandle file : names){
|
||||
@@ -278,7 +278,7 @@ public class FileChooser extends FloatingDialog {
|
||||
}
|
||||
|
||||
public class FileHistory{
|
||||
private Array<FileHandle> history = new Array<FileHandle>();
|
||||
private Array<FileHandle> history = new Array<>();
|
||||
private int index;
|
||||
|
||||
public FileHistory(){
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.ucore.scene.ui.Label;
|
||||
import io.anuke.ucore.scene.ui.TextField;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class BlockInventoryFragment implements Fragment {
|
||||
int row = 0;
|
||||
|
||||
table.margin(3f);
|
||||
table.defaults().size(16 * 2).space(6f);
|
||||
table.defaults().size(16*2).space(6f);
|
||||
|
||||
if(tile.block().hasItems) {
|
||||
int[] items = tile.entity.items.items;
|
||||
@@ -97,13 +97,6 @@ public class BlockInventoryFragment implements Fragment {
|
||||
|
||||
container.add(i);
|
||||
|
||||
Table t = new Table();
|
||||
t.left().bottom();
|
||||
|
||||
t.label(() -> round(items[f])).color(Color.DARK_GRAY);
|
||||
t.row();
|
||||
t.label(() -> round(items[f])).padTop(-22);
|
||||
|
||||
BooleanProvider canPick = () -> player.inventory.canAcceptItem(item);
|
||||
|
||||
HandCursorListener l = new HandCursorListener();
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ChatFragment extends Table implements Fragment{
|
||||
private float textWidth = Unit.dp.scl(600);
|
||||
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||
private float textspacing = Unit.dp.scl(10);
|
||||
private Array<String> history = new Array<String>();
|
||||
private Array<String> history = new Array<>();
|
||||
private int historyPos = 0;
|
||||
private int scrollPos = 0;
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@ package io.anuke.mindustry.ui.fragments;
|
||||
import io.anuke.ucore.scene.Group;
|
||||
|
||||
public interface Fragment{
|
||||
public void build(Group parent);
|
||||
void build(Group parent);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.fragments;
|
||||
import io.anuke.mindustry.input.InputHandler;
|
||||
import io.anuke.ucore.scene.Group;
|
||||
|
||||
/**Fragment for displaying overlays such as block inventories. One is created for each input handler.*/
|
||||
public class OverlayFragment implements Fragment{
|
||||
public final BlockInventoryFragment inv;
|
||||
public final BlockConfigFragment config;
|
||||
|
||||
Reference in New Issue
Block a user