diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 54a5a6cbe3..bd2aaf9091 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -95,6 +95,7 @@ server.versions = Your version:[accent] {0}[]\nServer version:[accent] {1}[] host.info = The [accent]host[] button hosts a server on port [scarlet]6567[]. \nAnybody on the same [lightgray]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[lightgray]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. Note that public networks sometimes do not allow server discovery. join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP. hostserver = Host Multiplayer Game +invitefriends = Invite Friends hostserver.mobile = Host\nGame host = Host hosting = [accent]Opening server... diff --git a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java index cebcb9bbee..aaf1e63d49 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java @@ -58,12 +58,16 @@ public class PausedDialog extends FloatingDialog{ cont.row(); cont.addButton("$hostserver", () -> { - if(steam){ - ui.host.runHost(); + if(net.active() && steam){ + platform.inviteFriends(); }else{ - ui.host.show(); + if(steam){ + ui.host.runHost(); + }else{ + ui.host.show(); + } } - }).disabled(b -> net.active()).colspan(2).width(dw * 2 + 20f); + }).disabled(b -> net.active() && !steam).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.active() && steam ? "$invitefriends" : "$hostserver")); } cont.row(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index e435bdcfa1..946723983a 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -161,8 +161,8 @@ public class MenuFragment extends Fragment{ new Buttoni("$loadgame", Icon.loadSmall, ui.load::show), new Buttoni("$tutorial", Icon.infoSmall, control::playTutorial) ), - steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null, new Buttoni("$editor", Icon.editorSmall, ui.maps::show), + steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null, new Buttoni("$settings", Icon.toolsSmall, ui.settings::show), new Buttoni("$about.button", Icon.infoSmall, ui.about::show), new Buttoni("$quit", Icon.exitSmall, Core.app::exit) diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java b/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java index a713640083..b85b4b5815 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java @@ -210,14 +210,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, @Override public void onLobbyInvite(SteamID steamIDUser, SteamID steamIDLobby, long gameID){ - Log.info("lobby invite {0} {1} {2}", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID); - - //ignore invites when hosting. - if(net.server()) return; - - ui.showConfirm("Someone has invited you to a game.", "But do you accept?", () -> { - smat.joinLobby(steamIDLobby); - }); + Log.info("onLobbyInvite {0} {1} {2}", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID); } @Override @@ -393,8 +386,8 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, } @Override - public void onGameLobbyJoinRequested(SteamID steamID, SteamID steamID1){ - + public void onGameLobbyJoinRequested(SteamID steamID, SteamID steamIDFriend){ + Log.info("onGameLobbyJoinRequested {0} {1}", steamID, steamIDFriend); } @Override @@ -408,12 +401,12 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, } @Override - public void onGameRichPresenceJoinRequested(SteamID steamID, String s){ - + public void onGameRichPresenceJoinRequested(SteamID steamID, String connect){ + Log.info("onGameRichPresenceJoinRequested {0} {1}", steamID, connect); } @Override - public void onGameServerChangeRequested(String s, String s1){ + public void onGameServerChangeRequested(String server, String password){ } diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java index df4e76d174..215c7d4613 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java @@ -71,7 +71,7 @@ public class SWorkshop implements SteamUGCCallback{ ugc.setItemTitle(h, map.name()); ugc.setItemDescription(h, map.description()); ugc.setItemTags(h, new String[]{"map", mode.name()}); - ugc.setItemVisibility(h, PublishedFileVisibility.Public); + ugc.setItemVisibility(h, PublishedFileVisibility.Private); ugc.setItemPreview(h, map.previewFile().absolutePath()); ugc.setItemContent(h, mapFile.parent().absolutePath()); ugc.addItemKeyValueTag(h, "mode", mode.name()); @@ -102,6 +102,9 @@ public class SWorkshop implements SteamUGCCallback{ if(result == SteamResult.OK){ //redirect user to page for further updates SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + SteamNativeHandle.getNativeHandle(publishedFileID)); + if(needsToAcceptWLA){ + SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement"); + } Events.fire(new MapPublishEvent()); }else{ ui.showErrorMessage(Core.bundle.format("map.publish.error ", result.name()));