mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 14:15:47 +03:00
Add SteamTimeline
This commit is contained in:
parent
5783d89634
commit
e4455258ac
@ -53,10 +53,10 @@ internal void SetTimelineGameMode( TimelineGameMode eMode )
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern TimelineEventHandle_t _AddInstantaneousTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
|
private static extern TimelineEventHandle _AddInstantaneousTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal TimelineEventHandle_t AddInstantaneousTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
|
internal TimelineEventHandle AddInstantaneousTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
|
||||||
{
|
{
|
||||||
var returnValue = _AddInstantaneousTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip );
|
var returnValue = _AddInstantaneousTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip );
|
||||||
return returnValue;
|
return returnValue;
|
||||||
@ -64,10 +64,10 @@ internal TimelineEventHandle_t AddInstantaneousTimelineEvent( [MarshalAs( Unmana
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddRangeTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_AddRangeTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern TimelineEventHandle_t _AddRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip );
|
private static extern TimelineEventHandle _AddRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal TimelineEventHandle_t AddRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip )
|
internal TimelineEventHandle AddRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unIconPriority, float flStartOffsetSeconds, float flDuration, TimelineEventClipPriority ePossibleClip )
|
||||||
{
|
{
|
||||||
var returnValue = _AddRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip );
|
var returnValue = _AddRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip );
|
||||||
return returnValue;
|
return returnValue;
|
||||||
@ -75,10 +75,10 @@ internal TimelineEventHandle_t AddRangeTimelineEvent( [MarshalAs( UnmanagedType.
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_StartRangeTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_StartRangeTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern TimelineEventHandle_t _StartRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
|
private static extern TimelineEventHandle _StartRangeTimelineEvent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal TimelineEventHandle_t StartRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
|
internal TimelineEventHandle StartRangeTimelineEvent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, float flStartOffsetSeconds, TimelineEventClipPriority ePossibleClip )
|
||||||
{
|
{
|
||||||
var returnValue = _StartRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unPriority, flStartOffsetSeconds, ePossibleClip );
|
var returnValue = _StartRangeTimelineEvent( Self, pchTitle, pchDescription, pchIcon, unPriority, flStartOffsetSeconds, ePossibleClip );
|
||||||
return returnValue;
|
return returnValue;
|
||||||
@ -86,40 +86,40 @@ internal TimelineEventHandle_t StartRangeTimelineEvent( [MarshalAs( UnmanagedTyp
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip );
|
private static extern void _UpdateRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal void UpdateRangeTimelineEvent( TimelineEventHandle_t ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip )
|
internal void UpdateRangeTimelineEvent( TimelineEventHandle ulEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchIcon, uint unPriority, TimelineEventClipPriority ePossibleClip )
|
||||||
{
|
{
|
||||||
_UpdateRangeTimelineEvent( Self, ulEvent, pchTitle, pchDescription, pchIcon, unPriority, ePossibleClip );
|
_UpdateRangeTimelineEvent( Self, ulEvent, pchTitle, pchDescription, pchIcon, unPriority, ePossibleClip );
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_EndRangeTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_EndRangeTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern void _EndRangeTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent, float flEndOffsetSeconds );
|
private static extern void _EndRangeTimelineEvent( IntPtr self, TimelineEventHandle ulEvent, float flEndOffsetSeconds );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal void EndRangeTimelineEvent( TimelineEventHandle_t ulEvent, float flEndOffsetSeconds )
|
internal void EndRangeTimelineEvent( TimelineEventHandle ulEvent, float flEndOffsetSeconds )
|
||||||
{
|
{
|
||||||
_EndRangeTimelineEvent( Self, ulEvent, flEndOffsetSeconds );
|
_EndRangeTimelineEvent( Self, ulEvent, flEndOffsetSeconds );
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_RemoveTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_RemoveTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern void _RemoveTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent );
|
private static extern void _RemoveTimelineEvent( IntPtr self, TimelineEventHandle ulEvent );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal void RemoveTimelineEvent( TimelineEventHandle_t ulEvent )
|
internal void RemoveTimelineEvent( TimelineEventHandle ulEvent )
|
||||||
{
|
{
|
||||||
_RemoveTimelineEvent( Self, ulEvent );
|
_RemoveTimelineEvent( Self, ulEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_DoesEventRecordingExist", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_DoesEventRecordingExist", CallingConvention = Platform.CC)]
|
||||||
private static extern SteamAPICall_t _DoesEventRecordingExist( IntPtr self, TimelineEventHandle_t ulEvent );
|
private static extern SteamAPICall_t _DoesEventRecordingExist( IntPtr self, TimelineEventHandle ulEvent );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal CallResult<SteamTimelineEventRecordingExists_t> DoesEventRecordingExist( TimelineEventHandle_t ulEvent )
|
internal CallResult<SteamTimelineEventRecordingExists_t> DoesEventRecordingExist( TimelineEventHandle ulEvent )
|
||||||
{
|
{
|
||||||
var returnValue = _DoesEventRecordingExist( Self, ulEvent );
|
var returnValue = _DoesEventRecordingExist( Self, ulEvent );
|
||||||
return new CallResult<SteamTimelineEventRecordingExists_t>( returnValue, IsServer );
|
return new CallResult<SteamTimelineEventRecordingExists_t>( returnValue, IsServer );
|
||||||
@ -198,10 +198,10 @@ internal void OpenOverlayToGamePhase( [MarshalAs( UnmanagedType.CustomMarshaler,
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent", CallingConvention = Platform.CC)]
|
||||||
private static extern void _OpenOverlayToTimelineEvent( IntPtr self, TimelineEventHandle_t ulEvent );
|
private static extern void _OpenOverlayToTimelineEvent( IntPtr self, TimelineEventHandle ulEvent );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal void OpenOverlayToTimelineEvent( TimelineEventHandle_t ulEvent )
|
internal void OpenOverlayToTimelineEvent( TimelineEventHandle ulEvent )
|
||||||
{
|
{
|
||||||
_OpenOverlayToTimelineEvent( Self, ulEvent );
|
_OpenOverlayToTimelineEvent( Self, ulEvent );
|
||||||
}
|
}
|
||||||
|
@ -2196,7 +2196,7 @@ internal enum SteamItemFlags : int
|
|||||||
//
|
//
|
||||||
// ETimelineGameMode
|
// ETimelineGameMode
|
||||||
//
|
//
|
||||||
internal enum TimelineGameMode : int
|
public enum TimelineGameMode : int
|
||||||
{
|
{
|
||||||
Invalid = 0,
|
Invalid = 0,
|
||||||
Playing = 1,
|
Playing = 1,
|
||||||
@ -2209,7 +2209,7 @@ internal enum TimelineGameMode : int
|
|||||||
//
|
//
|
||||||
// ETimelineEventClipPriority
|
// ETimelineEventClipPriority
|
||||||
//
|
//
|
||||||
internal enum TimelineEventClipPriority : int
|
public enum TimelineEventClipPriority : int
|
||||||
{
|
{
|
||||||
Invalid = 0,
|
Invalid = 0,
|
||||||
None = 1,
|
None = 1,
|
||||||
|
@ -598,20 +598,20 @@ internal struct SteamInventoryUpdateHandle_t : IEquatable<SteamInventoryUpdateHa
|
|||||||
public int CompareTo( SteamInventoryUpdateHandle_t other ) => Value.CompareTo( other.Value );
|
public int CompareTo( SteamInventoryUpdateHandle_t other ) => Value.CompareTo( other.Value );
|
||||||
}
|
}
|
||||||
|
|
||||||
internal struct TimelineEventHandle_t : IEquatable<TimelineEventHandle_t>, IComparable<TimelineEventHandle_t>
|
public struct TimelineEventHandle : IEquatable<TimelineEventHandle>, IComparable<TimelineEventHandle>
|
||||||
{
|
{
|
||||||
// Name: TimelineEventHandle_t, Type: unsigned long long
|
// Name: TimelineEventHandle_t, Type: unsigned long long
|
||||||
public ulong Value;
|
public ulong Value;
|
||||||
|
|
||||||
public static implicit operator TimelineEventHandle_t( ulong value ) => new TimelineEventHandle_t(){ Value = value };
|
public static implicit operator TimelineEventHandle( ulong value ) => new TimelineEventHandle(){ Value = value };
|
||||||
public static implicit operator ulong( TimelineEventHandle_t value ) => value.Value;
|
public static implicit operator ulong( TimelineEventHandle value ) => value.Value;
|
||||||
public override string ToString() => Value.ToString();
|
public override string ToString() => Value.ToString();
|
||||||
public override int GetHashCode() => Value.GetHashCode();
|
public override int GetHashCode() => Value.GetHashCode();
|
||||||
public override bool Equals( object p ) => this.Equals( (TimelineEventHandle_t) p );
|
public override bool Equals( object p ) => this.Equals( (TimelineEventHandle) p );
|
||||||
public bool Equals( TimelineEventHandle_t p ) => p.Value == Value;
|
public bool Equals( TimelineEventHandle p ) => p.Value == Value;
|
||||||
public static bool operator ==( TimelineEventHandle_t a, TimelineEventHandle_t b ) => a.Equals( b );
|
public static bool operator ==( TimelineEventHandle a, TimelineEventHandle b ) => a.Equals( b );
|
||||||
public static bool operator !=( TimelineEventHandle_t a, TimelineEventHandle_t b ) => !a.Equals( b );
|
public static bool operator !=( TimelineEventHandle a, TimelineEventHandle b ) => !a.Equals( b );
|
||||||
public int CompareTo( TimelineEventHandle_t other ) => Value.CompareTo( other.Value );
|
public int CompareTo( TimelineEventHandle other ) => Value.CompareTo( other.Value );
|
||||||
}
|
}
|
||||||
|
|
||||||
internal struct RemotePlaySessionID_t : IEquatable<RemotePlaySessionID_t>, IComparable<RemotePlaySessionID_t>
|
internal struct RemotePlaySessionID_t : IEquatable<RemotePlaySessionID_t>, IComparable<RemotePlaySessionID_t>
|
||||||
|
@ -43,7 +43,8 @@ public static void Init( uint appid, bool asyncCallbacks = true )
|
|||||||
ISteamUserStats.Version,
|
ISteamUserStats.Version,
|
||||||
ISteamUtils.Version,
|
ISteamUtils.Version,
|
||||||
ISteamVideo.Version,
|
ISteamVideo.Version,
|
||||||
ISteamRemotePlay.Version );
|
ISteamRemotePlay.Version,
|
||||||
|
ISteamTimeline.Version );
|
||||||
var result = SteamAPI.Init( interfaceVersions, out var error );
|
var result = SteamAPI.Init( interfaceVersions, out var error );
|
||||||
if ( result != SteamAPIInitResult.OK )
|
if ( result != SteamAPIInitResult.OK )
|
||||||
{
|
{
|
||||||
@ -55,12 +56,12 @@ public static void Init( uint appid, bool asyncCallbacks = true )
|
|||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dispatch is responsible for pumping the
|
// Dispatch is responsible for pumping the event loop.
|
||||||
// event loop.
|
|
||||||
//
|
//
|
||||||
Dispatch.Init();
|
Dispatch.Init();
|
||||||
Dispatch.ClientPipe = SteamAPI.GetHSteamPipe();
|
Dispatch.ClientPipe = SteamAPI.GetHSteamPipe();
|
||||||
|
|
||||||
|
// Note: don't forget to add the interface version to SteamAPI.Init above!!!
|
||||||
AddInterface<SteamApps>();
|
AddInterface<SteamApps>();
|
||||||
AddInterface<SteamFriends>();
|
AddInterface<SteamFriends>();
|
||||||
AddInterface<SteamInput>();
|
AddInterface<SteamInput>();
|
||||||
@ -81,6 +82,8 @@ public static void Init( uint appid, bool asyncCallbacks = true )
|
|||||||
AddInterface<SteamUtils>();
|
AddInterface<SteamUtils>();
|
||||||
AddInterface<SteamVideo>();
|
AddInterface<SteamVideo>();
|
||||||
AddInterface<SteamRemotePlay>();
|
AddInterface<SteamRemotePlay>();
|
||||||
|
AddInterface<SteamTimeline>();
|
||||||
|
// Note: don't forget to add the interface version to SteamAPI.Init above!!!
|
||||||
|
|
||||||
initialized = openInterfaces.Count > 0;
|
initialized = openInterfaces.Count > 0;
|
||||||
|
|
||||||
|
202
Facepunch.Steamworks/SteamTimeline.cs
Normal file
202
Facepunch.Steamworks/SteamTimeline.cs
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Steamworks.Data;
|
||||||
|
|
||||||
|
namespace Steamworks;
|
||||||
|
|
||||||
|
public class SteamTimeline : SteamClientClass<SteamTimeline>
|
||||||
|
{
|
||||||
|
internal static ISteamTimeline Internal => Interface as ISteamTimeline;
|
||||||
|
|
||||||
|
internal override bool InitializeInterface( bool server )
|
||||||
|
{
|
||||||
|
SetInterface( server, new ISteamTimeline( server ) );
|
||||||
|
if ( Interface.Self == IntPtr.Zero ) return false;
|
||||||
|
|
||||||
|
InstallEvents();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void InstallEvents()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets a description for the current game state in the timeline. These help the user to find specific moments in the timeline when saving clips. Setting a
|
||||||
|
/// new state description replaces any previous description.
|
||||||
|
/// </summary>
|
||||||
|
public static void SetTimelineTooltip( string description, float timeOffsetSeconds )
|
||||||
|
{
|
||||||
|
Internal.SetTimelineTooltip( description, timeOffsetSeconds );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the previous set game state in the timeline.
|
||||||
|
/// </summary>
|
||||||
|
public static void ClearTimelineTooltip( float timeOffsetSeconds )
|
||||||
|
{
|
||||||
|
Internal.ClearTimelineTooltip( timeOffsetSeconds );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to mark an event on the Timeline. This event will be instantaneous. (See <see cref="AddRangeTimelineEvent"/> to add events that happened over time.)
|
||||||
|
/// </summary>
|
||||||
|
public static TimelineEventHandle AddInstantaneousTimelineEvent( string title, string description, string icon,
|
||||||
|
uint priority, float startOffsetSeconds, TimelineEventClipPriority possibleClip )
|
||||||
|
{
|
||||||
|
return Internal.AddInstantaneousTimelineEvent( title, description, icon, priority, startOffsetSeconds,
|
||||||
|
possibleClip );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to mark an event on the Timeline that takes some amount of time to complete.
|
||||||
|
/// </summary>
|
||||||
|
public static TimelineEventHandle AddRangeTimelineEvent( string title, string description, string icon,
|
||||||
|
uint priority, float startOffsetSeconds, float durationSeconds, TimelineEventClipPriority possibleClip )
|
||||||
|
{
|
||||||
|
return Internal.AddRangeTimelineEvent( title, description, icon, priority, startOffsetSeconds, durationSeconds,
|
||||||
|
possibleClip );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to mark the start of an event on the Timeline that takes some amount of time to complete. The duration of the event is determined by a matching call
|
||||||
|
/// to <see cref="EndRangeTimelineEvent"/>. If the game wants to cancel an event in progress, they can do that with a call to <see cref="RemoveTimelineEvent"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static TimelineEventHandle StartRangeTimelineEvent( string title, string description, string icon,
|
||||||
|
uint priority,
|
||||||
|
float startOffsetSeconds, TimelineEventClipPriority possibleClip )
|
||||||
|
{
|
||||||
|
return Internal.StartRangeTimelineEvent( title, description, icon, priority, startOffsetSeconds, possibleClip );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to update the details of an event that was started with <see cref="StartRangeTimelineEvent"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static void UpdateRangeTimelineEvent( TimelineEventHandle handle, string title, string description,
|
||||||
|
string icon, uint priority, TimelineEventClipPriority possibleClip )
|
||||||
|
{
|
||||||
|
Internal.UpdateRangeTimelineEvent( handle, title, description, icon, priority, possibleClip );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to identify the end of an event that was started with <see cref="StartRangeTimelineEvent"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static void EndRangeTimelineEvent( TimelineEventHandle handle, float endOffsetSeconds )
|
||||||
|
{
|
||||||
|
Internal.EndRangeTimelineEvent( handle, endOffsetSeconds );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to remove a Timeline event that was previously added.
|
||||||
|
/// </summary>
|
||||||
|
public static void RemoveTimelineEvent( TimelineEventHandle handle )
|
||||||
|
{
|
||||||
|
Internal.RemoveTimelineEvent( handle );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to determine if video recordings exist for the specified event. This can be useful when the game needs to decide whether or not to show a control
|
||||||
|
/// that will call <see cref="OpenOverlayToTimelineEvent"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static async Task<bool> DoesEventRecordingExist( TimelineEventHandle handle )
|
||||||
|
{
|
||||||
|
var result = await Internal.DoesEventRecordingExist( handle );
|
||||||
|
return result?.RecordingExists ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to start a game phase. Game phases allow the user to navigate their background recordings and clips. Exactly what a game phase means will vary game
|
||||||
|
/// to game, but the game phase should be a section of gameplay that is usually between 10 minutes and a few hours in length, and should be the main way a user
|
||||||
|
/// would think to divide up the game. These are presented to the user in a UI that shows the date the game was played, with one row per game slice. Game phases
|
||||||
|
/// should be used to mark sections of gameplay that the user might be interested in watching.
|
||||||
|
/// </summary>
|
||||||
|
public static void StartGamePhase()
|
||||||
|
{
|
||||||
|
Internal.StartGamePhase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to end a game phase that was started with <see cref="StartGamePhase"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static void EndGamePhase()
|
||||||
|
{
|
||||||
|
Internal.EndGamePhase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The phase ID is used to let the game identify which phase it is referring to in calls to <see cref="DoesGamePhaseRecordingExist"/> or
|
||||||
|
/// <see cref="OpenOverlayToGamePhase"/>. It may also be used to associated multiple phases with each other.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="phaseId">A game-provided persistent ID for a game phase. This could be a the match ID in a multiplayer game, a chapter name in a single player game, the ID of a character, etc.</param>
|
||||||
|
public static void SetGamePhaseId( string phaseId )
|
||||||
|
{
|
||||||
|
Internal.SetGamePhaseID( phaseId );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to determine if video recordings exist for the specified game phase. This can be useful when the game needs to decide whether or not to show a control that will call <see cref="OpenOverlayToGamePhase"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static async Task<GamePhaseRecordingInfo?> DoesGamePhaseRecordingExist( string phaseId )
|
||||||
|
{
|
||||||
|
var result = await Internal.DoesGamePhaseRecordingExist( phaseId );
|
||||||
|
if ( !result.HasValue )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var info = result.Value;
|
||||||
|
return new GamePhaseRecordingInfo
|
||||||
|
{
|
||||||
|
PhaseId = info.PhaseIDUTF8(),
|
||||||
|
RecordingMs = info.RecordingMS,
|
||||||
|
LongestClipMs = info.LongestClipMS,
|
||||||
|
ClipCount = info.ClipCount,
|
||||||
|
ScreenshotCount = info.ScreenshotCount,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to add a game phase tag. Phase tags represent data with a well defined set of options, which could be data such as match resolution, hero played, game mode, etc. Tags can have an icon
|
||||||
|
/// in addition to a text name. Multiple tags within the same group may be added per phase and all will be remembered. For example, this may be called multiple times for a "Bosses Defeated" group,
|
||||||
|
/// with different names and icons for each boss defeated during the phase, all of which will be shown to the user.
|
||||||
|
/// </summary>
|
||||||
|
public static void AddGamePhaseTag( string tagName, string icon, string tagGroup, uint priority )
|
||||||
|
{
|
||||||
|
Internal.AddGamePhaseTag( tagName, icon, tagGroup, priority );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to add a game phase attribute. Phase attributes represent generic text fields that can be updated throughout the duration of the phase. They are meant to be used for phase metadata
|
||||||
|
/// that is not part of a well defined set of options. For example, a KDA attribute that starts with the value "0/0/0" and updates as the phase progresses, or something like a played-entered character
|
||||||
|
/// name. Attributes can be set as many times as the game likes with SetGamePhaseAttribute, and only the last value will be shown to the user.
|
||||||
|
/// </summary>
|
||||||
|
public static void SetGamePhaseAttribute( string attributeGroup, string attributeValue, uint priority )
|
||||||
|
{
|
||||||
|
Internal.SetGamePhaseAttribute( attributeGroup, attributeValue, priority );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Changes the color of the timeline bar. See <see cref="TimelineGameMode"/> for how to use each value.
|
||||||
|
/// </summary>
|
||||||
|
public static void SetTimelineGameMode( TimelineGameMode gameMode )
|
||||||
|
{
|
||||||
|
Internal.SetTimelineGameMode( gameMode );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens the Steam overlay to the section of the timeline represented by the game phase.
|
||||||
|
/// </summary>
|
||||||
|
public static void OpenOverlayToGamePhase( string phaseId )
|
||||||
|
{
|
||||||
|
Internal.OpenOverlayToGamePhase( phaseId );
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens the Steam overlay to the section of the timeline represented by the timeline event. This event must be in the current game session, since <see cref="TimelineEventHandle"/> values are not
|
||||||
|
/// valid for future runs of the game.
|
||||||
|
/// </summary>
|
||||||
|
public static void OpenOverlayToTimelineEvent( TimelineEventHandle handle )
|
||||||
|
{
|
||||||
|
Internal.OpenOverlayToTimelineEvent( handle );
|
||||||
|
}
|
||||||
|
}
|
10
Facepunch.Steamworks/Structs/GamePhaseRecordingInfo.cs
Normal file
10
Facepunch.Steamworks/Structs/GamePhaseRecordingInfo.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Steamworks;
|
||||||
|
|
||||||
|
public struct GamePhaseRecordingInfo
|
||||||
|
{
|
||||||
|
public string PhaseId;
|
||||||
|
public ulong RecordingMs;
|
||||||
|
public ulong LongestClipMs;
|
||||||
|
public uint ClipCount;
|
||||||
|
public uint ScreenshotCount;
|
||||||
|
}
|
@ -64,6 +64,7 @@ public static string ConvertType( string type )
|
|||||||
type = type.Replace( "SteamNetConnectionRealTimeLaneStatus_t", "ConnectionLaneStatus" );
|
type = type.Replace( "SteamNetConnectionRealTimeLaneStatus_t", "ConnectionLaneStatus" );
|
||||||
type = type.Replace( "SteamInputGlyphSize", "GlyphSize" );
|
type = type.Replace( "SteamInputGlyphSize", "GlyphSize" );
|
||||||
type = type.Replace( "FloatingGamepadTextInputMode", "TextInputMode" );
|
type = type.Replace( "FloatingGamepadTextInputMode", "TextInputMode" );
|
||||||
|
type = type.Replace( "TimelineEventHandle_t", "TimelineEventHandle" );
|
||||||
|
|
||||||
type = type.Replace( "::", "." );
|
type = type.Replace( "::", "." );
|
||||||
|
|
||||||
@ -152,6 +153,9 @@ internal static string Expose( string name )
|
|||||||
if ( name == "TextFilteringContext" ) return "public";
|
if ( name == "TextFilteringContext" ) return "public";
|
||||||
if ( name == "GlyphSize" ) return "public";
|
if ( name == "GlyphSize" ) return "public";
|
||||||
if ( name == "TextInputMode" ) return "public";
|
if ( name == "TextInputMode" ) return "public";
|
||||||
|
if ( name == "TimelineGameMode" ) return "public";
|
||||||
|
if ( name == "TimelineEventClipPriority" ) return "public";
|
||||||
|
if ( name == "TimelineEventHandle" ) return "public";
|
||||||
|
|
||||||
return "internal";
|
return "internal";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user