UI cleanup

This commit is contained in:
Anuken
2020-07-23 17:37:45 -04:00
parent 69f6154894
commit 72fc103e16
28 changed files with 78 additions and 78 deletions

View File

@@ -62,7 +62,7 @@ public class DatabaseDialog extends BaseDialog{
image.addListener(listener);
if(!Vars.mobile && unlocked(unlock)){
image.addListener(new HandCursorListener());
image.update(() -> image.getColor().lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta));
image.update(() -> image.color.lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta));
}
if(unlocked(unlock)){

View File

@@ -76,7 +76,7 @@ public class FileChooser extends BaseDialog{
cancel.clicked(this::hide);
navigation = new TextField("");
navigation.touchable(Touchable.disabled);
navigation.touchable = Touchable.disabled;
files = new Table();
files.marginRight(10);

View File

@@ -286,12 +286,12 @@ public class JoinDialog extends BaseDialog{
pad = 6;
}
Cell cell = ((Table)pane.getParent()).getCell(button);
Cell cell = ((Table)pane.parent).getCell(button);
if(!Mathf.equal(cell.minWidth(), pw)){
cell.width(pw);
cell.padLeft(pad);
pane.getParent().invalidateHierarchy();
pane.parent.invalidateHierarchy();
}
});
}

View File

@@ -416,12 +416,12 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
stable.update(() -> {
if(selected != null){
if(launching){
stable.getColor().sub(0, 0, 0, 0.05f * Time.delta);
stable.color.sub(0, 0, 0, 0.05f * Time.delta);
}else{
//fade out UI when not facing selected sector
Tmp.v31.set(selected.tile.v).rotate(Vec3.Y, -planets.planet.getRotation()).scl(-1f).nor();
float dot = planets.cam.direction.dot(Tmp.v31);
stable.getColor().a = Math.max(dot, 0f)*2f;
stable.color.a = Math.max(dot, 0f)*2f;
if(dot*2f <= -0.1f){
stable.remove();
selected = null;

View File

@@ -64,7 +64,7 @@ public class ResearchDialog extends BaseDialog{
addListener(new InputListener(){
@Override
public boolean scrolled(InputEvent event, float x, float y, float amountX, float amountY){
view.setScale(Mathf.clamp(view.getScaleX() - amountY / 10f * view.getScaleX(), 0.25f, 1f));
view.setScale(Mathf.clamp(view.scaleX - amountY / 10f * view.scaleX, 0.25f, 1f));
view.setOrigin(Align.center);
view.setTransform(true);
return true;
@@ -81,7 +81,7 @@ public class ResearchDialog extends BaseDialog{
@Override
public void zoom(InputEvent event, float initialDistance, float distance){
if(view.lastZoom < 0){
view.lastZoom = view.getScaleX();
view.lastZoom = view.scaleX;
}
view.setScale(Mathf.clamp(distance / initialDistance * view.lastZoom, 0.25f, 1f));
@@ -91,13 +91,13 @@ public class ResearchDialog extends BaseDialog{
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
view.lastZoom = view.getScaleX();
view.lastZoom = view.scaleX;
}
@Override
public void pan(InputEvent event, float x, float y, float deltaX, float deltaY){
view.panX += deltaX / view.getScaleX();
view.panY += deltaY / view.getScaleY();
view.panX += deltaX / view.scaleX;
view.panY += deltaY / view.scaleY;
view.moved = true;
view.clamp();
}
@@ -180,7 +180,7 @@ public class ResearchDialog extends BaseDialog{
Table table = new Table();
table.actions(Actions.fadeOut(0.5f, Interp.fade), Actions.remove());
table.top().add(info);
table.setName("toast");
table.name = "toast";
table.update(() -> {
table.toFront();
table.setPosition(Core.graphics.getWidth() / 2f, Core.graphics.getHeight() - 21, Align.top);
@@ -230,7 +230,7 @@ public class ResearchDialog extends BaseDialog{
Table infoTable = new Table();
{
infoTable.touchable(Touchable.enabled);
infoTable.touchable = Touchable.enabled;
for(TechTreeNode node : nodes){
ImageButton button = new ImageButton(node.node.content.icon(Cicon.medium), Styles.nodei);
@@ -273,7 +273,7 @@ public class ResearchDialog extends BaseDialog{
}
});
button.touchable(() -> !node.visible ? Touchable.disabled : Touchable.enabled);
button.setUserObject(node.node);
button.userObject = node.node;
button.setSize(nodeSize);
button.update(() -> {
float offset = (Core.graphics.getHeight() % 2) / 2f;
@@ -335,7 +335,7 @@ public class ResearchDialog extends BaseDialog{
if(button == null) return;
TechNode node = (TechNode)button.getUserObject();
TechNode node = (TechNode)button.userObject;
infoTable.exited(() -> {
if(hoverNode == button && !infoTable.hasMouse() && !hoverNode.hasMouse()){

View File

@@ -277,8 +277,8 @@ public class SchematicsDialog extends BaseDialog{
@Override
public void draw(){
boolean checked = getParent().getParent() instanceof Button
&& ((Button)getParent().getParent()).isOver();
boolean checked = parent.parent instanceof Button
&& ((Button)parent.parent).isOver();
boolean wasSet = set;
if(!set){