- added another steam achievement for winning first online game
This commit is contained in:
parent
d78f28983b
commit
2988521701
|
@ -5177,6 +5177,7 @@ void saveStatsToSteam(Game* game, Stats& endStats) {
|
|||
if (steamInstance != NULL) {
|
||||
printf("\nSTEAM detected, writing out end game stats for player!\n");
|
||||
|
||||
// Write out stats here
|
||||
if (NetworkManager::getInstance().isNetworkGame()) {
|
||||
//printf("\nSTEAM Refresh Stats!\n");
|
||||
steamInstance->requestRefreshStats();
|
||||
|
@ -5228,6 +5229,7 @@ void saveStatsToSteam(Game* game, Stats& endStats) {
|
|||
}
|
||||
}
|
||||
|
||||
// Write out achievements here
|
||||
for (int factionIndex = 0;
|
||||
factionIndex < game->getWorld()->getFactionCount(); ++factionIndex) {
|
||||
if (factionIndex == game->getWorld()->getThisFactionIndex()) {
|
||||
|
@ -5236,6 +5238,11 @@ void saveStatsToSteam(Game* game, Stats& endStats) {
|
|||
if(steamInstance->isUnlocked(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME).c_str()) == false) {
|
||||
steamInstance->unlock(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME).c_str());
|
||||
}
|
||||
if (NetworkManager::getInstance().isNetworkGame()) {
|
||||
if(steamInstance->isUnlocked(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME_ONLINE).c_str()) == false) {
|
||||
steamInstance->unlock(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME_ONLINE).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,14 @@ inline EnumParser<SteamStatName>::EnumParser() {
|
|||
}
|
||||
|
||||
enum SteamAchievementName {
|
||||
ACH_WIN_ONE_GAME
|
||||
ACH_WIN_ONE_GAME,
|
||||
ACH_WIN_ONE_GAME_ONLINE
|
||||
};
|
||||
|
||||
template <>
|
||||
inline EnumParser<SteamAchievementName>::EnumParser() {
|
||||
enumMap["ACH_WIN_ONE_GAME"] = ACH_WIN_ONE_GAME;
|
||||
enumMap["ACH_WIN_ONE_GAME"] = ACH_WIN_ONE_GAME;
|
||||
enumMap["ACH_WIN_ONE_GAME_ONLINE"] = ACH_WIN_ONE_GAME_ONLINE;
|
||||
}
|
||||
|
||||
class Steam
|
||||
|
|
Loading…
Reference in New Issue