mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +03:00
Changed AddScore to reflect the real functionality
This commit is contained in:
parent
ca7107c8d3
commit
5c320bab12
@ -95,16 +95,16 @@ namespace Facepunch.Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a score to this leaderboard.
|
/// Add a score to this leaderboard.
|
||||||
/// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although
|
/// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although
|
||||||
/// they have no bearing on sorting at all.
|
/// they have no bearing on sorting at all
|
||||||
|
/// If onlyIfBeatsOldScore is true, the score will only be updated if it beats the existing score, else it will always
|
||||||
|
/// be updated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AddScore( bool replaceOldScore, bool onlyIfBeatsOldScore, int score, params int[] subscores )
|
public void AddScore( bool onlyIfBeatsOldScore, int score, params int[] subscores )
|
||||||
{
|
{
|
||||||
if ( !IsValid ) return;
|
if ( !IsValid ) return;
|
||||||
|
|
||||||
var flags = LeaderboardUploadScoreMethod.None;
|
var flags = LeaderboardUploadScoreMethod.ForceUpdate;
|
||||||
|
if ( onlyIfBeatsOldScore ) flags = LeaderboardUploadScoreMethod.KeepBest;
|
||||||
if ( replaceOldScore ) flags |= LeaderboardUploadScoreMethod.ForceUpdate;
|
|
||||||
if ( onlyIfBeatsOldScore ) flags |= LeaderboardUploadScoreMethod.KeepBest;
|
|
||||||
|
|
||||||
client.native.userstats.UploadLeaderboardScore( BoardId, flags, score, subscores, subscores.Length );
|
client.native.userstats.UploadLeaderboardScore( BoardId, flags, score, subscores, subscores.Length );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user