diff --git a/core/src/io/anuke/mindustry/core/Platform.java b/core/src/io/anuke/mindustry/core/Platform.java index a7c5826a63..bfedda548c 100644 --- a/core/src/io/anuke/mindustry/core/Platform.java +++ b/core/src/io/anuke/mindustry/core/Platform.java @@ -39,8 +39,8 @@ public interface Platform{ /** Steam: View a map listing on the workshop.*/ default void viewMapListing(Map map){} - /** Steam: View a map listing on the workshop.*/ - default void viewMapListing(String mapid){} + /** Steam: View a listing on the workshop.*/ + default void viewListing(String mapid){} /** Steam: View map workshop info, removing the map ID tag if its listing is deleted. * Also presents the option to update the map. */ diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 1a5da836bb..88fe62e604 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -150,7 +150,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ menu.cont.addImageTextButton("$editor.publish.workshop", Icon.linkSmall, () -> { Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim())); if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){ - platform.viewMapListing(editor.getTags().get("steamid")); + platform.viewListing(editor.getTags().get("steamid")); return; } diff --git a/core/src/io/anuke/mindustry/mod/Mods.java b/core/src/io/anuke/mindustry/mod/Mods.java index 4d2686aa48..fa483fbb6d 100644 --- a/core/src/io/anuke/mindustry/mod/Mods.java +++ b/core/src/io/anuke/mindustry/mod/Mods.java @@ -76,6 +76,7 @@ public class Mods implements Loadable{ @Override public void loadAsync(){ if(loaded.isEmpty()) return; + Time.mark(); packer = new PixmapPacker(2048, 2048, Format.RGBA8888, 2, true); @@ -104,11 +105,14 @@ public class Mods implements Loadable{ }); Log.info("Packed {0} images for mod '{1}'.", packed[0], mod.meta.name); } + + Log.info("Time to pack textures: {0}", Time.elapsed()); } @Override public void loadSync(){ if(packer == null) return; + Time.mark(); Texture editor = Core.atlas.find("clear-editor").getTexture(); PixmapPacker editorPacker = new PixmapPacker(2048, 2048, Format.RGBA8888, 2, true); @@ -140,6 +144,7 @@ public class Mods implements Loadable{ packer.dispose(); packer = null; + Log.info("Time to update textures: {0}", Time.elapsed()); } /** Removes a mod file and marks it for requiring a restart. */ @@ -271,7 +276,7 @@ public class Mods implements Loadable{ try{ //this binds the content but does not load it entirely Content loaded = parser.parse(mod, file.nameWithoutExtension(), file.readString(), type); - Log.info("[{0}] Loaded '{1}'.", mod.meta.name, loaded); + Log.info("[{0}] Loaded '{1}'.", mod.meta.name, (loaded instanceof UnlockableContent ? ((UnlockableContent)loaded).localizedName : loaded)); }catch(Exception e){ throw new RuntimeException("Failed to parse content file '" + file + "' for mod '" + mod.meta.name + "'.", e); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java index 183a542af4..26d85887c1 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java @@ -76,10 +76,16 @@ public class ModsDialog extends FloatingDialog{ setup(); }).height(50f).margin(8f).width(130f); - title.addImageButton(Icon.trash16Small, Styles.cleari, () -> ui.showConfirm("$confirm", "$mod.remove.confirm", () -> { - mods.removeMod(mod); - setup(); - })).size(50f); + title.addImageButton(mod.workshopID != null ? Icon.linkSmall : Icon.trash16Small, Styles.cleari, () -> { + if(mod.workshopID == null){ + ui.showConfirm("$confirm", "$mod.remove.confirm", () -> { + mods.removeMod(mod); + setup(); + }); + }else{ + platform.viewListing(mod.workshopID); + } + }).size(50f); }).growX().left().padTop(-14f).padRight(-14f); t.row(); diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index 92530555a1..1cfcce2fd5 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -228,11 +228,11 @@ public class DesktopLauncher extends ClientLauncher{ @Override public void viewMapListing(Map map){ - viewMapListing(map.file.parent().name()); + viewListing(map.file.parent().name()); } @Override - public void viewMapListing(String mapid){ + public void viewListing(String mapid){ SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + mapid); } diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java index 9939ae795c..31f6029e44 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java @@ -112,7 +112,7 @@ public class SWorkshop implements SteamUGCCallback{ dialog.addCloseButton(); dialog.buttons.addImageTextButton("$view.workshop", Icon.linkSmall, () -> { - platform.viewMapListing(id); + platform.viewListing(id); dialog.hide(); }).size(210f, 64f);