Lua HUD Красивые часы

s3nder_

Известный
Автор темы
61
82
Версия SA-MP
  1. 0.3.7 (R1)

Всем доброго времени суток

На связи создатель хуйни popit.lua
Сегодня мне было нечего делать (вау неожиданно)
И мне пришла в голову гениальная идея сделать настенные часы в SAMP

Получилось что получилось, раньш такого не видел, короче смотрите:
1687709029506.png


Есть менюшка с различными настройками часов (активация /watch), все настройки автоматически сохраняются
(P.S можно включить цифровые, будут отображаться ниже основных)

Зависимости: (героиновая), ImGUI (render версия), MimGUI (MimGUI версия) inicfg (по дефолту есть)
Отдельная благодарность @Andrinall за основу на MimGUI (ряльн пасибо)​
 

Вложения

  • watch-mimgui.lua
    10.7 KB · Просмотры: 28
  • watch.lua
    10.6 KB · Просмотры: 21
Последнее редактирование:

ShawGluz

Известный
70
4
По какой-то причине, если я выбираю "отключить строки деления", скрипт становится странным, и если я перезагружаю скрипт, он вылетает из gta.


.
Grand Theft Auto  San Andreas Screenshot 2023.06.23 - 23.05.58.62.png


Grand Theft Auto  San Andreas Screenshot 2023.06.23 - 23.05.56.77.png
 

s3nder_

Известный
Автор темы
61
82
По какой-то причине, если я выбираю "отключить строки деления", скрипт становится странным, и если я перезагружаю скрипт, он вылетает из gta.


.Посмотреть вложение 205467

Посмотреть вложение 205468
весьма странное событие, в скрипте ничего не трогал?
 

Andrinall

Известный
678
531
А нафига рендерить часы муновским рендером, если подключен imgui и используется для меню? В чём проблема отрендерить и часы тоже через imgui?

А нафига рендерить часы муновским рендером, если подключен imgui и используется для меню? В чём проблема отрендерить и часы тоже через imgui?
Эти же часы но чисто на mimgui
И без неизвестных науке артефактов
Lua:
local imgui = assert(select(2, pcall(require, 'mimgui')), "Lib mimgui not found")
local encoding = require 'encoding'
local inicfg   = require 'inicfg'

math.randomseed(os.time())

local new = imgui.new
local vec2 = imgui.ImVec2
encoding.default = 'CP1251'
u8 = encoding.UTF8

local menu = new.bool(false)
local watch = new.bool(true)
local divisions = { minute = new.bool(true), hour = new.bool(true) }
local digital = new.bool(true)

local pi_two = math.pi*2
local h_r_c = 0.0333333333333333
local m_r_c = 0.1666666666666667

local ex, ey = getScreenResolution()
local sx, sy, radius = ex - 140, ey / 2 + 120, new.int(120)

function msg(text)
    return sampAddChatMessage("[Watch]: {FFFFFF}"..text, join_argb(255, math.random(255), math.random(255), math.random(255)))
end

imgui.OnInitialize(function()
    imgui.GetIO().IniFilename = nil

    local defGlyph = imgui.GetIO().Fonts.ConfigData.Data[0].GlyphRanges
    imgui.GetIO().Fonts:Clear()
    local config = imgui.ImFontConfig()
    config.GlyphExtraSpacing.x = 0.1
    config.SizePixels = 24.0
    imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\arialbd.ttf', config.SizePixels, config, defGlyph)

    apply_custom_style()
end)

