Refactoring / Launch pad tweaks

This commit is contained in:
Anuken
2020-05-14 22:00:04 -04:00
parent 3fd677b3e6
commit a4987f864f
31 changed files with 761 additions and 679 deletions

View File

@@ -169,7 +169,7 @@ public class TechTreeDialog extends FloatingDialog{
void showToast(String info){
Table table = new Table();
table.actions(Actions.fadeOut(0.5f, Interpolation.fade), Actions.remove());
table.actions(Actions.fadeOut(0.5f, Interp.fade), Actions.remove());
table.top().add(info);
table.setName("toast");
table.update(() -> {
@@ -238,7 +238,7 @@ public class TechTreeDialog extends FloatingDialog{
addAction(new RelativeTemporalAction(){
{
setDuration(0.1f);
setInterpolation(Interpolation.fade);
setInterpolation(Interp.fade);
}
@Override

View File

@@ -7,7 +7,6 @@ import arc.scene.actions.*;
import arc.scene.ui.layout.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.core.GameState.*;
import mindustry.gen.*;
import static mindustry.Vars.*;
@@ -52,7 +51,7 @@ public class BlockConfigFragment extends Fragment{
table.pack();
table.setTransform(true);
table.actions(Actions.scaleTo(0f, 1f), Actions.visible(true),
Actions.scaleTo(1f, 1f, 0.07f, Interpolation.pow3Out));
Actions.scaleTo(1f, 1f, 0.07f, Interp.pow3Out));
table.update(() -> {
if(configTile != null && configTile.shouldHideConfigure(player)){
@@ -76,6 +75,6 @@ public class BlockConfigFragment extends Fragment{
public void hideConfig(){
configTile = null;
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interpolation.pow3Out), Actions.visible(false));
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interp.pow3Out), Actions.visible(false));
}
}

View File

@@ -85,7 +85,7 @@ public class BlockInventoryFragment extends Fragment{
public void hide(){
if(table == null) return;
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interpolation.pow3Out), Actions.run(() -> {
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interp.pow3Out), Actions.run(() -> {
table.clearChildren();
table.clearListeners();
table.update(null);
@@ -213,7 +213,7 @@ public class BlockInventoryFragment extends Fragment{
if(actions){
table.setScale(0f, 1f);
table.actions(Actions.scaleTo(1f, 1f, 0.07f, Interpolation.pow3Out));
table.actions(Actions.scaleTo(1f, 1f, 0.07f, Interp.pow3Out));
}else{
table.setScale(1f, 1f);
}

View File

@@ -348,9 +348,9 @@ public class HudFragment extends Fragment{
Table container = Core.scene.table();
container.top().add(table);
container.setTranslation(0, table.getPrefHeight());
container.actions(Actions.translateBy(0, -table.getPrefHeight(), 1f, Interpolation.fade), Actions.delay(2.5f),
container.actions(Actions.translateBy(0, -table.getPrefHeight(), 1f, Interp.fade), Actions.delay(2.5f),
//nesting actions() calls is necessary so the right prefHeight() is used
Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interpolation.fade), Actions.remove())));
Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interp.fade), Actions.remove())));
});
}
@@ -396,9 +396,9 @@ public class HudFragment extends Fragment{
Table container = Core.scene.table();
container.top().add(table);
container.setTranslation(0, table.getPrefHeight());
container.actions(Actions.translateBy(0, -table.getPrefHeight(), 1f, Interpolation.fade), Actions.delay(2.5f),
container.actions(Actions.translateBy(0, -table.getPrefHeight(), 1f, Interp.fade), Actions.delay(2.5f),
//nesting actions() calls is necessary so the right prefHeight() is used
Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interpolation.fade), Actions.run(() -> {
Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interp.fade), Actions.run(() -> {
lastUnlockTable = null;
lastUnlockLayout = null;
}), Actions.remove())));

View File

@@ -202,7 +202,7 @@ public class MenuFragment extends Fragment{
private void fadeInMenu(){
submenu.clearActions();
submenu.actions(Actions.alpha(1f, 0.15f, Interpolation.fade));
submenu.actions(Actions.alpha(1f, 0.15f, Interp.fade));
}
private void fadeOutMenu(){
@@ -212,7 +212,7 @@ public class MenuFragment extends Fragment{
}
submenu.clearActions();
submenu.actions(Actions.alpha(1f), Actions.alpha(0f, 0.2f, Interpolation.fade), Actions.run(() -> submenu.clearChildren()));
submenu.actions(Actions.alpha(1f), Actions.alpha(0f, 0.2f, Interp.fade), Actions.run(() -> submenu.clearChildren()));
}
private void buttons(Table t, Buttoni... buttons){