aboutsummaryrefslogtreecommitdiff
path: root/po/kn
Commit message (Expand)AuthorAge
* Update translationsupdatepo.sh2022-01-25
* Update translation filesupdatepo.sh2021-11-27
* Update translation filesupdatepo.sh2021-06-16
* Update translation filesupdatepo.sh2021-02-23
* Update translation filesupdatepo.sh2021-01-30
* Translated using Weblate (Kannada)Tejaswi Hegde2021-01-30
* Update translation filesupdatepo.sh2020-06-13
* Update translation filesupdatepo.sh2020-04-03
* Update translation sourcesrubenwardy2020-01-24
* Translated using Weblate (Kannada)Krock2020-01-24
* Update translation stringsupdatepo.sh2019-10-12
* Update from Weblate (hacky)Translators2019-10-12
* Update translation stringsupdatepo.sh2019-09-09
* Run updatepo.shTranslations2019-02-24
* Update minetest.conf.example, settings strings and locale files (#8230)Wuzzy2019-02-14
* Run updatepo.shTranslation2019-02-14
* Cleanup translation filesLoïc Blot2019-01-28
* Update translationsTranslations2019-01-27
/span> #include "threading/mutex_auto_lock.h" #include "util/string.h" std::string QuicktuneValue::getString() { switch(type){ case QVT_NONE: return "(none)"; case QVT_FLOAT: return ftos(value_QVT_FLOAT.current); } return "<invalid type>"; } void QuicktuneValue::relativeAdd(float amount) { switch(type){ case QVT_NONE: break; case QVT_FLOAT: value_QVT_FLOAT.current += amount * (value_QVT_FLOAT.max - value_QVT_FLOAT.min); if(value_QVT_FLOAT.current > value_QVT_FLOAT.max) value_QVT_FLOAT.current = value_QVT_FLOAT.max; if(value_QVT_FLOAT.current < value_QVT_FLOAT.min) value_QVT_FLOAT.current = value_QVT_FLOAT.min; break; } } static std::map<std::string, QuicktuneValue> g_values; static std::vector<std::string> g_names; std::mutex *g_mutex = NULL; static void makeMutex() { if(!g_mutex){ g_mutex = new std::mutex(); } } std::vector<std::string> getQuicktuneNames() { return g_names; } QuicktuneValue getQuicktuneValue(const std::string &name) { makeMutex(); MutexAutoLock lock(*g_mutex); std::map<std::string, QuicktuneValue>::iterator i = g_values.find(name); if(i == g_values.end()){ QuicktuneValue val; val.type = QVT_NONE; return val; } return i->second; } void setQuicktuneValue(const std::string &name, const QuicktuneValue &val) { makeMutex(); MutexAutoLock lock(*g_mutex); g_values[name] = val; g_values[name].modified = true; } void updateQuicktuneValue(const std::string &name, QuicktuneValue &val) { makeMutex(); MutexAutoLock lock(*g_mutex); std::map<std::string, QuicktuneValue>::iterator i = g_values.find(name); if(i == g_values.end()){ g_values[name] = val; g_names.push_back(name); return; } QuicktuneValue &ref = i->second; if(ref.modified) val = ref; else{ ref = val; ref.modified = false; } }