imgui.OnFrame(function() return menu[0] end, function()
    imgui.SetNextWindowPos(imgui.ImVec2(ex / 2, ey / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    
    if imgui.Begin(u8'Настройки часов', menu, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.AlwaysAutoResize) then
        local move_text = imgui.CalcTextSize(u8'Вы можете двигать часы при помощи курсора')
        imgui.SetCursorPosX(150 - move_text.x / 2)
        imgui.Text(u8'Вы можете двигать часы при помощи курсора')
        imgui.Separator()
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Часы", watch) then save() end
        imgui.SetCursorPosX(5)
        imgui.SliderInt(u8'Размер часов', radius, 100, 300)
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Часовые деления", divisions.hour) then save() end
        if divisions.hour then
            imgui.SetCursorPosX(5)
            if imgui.Checkbox(u8"Минутные деления", divisions.minute) then save() end
        end
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Цифровые часы", digital) then save() end
        imgui.End()
    end
end)

imgui.OnFrame(function() return watch[0] end, function()
    local dl = imgui.GetBackgroundDrawList()
    local center = vec2(sx, sy)
    dl:AddCircleFilled(center, radius[0] + 0.5, join_argb(127, rainbow(0.6)), radius[0] * 2.4)

    if divisions.hour[0] then
        for rot = 0, 360, 30 do dl:AddLine(center + getPointOnCircle(radius[0], rot, 360), center + getPointOnCircle(radius[0] - (radius[0] / 5), rot, 360), 0xFFFFFFFF, 2) end
        if divisions.minute[0] then
            for rot = 0, 360, 6 do
                local cos_, sin_, broken = math.cos(math.rad(rot)), math.sin(math.rad(rot)), false
                for i = 0, 360, 30 do if cos_ == math.cos(math.rad(i)) and sin_ == math.sin(math.rad(i)) then broken = true end break end
                if not broken then
                    dl:AddLine(center + getPointOnCircle(radius[0], rot, 360), center + getPointOnCircle(radius[0] - (radius[0] / 8), rot, 360), 0xFFFFFFFF, 2)
                end
            end
        end
    end

    local time = os.date("*t")
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.hour / h_r_c - 90)) * (radius[0] / 2.5), sy + math.sin(math.rad(time.hour / h_r_c - 90)) * (radius[0] / 2.5)), 0xFFFFFFFF, 2)
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.min / m_r_c - 90)) * (radius[0] / 1.5), sy + math.sin(math.rad(time.min / m_r_c - 90)) * (radius[0] / 1.5)), 0xFFFFFFFF, 2)
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.sec / m_r_c - 90)) * (radius[0] / 1.5), sy + math.sin(math.rad(time.sec / m_r_c - 90)) * (radius[0] / 1.5)), 0xFFFFFFFF, 2)

    if digital[0] then
        local time_str = os.date("%H:%M")
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2 - 1, sy + radius[0] + 5), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2 + 1, sy + radius[0] + 5), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 4), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 6), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 5), 0xFFFFFFFF, time_str)
    end
    if menu[0] then
        local cx, cy = getCursorPos()
        if cx > sx - radius[0] and cy > sy - radius[0] and cx < sx + radius[0] and cy < sy + radius[0] then
            if isKeyDown(0x01) then
                local cx, cy = getCursorPos()
                sx, sy = cx, cy
            end
        end
    end
end).HideCursor = true

function getPointOnCircle(cradius, point, max_points)
    local a = 0 + (point / max_points) * (pi_two - 0)
    return vec2(math.cos(a) * cradius, math.sin(a) * cradius)
end

function save()
    local saves = inicfg.save({
        main = {
        watch = watch[0],
        divisions_minute = divisions.minute[0],
        divisions_hour = divisions.hour[0],
        digital = digital[0],
        posX = sx,
        posY = sy}
    }, 'watch.ini')
    if not saves then
        msg('Не удалось сохранить по не известной причине')
    end
end

function main()
    repeat wait(0) until isSampAvailable()

    msg('Загружен')
    msg('Меню настроек: /watch')
    local inik = inicfg.load(nil, 'watch.ini')
    if inik ~= nil then
        watch[0] = inik.main.watch
        divisions.minute[0] = inik.main.divisions_minute
        divisions.hour[0] = inik.main.divisions_hour
        digital[0] = inik.main.digital
        sx = inik.main.posX
        sy = inik.main.posY
    else
        msg('INI файл не найден, он создан автоматически')
        save()
    end

    sampRegisterChatCommand('watch', function() menu[0] = not menu[0] end)
    wait(-1)
end


function join_argb(a, r, g, b)
    local argb = b
    argb = bit.bor(argb, bit.lshift(g, 8))
    argb = bit.bor(argb, bit.lshift(r, 16))
    argb = bit.bor(argb, bit.lshift(a, 24))
    return argb
end

function rainbow(speed)
    local r = math.floor(math.sin(os.clock() * speed) * 127 + 128)
    local g = math.floor(math.sin(os.clock() * speed + 2) * 127 + 128)
    local b = math.floor(math.sin(os.clock() * speed + 4) * 127 + 128)
    return r, g, b
