Workshop tweaks

This commit is contained in:
Anuken
2019-09-17 22:39:58 -04:00
parent 2424afa1fb
commit 5d0cfc3599
11 changed files with 59 additions and 21 deletions

View File

@@ -202,6 +202,11 @@ public class DesktopLauncher extends ClientLauncher{
return !steam ? super.getExternalMaps() : SVars.workshop.getMapFiles();
}
@Override
public void viewMapListing(Map map){
SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + map.file.parent().name());
}
@Override
public NetProvider getNet(){
return steam ? SVars.net : new ArcNetImpl();

View File

@@ -39,6 +39,15 @@ public class SWorkshop implements SteamUGCCallback{
}
public void publishMap(Map map){
if(map.tags.containsKey("steamid")){
Log.info("Map already published, redirecting to ID.");
SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + map.tags.get("steamid"));
return;
}
//update author name when publishing
map.tags.put("author", SVars.net.friends.getPersonaName());
FloatingDialog dialog = new FloatingDialog("$confirm");
dialog.setFillParent(false);
dialog.cont.add("$map.publish.confirm").width(600f).wrap();
@@ -141,6 +150,12 @@ public class SWorkshop implements SteamUGCCallback{
if(needsToAcceptWLA){
SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement");
}
ui.editor.editor.getTags().put("steamid", SteamNativeHandle.getNativeHandle(publishedFileID) + "");
try{
ui.editor.save();
}catch(Exception e){
Log.err(e);
}
Events.fire(new MapPublishEvent());
}else{
ui.showErrorMessage(Core.bundle.format("map.publish.error ", result.name()));