diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index db1b464ac9..aa79d77ee5 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -92,6 +92,7 @@ mods = Mods mods.none = [LIGHT_GRAY]No mods found! mods.guide = Modding Guide mods.report = Report Bug +mods.openfolder = Open Mod Folder mod.enabled = [lightgray]Enabled mod.disabled = [scarlet]Disabled mod.disable = Disable diff --git a/core/src/io/anuke/mindustry/mod/Mods.java b/core/src/io/anuke/mindustry/mod/Mods.java index 890b4e89ca..2d3c51a6c7 100644 --- a/core/src/io/anuke/mindustry/mod/Mods.java +++ b/core/src/io/anuke/mindustry/mod/Mods.java @@ -198,7 +198,7 @@ public class Mods implements Loadable{ }else{ disabled.add(mod); } - mod.addSteamID(file.parent().name()); + mod.addSteamID(file.name()); }catch(Exception e){ Log.err("Failed to load mod workshop file {0}. Skipping.", file); Log.err(e); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java index 691cefbc3b..8c9ab59ae7 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java @@ -21,8 +21,14 @@ public class ModsDialog extends FloatingDialog{ super("$mods"); addCloseButton(); - buttons.addImageTextButton("$mods.report", Icon.link, - () -> Core.net.openURI(reportIssueURL)) + buttons.addImageTextButton(mobile ? "$mods.report" : "$mods.openfolder", Icon.link, + () -> { + if(mobile){ + Core.net.openURI(reportIssueURL); + }else{ + Core.net.openFolder(modDirectory.absolutePath()); + } + }) .size(250f, 64f); buttons.row(); diff --git a/core/src/io/anuke/mindustry/ui/layout/RadialTreeLayout.java b/core/src/io/anuke/mindustry/ui/layout/RadialTreeLayout.java index b8aad3d3c4..e0c8006cb9 100644 --- a/core/src/io/anuke/mindustry/ui/layout/RadialTreeLayout.java +++ b/core/src/io/anuke/mindustry/ui/layout/RadialTreeLayout.java @@ -15,27 +15,29 @@ public class RadialTreeLayout implements TreeLayout{ delta = root.height * 2.4f; bfs(root, true); - radialize(root, 0, 360); + + ObjectSet all = new ObjectSet<>(visited); + for(TreeNode node : all){ + node.leaves = bfs(node, false); + } + + radialize(root, startRadius, 0, 360); } - void radialize(TreeNode root, float from, float to){ - int depthOfVertex = root.number; - float theta = from; - float radius = startRadius + (delta * depthOfVertex); + void radialize(TreeNode root, float radius, float from, float to){ + float angle = from; - int leavesNumber = bfs(root, false); for(TreeNode child : root.children){ - int lambda = bfs(child, false); - float mi = theta + ((float)lambda / leavesNumber * (to - from)); + float nextAngle = angle + ((float)child.leaves / root.leaves * (to - from)); - float x = radius * Mathf.cos((theta + mi) / 2f * Mathf.degRad); - float y = radius * Mathf.sin((theta + mi) / 2f * Mathf.degRad); + float x = radius * Mathf.cos((angle + nextAngle) / 2f * Mathf.degRad); + float y = radius * Mathf.sin((angle + nextAngle) / 2f * Mathf.degRad); child.x = x; child.y = y; - if(child.children.length > 0) radialize(child, theta, mi); - theta = mi; + if(child.children.length > 0) radialize(child, radius + delta, angle, nextAngle); + angle = nextAngle; } } @@ -54,8 +56,7 @@ public class RadialTreeLayout implements TreeLayout{ for(TreeNode child : current.children){ if(assign) child.number = current.number + 1; - if(!visited.contains(child)){ - visited.add(child); + if(visited.add(child)){ queue.addLast(child); } } diff --git a/core/src/io/anuke/mindustry/ui/layout/TreeLayout.java b/core/src/io/anuke/mindustry/ui/layout/TreeLayout.java index 8b905e051d..6b9f4556da 100644 --- a/core/src/io/anuke/mindustry/ui/layout/TreeLayout.java +++ b/core/src/io/anuke/mindustry/ui/layout/TreeLayout.java @@ -12,7 +12,7 @@ public interface TreeLayout{ //internal stuff public float mode, prelim, change, shift; - public int number = -1; + public int number = -1, leaves; public TreeNode thread, ancestor; public boolean isLeaf(){ diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java index 337a938df5..170e014a18 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java @@ -83,13 +83,16 @@ public class SWorkshop implements SteamUGCCallback{ public void viewListing(Publishable p){ long handle = Strings.parseLong(p.getSteamID(), -1); SteamPublishedFileID id = new SteamPublishedFileID(handle); + Log.info("Handle = " + handle); ui.loadfrag.show(); query(ugc.createQueryUGCDetailsRequest(id), (detailsList, result) -> { ui.loadfrag.hide(); + Log.info("Fetch result = " + result); if(result == SteamResult.OK){ SteamUGCDetails details = detailsList.first(); + Log.info("Details result = " + details.getResult()); if(details.getResult() == SteamResult.OK){ if(details.getOwnerID().equals(SVars.user.user.getSteamID())){ diff --git a/gradle.properties b/gradle.properties index 8acb26ee29..f6b7b82995 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=a9f704acf0cf17b7044a5659bf62be33cfbffb0f +archash=1d0223f7e3290454b313f295e8578216c95c024e