it is done

This commit is contained in:
Anuken
2019-12-25 01:39:38 -05:00
parent 5b21873f3c
commit 514d4817c8
488 changed files with 4572 additions and 4574 deletions

View File

@@ -0,0 +1,51 @@
package mindustry.ui.dialogs;
import arc.func.*;
import arc.graphics.*;
import arc.input.*;
import arc.scene.ui.*;
import arc.scene.ui.layout.*;
import mindustry.gen.*;
import mindustry.ui.*;
import static mindustry.Vars.*;
public class PaletteDialog extends Dialog{
private Cons<Color> cons;
public PaletteDialog(){
super("");
build();
}
private void build(){
Table table = new Table();
cont.add(table);
for(int i = 0; i < playerColors.length; i++){
Color color = playerColors[i];
ImageButton button = table.addImageButton(Tex.whiteui, Styles.clearTogglei, 34, () -> {
cons.get(color);
hide();
}).size(48).get();
button.setChecked(player.color.equals(color));
button.getStyle().imageUpColor = color;
if(i % 4 == 3){
table.row();
}
}
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)
hide();
});
}
public void show(Cons<Color> cons){
this.cons = cons;
show();
}
}