Class TCastleSteam
Unit
Declaration
type TCastleSteam = class(TObject)
Description
Integration with Steam. See Steam and Castle Game Engine documentation for usage. Create an instance of this class (passing to the constructor the Steam application id), observe properties like Enabled and UserStatsReceived, and call methods like SetAchievement to interact with Steam API.
Hierarchy
- TObject
- TCastleSteam
Overview
Methods
constructor Create(const AAppId: TAppId); |
|
destructor Destroy; override; |
|
procedure SetAchievement(const AchievementId: String); |
|
function GetAchievement(const AchievementId: String): Boolean; |
|
procedure ClearAchievement(const AchievementId: String); |
|
procedure ClearAllAchievements; |
|
procedure IndicateAchievementProgress(const AchievementId: String; const CurrentProgress, MaxProgress: UInt32); |
|
function Country: String; |
|
function OverlayEnabled: Boolean; |
|
function RunningInVR: Boolean; |
|
function RunningOnSteamDeck: Boolean; |
|
function BuildId: Integer; |
|
function DlcInstalled(const DlcAppID: TAppId): Boolean; |
|
function Language: String; |
Properties
property AppId: TAppId read FAppId; |
|
property Enabled: Boolean read FEnabled; |
|
property Achievements: TStrings read FAchievements; |
|
property UserStatsReceived: Boolean read FUserStatsReceived; |
|
property OnUserStatsReceived: TNotifyEvent
read FOnUserStatsReceived write FOnUserStatsReceived; |
Description
Methods
constructor Create(const AAppId: TAppId); |
|
Connect to Steam and initialize everything.
|
destructor Destroy; override; |
|
This item has no description. |
procedure SetAchievement(const AchievementId: String); |
|
Set achievement as "achieved", Steam will automatically show a small overlay indicating that the achievement is obtained. |
function GetAchievement(const AchievementId: String): Boolean; |
|
Is this achievement "achieved". |
procedure ClearAllAchievements; |
|
Clears all achievements from the connected user. See also
|
procedure IndicateAchievementProgress(const AchievementId: String; const CurrentProgress, MaxProgress: UInt32); |
|
Show Steam overlay "progress towards achievement" e.g. "Wins 33/100". Don't use this when achievement is already achieved. Doing so will only result in an error from Steam, visible as a warning in logs: "Failed to SteamAPI_ISteamUserStats_IndicateAchievementProgress". Calling this with CurrentProgress >= MaxProgress does not mark the achievement as achieved. It only shows the progress in the overlay. You still have to call SetAchievement to make it achieved. |
function Country: String; |
|
2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) e.g "US" or "UK". |
function RunningInVR: Boolean; |
|
Is Steam running in VR mode. |
function RunningOnSteamDeck: Boolean; |
|
Is currently running on the Steam Deck device. |
function BuildId: Integer; |
|
Build id of this app. |
function DlcInstalled(const DlcAppID: TAppId): Boolean; |
|
Checks if the user owns the DLC and if the DLC is installed. |
function Language: String; |
|
Current game language. |
Properties
property AppId: TAppId read FAppId; |
|
Steam application id, given when creating this. |
property Enabled: Boolean read FEnabled; |
|
Do we have Steam integration available. If This is the normal state of things when the game is run through Steam. It means that all features of this class work as they should. |
property Achievements: TStrings read FAchievements; |
|
Achievement names for this game (read-only). These are IDs of achievements, can be used in other calls like SetAchievement or GetAchievement. This field is initialized when UserStatsReceived becomes |
property OnUserStatsReceived: TNotifyEvent
read FOnUserStatsReceived write FOnUserStatsReceived; |
|
We have received user stats from Steam. Right before calling this event, UserStatsReceived changed to |
Generated by PasDoc 0.16.0-snapshot.