end

function apply_custom_style()
    imgui.SwitchContext()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4

    style.WindowRounding = 2.0
    style.WindowTitleAlign = imgui.ImVec2(0.5, 0.84)
    style.ChildRounding = 2.0
    style.FrameRounding = 2.0
    style.ItemSpacing = imgui.ImVec2(5.0, 4.0)
    style.ScrollbarSize = 13.0
    style.ScrollbarRounding = 0
    style.GrabMinSize = 8.0
    style.GrabRounding = 1.0

    colors[clr.FrameBg]                = ImVec4(0.16, 0.29, 0.48, 0.54)
    colors[clr.FrameBgHovered]         = ImVec4(0.26, 0.59, 0.98, 0.40)
    colors[clr.FrameBgActive]          = ImVec4(0.26, 0.59, 0.98, 0.67)
    colors[clr.TitleBg]                = ImVec4(0.04, 0.04, 0.04, 1.00)
    colors[clr.TitleBgActive]          = ImVec4(0.16, 0.29, 0.48, 1.00)
    colors[clr.TitleBgCollapsed]       = ImVec4(0.00, 0.00, 0.00, 0.51)
    colors[clr.CheckMark]              = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.SliderGrab]             = ImVec4(0.24, 0.52, 0.88, 1.00)
    colors[clr.SliderGrabActive]       = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.Button]                 = ImVec4(0.26, 0.59, 0.98, 0.40)
    colors[clr.ButtonHovered]          = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.ButtonActive]           = ImVec4(0.06, 0.53, 0.98, 1.00)
    colors[clr.Header]                 = ImVec4(0.26, 0.59, 0.98, 0.31)
    colors[clr.HeaderHovered]          = ImVec4(0.26, 0.59, 0.98, 0.80)
    colors[clr.HeaderActive]           = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.Separator]              = colors[clr.Border]
    colors[clr.SeparatorHovered]       = ImVec4(0.26, 0.59, 0.98, 0.78)
    colors[clr.SeparatorActive]        = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.ResizeGrip]             = ImVec4(0.26, 0.59, 0.98, 0.25)
    colors[clr.ResizeGripHovered]      = ImVec4(0.26, 0.59, 0.98, 0.67)
    colors[clr.ResizeGripActive]       = ImVec4(0.26, 0.59, 0.98, 0.95)
    colors[clr.TextSelectedBg]         = ImVec4(0.26, 0.59, 0.98, 0.35)
    colors[clr.Text]                   = ImVec4(1.00, 1.00, 1.00, 1.00)
    colors[clr.TextDisabled]           = ImVec4(0.50, 0.50, 0.50, 1.00)
    colors[clr.WindowBg]               = ImVec4(0.06, 0.06, 0.06, 0.94)
    colors[clr.ChildBg]          = ImVec4(1.00, 1.00, 1.00, 0.00)
    colors[clr.PopupBg]                = ImVec4(0.08, 0.08, 0.08, 0.94)
    --colors[clr.ComboBg]                = colors[clr.PopupBg]
    colors[clr.Border]                 = ImVec4(0.43, 0.43, 0.50, 0.50)
    colors[clr.BorderShadow]           = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.MenuBarBg]              = ImVec4(0.14, 0.14, 0.14, 1.00)
    colors[clr.ScrollbarBg]            = ImVec4(0.02, 0.02, 0.02, 0.53)
    colors[clr.ScrollbarGrab]          = ImVec4(0.31, 0.31, 0.31, 1.00)
    colors[clr.ScrollbarGrabHovered]   = ImVec4(0.41, 0.41, 0.41, 1.00)
    colors[clr.ScrollbarGrabActive]    = ImVec4(0.51, 0.51, 0.51, 1.00)
    --colors[clr.CloseButton]            = ImVec4(0.41, 0.41, 0.41, 0.50)
    --colors[clr.CloseButtonHovered]     = ImVec4(0.98, 0.39, 0.36, 1.00)
    --colors[clr.CloseButtonActive]      = ImVec4(0.98, 0.39, 0.36, 1.00)
    colors[clr.PlotLines]              = ImVec4(0.61, 0.61, 0.61, 1.00)
    colors[clr.PlotLinesHovered]       = ImVec4(1.00, 0.43, 0.35, 1.00)
    colors[clr.PlotHistogram]          = ImVec4(0.90, 0.70, 0.00, 1.00)
    colors[clr.PlotHistogramHovered]   = ImVec4(1.00, 0.60, 0.00, 1.00)
    --colors[clr.ModalWindowDarkening]   = ImVec4(0.80, 0.80, 0.80, 0.35)
