mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Implement proper font handling
This commit is contained in:
@@ -620,6 +620,13 @@ void Settings::update(const Settings &other)
|
||||
}
|
||||
|
||||
|
||||
void Settings::registerChangedCallback(std::string name,
|
||||
setting_changed_callback cbf)
|
||||
{
|
||||
m_callbacks[name].push_back(cbf);
|
||||
}
|
||||
|
||||
|
||||
inline bool Settings::parseConfigObject(std::istream &is,
|
||||
std::string &name, std::string &value)
|
||||
{
|
||||
@@ -701,3 +708,20 @@ void Settings::clearNoLock()
|
||||
m_defaults.clear();
|
||||
}
|
||||
|
||||
void Settings::doCallbacks(const std::string name)
|
||||
{
|
||||
std::vector<setting_changed_callback> tempvector;
|
||||
{
|
||||
JMutexAutoLock lock(m_mutex);
|
||||
if (m_callbacks.find(name) != m_callbacks.end())
|
||||
{
|
||||
tempvector = m_callbacks[name];
|
||||
}
|
||||
}
|
||||
|
||||
for (std::vector<setting_changed_callback>::iterator iter = tempvector.begin();
|
||||
iter != tempvector.end(); iter ++)
|
||||
{
|
||||
(*iter)(name);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user