mirror of
https://github.com/glest/glest-source.git
synced 2025-08-25 17:20:43 +02:00
- added another steam achievement for winning first online game
This commit is contained in:
@@ -5177,6 +5177,7 @@ void saveStatsToSteam(Game* game, Stats& endStats) {
|
|||||||
if (steamInstance != NULL) {
|
if (steamInstance != NULL) {
|
||||||
printf("\nSTEAM detected, writing out end game stats for player!\n");
|
printf("\nSTEAM detected, writing out end game stats for player!\n");
|
||||||
|
|
||||||
|
// Write out stats here
|
||||||
if (NetworkManager::getInstance().isNetworkGame()) {
|
if (NetworkManager::getInstance().isNetworkGame()) {
|
||||||
//printf("\nSTEAM Refresh Stats!\n");
|
//printf("\nSTEAM Refresh Stats!\n");
|
||||||
steamInstance->requestRefreshStats();
|
steamInstance->requestRefreshStats();
|
||||||
@@ -5228,6 +5229,7 @@ void saveStatsToSteam(Game* game, Stats& endStats) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write out achievements here
|
||||||
for (int factionIndex = 0;
|
for (int factionIndex = 0;
|
||||||
factionIndex < game->getWorld()->getFactionCount(); ++factionIndex) {
|
factionIndex < game->getWorld()->getFactionCount(); ++factionIndex) {
|
||||||
if (factionIndex == game->getWorld()->getThisFactionIndex()) {
|
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) {
|
if(steamInstance->isUnlocked(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME).c_str()) == false) {
|
||||||
steamInstance->unlock(EnumParser<SteamAchievementName>::getString(ACH_WIN_ONE_GAME).c_str());
|
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 {
|
enum SteamAchievementName {
|
||||||
ACH_WIN_ONE_GAME
|
ACH_WIN_ONE_GAME,
|
||||||
|
ACH_WIN_ONE_GAME_ONLINE
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline EnumParser<SteamAchievementName>::EnumParser() {
|
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
|
class Steam
|
||||||
|
Reference in New Issue
Block a user