end
 
Последнее редактирование:
  • Нравится
Реакции: s3nder_ и ARMOR

s3nder_

Известный
Автор темы
61
82
А нафига рендерить часы муновским рендером, если подключен imgui и используется для меню? В чём проблема отрендерить и часы тоже через imgui?


Эти же часы но чисто на mimgui
И без неизвестных науке артефактов
Lua:
local imgui = assert(select(2, pcall(require, 'mimgui')), "Lib mimgui not found")
local encoding = require 'encoding'
local inicfg   = require 'inicfg'

math.randomseed(os.time())

local new = imgui.new
local vec2 = imgui.ImVec2
encoding.default = 'CP1251'
u8 = encoding.UTF8

local menu = new.bool(false)
local watch = new.bool(true)
local divisions = { minute = new.bool(true), hour = new.bool(true) }
local digital = new.bool(true)

local pi_two = math.pi*2
local h_r_c = 0.0333333333333333
local m_r_c = 0.1666666666666667

local ex, ey = getScreenResolution()
local sx, sy, radius = ex - 140, ey / 2 + 120, new.int(120)

function msg(text)
    return sampAddChatMessage("[Watch]: {FFFFFF}"..text, join_argb(255, math.random(255), math.random(255), math.random(255)))
end

imgui.OnInitialize(function()
    imgui.GetIO().IniFilename = nil

    local defGlyph = imgui.GetIO().Fonts.ConfigData.Data[0].GlyphRanges
    imgui.GetIO().Fonts:Clear()
    local config = imgui.ImFontConfig()
    config.GlyphExtraSpacing.x = 0.1
    config.SizePixels = 24.0
    imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\arialbd.ttf', config.SizePixels, config, defGlyph)

    apply_custom_style()
end)

imgui.OnFrame(function() return menu[0] end, function()
    imgui.SetNextWindowPos(imgui.ImVec2(ex / 2, ey / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
   
    if imgui.Begin(u8'Настройки часов', menu, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.AlwaysAutoResize) then
        local move_text = imgui.CalcTextSize(u8'Вы можете двигать часы при помощи курсора')
        imgui.SetCursorPosX(150 - move_text.x / 2)
        imgui.Text(u8'Вы можете двигать часы при помощи курсора')
        imgui.Separator()
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Часы", watch) then save() end
        imgui.SetCursorPosX(5)
        imgui.SliderInt(u8'Размер часов', radius, 100, 300)
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Часовые деления", divisions.hour) then save() end
        if divisions.hour then
            imgui.SetCursorPosX(5)
            if imgui.Checkbox(u8"Минутные деления", divisions.minute) then save() end
        end
        imgui.SetCursorPosX(5)
        if imgui.Checkbox(u8"Цифровые часы", digital) then save() end
        imgui.End()
    end
end)

imgui.OnFrame(function() return watch[0] end, function()
    local dl = imgui.GetBackgroundDrawList()
    local center = vec2(sx, sy)
    dl:AddCircleFilled(center, radius[0] + 0.5, join_argb(127, rainbow(0.6)), radius[0] * 2.4)

    if divisions.hour[0] then
        for rot = 0, 360, 30 do dl:AddLine(center + getPointOnCircle(radius[0], rot, 360), center + getPointOnCircle(radius[0] - (radius[0] / 5), rot, 360), 0xFFFFFFFF, 2) end
        if divisions.minute[0] then
            for rot = 0, 360, 6 do
                local cos_, sin_, broken = math.cos(math.rad(rot)), math.sin(math.rad(rot)), false
                for i = 0, 360, 30 do if cos_ == math.cos(math.rad(i)) and sin_ == math.sin(math.rad(i)) then broken = true end break end
                if not broken then
                    dl:AddLine(center + getPointOnCircle(radius[0], rot, 360), center + getPointOnCircle(radius[0] - (radius[0] / 8), rot, 360), 0xFFFFFFFF, 2)
                end
            end
        end
    end

    local time = os.date("*t")
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.hour / h_r_c - 90)) * (radius[0] / 2.5), sy + math.sin(math.rad(time.hour / h_r_c - 90)) * (radius[0] / 2.5)), 0xFFFFFFFF, 2)
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.min / m_r_c - 90)) * (radius[0] / 1.5), sy + math.sin(math.rad(time.min / m_r_c - 90)) * (radius[0] / 1.5)), 0xFFFFFFFF, 2)
    dl:AddLine(vec2(sx, sy), vec2(sx + math.cos(math.rad(time.sec / m_r_c - 90)) * (radius[0] / 1.5), sy + math.sin(math.rad(time.sec / m_r_c - 90)) * (radius[0] / 1.5)), 0xFFFFFFFF, 2)

    if digital[0] then
        local time_str = os.date("%H:%M")
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2 - 1, sy + radius[0] + 5), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2 + 1, sy + radius[0] + 5), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 4), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 6), 0xFF000000, time_str)
        dl:AddText(vec2(sx - imgui.CalcTextSize(time_str).x / 2, sy + radius[0] + 5), 0xFFFFFFFF, time_str)
    end
    if menu[0] then
        local cx, cy = getCursorPos()
        if cx > sx - radius[0] and cy > sy - radius[0] and cx < sx + radius[0] and cy < sy + radius[0] then
            if isKeyDown(0x01) then
                local cx, cy = getCursorPos()
                sx, sy = cx, cy
            end
        end
    end
