таблица

Дядя Энрик.

Активный
Автор темы
319
75
Версия MoonLoader
Другое
сделайте пожалуйста рабочую таблицу color, лично у меня ничего не выходит <3
Lua:
function imgui.ColoredRadioButtonBool(label, state, color)
    local DL, p, size = imgui.GetWindowDrawList(), imgui.GetCursorScreenPos(), imgui.ImVec2(20, 20)
    local button = imgui.InvisibleButton('##radio_'..label, size)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2, imgui.GetColorU32Vec4(imgui.ImVec4(color.x, color.y, color.z, 0.5)), 100)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2.7, imgui.GetColorU32Vec4(color), 100)
    if state then
        DL:AddCircle(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2 + 1, 0xCCffffff, 100, 2)
    end
    return button
end
 
Решение
сделайте пожалуйста рабочую таблицу color, лично у меня ничего не выходит <3
Lua:
function imgui.ColoredRadioButtonBool(label, state, color)
    local DL, p, size = imgui.GetWindowDrawList(), imgui.GetCursorScreenPos(), imgui.ImVec2(20, 20)
    local button = imgui.InvisibleButton('##radio_'..label, size)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2, imgui.GetColorU32Vec4(imgui.ImVec4(color.x, color.y, color.z, 0.5)), 100)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2.7, imgui.GetColorU32Vec4(color), 100)
    if state then
        DL:AddCircle(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2 + 1, 0xCCffffff, 100, 2)
    end
    return button...

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,214
сделайте пожалуйста рабочую таблицу color, лично у меня ничего не выходит <3
Lua:
function imgui.ColoredRadioButtonBool(label, state, color)
    local DL, p, size = imgui.GetWindowDrawList(), imgui.GetCursorScreenPos(), imgui.ImVec2(20, 20)
    local button = imgui.InvisibleButton('##radio_'..label, size)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2, imgui.GetColorU32Vec4(imgui.ImVec4(color.x, color.y, color.z, 0.5)), 100)
    DL:AddCircleFilled(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2.7, imgui.GetColorU32Vec4(color), 100)
    if state then
        DL:AddCircle(imgui.ImVec2(p.x + size.x / 2, p.y + size.y / 2), size.x / 2 + 1, 0xCCffffff, 100, 2)
    end
    return button
end
какую таблицу, color это ImVec4
Lua:
local selected = 'White'
if imgui.ColoredRadioButtonBool(u8'Белый', selected == 'While', imgui.ImVec4(1, 1, 1, 1)) then
    selected = 'White'
end
if imgui.ColoredRadioButtonBool(u8'Красный', selected == 'Red', imgui.ImVec4(1, 0, 0, 1)) then
    selected = 'Red'
end
 
  • Нравится
Реакции: Lance_Sterling

Дядя Энрик.

Активный
Автор темы
319
75
какую таблицу, color это ImVec4
Lua:
local selected = 'White'
if imgui.ColoredRadioButtonBool(u8'Белый', selected == 'While', imgui.ImVec4(1, 1, 1, 1)) then
    selected = 'White'
end
if imgui.ColoredRadioButtonBool(u8'Красный', selected == 'Red', imgui.ImVec4(1, 0, 0, 1)) then
    selected = 'Red'
end
о, ну так работает
а как это запихать сюда?
Lua:
            if imgui.ColoredRadioButtonBool(u8"##тема"..i, config.settings.theme == i and false or true) then
                config.settings.theme = i
                inicfg.save(config, example)
                SwitchTheStyle(config.settings.theme)
            end
1683538916348.png
1683539075164.png


Сделал. Спасибо
 
Последнее редактирование: