Implemented hiscore and hiscore display
This commit is contained in:
@@ -6,21 +6,24 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
|
||||
import io.anuke.mindustry.GameState;
|
||||
import io.anuke.mindustry.World;
|
||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||
import io.anuke.ucore.scene.ui.Dialog;
|
||||
import io.anuke.ucore.scene.ui.ImageButton;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.scene.ui.*;
|
||||
|
||||
public class LevelDialog extends Dialog{
|
||||
Label[] scores = new Label[maps.length];
|
||||
private int selectedMap;
|
||||
|
||||
public LevelDialog(){
|
||||
super("Level Select");
|
||||
setup();
|
||||
|
||||
shown(()->{
|
||||
for(int i = 0; i < maps.length; i ++)
|
||||
scores[i].setText("High Score: [lime]" + Settings.getInt("hiscore"+maps[i]));
|
||||
});
|
||||
}
|
||||
|
||||
void setup(){
|
||||
ButtonGroup<ImageButton> mapgroup = new ButtonGroup<>();
|
||||
|
||||
addCloseButton();
|
||||
getButtonTable().addButton("Play", ()->{
|
||||
hide();
|
||||
@@ -28,6 +31,8 @@ public class LevelDialog extends Dialog{
|
||||
GameState.play();
|
||||
});
|
||||
|
||||
ButtonGroup<ImageButton> mapgroup = new ButtonGroup<>();
|
||||
|
||||
for(int i = 0; i < maps.length; i ++){
|
||||
content().add(maps[i]);
|
||||
}
|
||||
@@ -44,5 +49,12 @@ public class LevelDialog extends Dialog{
|
||||
image.getImageCell().size(150, 150);
|
||||
content().add(image).size(180);
|
||||
}
|
||||
|
||||
content().row();
|
||||
|
||||
for(int i = 0; i < maps.length; i ++){
|
||||
scores[i] = new Label("");
|
||||
content().add(scores[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user