Fix instant help received not being remembered

This commit is contained in:
2015-10-06 19:17:17 -04:00
parent 168e4c5e52
commit 5cab4fdb9f
2 changed files with 8 additions and 0 deletions

View File

@@ -838,7 +838,10 @@ static void give_help(short help1,short help2,cDialog* parent) {
}
if(!get_bool_pref("ShowInstantHelp", true) && !help_forced)
return;
if(get_iarray_pref_contains("ReceivedHelp", help1))
return;
append_iarray_pref("ReceivedHelp", help1);
append_iarray_pref("ReceivedHelp", help2);
str1 = get_str("help",help1);
if(help2 > 0)
str2 = get_str("help",help2);

View File

@@ -21,6 +21,11 @@ int get_int_pref(std::string keypath, int fallback = 0);
void append_iarray_pref(std::string keypath, int value);
std::vector<int> get_iarray_pref(std::string keypath);
inline bool get_iarray_pref_contains(std::string keypath, int value) {
const std::vector<int>& val = get_iarray_pref(keypath);
return std::find(val.begin(), val.end(), value) != val.end();
}
void clear_pref(std::string keypath);
bool sync_prefs();