Помощь в mimgui и таблицей

_Dino_

Активный
Автор темы
135
51
Версия MoonLoader
.026-beta
Приветствую, можете подсказать/навести пример как сделать в интерфейсе mimgui.BeginPopupModal вот такую вот штучку
1692346771091.png

Таблица:
local MyItems = {
    {selected = settings.other.id["2"], id = 2, name = "Кнопка 1", category = "основное"},
    {selected = settings.other.id["3"], id = 3, name = "Кнопка 2", category = "основное"},
    {selected = settings.other.id["6"], id = 6, name = "Кнопка 3", category = "чЭты"},
    {selected = settings.other.id["14"], id = 14, name = "Кнопка 4", category = "бАты"},
    {selected = settings.other.id["84"], id = 84, name = "Кнопка 5", category = "бАты"},
    {selected = settings.other.id["105"], id = 105, name = "Кнопка 6", category = "чЭты"}
    -- И там дальше, их примерно 20 штук
}
 

why ega

РП игрок
Модератор
2,541
2,233
Приветствую, можете подсказать/навести пример как сделать в интерфейсе mimgui.BeginPopupModal вот такую вот штучку
Посмотреть вложение 212232
Таблица:
local
[CODE=lua]imgui.BeginChild("test")
for i, element in ipairs(MyItems) do
    if imgui.Button(element.name) then
        print(("Нажали на кнопку, номер %s"):format(i))
    end
end
imgui.EndChild
= {
{selected = settings.other.id["2"], id = 2, name = "Кнопка 1", category = "основное"},
{selected = settings.other.id["3"], id = 3, name = "Кнопка 2", category = "основное"},
{selected = settings.other.id["6"], id = 6, name = "Кнопка 3", category = "чЭты"},
{selected = settings.other.id["14"], id = 14, name = "Кнопка 4", category = "бАты"},
{selected = settings.other.id["84"], id = 84, name = "Кнопка 5", category = "бАты"},
{selected = settings.other.id["105"], id = 105, name = "Кнопка 6", category = "чЭты"}
-- И там дальше, их примерно 20 штук
}[/CODE]

Lua:
imgui.BeginChild("test")
for i, element in ipairs(MyItems) do
    if imgui.Button(element.name) then
        print(("Нажали на кнопку, номер %s"):format(i))
    end
end
imgui.EndChild()
 
Последнее редактирование:
  • Нравится
Реакции: MLycoris