Allow changing inventory_items_animations from the main menu

If you try and change the setting from in-game you'll have to log out 
and back in for it to update.
master
luk3yx 2021-12-30 12:30:30 +13:00
parent 8053b775e4
commit e7c44f2796
3 changed files with 4 additions and 2 deletions

View File

@ -135,6 +135,7 @@ Client::Client(
m_cache_save_interval = g_settings->getU16("server_map_save_interval");
m_round_screen = g_settings->getU16("round_screen");
m_hud_scaling = g_settings->getFloat("hud_scaling");
m_inv_item_anim_enabled = g_settings->getBool("inventory_items_animations");
}
void Client::loadMods()

View File

@ -430,6 +430,7 @@ public:
const u16 getRoundScreen() { return m_round_screen; }
const f32 getHudScaling() { return m_hud_scaling; }
const bool getInvItemAnimEnabled() { return m_inv_item_anim_enabled; }
private:
void loadMods();
@ -593,4 +594,5 @@ private:
u16 m_round_screen;
f32 m_hud_scaling;
bool m_inv_item_anim_enabled;
};

View File

@ -948,8 +948,7 @@ void drawItemStack(
return;
}
const static thread_local bool enable_animations =
g_settings->getBool("inventory_items_animations");
const bool enable_animations = client->getInvItemAnimEnabled();
const ItemDefinition &def = item.getDefinition(client->idef());