-- вне окна
local buttons = {
{name='Настройки',text='Пользователь, вид\nскрипта, цены',icon=fa.ICON_FA_LIGHT_COG,y_hovered=10,timer=0},
{name='Дополнительно',text='Правила, заметки,\nотыгровки, чекер',icon=fa.ICON_FA_FOLDER,y_hovered=10,timer=0},
{name='Информация',text='Обновления, автор,\nо скрипте',icon=fa.ICON_FA_LIGHT_INFO_CIRCLE,y_hovered=10,timer=0},
}
-- в окне
if mainwindow[0] == 0 then
imgui.PushStyleVarFloat(imgui.StyleVar.Alpha, ImSaturate(1 / (alphaAnimTime / (clock() - alpha[0]))))
imgui.SetCursorPos(imgui.ImVec2(25,50))
imgui.BeginGroup()
for k,v in pairs(buttons) do
imgui.BeginGroup()
local p = imgui.GetCursorScreenPos()
if imgui.InvisibleButton(v.name, imgui.ImVec2(150,130)) then
mainwindow[0] = k
alpha[0] = clock()
end
if v.timer == 0 then
v.timer = imgui.GetTime()
end
if imgui.IsItemHovered() then
v.y_hovered = ceil(v.y_hovered) > 0 and 10 - ((imgui.GetTime() - v.timer) * 100) or 0
v.timer = ceil(v.y_hovered) > 0 and v.timer or 0
imgui.SetMouseCursor(imgui.MouseCursor.Hand)
else
v.y_hovered = ceil(v.y_hovered) < 10 and (imgui.GetTime() - v.timer) * 100 or 10
v.timer = ceil(v.y_hovered) < 10 and v.timer or 0
end
imgui.GetWindowDrawList():AddRectFilled(imgui.ImVec2(p.x, p.y + v.y_hovered), imgui.ImVec2(p.x + 150, p.y + 110 + v.y_hovered), imgui.ColorConvertFloat4ToU32(imgui.GetStyle().Colors[imgui.Col.Button]), 7)
imgui.GetWindowDrawList():AddRect(imgui.ImVec2(p.x-4, p.y + v.y_hovered - 4), imgui.ImVec2(p.x + 154, p.y + 110 + v.y_hovered + 4), imgui.ColorConvertFloat4ToU32(imgui.GetStyle().Colors[imgui.Col.ButtonActive]), 10, nil, 1.9)
imgui.SameLine(10)
imgui.SetCursorPosY(imgui.GetCursorPosY() + 10 + v.y_hovered)
imgui.PushFont(font[25])
imgui.Text(v.icon)
imgui.PopFont()
imgui.SameLine(10)
imgui.SetCursorPosY(imgui.GetCursorPosY() + 30 + v.y_hovered)
imgui.BeginGroup()
imgui.PushFont(font[16])
imgui.Text(u8(v.name))
imgui.PopFont()
imgui.Text(u8(v.text))
imgui.EndGroup()
imgui.EndGroup()
if k ~= #buttons then
imgui.SameLine(k*200)
end
end
imgui.EndGroup()
imgui.PopStyleVar()
end