Fixed #2066
This commit is contained in:
41
core/src/mindustry/ui/dialogs/ResourcesDialog.java
Normal file
41
core/src/mindustry/ui/dialogs/ResourcesDialog.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package mindustry.ui.dialogs;
|
||||
|
||||
import arc.graphics.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class ResourcesDialog extends FloatingDialog{
|
||||
|
||||
public ResourcesDialog(){
|
||||
super("//TODO resources");
|
||||
shown(this::setup);
|
||||
addCloseButton();
|
||||
}
|
||||
|
||||
void setup(){
|
||||
cont.clear();
|
||||
|
||||
cont.table(Tex.button, t -> {
|
||||
t.left();
|
||||
t.margin(10f);
|
||||
int[] exports = universe.getTotalExports();
|
||||
for(Item item : content.items()){
|
||||
if(exports[item.id] > 0 || data.getItem(item) > 0){
|
||||
t.image(item.icon(Cicon.small)).padRight(4);
|
||||
t.add(ui.formatAmount(data.getItem(item))).color(Color.lightGray);
|
||||
if(exports[item.id] > 0){
|
||||
t.add("+ [accent]" + ui.formatAmount(exports[item.id]) + " [lightgray]/T");
|
||||
}else{
|
||||
t.add();
|
||||
}
|
||||
t.row();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user