end).HideCursor = true

function getPointOnCircle(cradius, point, max_points)
    local a = 0 + (point / max_points) * (pi_two - 0)
    return vec2(math.cos(a) * cradius, math.sin(a) * cradius)
end

function save()
    local saves = inicfg.save({
        main = {
        watch = watch[0],
        divisions_minute = divisions.minute[0],
        divisions_hour = divisions.hour[0],
        digital = digital[0],
        posX = sx,
        posY = sy}
    }, 'watch.ini')
    if not saves then
        msg('Не удалось сохранить по не известной причине')
    end
end

function main()
    repeat wait(0) until isSampAvailable()

    msg('Загружен')
    msg('Меню настроек: /watch')
    local inik = inicfg.load(nil, 'watch.ini')
    if inik ~= nil then
        watch[0] = inik.main.watch
        divisions.minute[0] = inik.main.divisions_minute
        divisions.hour[0] = inik.main.divisions_hour
        digital[0] = inik.main.digital
        sx = inik.main.posX
        sy = inik.main.posY
    else
        msg('INI файл не найден, он создан автоматически')
        save()
    end

    sampRegisterChatCommand('watch', function() menu[0] = not menu[0] end)
    wait(-1)
end


function join_argb(a, r, g, b)
    local argb = b
    argb = bit.bor(argb, bit.lshift(g, 8))
    argb = bit.bor(argb, bit.lshift(r, 16))
    argb = bit.bor(argb, bit.lshift(a, 24))
    return argb
end

function rainbow(speed)
    local r = math.floor(math.sin(os.clock() * speed) * 127 + 128)
    local g = math.floor(math.sin(os.clock() * speed + 2) * 127 + 128)
    local b = math.floor(math.sin(os.clock() * speed + 4) * 127 + 128)
    return r, g, b
end

