mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 11:15:34 +08:00
updateing stat check for (progress - last_notified) >= min_diff
setting min diff for float to 0.1 instead of 1 adding last_notified_progress into achievement_stat_trigger
This commit is contained in:
parent
623ba9025b
commit
58ae7e7b0d
@ -260,7 +260,7 @@ public:
|
||||
bool save_only_higher_stat_achievement_progress = true;
|
||||
// Minimum value to indicate progress being made for the user.
|
||||
int stat_int_min_diff_progress = 1;
|
||||
float stat_float_min_diff_progress = 1;
|
||||
float stat_float_min_diff_progress = 0.1;
|
||||
// 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
|
||||
// or when the app calls `SteamAPI_RunCallbacks()`
|
||||
|
@ -49,6 +49,7 @@ struct achievement_trigger {
|
||||
std::string value_operation{};
|
||||
std::string min_value{}; // min progress
|
||||
std::string max_value{}; // max progress
|
||||
std::string last_notified_progress{};
|
||||
|
||||
bool should_unlock_ach(float stat) const;
|
||||
bool should_unlock_ach(int32 stat) const;
|
||||
|
@ -72,6 +72,7 @@ Steam_User_Stats::Steam_User_Stats(Settings *settings, class Networking *network
|
||||
std::string stat_name = common_helpers::ascii_to_lowercase(static_cast<std::string const&>(it["progress"]["value"]["operand1"]));
|
||||
trig.min_value = static_cast<std::string const&>(it["progress"]["min_val"]);
|
||||
trig.max_value = static_cast<std::string const&>(it["progress"]["max_val"]);
|
||||
trig.last_notified_progress = static_cast<std::string const&>(it["progress"]["min_val"]);
|
||||
achievement_stat_trigger[stat_name].push_back(trig);
|
||||
} catch(...) {}
|
||||
|
||||
|
@ -127,9 +127,11 @@ Steam_User_Stats::InternalSetResult<int32> Steam_User_Stats::set_stat_internal(
|
||||
}
|
||||
} catch(...){}
|
||||
}
|
||||
|
||||
if (indicate_progress && (stats_data->second.default_value_int + settings->stat_int_min_diff_progress) >= nData) {
|
||||
// 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:stoi(t.last_notified_progress)) >= settings->stat_int_min_diff_progress) {
|
||||
IndicateAchievementProgress(t.name.c_str(), nData, std::stoi(t.max_value));
|
||||
t.last_notified_progress = std::to_string(nData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -202,8 +204,9 @@ Steam_User_Stats::InternalSetResult<std::pair<GameServerStats_Messages::StatInfo
|
||||
} catch(...){}
|
||||
}
|
||||
|
||||
if (indicate_progress && (stats_data->second.default_value_float + settings->stat_float_min_diff_progress) >= fData) {
|
||||
if (indicate_progress && ((nData - std:stof(t.last_notified_progress)) >= settings->stat_float_min_diff_progress) {
|
||||
IndicateAchievementProgress(t.name.c_str(), (uint32)fData, (uint32)std::stof(t.max_value));
|
||||
t.last_notified_progress = std::to_string(nData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,8 +74,8 @@ paginated_achievements_icons=10
|
||||
# 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=1
|
||||
stat_float_min_diff_progress=1
|
||||
# default=0.1
|
||||
stat_float_min_diff_progress=0.1
|
||||
|
||||
[main::connectivity]
|
||||
# 1=prevent hooking OS networking APIs and allow any external requests
|
||||
|
Loading…
Reference in New Issue
Block a user