imgui help

Kegwineye.

Участник
Автор темы
478
20
В Интуп тексте, большом непишеться текстну и в тэг'ах проблемы.

Lua:
require "lib.moonloader"
local tag = "{00FF7F}[Army-Helper] {FFFFFF}"
local imgui = require 'imgui'
local hook = require 'lib.samp.events'
local vkeys = require 'vkeys'
local pokaz = false
local encoding = require 'encoding'
local inicfg = require 'inicfg'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local fa = require 'fAwesome5'

local image
local window = imgui.ImBool(false)
local sc = '{ADFF2F}'

local mainIni = inicfg.load({
config =
{
rank = u8' Генерал',
rankAndNumber = '(10)'
},
    Binds_Name = {},
    Binds_Action = {},
    Binds_Deleay = {}
}, "Army Helper")

local binder_delay = imgui.ImInt(2500)
local text_binder = imgui.ImBuffer(65536)
local text_ustav = imgui.ImBuffer(65536)
local binder_name = imgui.ImBuffer(35)

local status = inicfg.load(mainIni, 'Army Helper.ini')
if not doesFileExist('moonloader/config/Army Helper.ini') then inicfg.save(mainIni, 'Army Helper.ini') end
function main()
    while not isSampAvailable() do wait(200) end
    addiconlocal = imgui.CreateTextureFromFile("moonloader/army-helper-icon/iconsanandresrp.png")
    rulesarmy = imgui.CreateTextureFromFile("moonloader/army-helper-icon/armyrules.png")
    sampRegisterChatCommand('armh', cmd_armh)
    imgui.Process = false
    window.v = true  --show window on start
    while true do
        wait(0)
        imgui.Process = window.v
    end
end


function cmd_armh()
    window.v = not window.v
end

-- Имгуи
function imgui.OnDrawFrame()
if window.v then
local sw, sh = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(950, 537), imgui.Cond.FirstUseEver)

imgui.Begin(u8"Army-Helper v 1.0", window, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoScrollbar)
imgui.SetCursorPosX(40)
imgui.Image(addiconlocal, imgui.ImVec2(150, 150))

imgui.BeginChild('##infoforped', imgui.ImVec2(220, 180), true)
imgui.CenterText(u8'Ваша статистика')
imgui.Separator()
imgui.SetCursorPosY(40)
imgui.NewLine()

imgui.CenterText(fa.ICON_FA_ID_CARD_ALT .. '')

imgui.CenterText(mainIni.config.rank.. '')
imgui.CenterText(mainIni.config.rankAndNumber)
imgui.SetCursorPosX(60)
imgui.SetCursorPosY(140)
if imgui.Button(u8'Обновить', imgui.ImVec2(100,20)) then
    checkOrg()
    else
    imgui.Hint(u8'Нажмите, чтобы обновить данные статистики.')
end
imgui.EndChild()
imgui.SetCursorPosY(380)
if imgui.Button(u8"Основное", imgui.ImVec2(220, 30)) then menu = 1 end
if imgui.Button(u8"Второстепенное", imgui.ImVec2(220, 30)) then menu = 2 end
if imgui.Button(u8"Биндер", imgui.ImVec2(220, 30)) then menu = 3 end
if imgui.Button(u8"Информация", imgui.ImVec2(220, 30)) then menu = 4 end

imgui.SetCursorPosY(30)
imgui.SetCursorPosX(240)
imgui.BeginChild('right', imgui.ImVec2(700, 500), true)
if menu == 1 then

end


if menu == 2 then

end

