Fixed mod deletion issue
This commit is contained in:
@@ -151,9 +151,9 @@ public class Mods implements Loadable{
|
|||||||
/** Removes a mod file and marks it for requiring a restart. */
|
/** Removes a mod file and marks it for requiring a restart. */
|
||||||
public void removeMod(LoadedMod mod){
|
public void removeMod(LoadedMod mod){
|
||||||
if(mod.root instanceof ZipFileHandle){
|
if(mod.root instanceof ZipFileHandle){
|
||||||
Log.info("Deleting zip file.");
|
|
||||||
mod.root.delete();
|
mod.root.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean deleted = mod.file.isDirectory() ? mod.file.deleteDirectory() : mod.file.delete();
|
boolean deleted = mod.file.isDirectory() ? mod.file.deleteDirectory() : mod.file.delete();
|
||||||
|
|
||||||
if(!deleted){
|
if(!deleted){
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class ModsDialog extends FloatingDialog{
|
|||||||
t.margin(14f).left();
|
t.margin(14f).left();
|
||||||
t.table(title -> {
|
t.table(title -> {
|
||||||
title.left();
|
title.left();
|
||||||
title.add("[accent]" + mod.meta.name + "[lightgray] v" + mod.meta.version + (" | " + Core.bundle.get(mod.enabled() ? "mod.enabled" : "mod.disabled"))).width(270f).wrap();
|
title.add("[accent]" + mod.meta.name + "[lightgray] v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).width(200f).wrap();
|
||||||
title.add().growX();
|
title.add().growX();
|
||||||
|
|
||||||
title.addImageTextButton(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.arrowDownSmall : Icon.arrowUpSmall, Styles.cleart, () -> {
|
title.addImageTextButton(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.arrowDownSmall : Icon.arrowUpSmall, Styles.cleart, () -> {
|
||||||
@@ -159,7 +159,7 @@ public class ModsDialog extends FloatingDialog{
|
|||||||
t.labelWrap(Core.bundle.format("mod.missingdependencies", mod.missingDependencies.toString(", "))).growX();
|
t.labelWrap(Core.bundle.format("mod.missingdependencies", mod.missingDependencies.toString(", "))).growX();
|
||||||
t.row();
|
t.row();
|
||||||
}
|
}
|
||||||
}).width(500f);
|
}).width(mobile ? 430f : 500f);
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=35bd829fddd24bd90b2384d954bc76da173e8a0f
|
archash=37c9b0d7191c34c4cd34d9457d08396d50a0c476
|
||||||
|
|||||||
Reference in New Issue
Block a user