(10dd92c0a) Added Steam overlay support to workshop
This commit is contained in:
@@ -44,7 +44,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private ContentPackage itemContentPackage;
|
private ContentPackage itemContentPackage;
|
||||||
private Facepunch.Steamworks.Workshop.Editor itemEditor;
|
private Facepunch.Steamworks.Workshop.Editor itemEditor;
|
||||||
//private Facepunch.Steamworks.Overlay overlay;
|
|
||||||
|
|
||||||
public SteamWorkshopScreen()
|
public SteamWorkshopScreen()
|
||||||
{
|
{
|
||||||
@@ -132,7 +131,7 @@ namespace Barotrauma
|
|||||||
OutlineColor = new Color(72, 124, 77, 255),
|
OutlineColor = new Color(72, 124, 77, 255),
|
||||||
OnClicked = (btn, userdata) =>
|
OnClicked = (btn, userdata) =>
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process.Start("steam://url/SteamWorkshopPage/" + SteamManager.AppID);
|
SteamManager.OverlayCustomURL("steam://url/SteamWorkshopPage/" + SteamManager.AppID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -639,13 +638,7 @@ namespace Barotrauma
|
|||||||
OutlineColor = new Color(72, 124, 77, 255),
|
OutlineColor = new Color(72, 124, 77, 255),
|
||||||
OnClicked = (btn, userdata) =>
|
OnClicked = (btn, userdata) =>
|
||||||
{
|
{
|
||||||
// Failed attempt, might have to be activated before accessing because as of now it just throws a null for overlay
|
SteamManager.OverlayCustomURL("steam://url/CommunityFilePage/" + item.Id);
|
||||||
/*if (overlay.Enabled)
|
|
||||||
{
|
|
||||||
overlay.OpenUrl("steam://url/CommunityFilePage/" + item.Id);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
System.Diagnostics.Process.Start("steam://url/CommunityFilePage/" + item.Id);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,6 +67,11 @@ namespace Barotrauma.Steam
|
|||||||
instance = new SteamManager();
|
instance = new SteamManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void OverlayCustomURL(string url)
|
||||||
|
{
|
||||||
|
instance.client.Overlay.OpenUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
public static bool UnlockAchievement(string achievementName)
|
public static bool UnlockAchievement(string achievementName)
|
||||||
{
|
{
|
||||||
if (instance == null || !instance.isInitialized || instance.client == null)
|
if (instance == null || !instance.isInitialized || instance.client == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user