if menu == 3 then
    imgui.CenterText(u8'Меню пользовательских биндов')
    imgui.Separator()
    if #mainIni.Binds_Name > 0 then
    for key_bind, name_bind in pairs(mainIni.Binds_Name) do
    if imgui.Button(u8(name_bind)..'##'..key_bind, imgui.ImVec2(312, 30)) then
    play_bind(key_bind)
    window.v = false
    end
    imgui.SameLine()
    if imgui.Button(fa.ICON_FA_PEN..'##'..key_bind, imgui.ImVec2(30, 30)) then
    EditOldBind = true
    name_old_bild = mainIni.Binds_Name[key_bind]
    getpos = key_bind
    binder_delay.v = mainIni.Binds_Deleay[key_bind]
    local returnwrapped = tostring(mainIni.Binds_Action[key_bind]):gsub('~', '\n')
    text_binder.v = u8(returnwrapped)
    binder_name.v = tostring(u8(mainIni.Binds_Name[key_bind]))
    imgui.OpenPopup(u8'Биндер')
    end
    imgui.SameLine()
    if imgui.Button(fa.ICON_FA_TRASH..'##'..key_bind, imgui.ImVec2(30, 30)) then
    GHsms('Бинд {ADFF2F}«'..mainIni.Binds_Name[key_bind]..'»{FFFFFF} удалён!')
    table.remove(mainIni.Binds_Name, key_bind)
    table.remove(mainIni.Binds_Action, key_bind)
    table.remove(mainIni.Binds_Deleay, key_bind)
    inicfg.save(mainIni, 'Army Helper.ini')
    end
    end
    else
    imgui.CenterText(u8'Здесь пока нету Ваших биндов.')
    imgui.CenterText(u8'Их можно создать!')
    imgui.SetCursorPosX((imgui.GetWindowWidth() - 25) / 2)
    imgui.PushFont(fontsize13)
    imgui.PopFont()
    end
    imgui.Separator()
    if imgui.Button(fa.ICON_FA_PLUS_CIRCLE..u8' Создать бинд', imgui.ImVec2(-1,30)) then
    imgui.OpenPopup(u8'Биндер')
    binder_delay.v = 2500
    end
    end

            if imgui.BeginPopupModal(u8'Биндер', false, imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.NoTitleBar) then
            imgui.BeginChild("##EditBinder", imgui.ImVec2(600, 337), true)
            imgui.PushItemWidth(150)
            imgui.InputInt(u8("Задержка между строками в миллисекундах"), binder_delay); imgui.SameLine(); imgui.Vopros(); imgui.Hint(u8'Не больше 60.000 ms!\n(1 sec = 1000 ms)')
            imgui.PopItemWidth()
            if binder_delay.v <= 0 then
            binder_delay.v = 1
            elseif binder_delay.v >= 60001 then
            binder_delay.v = 60000
            end
            imgui.SameLine()
            if imgui.Button(u8'Локальные тэги##LocalTag', imgui.ImVec2(140,20)) then
            imgui.OpenPopup(u8'Локальные тэги')
            end
            localtag()
            imgui.InputTextMultiline("##EditMultiline", text_binder, imgui.ImVec2(-1, 250))
            imgui.Text(u8'Название бинда (обязательно):'); imgui.SameLine()
            imgui.PushItemWidth(200)
            imgui.InputText("##binder_name", binder_name)
            imgui.PopItemWidth()

            if #binder_name.v > 0 and #text_binder.v > 0 then
            imgui.SameLine()
            if imgui.Button(u8'Сохранить##bind1', imgui.ImVec2(-1,20)) then
            if not EditOldBind then
            refresh_text = text_binder.v:gsub("\n", "~")
            table.insert(mainIni.Binds_Name, u8:decode(binder_name.v))
            table.insert(mainIni.Binds_Action, u8:decode(refresh_text))
            table.insert(mainIni.Binds_Deleay, binder_delay.v)
            if inicfg.save(mainIni, 'Army Helper.ini') then
            GHsms('Бинд {ADFF2F}«'..u8:decode(binder_name.v)..'»{FFFFFF} успешно добавлен!')
            binder_name.v, text_binder.v = '', ''
            end
            imgui.CloseCurrentPopup()
            else
            refresh_text = text_binder.v:gsub("\n", "~")
            table.insert(mainIni.Binds_Name, getpos, u8:decode(binder_name.v))
            table.insert(mainIni.Binds_Action, getpos, u8:decode(refresh_text))
            table.insert(mainIni.Binds_Deleay, getpos, binder_delay.v)
            table.remove(mainIni.Binds_Name, getpos + 1)
            table.remove(mainIni.Binds_Action, getpos + 1)
            table.remove(mainIni.Binds_Deleay, getpos + 1)
            if inicfg.save(mainIni, 'Army Helper.ini') then
            GHsms('Бинд {ADFF2F}«'..name_old_bild..'»{FFFFFF} успешно отредактирован!')
            binder_name.v, text_binder.v = '', ''
            end
            EditOldBind = false
            imgui.CloseCurrentPopup()
            end
            end
            else
            imgui.SameLine()
            imgui.DisableButton(u8'Сохранить##bind2', imgui.ImVec2(-1,20))
            imgui.Hint(u8'Заполнены не все пункты!')
            end

            if imgui.Button(u8'Закрыть', imgui.ImVec2(-1,20)) then
            if not EditOldBind then
            imgui.CloseCurrentPopup()
            binder_name.v, text_binder.v = '', ''
            else
            EditOldBind = false
            imgui.CloseCurrentPopup()
            binder_name.v, text_binder.v = '', ''
            end
            end
            imgui.EndChild()
            imgui.EndPopup()

        end

        if imgui.BeginPopupModal(u8'Биндер', false, imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.NoTitleBar) then
        imgui.BeginChild("##EditBinder", imgui.ImVec2(600, 337), true)
        imgui.PushItemWidth(150)
        imgui.InputInt(u8("Задержка между строками в миллисекундах"), binder_delay); imgui.SameLine(); imgui.Vopros(); imgui.Hint(u8'Не больше 60.000 ms!\n(1 sec = 1000 ms)')
        imgui.PopItemWidth()
        if binder_delay.v <= 0 then
        binder_delay.v = 1
        elseif binder_delay.v >= 60001 then
        binder_delay.v = 60000
        end
        imgui.SameLine()
        if imgui.Button(u8'Локальные тэги##LocalTag', imgui.ImVec2(140,20)) then
        imgui.OpenPopup(u8'Локальные тэги')
        end
        localtag()
        imgui.InputTextMultiline("##EditMultiline", text_binder, imgui.ImVec2(-1, 250))
        imgui.Text(u8'Название бинда (обязательно):'); imgui.SameLine()
        imgui.PushItemWidth(200)
        imgui.InputText("##binder_name", binder_name)
        imgui.PopItemWidth()

        if #binder_name.v > 0 and #text_binder.v > 0 then
        imgui.SameLine()
        if imgui.Button(u8'Сохранить##bind1', imgui.ImVec2(-1,20)) then
        if not EditOldBind then
        refresh_text = text_binder.v:gsub("\n", "~")
        table.insert(mainIni.Binds_Name, u8:decode(binder_name.v))
        table.insert(mainIni.Binds_Action, u8:decode(refresh_text))
        table.insert(mainIni.Binds_Deleay, binder_delay.v)
        if inicfg.save(mainIni, 'Army Helper.ini') then
        GHsms('Бинд {ADFF2F}«'..u8:decode(binder_name.v)..'»{FFFFFF} успешно добавлен!')
        binder_name.v, text_binder.v = '', ''
        end
        imgui.CloseCurrentPopup()
        else
        refresh_text = text_binder.v:gsub("\n", "~")
        table.insert(mainIni.Binds_Name, getpos, u8:decode(binder_name.v))
        table.insert(mainIni.Binds_Action, getpos, u8:decode(refresh_text))
        table.insert(mainIni.Binds_Deleay, getpos, binder_delay.v)
        table.remove(mainIni.Binds_Name, getpos + 1)
        table.remove(mainIni.Binds_Action, getpos + 1)
        table.remove(mainIni.Binds_Deleay, getpos + 1)
        if inicfg.save(mainIni, 'Army Helper.ini') then
        GHsms('Бинд {ADFF2F}«'..name_old_bild..'»{FFFFFF} успешно отредактирован!')
        binder_name.v, text_binder.v = '', ''
        end
        EditOldBind = false
        imgui.CloseCurrentPopup()
        end
        end
        else
        imgui.SameLine()
        imgui.DisableButton(u8'Сохранить##bind2', imgui.ImVec2(-1,20))
        imgui.Hint(u8'Заполнены не все пункты!')
        end

        if imgui.Button(u8'Закрыть', imgui.ImVec2(-1,20)) then
        if not EditOldBind then
        imgui.CloseCurrentPopup()
        binder_name.v, text_binder.v = '', ''
        else
        EditOldBind = false
        imgui.CloseCurrentPopup()
        binder_name.v, text_binder.v = '', ''
        end
        end
        imgui.EndChild()
        imgui.EndPopup()

