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

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

View File

@@ -14,7 +14,7 @@ TintedDrawable: {
chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}}, chatfield: {name: white, color: {r: 0, g: 0, b: 0, a: 0.2}},
dark: {name: white, color: {hex: "#000000ff"}}, dark: {name: white, color: {hex: "#000000ff"}},
none: {name: white, color: {r: 0, g: 0, b: 0, a: 0}}, 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-over: {name: white, color: { hex: "#ffffff82" }},
flat-alpha: {name: white, color: { hex: "#ffd37fff" }}, flat-alpha: {name: white, color: { hex: "#ffd37fff" }},
flat-down: {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; if(!control.unlocks.isUnlocked(items.get(i))) continue;
final int f = i; final int f = i;
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24, ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24,
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38, 42).padBottom(-5.1f).group(group).get(); () -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get();
button.setChecked(entity.source.id == f); button.setChecked(entity.source.id == f);
if(i % 4 == 3){ if(i % 4 == 3){

View File

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

View File

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

View File

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

View File

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