function apply_custom_style()
    imgui.SwitchContext()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4

    style.WindowRounding = 2.0
    style.WindowTitleAlign = imgui.ImVec2(0.5, 0.84)
    style.ChildRounding = 2.0
    style.FrameRounding = 2.0
    style.ItemSpacing = imgui.ImVec2(5.0, 4.0)
    style.ScrollbarSize = 13.0
    style.ScrollbarRounding = 0
    style.GrabMinSize = 8.0
    style.GrabRounding = 1.0

    colors[clr.FrameBg]                = ImVec4(0.16, 0.29, 0.48, 0.54)
    colors[clr.FrameBgHovered]         = ImVec4(0.26, 0.59, 0.98, 0.40)
    colors[clr.FrameBgActive]          = ImVec4(0.26, 0.59, 0.98, 0.67)
    colors[clr.TitleBg]                = ImVec4(0.04, 0.04, 0.04, 1.00)
    colors[clr.TitleBgActive]          = ImVec4(0.16, 0.29, 0.48, 1.00)
    colors[clr.TitleBgCollapsed]       = ImVec4(0.00, 0.00, 0.00, 0.51)
    colors[clr.CheckMark]              = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.SliderGrab]             = ImVec4(0.24, 0.52, 0.88, 1.00)
    colors[clr.SliderGrabActive]       = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.Button]                 = ImVec4(0.26, 0.59, 0.98, 0.40)
    colors[clr.ButtonHovered]          = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.ButtonActive]           = ImVec4(0.06, 0.53, 0.98, 1.00)
    colors[clr.Header]                 = ImVec4(0.26, 0.59, 0.98, 0.31)
    colors[clr.HeaderHovered]          = ImVec4(0.26, 0.59, 0.98, 0.80)
    colors[clr.HeaderActive]           = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.Separator]              = colors[clr.Border]
    colors[clr.SeparatorHovered]       = ImVec4(0.26, 0.59, 0.98, 0.78)
    colors[clr.SeparatorActive]        = ImVec4(0.26, 0.59, 0.98, 1.00)
    colors[clr.ResizeGrip]             = ImVec4(0.26, 0.59, 0.98, 0.25)
    colors[clr.ResizeGripHovered]      = ImVec4(0.26, 0.59, 0.98, 0.67)
    colors[clr.ResizeGripActive]       = ImVec4(0.26, 0.59, 0.98, 0.95)
    colors[clr.TextSelectedBg]         = ImVec4(0.26, 0.59, 0.98, 0.35)
    colors[clr.Text]                   = ImVec4(1.00, 1.00, 1.00, 1.00)
    colors[clr.TextDisabled]           = ImVec4(0.50, 0.50, 0.50, 1.00)
    colors[clr.WindowBg]               = ImVec4(0.06, 0.06, 0.06, 0.94)
    colors[clr.ChildBg]          = ImVec4(1.00, 1.00, 1.00, 0.00)
    colors[clr.PopupBg]                = ImVec4(0.08, 0.08, 0.08, 0.94)
    --colors[clr.ComboBg]                = colors[clr.PopupBg]
    colors[clr.Border]                 = ImVec4(0.43, 0.43, 0.50, 0.50)
    colors[clr.BorderShadow]           = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.MenuBarBg]              = ImVec4(0.14, 0.14, 0.14, 1.00)
    colors[clr.ScrollbarBg]            = ImVec4(0.02, 0.02, 0.02, 0.53)
    colors[clr.ScrollbarGrab]          = ImVec4(0.31, 0.31, 0.31, 1.00)
    colors[clr.ScrollbarGrabHovered]   = ImVec4(0.41, 0.41, 0.41, 1.00)
    colors[clr.ScrollbarGrabActive]    = ImVec4(0.51, 0.51, 0.51, 1.00)
    --colors[clr.CloseButton]            = ImVec4(0.41, 0.41, 0.41, 0.50)
    --colors[clr.CloseButtonHovered]     = ImVec4(0.98, 0.39, 0.36, 1.00)
    --colors[clr.CloseButtonActive]      = ImVec4(0.98, 0.39, 0.36, 1.00)
    colors[clr.PlotLines]              = ImVec4(0.61, 0.61, 0.61, 1.00)
    colors[clr.PlotLinesHovered]       = ImVec4(1.00, 0.43, 0.35, 1.00)
    colors[clr.PlotHistogram]          = ImVec4(0.90, 0.70, 0.00, 1.00)
    colors[clr.PlotHistogramHovered]   = ImVec4(1.00, 0.60, 0.00, 1.00)
    --colors[clr.ModalWindowDarkening]   = ImVec4(0.80, 0.80, 0.80, 0.35)
end
я не шарю за эти ваши мимгуи
 

s3nder_

Известный
Автор темы
61
82
Там от имгуи отличий не так уж и много в плане написания кода, просто научиться при непонятках смотреть в lib/mimgui/cdefs.lua и всё)
пускай синтаксис простой, но мне привычней обычный имгуи
и да, спасибо за версию с мимгуем, возможно добавлю в тему
 
  • Нравится
Реакции: Andrinall

chereshnya

Известный
1,295
599
сделай возможность делать типа настенных часов, интересно будет