end

if menu == 4 then

end
imgui.EndChild()
imgui.End() end end -- Конец имгуи
-- Имгуи

if sampevcheck then
    function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
        if dialogId == 235 and getRankInStats then
            if not text:find('Армия') and not owner then
                lua_thread.create(function()
                    wait(1000)
                    GHsms('Вы не в организации '..sc..'Армия')
                    GHsms('Скрипт работает только в этой организации')
                    GHsms('Скрипт отключен...')
                    log('Скрипт отключен. Вы не в организации "Армия LS/SF/LV."')
                    wait(100)
                    showCursor(false)
                    thisScript():unload()
                end)
                return false
            end
            function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
                 if dialogId == 235 and getRankInStats then
                    if tonumber(getStatsRank) then
                       if tonumber(getStatsRank) ~= cfg.Settings.rankAndNumber then
                    cfg.Settings.rankAndNumber = tonumber(getStatsRank)
                    cfg.Settings.rank = tostring(nameRankStats)
                    GHsms('Ранг обновлён на '..tostring(nameRankStats)..'('..tostring(getStatsRank)..')')
                    inicfg.save(mainIni, 'Army Helper.ini')
                    else
                    GHsms('Ваша должность соответствует данным из статистики.')
                end
            end
        end
        sampSendDialogResponse(dialogId, 0, _, _)
        getRankInStats = false
        return false
            end
        end
    end
