Search in sources :

Example 1 with VersionInfo

use of io.anuke.mindustry.io.Changelogs.VersionInfo in project Mindustry by Anuken.

the class ChangelogDialog method setup.

void setup() {
    Table table = new Table();
    ScrollPane pane = new ScrollPane(table, "clear");
    content().clear();
    content().add(pane).grow();
    if (versions == null) {
        table.add("$text.changelog.error");
        if (Vars.android) {
            table.row();
            table.add("$text.changelog.error.android").padTop(8);
        }
    } else {
        for (VersionInfo info : versions) {
            Table in = new Table("clear");
            in.top().left().margin(10);
            in.add("[accent]" + info.name);
            if (info.build == Version.build) {
                in.row();
                in.add("$text.changelog.current");
            } else if (info == versions.first()) {
                in.row();
                in.add("$text.changelog.latest");
            }
            in.row();
            in.labelWrap("[lightgray]" + info.description).width(vw - 20).padTop(12);
            table.add(in).width(vw).pad(8).row();
        }
        int lastid = Settings.getInt("lastBuild");
        if (lastid != 0 && versions.peek().build > lastid) {
            Settings.putInt("lastBuild", versions.peek().build);
            Settings.save();
            show();
        }
    }
}
Also used : VersionInfo(io.anuke.mindustry.io.Changelogs.VersionInfo) Table(io.anuke.ucore.scene.ui.layout.Table) ScrollPane(io.anuke.ucore.scene.ui.ScrollPane)

Aggregations

VersionInfo (io.anuke.mindustry.io.Changelogs.VersionInfo)1 ScrollPane (io.anuke.ucore.scene.ui.ScrollPane)1 Table (io.anuke.ucore.scene.ui.layout.Table)1