Bugfixes for Steam

This commit is contained in:
Anuken 2019-11-04 22:18:34 -05:00
parent 08b730a349
commit 6153764c0d
7 changed files with 30 additions and 19 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -15,27 +15,29 @@ public class RadialTreeLayout implements TreeLayout{
delta = root.height * 2.4f;
bfs(root, true);
radialize(root, 0, 360);
ObjectSet<TreeNode> 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);
}
}

View File

@ -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(){

View File

@ -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())){

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=a9f704acf0cf17b7044a5659bf62be33cfbffb0f
archash=1d0223f7e3290454b313f295e8578216c95c024e