mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
Fix content names for layouts inserted with :add()
This commit is contained in:
parent
096255534a
commit
aea2c019de
@ -44,11 +44,10 @@ namespace LuaUi
|
|||||||
|
|
||||||
void Content::insert(size_t index, const sol::table& table)
|
void Content::insert(size_t index, const sol::table& table)
|
||||||
{
|
{
|
||||||
size_t size = mOrdered.size();
|
if (mOrdered.size() < index)
|
||||||
if (size < index)
|
|
||||||
throw std::logic_error("Can't have gaps in UI Content.");
|
throw std::logic_error("Can't have gaps in UI Content.");
|
||||||
mOrdered.insert(mOrdered.begin() + index, table);
|
mOrdered.insert(mOrdered.begin() + index, table);
|
||||||
for (size_t i = index; i < size; ++i)
|
for (size_t i = index; i < mOrdered.size(); ++i)
|
||||||
{
|
{
|
||||||
sol::optional<std::string> name = mOrdered[i]["name"];
|
sol::optional<std::string> name = mOrdered[i]["name"];
|
||||||
if (name.has_value())
|
if (name.has_value())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user