Further UI cleanup
This commit is contained in:
BIN
core/assets-raw/sprites/ui/icons/icon-tree.png
Normal file
BIN
core/assets-raw/sprites/ui/icons/icon-tree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 188 B |
@@ -52,6 +52,7 @@ noname = Pick a[accent] player name[] first.
|
|||||||
filename = File Name:
|
filename = File Name:
|
||||||
unlocked = New content unlocked!
|
unlocked = New content unlocked!
|
||||||
completed = [accent]Completed
|
completed = [accent]Completed
|
||||||
|
techtree = Tech Tree
|
||||||
research = Research
|
research = Research
|
||||||
researched = [LIGHT_GRAY]{0} researched.
|
researched = [LIGHT_GRAY]{0} researched.
|
||||||
players = {0} players online
|
players = {0} players online
|
||||||
|
|||||||
@@ -2764,7 +2764,7 @@ bullet-back
|
|||||||
index: -1
|
index: -1
|
||||||
casing
|
casing
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1135, 907
|
xy: 847, 891
|
||||||
size: 8, 16
|
size: 8, 16
|
||||||
orig: 8, 16
|
orig: 8, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -2834,7 +2834,7 @@ laserfull
|
|||||||
index: -1
|
index: -1
|
||||||
minelaser
|
minelaser
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2041, 1233
|
xy: 847, 841
|
||||||
size: 4, 48
|
size: 4, 48
|
||||||
orig: 4, 48
|
orig: 4, 48
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -2925,7 +2925,7 @@ shot
|
|||||||
index: -1
|
index: -1
|
||||||
transfer
|
transfer
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2041, 1183
|
xy: 847, 791
|
||||||
size: 4, 48
|
size: 4, 48
|
||||||
orig: 4, 48
|
orig: 4, 48
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -8784,21 +8784,21 @@ icon-production
|
|||||||
index: -1
|
index: -1
|
||||||
icon-turret
|
icon-turret
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 786, 837
|
xy: 919, 1005
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-units
|
icon-units
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 993, 919
|
xy: 960, 11
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-upgrade
|
icon-upgrade
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1011, 911
|
xy: 1029, 911
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9155,7 +9155,7 @@ icon-line
|
|||||||
index: -1
|
index: -1
|
||||||
icon-link
|
icon-link
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1047, 913
|
xy: 1065, 913
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9169,7 +9169,7 @@ icon-liquid-small
|
|||||||
index: -1
|
index: -1
|
||||||
icon-load
|
icon-load
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1063, 913
|
xy: 1081, 913
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9204,14 +9204,14 @@ icon-locked
|
|||||||
index: -1
|
index: -1
|
||||||
icon-logic
|
icon-logic
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 907, 913
|
xy: 923, 913
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-map
|
icon-map
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1079, 913
|
xy: 1097, 913
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9246,28 +9246,28 @@ icon-mission-background
|
|||||||
index: -1
|
index: -1
|
||||||
icon-mission-battle
|
icon-mission-battle
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 919, 913
|
xy: 618, 1832
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-mission-defense
|
icon-mission-defense
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 618, 1832
|
xy: 1113, 913
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-mission-done
|
icon-mission-done
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 210, 4
|
xy: 1125, 913
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-none
|
icon-none
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 222, 4
|
xy: 210, 4
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9281,7 +9281,7 @@ icon-paste
|
|||||||
index: -1
|
index: -1
|
||||||
icon-pause
|
icon-pause
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 234, 4
|
xy: 222, 4
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9295,7 +9295,7 @@ icon-pencil
|
|||||||
index: -1
|
index: -1
|
||||||
icon-pencil-small
|
icon-pencil-small
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1095, 913
|
xy: 795, 919
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9309,35 +9309,35 @@ icon-pick
|
|||||||
index: -1
|
index: -1
|
||||||
icon-play
|
icon-play
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 246, 4
|
xy: 234, 4
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-play-2
|
icon-play-2
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 795, 919
|
xy: 795, 903
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-players
|
icon-players
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 636, 1840
|
xy: 246, 4
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-power-small
|
icon-power-small
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1111, 913
|
xy: 636, 1840
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-quit
|
icon-quit
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 795, 903
|
xy: 811, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9351,14 +9351,14 @@ icon-redo
|
|||||||
index: -1
|
index: -1
|
||||||
icon-refresh
|
icon-refresh
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 811, 925
|
xy: 827, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-rename
|
icon-rename
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 827, 925
|
xy: 811, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9372,35 +9372,35 @@ icon-resize
|
|||||||
index: -1
|
index: -1
|
||||||
icon-rotate
|
icon-rotate
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 811, 909
|
xy: 843, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-rotate-arrow
|
icon-rotate-arrow
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 843, 925
|
xy: 827, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-rotate-left
|
icon-rotate-left
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 827, 909
|
xy: 859, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-rotate-right
|
icon-rotate-right
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 859, 925
|
xy: 843, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-save
|
icon-save
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 843, 909
|
xy: 875, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9421,7 +9421,7 @@ icon-save-map
|
|||||||
index: -1
|
index: -1
|
||||||
icon-settings
|
icon-settings
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1123, 913
|
xy: 811, 897
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9435,28 +9435,28 @@ icon-terrain
|
|||||||
index: -1
|
index: -1
|
||||||
icon-tools
|
icon-tools
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 875, 925
|
xy: 859, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-touch
|
icon-touch
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 811, 897
|
xy: 823, 897
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-touchDelete
|
icon-touchDelete
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 823, 897
|
xy: 835, 897
|
||||||
size: 10, 10
|
size: 10, 10
|
||||||
orig: 10, 10
|
orig: 10, 10
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-trash
|
icon-trash
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 859, 909
|
xy: 891, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@@ -9468,6 +9468,13 @@ icon-trash-16
|
|||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
icon-tree
|
||||||
|
rotate: false
|
||||||
|
xy: 786, 837
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
icon-tree-locked
|
icon-tree-locked
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 305, 77
|
xy: 305, 77
|
||||||
@@ -9477,56 +9484,56 @@ icon-tree-locked
|
|||||||
index: -1
|
index: -1
|
||||||
icon-trello
|
icon-trello
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 891, 925
|
xy: 875, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-tutorial
|
icon-tutorial
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 875, 909
|
xy: 907, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-undo
|
icon-undo
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 919, 1005
|
xy: 993, 919
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-unlocked
|
icon-unlocked
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 960, 11
|
xy: 1011, 911
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-unlocks
|
icon-unlocks
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 907, 925
|
xy: 891, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-wiki
|
icon-wiki
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 891, 909
|
xy: 923, 925
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-zoom
|
icon-zoom
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1029, 911
|
xy: 1047, 911
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
orig: 16, 16
|
orig: 16, 16
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
icon-zoom-small
|
icon-zoom-small
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 923, 925
|
xy: 907, 909
|
||||||
size: 14, 14
|
size: 14, 14
|
||||||
orig: 14, 14
|
orig: 14, 14
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 967 KiB After Width: | Height: | Size: 968 KiB |
@@ -7,6 +7,7 @@ import io.anuke.arc.scene.ui.layout.Table;
|
|||||||
import io.anuke.mindustry.game.Rules;
|
import io.anuke.mindustry.game.Rules;
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.mindustry.game.UnlockableContent;
|
||||||
import io.anuke.mindustry.maps.generators.Generator;
|
import io.anuke.mindustry.maps.generators.Generator;
|
||||||
|
import io.anuke.mindustry.world.Block;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.state;
|
import static io.anuke.mindustry.Vars.state;
|
||||||
|
|
||||||
@@ -15,6 +16,8 @@ public class Zone extends UnlockableContent{
|
|||||||
public final Generator generator;
|
public final Generator generator;
|
||||||
public ItemStack[] deployCost = {};
|
public ItemStack[] deployCost = {};
|
||||||
public ItemStack[] startingItems = {};
|
public ItemStack[] startingItems = {};
|
||||||
|
public Block[] blockRequirements = {};
|
||||||
|
public ItemStack[] itemRequirements = {};
|
||||||
public Supplier<Rules> rules = Rules::new;
|
public Supplier<Rules> rules = Rules::new;
|
||||||
public boolean alwaysUnlocked;
|
public boolean alwaysUnlocked;
|
||||||
public int conditionWave = Integer.MAX_VALUE;
|
public int conditionWave = Integer.MAX_VALUE;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Table table = new Table("underline-2");
|
Table table = new Table("underline");
|
||||||
table.margin(0);
|
table.margin(0);
|
||||||
table.table(img -> {
|
table.table(img -> {
|
||||||
img.addImage("white").height(h - 5).width(40f).color(link.color);
|
img.addImage("white").height(h - 5).width(40f).color(link.color);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
cont.clear();
|
cont.clear();
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
buttons.addButton("$techtree", () -> ui.tech.show()).size(200f, 60f);
|
buttons.addImageTextButton("$techtree", "icon-tree", 16 * 2, () -> ui.tech.show()).size(230f, 64f);
|
||||||
|
|
||||||
cont.stack(new Table(){{
|
cont.stack(new Table(){{
|
||||||
top().left().margin(10);
|
top().left().margin(10);
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import io.anuke.arc.collection.Array;
|
|||||||
import io.anuke.arc.collection.ObjectSet;
|
import io.anuke.arc.collection.ObjectSet;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
import io.anuke.arc.graphics.g2d.Lines;
|
||||||
import io.anuke.arc.graphics.g2d.ScissorStack;
|
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
import io.anuke.arc.math.Interpolation;
|
import io.anuke.arc.math.Interpolation;
|
||||||
import io.anuke.arc.math.geom.Rectangle;
|
import io.anuke.arc.math.geom.Rectangle;
|
||||||
|
import io.anuke.arc.scene.Element;
|
||||||
import io.anuke.arc.scene.Group;
|
import io.anuke.arc.scene.Group;
|
||||||
import io.anuke.arc.scene.actions.Actions;
|
import io.anuke.arc.scene.actions.Actions;
|
||||||
import io.anuke.arc.scene.event.InputEvent;
|
import io.anuke.arc.scene.event.InputEvent;
|
||||||
@@ -36,10 +36,11 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
||||||
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
||||||
private static final float nodeSize = 60f;
|
private static final float nodeSize = 60f;
|
||||||
private int toasts;
|
|
||||||
|
|
||||||
public TechTreeDialog(){
|
public TechTreeDialog(){
|
||||||
super("$techtree");
|
super("");
|
||||||
|
|
||||||
|
cont.setFillParent(true);
|
||||||
|
|
||||||
TreeLayout layout = new TreeLayout();
|
TreeLayout layout = new TreeLayout();
|
||||||
layout.gapBetweenLevels = 60f;
|
layout.gapBetweenLevels = 60f;
|
||||||
@@ -67,6 +68,11 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
addCloseButton();
|
addCloseButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawBackground(float x, float y){
|
||||||
|
drawDefaultBackground(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
void checkNodes(TechTreeNode node){
|
void checkNodes(TechTreeNode node){
|
||||||
boolean locked = locked(node);
|
boolean locked = locked(node);
|
||||||
if(!locked) node.visible = true;
|
if(!locked) node.visible = true;
|
||||||
@@ -78,14 +84,24 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showToast(String info){
|
void showToast(String info){
|
||||||
toasts ++;
|
int maxIndex = 0;
|
||||||
int t = toasts;
|
|
||||||
|
for(Element e : Core.scene.root.getChildren()){
|
||||||
|
if("toast".equals(e.getName())){
|
||||||
|
maxIndex = Math.max(maxIndex, (Integer)e.getUserObject() + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int m = maxIndex;
|
||||||
|
|
||||||
Table table = new Table();
|
Table table = new Table();
|
||||||
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.run(() -> toasts --), Actions.removeActor());
|
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.removeActor());
|
||||||
table.top().add(info);
|
table.top().add(info);
|
||||||
|
table.setName("toast");
|
||||||
|
table.setUserObject(maxIndex);
|
||||||
table.update(() -> {
|
table.update(() -> {
|
||||||
table.toFront();
|
table.toFront();
|
||||||
table.setPosition(Core.graphics.getWidth()/2f, Core.graphics.getHeight() - 21 - t*20f, Align.top);
|
table.setPosition(Core.graphics.getWidth()/2f, Core.graphics.getHeight() - 21 - m*20f, Align.top);
|
||||||
});
|
});
|
||||||
Core.scene.add(table);
|
Core.scene.add(table);
|
||||||
}
|
}
|
||||||
@@ -117,7 +133,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
class View extends Group{
|
class View extends Group{
|
||||||
float panX = 0, panY = 0;
|
float panX = 0, panY = -200;
|
||||||
boolean moved = false;
|
boolean moved = false;
|
||||||
Rectangle clip = new Rectangle();
|
Rectangle clip = new Rectangle();
|
||||||
ImageButton hoverNode;
|
ImageButton hoverNode;
|
||||||
@@ -253,10 +269,6 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
if(!ScissorStack.pushScissors(clip.set(x, y, width, height))){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float offsetX = panX + width/2f + x, offsetY = panY + height/2f + y;
|
float offsetX = panX + width/2f + x, offsetY = panY + height/2f + y;
|
||||||
|
|
||||||
for(TreeNode node : nodes){
|
for(TreeNode node : nodes){
|
||||||
@@ -268,8 +280,6 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
super.draw();
|
super.draw();
|
||||||
|
|
||||||
ScissorStack.popScissors();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user