end


-- Функция для подсказок
function imgui.TextQuestion(text)
imgui.TextDisabled(u8'(Подсказка)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.PushTextWrapPos(450)
imgui.TextUnformatted(text)
imgui.PopTextWrapPos()
imgui.EndTooltip() end end
-- Функция для подсказок

function imgui.CenterText(text)
local width = imgui.GetWindowWidth()
local calc = imgui.CalcTextSize(text)
imgui.SetCursorPosX( width / 2 - calc.x / 2 )
imgui.Text(text)
end

 -- ICONS LIST: https://fontawesome.com/v5.15/icons?d=gallery&s=solid&m=free
local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig()
        font_config.MergeMode = true
        
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 23.0, font_config, fa_glyph_ranges)

        if fontsize20 == nil then
            fontsize13 = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end

        if fontsize == nil then
            fontsize = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 18.0, nil, imgui.GetIO().Fonts:GetGlyphRangesCyrillic()) -- вместо 30 любой нужный размеp
            fontsize28 = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 28.0, nil, imgui.GetIO().Fonts:GetGlyphRangesCyrillic()) -- вместо 30 любой нужный размеp
        end
    end
end

-- Стиль Имгуи
function custom_style_1()
        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.ChildWindowRounding = 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.42, 0.48, 0.16, 0.54)
        colors[clr.FrameBgHovered]         = ImVec4(0.85, 0.98, 0.26, 0.40)
        colors[clr.FrameBgActive]          = ImVec4(0.85, 0.98, 0.26, 0.67)
        colors[clr.TitleBg]                = ImVec4(0.04, 0.04, 0.04, 1.00)
        colors[clr.TitleBgActive]          = ImVec4(0.42, 0.48, 0.16, 1.00)
        colors[clr.TitleBgCollapsed]       = ImVec4(0.00, 0.00, 0.00, 0.51)
        colors[clr.CheckMark]              = ImVec4(0.85, 0.98, 0.26, 1.00)
        colors[clr.SliderGrab]             = ImVec4(0.77, 0.88, 0.24, 1.00)
        colors[clr.SliderGrabActive]       = ImVec4(0.85, 0.98, 0.26, 1.00)
        colors[clr.Button]                 = ImVec4(0.85, 0.98, 0.26, 0.40)
        colors[clr.ButtonHovered]          = ImVec4(0.85, 0.98, 0.26, 1.00)
        colors[clr.ButtonActive]           = ImVec4(0.82, 0.98, 0.06, 1.00)
        colors[clr.Header]                 = ImVec4(0.85, 0.98, 0.26, 0.31)
        colors[clr.HeaderHovered]          = ImVec4(0.85, 0.98, 0.26, 0.80)
        colors[clr.HeaderActive]           = ImVec4(0.85, 0.98, 0.26, 1.00)
        colors[clr.Separator]              = colors[clr.Border]
        colors[clr.SeparatorHovered]       = ImVec4(0.63, 0.75, 0.10, 0.78)
        colors[clr.SeparatorActive]        = ImVec4(0.63, 0.75, 0.10, 1.00)
        colors[clr.ResizeGrip]             = ImVec4(0.85, 0.98, 0.26, 0.25)
        colors[clr.ResizeGripHovered]      = ImVec4(0.85, 0.98, 0.26, 0.67)
        colors[clr.ResizeGripActive]       = ImVec4(0.85, 0.98, 0.26, 0.95)
        colors[clr.PlotLines]              = ImVec4(0.61, 0.61, 0.61, 1.00)
        colors[clr.PlotLinesHovered]       = ImVec4(1.00, 0.81, 0.35, 1.00)
        colors[clr.TextSelectedBg]         = ImVec4(0.85, 0.98, 0.26, 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.ChildWindowBg]          = 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.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
custom_style_1()
-- Стиль Имгуи

