This commit is contained in:
Anuken
2020-11-29 13:59:09 -05:00
parent 682c1692df
commit 2a9f362e15
4 changed files with 13 additions and 6 deletions

View File

@@ -102,12 +102,16 @@ public class ModsDialog extends BaseDialog{
t.button("@mod.import.github", Icon.github, bstyle, () -> {
dialog.hide();
var modString = Core.settings.getString("lastmod", "");
var suggested = Structs.random(suggestedMods);
ui.showTextInput("@mod.import.github", "", 64, Core.settings.getString("lastmod", "Anuken/ExampleMod"), text -> {
Core.settings.put("lastmod", text);
ui.showTextInput("@mod.import.github", "", 64, modString.isEmpty() ? suggested : modString, text -> {
if(!modString.isEmpty() || !Structs.eq(suggested, text)){
Core.settings.put("lastmod", text);
}
ui.loadfrag.show();
//Try to download the 6.0 branch first, but if it doesn't exist try master.
//Try to download the 6.0 branch first, but if it doesn't exist, try master.
githubImport("6.0", text, e1 -> {
githubImport("master", text, e2 -> {
githubImport("main", text, e3 -> {