mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 11:15:34 +08:00
update stats to a % system
This commit is contained in:
parent
58ae7e7b0d
commit
70ab93c62f
@ -259,7 +259,6 @@ public:
|
|||||||
// the stat itself is always saved regardless of that flag, only affects the achievement progress
|
// the stat itself is always saved regardless of that flag, only affects the achievement progress
|
||||||
bool save_only_higher_stat_achievement_progress = true;
|
bool save_only_higher_stat_achievement_progress = true;
|
||||||
// Minimum value to indicate progress being made for the user.
|
// Minimum value to indicate progress being made for the user.
|
||||||
int stat_int_min_diff_progress = 1;
|
|
||||||
float stat_float_min_diff_progress = 0.1;
|
float stat_float_min_diff_progress = 0.1;
|
||||||
// the emulator loads the achievements icons is memory mainly for `ISteamUserStats::GetAchievementIcon()`
|
// the emulator loads the achievements icons is memory mainly for `ISteamUserStats::GetAchievementIcon()`
|
||||||
// this defines how many icons to load each iteration when the periodic callback in `Steam_User_Stats` is triggered
|
// this defines how many icons to load each iteration when the periodic callback in `Steam_User_Stats` is triggered
|
||||||
|
@ -1450,19 +1450,11 @@ static void parse_stats_features(class Settings *settings_client, class Settings
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
long val_client_i = ini.GetLongValue("main::stats", "stat_int_min_diff_progress", settings_client->stat_int_min_diff_progress);
|
double val_client_d = ini.GetDoubleValue("main::stats", "stat_min_diff_progress", settings_client->stat_min_diff_progress);
|
||||||
settings_client->stat_int_min_diff_progress = static_cast<int>(val_client_i);
|
settings_client->stat_min_diff_progress = static_cast<float>(val_client_d);
|
||||||
|
|
||||||
long val_server_i = ini.GetLongValue("main::stats", "stat_int_min_diff_progress", settings_server->stat_int_min_diff_progress);
|
double val_server_d = ini.GetDoubleValue("main::stats", "stat_min_diff_progress", settings_server->stat_min_diff_progress);
|
||||||
settings_server->stat_int_min_diff_progress = static_cast<int>(val_server_i);
|
settings_server->stat_min_diff_progress = static_cast<float>(val_server_d);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
double val_client_d = ini.GetDoubleValue("main::stats", "stat_float_min_diff_progress", settings_client->stat_float_min_diff_progress);
|
|
||||||
settings_client->stat_float_min_diff_progress = static_cast<float>(val_client_d);
|
|
||||||
|
|
||||||
double val_server_d = ini.GetDoubleValue("main::stats", "stat_float_min_diff_progress", settings_server->stat_float_min_diff_progress);
|
|
||||||
settings_server->stat_float_min_diff_progress = static_cast<float>(val_server_d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -127,9 +127,9 @@ Steam_User_Stats::InternalSetResult<int32> Steam_User_Stats::set_stat_internal(
|
|||||||
}
|
}
|
||||||
} catch(...){}
|
} catch(...){}
|
||||||
}
|
}
|
||||||
// Alternative progress based on %:
|
|
||||||
// ((nData - std:stoi(t.last_notified_progress)) / std::stoi(t.max_value)) >= settings->stat_int_min_diff_progress_presentage
|
if (indicate_progress && ((nData - std::stof(t.last_notified_progress) / std::stof(t.max_value) >= settings->stat_min_diff_progress)))
|
||||||
if (indicate_progress && (nData - std:stoi(t.last_notified_progress)) >= settings->stat_int_min_diff_progress) {
|
{
|
||||||
IndicateAchievementProgress(t.name.c_str(), nData, std::stoi(t.max_value));
|
IndicateAchievementProgress(t.name.c_str(), nData, std::stoi(t.max_value));
|
||||||
t.last_notified_progress = std::to_string(nData);
|
t.last_notified_progress = std::to_string(nData);
|
||||||
}
|
}
|
||||||
@ -204,9 +204,10 @@ Steam_User_Stats::InternalSetResult<std::pair<GameServerStats_Messages::StatInfo
|
|||||||
} catch(...){}
|
} catch(...){}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indicate_progress && ((nData - std:stof(t.last_notified_progress)) >= settings->stat_float_min_diff_progress) {
|
if (indicate_progress && ((fData - std::stof(t.last_notified_progress) / std::stof(t.max_value) >= settings->stat_min_diff_progress)))
|
||||||
|
{
|
||||||
IndicateAchievementProgress(t.name.c_str(), (uint32)fData, (uint32)std::stof(t.max_value));
|
IndicateAchievementProgress(t.name.c_str(), (uint32)fData, (uint32)std::stof(t.max_value));
|
||||||
t.last_notified_progress = std::to_string(nData);
|
t.last_notified_progress = std::to_string(fData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,10 +72,8 @@ paginated_achievements_icons=10
|
|||||||
|
|
||||||
# Minimum value to indicate progress being made for the user.
|
# Minimum value to indicate progress being made for the user.
|
||||||
# Usually good for achievement that use stat values and contains high number (ie: kill 200 cops)
|
# Usually good for achievement that use stat values and contains high number (ie: kill 200 cops)
|
||||||
# default=1
|
|
||||||
stat_int_min_diff_progress=1
|
|
||||||
# default=0.1
|
# default=0.1
|
||||||
stat_float_min_diff_progress=0.1
|
stat_min_diff_progress=0.1
|
||||||
|
|
||||||
[main::connectivity]
|
[main::connectivity]
|
||||||
# 1=prevent hooking OS networking APIs and allow any external requests
|
# 1=prevent hooking OS networking APIs and allow any external requests
|
||||||
|
Loading…
Reference in New Issue
Block a user