New changes, possible fixes to UI layout bugs
This commit is contained in:
@@ -15,6 +15,7 @@ import io.anuke.arc.scene.*;
|
|||||||
import io.anuke.arc.scene.actions.Actions;
|
import io.anuke.arc.scene.actions.Actions;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
||||||
|
import io.anuke.arc.scene.ui.Tooltip.Tooltips;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.scene.ui.layout.Unit;
|
import io.anuke.arc.scene.ui.layout.Unit;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
@@ -92,7 +93,7 @@ public class UI implements ApplicationListener{
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
TooltipManager.getInstance().animations = false;
|
Tooltips.getInstance().animations = false;
|
||||||
|
|
||||||
Core.settings.setErrorHandler(e -> {
|
Core.settings.setErrorHandler(e -> {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -5,19 +5,18 @@ import io.anuke.arc.graphics.g2d.Draw;
|
|||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
import io.anuke.arc.scene.Element;
|
import io.anuke.arc.scene.Element;
|
||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Container;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Unit;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Minimap extends Container<Element>{
|
public class Minimap extends Table{
|
||||||
|
|
||||||
public Minimap(){
|
public Minimap(){
|
||||||
background("pane");
|
background("pane");
|
||||||
float margin = 5f;
|
float margin = 5f;
|
||||||
touchable(Touchable.enabled);
|
touchable(Touchable.enabled);
|
||||||
|
|
||||||
addChild(new Element(){
|
add(new Element(){
|
||||||
{
|
{
|
||||||
setSize(Unit.dp.scl(140f));
|
setSize(Unit.dp.scl(140f));
|
||||||
}
|
}
|
||||||
@@ -39,9 +38,8 @@ public class Minimap extends Container<Element>{
|
|||||||
renderer.minimap.drawEntities(x, y, width, height);
|
renderer.minimap.drawEntities(x, y, width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}).size(140f);
|
||||||
|
|
||||||
size(140f);
|
|
||||||
margin(margin);
|
margin(margin);
|
||||||
|
|
||||||
addListener(new InputListener(){
|
addListener(new InputListener(){
|
||||||
|
|||||||
@@ -59,9 +59,7 @@ public class DatabaseDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(unlocked(unlock)){
|
if(unlocked(unlock)){
|
||||||
image.clicked(() -> Vars.ui.content.show(unlock));
|
image.clicked(() -> Vars.ui.content.show(unlock));
|
||||||
image.addListener(new Tooltip<>(new Table("button"){{
|
image.addListener(new Tooltip(t -> t.add(unlock.localizedName())));
|
||||||
add(unlock.localizedName());
|
|
||||||
}}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((++count) % maxWidth == 0){
|
if((++count) % maxWidth == 0){
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
Cell cell = ((Table)pane.getParent()).getCell(button);
|
Cell cell = ((Table)pane.getParent()).getCell(button);
|
||||||
|
|
||||||
if(!Mathf.isEqual(cell.getMinWidth(), pw)){
|
if(!Mathf.isEqual(cell.minWidth(), pw)){
|
||||||
cell.width(pw);
|
cell.width(pw);
|
||||||
cell.padLeft(pad);
|
cell.padLeft(pad);
|
||||||
pane.getParent().invalidateHierarchy();
|
pane.getParent().invalidateHierarchy();
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ public class BlockInventoryFragment extends Fragment{
|
|||||||
int cols = 3;
|
int cols = 3;
|
||||||
int row = 0;
|
int row = 0;
|
||||||
|
|
||||||
table.margin(6f);
|
table.margin(4f);
|
||||||
table.defaults().size(8 * 5).space(8f);
|
table.defaults().size(8 * 5).pad(4f);
|
||||||
|
|
||||||
if(tile.block().hasItems){
|
if(tile.block().hasItems){
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,9 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
Table wavesMain, editorMain;
|
Table wavesMain, editorMain;
|
||||||
|
|
||||||
cont.stack(wavesMain = new Table(), editorMain = new Table()).height(e -> wavesMain.isVisible() ? wavesMain.getPrefHeight() : editorMain.getPrefHeight());
|
cont.stack(wavesMain = new Table(), editorMain = new Table()).height(wavesMain.getPrefHeight()).update(s -> {
|
||||||
|
((Table)s.getParent()).getCell(s).height(wavesMain.isVisible() ? wavesMain.getPrefHeight() : editorMain.getPrefHeight());
|
||||||
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
wavesMain.visible(() -> shown && !state.isEditor());
|
wavesMain.visible(() -> shown && !state.isEditor());
|
||||||
|
|||||||
Reference in New Issue
Block a user