@@ -178,17 +178,25 @@ def Init():
178178# Steam.cdll.UpdateLeaderboardHandle.restype = None
179179# Steam.cdll.GetLeadboardHandle.restype = c_uint64
180180# Steam.cdll.GetLeaderboardEntries.restype = None
181- # Set restype for Utilities functions
181+ # Set restype for Utils functions
182+ Steam .cdll .OverlayNeedsPresent .restype = bool
183+ Steam .cdll .GetAppID .restype = int
182184 Steam .cdll .GetCurrentBatteryPower .restype = int
185+ Steam .cdll .GetIPCCallCount .restype = c_uint32
183186 Steam .cdll .GetIPCountry .restype = c_char_p
184187 Steam .cdll .GetSecondsSinceAppActive .restype = int
185188 Steam .cdll .GetSecondsSinceComputerActive .restype = int
186189 Steam .cdll .GetServerRealTime .restype = int
190+ Steam .cdll .GetSteamUILanguage .restype = c_char_p
187191 Steam .cdll .IsOverlayEnabled .restype = bool
192+ Steam .cdll .IsSteamInBigPictureMode .restype = bool
188193 Steam .cdll .IsSteamRunningInVR .restype = bool
189- Steam .cdll .GetSteamUILanguage .restype = c_char_p
190- Steam .cdll .GetAppID .restype = int
194+ Steam .cdll .IsVRHeadsetStreamingEnabled .restype = bool
195+ Steam .cdll .SetOverlayNotificationInset .restype = None
191196 Steam .cdll .SetOverlayNotificationPosition .restype = None
197+ Steam .cdll .SetVRHeadsetStreamingEnabled .restype = None
198+ Steam .cdll .ShowGamepadTextInput .restype = bool
199+ Steam .cdll .StartVRDashboard .restype = None
192200 # Set argtypes and restype for Workshop functions
193201 Steam .cdll .Workshop_StartItemUpdate .restype = c_uint64
194202 Steam .cdll .Workshop_SetItemTitle .restype = bool
@@ -618,79 +626,128 @@ def FindLeaderboard(name, callback = None):
618626 else :
619627 return False
620628#------------------------------------------------
621- # Class for Steam Utilities
629+ # Class for Steam Utils
622630#------------------------------------------------
623- class SteamUtilities :
624- # Get the amount of battery power, clearly for laptops
631+ class SteamUtils :
632+ # Checks if the Overlay needs a present. Only required if using event driven render updates.
633+ @staticmethod
634+ def OverlayNeedsPresent ():
635+ if Steam .IsSteamLoaded ():
636+ return Steam .cdll .OverlayNeedsPresent ()
637+ else :
638+ return False
639+ # Get the Steam ID of the running application/game.
640+ @staticmethod
641+ def GetAppID ():
642+ if Steam .IsSteamLoaded ():
643+ return Steam .cdll .GetAppID ()
644+ else :
645+ return 0
646+ # Get the amount of battery power, clearly for laptops.
625647 @staticmethod
626648 def GetCurrentBatteryPower ():
627- if Steam .isSteamLoaded ():
649+ if Steam .IsSteamLoaded ():
628650 return Steam .cdll .GetCurrentBatteryPower ()
629651 else :
630652 return 0
631- # Get the user's country by IP
653+ # Returns the number of IPC calls made since the last time this function was called.
654+ @staticmethod
655+ def GetIPCCallCount ():
656+ if Steam .IsSteamLoaded ():
657+ return Steam .cdll .GetIPCCallCount ()
658+ else :
659+ return 0
660+ # Get the user's country by IP.
632661 @staticmethod
633662 def GetIPCountry ():
634- if Steam .isSteamLoaded ():
663+ if Steam .IsSteamLoaded ():
635664 return Steam .cdll .GetIPCountry ()
636665 else :
637- return "None "
638- # Returns seconds since application/game was started
666+ return ""
667+ # Return amount of time, in seconds, user has spent in this session.
639668 @staticmethod
640669 def GetSecondsSinceAppActive ():
641- if Steam .isSteamLoaded ():
670+ if Steam .IsSteamLoaded ():
642671 return Steam .cdll .GetSecondsSinceAppActive ()
643672 else :
644673 return 0
645- # Return seconds since computer was started
674+ # Returns the number of seconds since the user last moved the mouse.
646675 @staticmethod
647676 def GetSecondsSinceComputerActive ():
648- if Steam .isSteamLoaded ():
677+ if Steam .IsSteamLoaded ():
649678 return Steam .cdll .GetSecondsSinceComputerActive ()
650679 else :
651680 return 0
652- # Get the actual time
681+ # Get the actual time.
653682 @staticmethod
654683 def GetServerRealTime ():
655- if Steam .isSteamLoaded ():
684+ if Steam .IsSteamLoaded ():
656685 return Steam .cdll .GetServerRealTime ()
657686 else :
658687 return 0
659- # Returns true/false if Steam overlay is enabled
688+ # Get the Steam user interface language.
689+ @staticmethod
690+ def GetSteamUILanguage ():
691+ if Steam .IsSteamLoaded ():
692+ return Steam .cdll .GetSteamUILanguage ()
693+ else :
694+ return ""
695+ # Returns true/false if Steam overlay is enabled.
660696 @staticmethod
661697 def IsOverlayEnabled ():
662- if Steam .isSteamLoaded ():
698+ if Steam .IsSteamLoaded ():
663699 return Steam .cdll .IsOverlayEnabled ()
664700 else :
665701 return False
666- # Is Steam running in VR?
702+ # Returns true if Steam & the Steam Overlay are running in Big Picture mode.
667703 @staticmethod
668- def IsSteamRunningInVR ():
669- if Steam .isSteamLoaded ():
670- return Steam .cdll .IsSteamRunningInVR ()
704+ def IsSteamInBigPictureMode ():
705+ if Steam .IsSteamLoaded ():
706+ return Steam .cdll .IsSteamInBigPictureMode ()
671707 else :
672708 return False
673- # Get the Steam user interface language
709+ # Is Steam running in VR?
674710 @staticmethod
675- def GetSteamUILanguage ():
676- if Steam .isSteamLoaded ():
677- return Steam .cdll .GetSteamUILanguage ()
711+ def IsVRHeadsetStreamingEnabled ():
712+ if Steam .IsSteamLoaded ():
713+ return Steam .cdll .IsVRHeadsetStreamingEnabled ()
678714 else :
679- return "None"
680- # Get the Steam ID of the running application/game
715+ return False
716+ # Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition.
681717 @staticmethod
682- def GetAppID ( ):
683- if Steam .isSteamLoaded ():
684- return Steam .cdll .GetAppID ( )
718+ def SetOverlayNotificationInset ( horizontal , vertical ):
719+ if Steam .IsSteamLoaded ():
720+ return Steam .cdll .SetOverlayNotificationInset ( horizontal , vertical )
685721 else :
686- return 0
687- # Set the position where overlay shows notifications
722+ return
723+ # Set the position where overlay shows notifications.
688724 @staticmethod
689725 def SetOverlayNotificationPosition (pos ):
690- if Steam .isSteamLoaded ():
726+ if Steam .IsSteamLoaded ():
691727 return Steam .cdll .SetOverlayNotificationPosition (pos )
728+ else :
729+ return
730+ # Set whether the HMD content will be streamed via Steam In-Home Streaming.
731+ @staticmethod
732+ def SetVRHeadsetStreamingEnabled (enabled ):
733+ if Steam .IsSteamLoaded ():
734+ return Steam .cdll .SetVRHeadsetStreamingEnabled (enabled )
735+ else :
736+ return
737+ # Activates the Big Picture text input dialog which only supports gamepad input.
738+ @staticmethod
739+ def ShowGamepadTextInput (inputMode , lineInputMode , description , maxText , presetText ):
740+ if Steam .IsSteamLoaded ():
741+ return Steam .cdll .ShowGamepadTextInput ()
692742 else :
693743 return False
744+ # Ask SteamUI to create and render its OpenVR dashboard.
745+ @staticmethod
746+ def StartVRDashboard ():
747+ if Steam .IsSteamLoaded ():
748+ return Steam .cdll .StartVRDashboard ()
749+ else :
750+ return
694751#------------------------------------------------
695752# Class for Steam Workshop
696753#------------------------------------------------
0 commit comments