(10dd92c0a) Added Steam overlay support to workshop

This commit is contained in:
Joonas Rikkonen
2019-04-17 12:44:21 +03:00
parent 56a24772ec
commit 91d3ea6a0f
2 changed files with 7 additions and 9 deletions

View File

@@ -44,7 +44,6 @@ namespace Barotrauma
private ContentPackage itemContentPackage;
private Facepunch.Steamworks.Workshop.Editor itemEditor;
//private Facepunch.Steamworks.Overlay overlay;
public SteamWorkshopScreen()
{
@@ -132,7 +131,7 @@ namespace Barotrauma
OutlineColor = new Color(72, 124, 77, 255),
OnClicked = (btn, userdata) =>
{
System.Diagnostics.Process.Start("steam://url/SteamWorkshopPage/" + SteamManager.AppID);
SteamManager.OverlayCustomURL("steam://url/SteamWorkshopPage/" + SteamManager.AppID);
return true;
}
};
@@ -639,13 +638,7 @@ namespace Barotrauma
OutlineColor = new Color(72, 124, 77, 255),
OnClicked = (btn, userdata) =>
{
// Failed attempt, might have to be activated before accessing because as of now it just throws a null for overlay
/*if (overlay.Enabled)
{
overlay.OpenUrl("steam://url/CommunityFilePage/" + item.Id);
}*/
System.Diagnostics.Process.Start("steam://url/CommunityFilePage/" + item.Id);
SteamManager.OverlayCustomURL("steam://url/CommunityFilePage/" + item.Id);
return true;
}
};

View File

@@ -66,6 +66,11 @@ namespace Barotrauma.Steam
if (!USE_STEAM) return;
instance = new SteamManager();
}
public static void OverlayCustomURL(string url)
{
instance.client.Overlay.OpenUrl(url);
}
public static bool UnlockAchievement(string achievementName)
{