function imgui.CenterText(text)
    imgui.SetCursorPosX(imgui.GetWindowSize().x / 2 - imgui.CalcTextSize(text).x / 2)
    imgui.Text(text)
end

function GHsms(text)
    sampAddChatMessage("{ADFF2F}[Army Helper] {FFFFFF}"..text, 0xFFFFFF)
end

function checkOrg()
    while not sampIsLocalPlayerSpawned() do wait(1000) end
    if sampIsLocalPlayerSpawned() then
        GHsms('Проверяю данные из Вашей статистики.')
        getRankInStats = true
        sampSendChat('/stats')
    end
end

function imgui.Hint(text, delay, action)
    if imgui.IsItemHovered() then
        if go_hint == nil then go_hint = os.clock() + (delay and delay or 0.0) end
        local alpha = (os.clock() - go_hint) * 5 -- скорость появления
        if os.clock() >= go_hint then
            imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(10, 10))
            imgui.PushStyleVar(imgui.StyleVar.Alpha, (alpha <= 1.0 and alpha or 1.0))
            imgui.PushStyleColor(imgui.Col.PopupBg, imgui.GetStyle().Colors[imgui.Col.PopupBg])
            imgui.BeginTooltip()
            imgui.PushTextWrapPos(700)
            imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.ButtonActive], fa.ICON_FA_INFO_CIRCLE..u8' Подсказка:')
            imgui.TextUnformatted(text)
            if action ~= nil then
                imgui.TextColored(imgui.GetStyle().Colors[imgui.Col.TextDisabled], '\n'..fa.ICON_FA_SHARE..' '..action)
            end
            if not imgui.IsItemVisible() and imgui.GetStyle().Alpha == 1.0 then go_hint = nil end
            imgui.PopTextWrapPos()
            imgui.EndTooltip()
            imgui.PopStyleColor()
            imgui.PopStyleVar(2)
        end
    end
end

function imgui.Vopros()
    imgui.TextDisabled(fa.ICON_FA_QUESTION_CIRCLE)
end

function localtag()
    if imgui.BeginPopupModal(u8'Локальные тэги', false, imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.NoTitleBar) then
        imgui.CenterText('Тэги:')
        --
        if imgui.Button('{my:name}') then setClipboardText('{my:name}'); GHsms('Тэг "{my:name}" скопирован в буфер обмена!') else imgui.Hint(u8'Нажмите, чтобы скопировать') end; imgui.SameLine(); imgui.Text(u8'Выведет Ваше имя в РП формате')
        --
        if imgui.Button('{my:id}') then setClipboardText('{my:id}'); GHsms('Тэг "{my:id}" скопирован в буфер обмена!') else imgui.Hint(u8'Нажмите, чтобы скопировать') end; imgui.SameLine(); imgui.Text(u8'Выведет Ваш Ид')
        --
        if imgui.Button('{my:rank}') then setClipboardText('{my:rank}'); GHsms('Тэг "{my:rank}" скопирован в буфер обмена!') else imgui.Hint(u8'Нажмите, чтобы скопировать') end; imgui.SameLine(); imgui.Text(u8'Выведет Вашу должность')
        --
        if imgui.Button('{time}') then setClipboardText('{time}'); GHsms('Тэг "{time}" скопирован в буфер обмена!') else imgui.Hint(u8'Нажмите, чтобы скопировать.\nВ биндере использовать на новой строчке!') end; imgui.SameLine(); imgui.Text(u8'Напишет "/time" в чат')
        --
        if imgui.Button('{screen}') then setClipboardText('{screen}'); GHsms('Тэг "{screen}" скопирован в буфер обмена!') else imgui.Hint(u8'Нажмите, чтобы скопировать.\nВ биндере советую использовать в строчке с текстом, иначе будет пустая строка в чате!') end; imgui.SameLine(); imgui.Text(u8'Делает скриншот экрана (F8)')
        --
        if imgui.Button(u8'Закрыть##LocalTag', imgui.ImVec2(-1,20)) then
            imgui.CloseCurrentPopup()
        end
        imgui.EndPopup()
    end
end

function imgui.DisableButton(text, size)
    imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.0, 0.0, 0.0, 0.2))
    imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(0.0, 0.0, 0.0, 0.2))
    imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(0.0, 0.0, 0.0, 0.2))
    local button = imgui.Button(text, size)
    imgui.PopStyleColor(3)
    return button
end
 

Похожие темы

  1. Ответы
    6
    Просмотры
    3K
  2. Ответы
    8
    Просмотры
    1K
  3. Ответы
    4
    Просмотры
    925