hopefully everything got fixed
This commit is contained in:
@@ -173,19 +173,19 @@ public class ModsDialog extends BaseDialog{
|
|||||||
} else {
|
} else {
|
||||||
Json json = new Json();
|
Json json = new Json();
|
||||||
Seq<ModListing> listings = json.fromJson(Seq.class, ModListing.class, response.getResultAsString());
|
Seq<ModListing> listings = json.fromJson(Seq.class, ModListing.class, response.getResultAsString());
|
||||||
for (ModListing modsbrolist : listings) {
|
for (ModListing mod : listings) {
|
||||||
if((!searchtxt.isEmpty() && !modsbrolist.repo.contains(searchtxt))||searchtxt==null) continue;
|
if((!searchtxt.isEmpty() && !mod.repo.contains(searchtxt))||searchtxt==null) continue;
|
||||||
tablebrow.button(btn -> {
|
tablebrow.button(btn -> {
|
||||||
btn.top().left();
|
btn.top().left();
|
||||||
btn.margin(12f);
|
btn.margin(12f);
|
||||||
btn.table(con -> {
|
btn.table(con -> {
|
||||||
con.left();
|
con.left();
|
||||||
con.add("[lightgray]Name:[] " + modsbrolist.name + "\n[lightgray]Author:[] " + modsbrolist.author + "\n[accent]\uE809: " + modsbrolist.stars).width(388f).wrap().growX().pad(0f,6f,0f,6f);
|
con.add("[lightgray]Name:[] " + mod.name + "\n[lightgray]Author:[] " + mod.author + "\n[accent]\uE809 " + mod.stars).width(388f).wrap().growX().pad(0f,6f,0f,6f);
|
||||||
con.add().growX().pad(0f,6f,0f,6f);
|
con.add().growX().pad(0f,6f,0f,6f);
|
||||||
}).fillY().growX().pad(0f,6f,0f,6f);
|
}).fillY().growX().pad(0f,6f,0f,6f);
|
||||||
}, Styles.clearPartialt, () -> {
|
}, Styles.clearPartialt, () -> {
|
||||||
BaseDialog modSelected = new BaseDialog((Core.bundle.get("mods.browser.selected"))+ ": "+ modsbrolist.name);
|
BaseDialog modSelected = new BaseDialog((Core.bundle.get("mods.browser.selected"))+ ": "+ mod.name);
|
||||||
modSelected.cont.add(modsbrolist.description).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
modSelected.cont.add(mod.description).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
||||||
modSelected.buttons.defaults().size(200f, 54f).pad(2f);
|
modSelected.buttons.defaults().size(200f, 54f).pad(2f);
|
||||||
modSelected.setFillParent(false);
|
modSelected.setFillParent(false);
|
||||||
modSelected.buttons.button("$back", Icon.left, () -> {
|
modSelected.buttons.button("$back", Icon.left, () -> {
|
||||||
@@ -196,14 +196,14 @@ public class ModsDialog extends BaseDialog{
|
|||||||
modSelected.hide();
|
modSelected.hide();
|
||||||
installMod[0] = () -> {
|
installMod[0] = () -> {
|
||||||
ui.loadfrag.show();
|
ui.loadfrag.show();
|
||||||
Core.net.httpGet("http://api.github.com/repos/" + modsbrolist.repo + "/zipball/master", loc -> {
|
Core.net.httpGet("http://api.github.com/repos/" + mod.repo + "/zipball/master", loc -> {
|
||||||
Core.net.httpGet(loc.getHeader("Location"), result -> {
|
Core.net.httpGet(loc.getHeader("Location"), result -> {
|
||||||
if (result.getStatus() != HttpStatus.OK) {
|
if (result.getStatus() != HttpStatus.OK) {
|
||||||
ui.showErrorMessage(Core.bundle.format("connectfail", result.getStatus()));
|
ui.showErrorMessage(Core.bundle.format("connectfail", result.getStatus()));
|
||||||
ui.loadfrag.hide();
|
ui.loadfrag.hide();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Fi file = tmpDirectory.child((modsbrolist.repo).replace("/", "") + ".zip");
|
Fi file = tmpDirectory.child((mod.repo).replace("/", "") + ".zip");
|
||||||
Streams.copy(result.getResultAsStream(), file.write(false));
|
Streams.copy(result.getResultAsStream(), file.write(false));
|
||||||
mods.importMod(file);
|
mods.importMod(file);
|
||||||
file.delete();
|
file.delete();
|
||||||
@@ -226,7 +226,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
});
|
});
|
||||||
modSelected.buttons.button("$mods.github.open", Icon.github, () -> {
|
modSelected.buttons.button("$mods.github.open", Icon.github, () -> {
|
||||||
openGithubPage[0] = () -> {
|
openGithubPage[0] = () -> {
|
||||||
Core.app.openURI("https://github.com/" + modsbrolist.repo);
|
Core.app.openURI("https://github.com/" + mod.repo);
|
||||||
};
|
};
|
||||||
openGithubPage[0].run();
|
openGithubPage[0].run();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user