Added list of contributors to credits
This commit is contained in:
@@ -2,7 +2,11 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ObjectSet;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.io.Contributors;
|
||||
import io.anuke.mindustry.io.Contributors.Contributor;
|
||||
import io.anuke.mindustry.ui.Links;
|
||||
import io.anuke.mindustry.ui.Links.LinkEntry;
|
||||
import io.anuke.ucore.core.Core;
|
||||
@@ -18,11 +22,14 @@ import static io.anuke.mindustry.Vars.ios;
|
||||
import static io.anuke.mindustry.Vars.ui;
|
||||
|
||||
public class AboutDialog extends FloatingDialog{
|
||||
private Array<Contributor> contributors = new Array<>();
|
||||
private static ObjectSet<String> bannedItems = ObjectSet.with("google-play", "itch.io", "dev-builds", "trello");
|
||||
|
||||
public AboutDialog(){
|
||||
super("$text.about.button");
|
||||
|
||||
Contributors.getContributors(out -> contributors = out, Throwable::printStackTrace);
|
||||
|
||||
shown(this::setup);
|
||||
onResize(this::setup);
|
||||
}
|
||||
@@ -94,7 +101,24 @@ public class AboutDialog extends FloatingDialog{
|
||||
public void showCredits(){
|
||||
FloatingDialog dialog = new FloatingDialog("$text.credits");
|
||||
dialog.addCloseButton();
|
||||
dialog.content().labelWrap("$text.credits.text").width(400f);
|
||||
dialog.content().add("$text.credits.text");
|
||||
dialog.content().row();
|
||||
if(!contributors.isEmpty()){
|
||||
dialog.content().addImage("blank").color(Palette.accent).fillX().height(3f).pad(3f);
|
||||
dialog.content().row();
|
||||
dialog.content().add("$text.contributors");
|
||||
dialog.content().row();
|
||||
dialog.content().pane("clear", new Table(){{
|
||||
int i = 0;
|
||||
left();
|
||||
for(Contributor c : contributors){
|
||||
add("[lightgray]" + c.login).left().pad(3).padLeft(6).padRight(6);
|
||||
if(++i % 3 == 0){
|
||||
row();
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user