Seq.
This commit is contained in:
@@ -38,7 +38,7 @@ public class ContentDisplay{
|
||||
BlockStats stats = block.stats;
|
||||
|
||||
for(StatCategory cat : stats.toMap().keys()){
|
||||
OrderedMap<BlockStat, Array<StatValue>> map = stats.toMap().get(cat);
|
||||
OrderedMap<BlockStat, Seq<StatValue>> map = stats.toMap().get(cat);
|
||||
|
||||
if(map.size == 0) continue;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ContentDisplay{
|
||||
table.table(inset -> {
|
||||
inset.left();
|
||||
inset.add("[lightgray]" + stat.localized() + ":[] ").left();
|
||||
Array<StatValue> arr = map.get(stat);
|
||||
Seq<StatValue> arr = map.get(stat);
|
||||
for(StatValue value : arr){
|
||||
value.display(inset);
|
||||
inset.add().size(10f);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class Fonts{
|
||||
}
|
||||
|
||||
public static void loadContentIcons(){
|
||||
Array<BitmapFont> fonts = Array.with(Fonts.chat, Fonts.def, Fonts.outline);
|
||||
Seq<BitmapFont> fonts = Seq.with(Fonts.chat, Fonts.def, Fonts.outline);
|
||||
Texture uitex = Core.atlas.find("logo").getTexture();
|
||||
int size = (int)(Fonts.def.getData().lineHeight/Fonts.def.getData().scaleY);
|
||||
|
||||
@@ -156,7 +156,7 @@ public class Fonts{
|
||||
|
||||
Page page = UI.packer.getPages().first();
|
||||
|
||||
Array<AtlasRegion> regions = atlas.getRegions().select(t -> t.getTexture() == texture);
|
||||
Seq<AtlasRegion> regions = atlas.getRegions().select(t -> t.getTexture() == texture);
|
||||
for(AtlasRegion region : regions){
|
||||
//get new pack rect
|
||||
page.setDirty(false);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package mindustry.ui;
|
||||
|
||||
import arc.struct.Array;
|
||||
import arc.struct.Seq;
|
||||
import arc.scene.ui.layout.Stack;
|
||||
import arc.util.Time;
|
||||
|
||||
public class MultiReqImage extends Stack{
|
||||
private Array<ReqImage> displays = new Array<>();
|
||||
private Seq<ReqImage> displays = new Seq<>();
|
||||
private float time;
|
||||
|
||||
public void add(ReqImage display){
|
||||
|
||||
@@ -15,14 +15,14 @@ import mindustry.ui.Links.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class AboutDialog extends BaseDialog{
|
||||
private Array<String> contributors = new Array<>();
|
||||
private Seq<String> contributors = new Seq<>();
|
||||
private static ObjectSet<String> bannedItems = ObjectSet.with("google-play", "itch.io", "dev-builds", "f-droid");
|
||||
|
||||
public AboutDialog(){
|
||||
super("$about.button");
|
||||
|
||||
shown(() -> {
|
||||
contributors = Array.with(Core.files.internal("contributors").readString("UTF-8").split("\n"));
|
||||
contributors = Seq.with(Core.files.internal("contributors").readString("UTF-8").split("\n"));
|
||||
Core.app.post(this::setup);
|
||||
});
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
t.add("$empty");
|
||||
}
|
||||
|
||||
Array<Block> array = Array.with(rules.bannedBlocks);
|
||||
Seq<Block> array = Seq.with(rules.bannedBlocks);
|
||||
array.sort();
|
||||
|
||||
int cols = mobile && Core.graphics.isPortrait() ? 1 : mobile ? 2 : 3;
|
||||
|
||||
@@ -34,12 +34,12 @@ public class DatabaseDialog extends BaseDialog{
|
||||
table.margin(20);
|
||||
ScrollPane pane = new ScrollPane(table);
|
||||
|
||||
Array<Content>[] allContent = Vars.content.getContentMap();
|
||||
Seq<Content>[] allContent = Vars.content.getContentMap();
|
||||
|
||||
for(int j = 0; j < allContent.length; j++){
|
||||
ContentType type = ContentType.values()[j];
|
||||
|
||||
Array<Content> array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden());
|
||||
Seq<Content> array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden());
|
||||
if(array.size == 0) continue;
|
||||
|
||||
table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent);
|
||||
|
||||
@@ -254,7 +254,7 @@ public class FileChooser extends BaseDialog{
|
||||
}
|
||||
|
||||
public class FileHistory{
|
||||
private Array<Fi> history = new Array<>();
|
||||
private Seq<Fi> history = new Seq<>();
|
||||
private int index;
|
||||
|
||||
public FileHistory(){
|
||||
|
||||
@@ -20,7 +20,7 @@ import mindustry.ui.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class JoinDialog extends BaseDialog{
|
||||
Array<Server> servers = new Array<>();
|
||||
Seq<Server> servers = new Seq<>();
|
||||
Dialog add;
|
||||
Server renaming;
|
||||
Table local = new Table();
|
||||
@@ -417,7 +417,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void loadServers(){
|
||||
servers = Core.settings.getJson("servers", Array.class, Array::new);
|
||||
servers = Core.settings.getJson("servers", Seq.class, Seq::new);
|
||||
|
||||
//load imported legacy data
|
||||
if(Core.settings.has("server-list")){
|
||||
|
||||
@@ -50,7 +50,7 @@ public class LoadDialog extends BaseDialog{
|
||||
|
||||
Time.runTask(2f, () -> Core.scene.setScrollFocus(pane));
|
||||
|
||||
Array<SaveSlot> array = control.saves.getSaveSlots();
|
||||
Seq<SaveSlot> array = control.saves.getSaveSlots();
|
||||
array.sort((slot, other) -> -Long.compare(slot.getTimestamp(), other.getTimestamp()));
|
||||
|
||||
int maxwidth = Math.max((int)(Core.graphics.getWidth() / Scl.scl(470)), 1);
|
||||
|
||||
@@ -15,8 +15,8 @@ public class LoadoutDialog extends BaseDialog{
|
||||
private Runnable hider;
|
||||
private Runnable resetter;
|
||||
private Runnable updater;
|
||||
private Array<ItemStack> stacks = new Array<>();
|
||||
private Array<ItemStack> originalStacks = new Array<>();
|
||||
private Seq<ItemStack> stacks = new Seq<>();
|
||||
private Seq<ItemStack> originalStacks = new Seq<>();
|
||||
private Table items;
|
||||
private int capacity;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class LoadoutDialog extends BaseDialog{
|
||||
}).size(210f, 64f);
|
||||
}
|
||||
|
||||
public void show(int capacity, Array<ItemStack> stacks, Runnable reseter, Runnable updater, Runnable hider){
|
||||
public void show(int capacity, Seq<ItemStack> stacks, Runnable reseter, Runnable updater, Runnable hider){
|
||||
this.originalStacks = stacks;
|
||||
reseed();
|
||||
this.resetter = reseter;
|
||||
|
||||
@@ -332,7 +332,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
cont.add(new SchematicImage(schem)).maxSize(800f);
|
||||
cont.row();
|
||||
|
||||
Array<ItemStack> arr = schem.requirements();
|
||||
Seq<ItemStack> arr = schem.requirements();
|
||||
cont.table(r -> {
|
||||
int i = 0;
|
||||
for(ItemStack s : arr){
|
||||
|
||||
@@ -191,7 +191,7 @@ public class TechTreeDialog extends BaseDialog{
|
||||
this.parent = parent;
|
||||
this.width = this.height = nodeSize;
|
||||
if(node.children != null){
|
||||
children = Array.with(node.children).map(t -> new LayoutNode(t, this)).toArray(LayoutNode.class);
|
||||
children = Seq.with(node.children).map(t -> new LayoutNode(t, this)).toArray(LayoutNode.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import static mindustry.Vars.*;
|
||||
|
||||
public class ChatFragment extends Table{
|
||||
private final static int messagesShown = 10;
|
||||
private Array<ChatMessage> messages = new Array<>();
|
||||
private Seq<ChatMessage> messages = new Seq<>();
|
||||
private float fadetime;
|
||||
private boolean shown = false;
|
||||
private TextField chatfield;
|
||||
@@ -32,7 +32,7 @@ public class ChatFragment extends Table{
|
||||
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
|
||||
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||
private float textspacing = Scl.scl(10);
|
||||
private Array<String> history = new Array<>();
|
||||
private Seq<String> history = new Seq<>();
|
||||
private int historyPos = 0;
|
||||
private int scrollPos = 0;
|
||||
private Fragment container = new Fragment(){
|
||||
|
||||
@@ -119,7 +119,7 @@ public class HudFragment extends Fragment{
|
||||
select.image().color(Pal.gray).width(4f).fillY();
|
||||
|
||||
float size = Scl.scl(dsize);
|
||||
Array<Element> children = new Array<>(select.getChildren());
|
||||
Seq<Element> children = new Seq<>(select.getChildren());
|
||||
|
||||
//now, you may be wondering, why is this necessary? the answer is, I don't know, but it fixes layout issues somehow
|
||||
int index = 0;
|
||||
@@ -474,7 +474,7 @@ public class HudFragment extends Fragment{
|
||||
int cap = col * col - 1;
|
||||
|
||||
//get old elements
|
||||
Array<Element> elements = new Array<>(lastUnlockLayout.getChildren());
|
||||
Seq<Element> elements = new Seq<>(lastUnlockLayout.getChildren());
|
||||
int esize = elements.size;
|
||||
|
||||
//...if it's already reached the cap, ignore everything
|
||||
|
||||
@@ -27,8 +27,8 @@ public class PlacementFragment extends Fragment{
|
||||
final int rowWidth = 4;
|
||||
|
||||
public Category currentCategory = Category.distribution;
|
||||
Array<Block> returnArray = new Array<>();
|
||||
Array<Category> returnCatArray = new Array<>();
|
||||
Seq<Block> returnArray = new Seq<>();
|
||||
Seq<Category> returnCatArray = new Seq<>();
|
||||
boolean[] categoryEmpty = new boolean[Category.all.length];
|
||||
ObjectMap<Category,Block> selectedBlocks = new ObjectMap<>();
|
||||
ObjectFloatMap<Category> scrollPositions = new ObjectFloatMap<>();
|
||||
@@ -115,7 +115,7 @@ public class PlacementFragment extends Fragment{
|
||||
for(int i = 0; i < blockSelect.length; i++){
|
||||
if(Core.input.keyTap(blockSelect[i])){
|
||||
if(i > 9) { //select block directionally
|
||||
Array<Block> blocks = getByCategory(currentCategory);
|
||||
Seq<Block> blocks = getByCategory(currentCategory);
|
||||
Block currentBlock = getSelectedBlock(currentCategory);
|
||||
for(int j = 0; j < blocks.size; j++){
|
||||
if(blocks.get(j) == currentBlock){
|
||||
@@ -157,7 +157,7 @@ public class PlacementFragment extends Fragment{
|
||||
i += (blockSelectSeq - (i != 9 ? 0 : 1)) * 10;
|
||||
blockSelectEnd = true;
|
||||
}
|
||||
Array<Block> blocks = getByCategory(currentCategory);
|
||||
Seq<Block> blocks = getByCategory(currentCategory);
|
||||
input.block = (i < blocks.size) ? blocks.get(i) : null;
|
||||
selectedBlocks.put(currentCategory, input.block);
|
||||
blockSelectSeqMillis = Time.millis();
|
||||
@@ -276,7 +276,7 @@ public class PlacementFragment extends Fragment{
|
||||
topTable.table(header -> {
|
||||
String keyCombo = "";
|
||||
if(!mobile && Core.settings.getBool("blockselectkeys")){
|
||||
Array<Block> blocks = getByCategory(currentCategory);
|
||||
Seq<Block> blocks = getByCategory(currentCategory);
|
||||
for(int i = 0; i < blocks.size; i++){
|
||||
if(blocks.get(i) == lastDisplay && (i + 1) / 10 - 1 < blockSelect.length){
|
||||
keyCombo = Core.bundle.format("placement.blockselectkeys", Core.keybinds.get(blockSelect[currentCategory.ordinal()]).key.toString())
|
||||
@@ -384,7 +384,7 @@ public class PlacementFragment extends Fragment{
|
||||
|
||||
//update category empty values
|
||||
for(Category cat : Category.all){
|
||||
Array<Block> blocks = getByCategory(cat);
|
||||
Seq<Block> blocks = getByCategory(cat);
|
||||
categoryEmpty[cat.ordinal()] = blocks.isEmpty();
|
||||
}
|
||||
|
||||
@@ -415,14 +415,14 @@ public class PlacementFragment extends Fragment{
|
||||
});
|
||||
}
|
||||
|
||||
Array<Category> getCategories(){
|
||||
Seq<Category> getCategories(){
|
||||
returnCatArray.clear();
|
||||
returnCatArray.addAll(Category.all);
|
||||
returnCatArray.sort((c1, c2) -> Boolean.compare(categoryEmpty[c1.ordinal()], categoryEmpty[c2.ordinal()]));
|
||||
return returnCatArray;
|
||||
}
|
||||
|
||||
Array<Block> getByCategory(Category cat){
|
||||
Seq<Block> getByCategory(Category cat){
|
||||
returnArray.clear();
|
||||
for(Block block : content.blocks()){
|
||||
if(block.category == cat && block.isVisible() && unlocked(block)){
|
||||
|
||||
@@ -20,7 +20,7 @@ import static mindustry.Vars.*;
|
||||
|
||||
public class ScriptConsoleFragment extends Table{
|
||||
private final static int messagesShown = 30;
|
||||
private Array<String> messages = new Array<>();
|
||||
private Seq<String> messages = new Seq<>();
|
||||
private boolean open = false, shown;
|
||||
private TextField chatfield;
|
||||
private Label fieldlabel = new Label(">");
|
||||
@@ -29,7 +29,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
|
||||
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||
private float textspacing = Scl.scl(10);
|
||||
private Array<String> history = new Array<>();
|
||||
private Seq<String> history = new Seq<>();
|
||||
private int historyPos = 0;
|
||||
private int scrollPos = 0;
|
||||
private Fragment container = new Fragment(){
|
||||
|
||||
@@ -12,7 +12,7 @@ public class BranchTreeLayout implements TreeLayout{
|
||||
public float gapBetweenLevels = 10;
|
||||
public float gapBetweenNodes = 10f;
|
||||
|
||||
private final FloatArray sizeOfLevel = new FloatArray();
|
||||
private final FloatSeq sizeOfLevel = new FloatSeq();
|
||||
private float boundsLeft = Float.MAX_VALUE;
|
||||
private float boundsRight = Float.MIN_VALUE;
|
||||
private float boundsTop = Float.MAX_VALUE;
|
||||
|
||||
@@ -6,7 +6,7 @@ public class RowTreeLayout implements TreeLayout{
|
||||
|
||||
@Override
|
||||
public void layout(TreeNode root){
|
||||
layout(root, 0, new IntArray());
|
||||
layout(root, 0, new IntSeq());
|
||||
|
||||
/*
|
||||
def minimum_ws(tree, depth=0):
|
||||
@@ -18,7 +18,7 @@ public class RowTreeLayout implements TreeLayout{
|
||||
*/
|
||||
}
|
||||
|
||||
void layout(TreeNode node, int depth, IntArray nexts){
|
||||
void layout(TreeNode node, int depth, IntSeq nexts){
|
||||
float size = node.height * 5f;
|
||||
|
||||
if(nexts.size < depth + 1){
|
||||
|
||||
Reference in New Issue
Block a user