Block config UI fixes

This commit is contained in:
Anuken 2018-11-27 09:29:28 -05:00
parent dcea8ae64f
commit b45368342d
15 changed files with 881 additions and 934 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Before After
Before After

View file

@ -14,7 +14,7 @@ TintedDrawable: {
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
dark: {name: white, color: {hex: "#000000ff"}},
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}},
flat: {name: white, color: {r: 0.0, g: 0.0, b: 0.0, a: 0.42}},
flat: {name: white, color: {r: 0.0, g: 0.0, b: 0.0, a: 0.6}},
flat-over: {name: white, color: { hex: "#ffffff82" }},
flat-alpha: {name: white, color: { hex: "#ffd37fff" }},
flat-down: {name: white, color: { hex: "#ffd37fff" }}

View file

@ -144,8 +144,8 @@ public class DebugBlocks extends BlockList implements ContentList{
if(!control.unlocks.isUnlocked(items.get(i))) continue;
final int f = i;
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24,
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38, 42).padBottom(-5.1f).group(group).get();
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24,
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get();
button.setChecked(entity.source.id == f);
if(i % 4 == 3){

View file

@ -51,27 +51,22 @@ public class PausedDialog extends FloatingDialog{
content().row();
if(!mobile){
content().defaults().width(220).height(50);
float dw = 210f;
content().defaults().width(dw).height(50).pad(5f);
content().addButton("$text.back", () -> {
hide();
});
content().addButton("$text.back", this::hide).colspan(2).width(dw*2 + 10f);
content().row();
content().addButton("$text.unlocks", ui.unlocks::show);
content().row();
content().addButton("$text.settings", ui.settings::show);
content().row();
content().addButton("$text.savegame", save::show).disabled(s -> world.getSector() != null);
content().row();
content().addButton("$text.loadgame", load::show).disabled(b -> Net.active());
content().row();
content().addButton("$text.hostserver", ui.host::show).disabled(b -> Net.active());
content().addButton("$text.hostserver", ui.host::show).disabled(b -> Net.active()).colspan(2).width(dw*2 + 10f);
content().row();
@ -81,7 +76,7 @@ public class PausedDialog extends FloatingDialog{
runExitSave();
hide();
});
});
}).colspan(2).width(dw + 10f);
}else{
content().defaults().size(120f).pad(5);

View file

@ -59,10 +59,10 @@ public class HudFragment extends Fragment{
select.left();
select.defaults().size(dsize).left();
menu = select.addImageButton("icon-menu", isize, ui.paused::show).get();
flip = select.addImageButton("icon-arrow-up", isize, this::toggleMenus).get();
menu = select.addImageButton("icon-menu", "clear", isize, ui.paused::show).get();
flip = select.addImageButton("icon-arrow-up", "clear", isize, this::toggleMenus).get();
select.addImageButton("icon-pause", isize, () -> {
select.addImageButton("icon-pause", "clear", isize, () -> {
if(Net.active()){
ui.listfrag.toggle();
}else{
@ -77,7 +77,7 @@ public class HudFragment extends Fragment{
}
}).get();
select.addImageButton("icon-settings", isize, () -> {
select.addImageButton("icon-settings", "clear", isize, () -> {
if(Net.active() && mobile){
if(ui.chatfrag.chatOpen()){
ui.chatfrag.hide();
@ -150,7 +150,7 @@ public class HudFragment extends Fragment{
parent.fill(t -> {
t.visible(() -> netServer.isWaitingForPlayers() && !state.is(State.menu));
t.table("clear", c -> c.margin(10).add("$text.waiting.players"));
t.table("button", c -> c.add("$text.waiting.players"));
});
//'core is under attack' table

View file

@ -24,12 +24,12 @@ public interface SelectionTrait{
ButtonGroup<ImageButton> group = new ButtonGroup<>();
Table cont = new Table();
cont.defaults().size(38, 42).padBottom(-5.1f);
cont.defaults().size(38);
int i = 0;
if(nullItem){
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> consumer.accept(null)).group(group).get();
ImageButton button = cont.addImageButton("white", "clear-toggle", 24, () -> consumer.accept(null)).group(group).get();
button.getStyle().imageUp = new TextureRegionDrawable(Draw.region("icon-nullitem"));
button.setChecked(holder.get() == null);
@ -39,7 +39,7 @@ public interface SelectionTrait{
for(Item item : items){
if(!control.unlocks.isUnlocked(item)) continue;
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> consumer.accept(item))
ImageButton button = cont.addImageButton("white", "clear-toggle", 24, () -> consumer.accept(item))
.group(group).get();
button.getStyle().imageUp = new TextureRegionDrawable(item.region);
button.setChecked(holder.get() == item);

View file

@ -84,12 +84,12 @@ public class CommandCenter extends Block{
Table buttons = new Table();
for(UnitCommand cmd : UnitCommand.values()){
buttons.addImageButton("command-" + cmd.name(), "toggle", 8*3, () -> threads.run(() -> Call.onCommandCenterSet(players[0], tile, cmd))).size(40f, 44f)
.checked(entity.command == cmd).group(group);
buttons.addImageButton("command-" + cmd.name(), "clear-toggle", 8*3, () -> threads.run(() -> Call.onCommandCenterSet(players[0], tile, cmd)))
.size(38f).checked(entity.command == cmd).group(group);
}
table.add(buttons);
table.row();
table.table("button", t -> t.label(() -> entity.command.localized()).center().growX()).growX().padTop(-5);
table.table("pane", t -> t.label(() -> entity.command.localized()).center().growX()).growX();
}
@Remote(called = Loc.server, forward = true, targets = Loc.both)