24 lines
727 B
C#
24 lines
727 B
C#
using System;
|
|
using System.Reflection;
|
|
using System.Windows.Data;
|
|
using VRage.GameServices;
|
|
|
|
namespace Torch
|
|
{
|
|
/// <summary>
|
|
/// Provides static accessor for MySteamService because Keen made it internal
|
|
/// </summary>
|
|
public class MySteamServiceWrapper
|
|
{
|
|
private static readonly MethodInfo _getGameService;
|
|
|
|
public static IMyGameService Static => (IMyGameService)_getGameService.Invoke(null, null);
|
|
|
|
static MySteamServiceWrapper()
|
|
{
|
|
var type = Type.GetType("VRage.Steam.MySteamService, VRage.Steam");
|
|
var prop = type.GetProperty("Static", BindingFlags.Static | BindingFlags.Public);
|
|
_getGameService = prop.GetGetMethod();
|
|
}
|
|
}
|
|
} |