mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
[CSM] Add function to set minimap shape (#5569)
* [CSM] Add function to set minimap shape Also deprecates `toggle_shape`. * Oh fish, I messed that one up! * Fix Style * Sorry, I missed something I still had the `luamethod` call in there! * Add getters * Remove extra line * Remove useless variable Please review again @nerzhul . Thanks! * Satisfy nerzhul
This commit is contained in:
parent
6f641df8a5
commit
e80a83d1cb
6 changed files with 49 additions and 6 deletions
|
@ -272,6 +272,28 @@ void Minimap::toggleMinimapShape()
|
|||
m_minimap_update_thread->deferUpdate();
|
||||
}
|
||||
|
||||
void Minimap::setMinimapShape(MinimapShape shape)
|
||||
{
|
||||
MutexAutoLock lock(m_mutex);
|
||||
|
||||
if (shape == MINIMAP_SHAPE_SQUARE)
|
||||
data->minimap_shape_round = false;
|
||||
else if (shape == MINIMAP_SHAPE_ROUND)
|
||||
data->minimap_shape_round = true;
|
||||
|
||||
g_settings->setBool("minimap_shape_round", data->minimap_shape_round);
|
||||
m_minimap_update_thread->deferUpdate();
|
||||
}
|
||||
|
||||
MinimapShape Minimap::getMinimapShape()
|
||||
{
|
||||
if (data->minimap_shape_round) {
|
||||
return MINIMAP_SHAPE_ROUND;
|
||||
} else {
|
||||
return MINIMAP_SHAPE_SQUARE;
|
||||
}
|
||||
}
|
||||
|
||||
void Minimap::setMinimapMode(MinimapMode mode)
|
||||
{
|
||||
static const MinimapModeDef modedefs[MINIMAP_MODE_COUNT] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue