ацените меню луа мимгуи! пж.

крута


  • Всего проголосовало
    23

whyhardlyz

Известный
Автор темы
117
88
всем привет так как это тема Юмор/Креатив, я хочу показать вам меню, так как я в mimgui первый день хотелось бы критики в сторону дизайна моего меню

1643444577791.png

критика в сторону белого меню не работает в данной теме.

сам юмор темы в названии скрипта.
 
  • Влюблен
Реакции: Михаил Бластов

(^O_O^)

Активный
114
27
вставлю 10 клоунов из 12 волков

жду код бро
 
Последнее редактирование:
  • Вау
Реакции: whyhardlyz

whyhardlyz

Известный
Автор темы
117
88
вставлю 10 клоунов из 12 волков

жду код бро
зачем тебе код функций скара (аим, и т.п связанное с стрельбой), + мимгуи код чела который изучает его часов 10 от силы.....

зачем тебе код функций скара (аим, и т.п связанное с стрельбой), + мимгуи код чела который изучает его часов 10 от силы.....
Lua:
local imgui = require 'mimgui'
local vkeys = require 'vkeys'
local encoding = require 'encoding'

local w, h = getScreenResolution()

local wm = require 'windows.message'

local tab = 0
local subtab = 0

encoding.default = 'CP1251'
local u8 = encoding.UTF8 

local new = imgui.new

local renderWindow = new.bool()


local window_flags = imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoScrollbar

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

local newFrame = imgui.OnFrame(
    function() return renderWindow[0] end,
    function(player)
        imgui.SetNextWindowPos(imgui.ImVec2(w / 2, h / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.SetNextWindowSize(imgui.ImVec2(800, 550))
        imgui.Begin("window", renderWindow, window_flags)
        position = imgui.GetWindowPos()
        draw = imgui.GetWindowDrawList()
        draw:AddRectFilled(imgui.ImVec2(position.x + 180, position.y + 50), imgui.ImVec2(position.x + 800, position.y + 550), imgui.ColorConvertFloat4ToU32(imgui.ImVec4(229 / 255.0, 229 / 255.0, 231 / 255.0, 255 / 255.0)), 4, 4)
        draw:AddLine(imgui.ImVec2(position.x + 180, position.y), imgui.ImVec2(position.x + 180, position.y + 550), imgui.ColorConvertFloat4ToU32(imgui.ImVec4(120 / 255, 120 / 255, 120 / 255, 70 / 255)))
        draw:AddLine(imgui.ImVec2(position.x, position.y + 50), imgui.ImVec2(position.x + 800, position.y + 50), imgui.ColorConvertFloat4ToU32(imgui.ImVec4(120 / 255, 120 / 255, 120 / 255, 70 / 255)))
        draw:AddLine(imgui.ImVec2(position.x + 200, position.y + 90), imgui.ImVec2(position.x + 780, position.y + 90), imgui.ColorConvertFloat4ToU32(imgui.ImVec4(120 / 255, 120 / 255, 120 / 255, 100 / 255)))
        draw:AddText({position.x + 20, position.y + 70 }, imgui.ColorConvertFloat4ToU32(imgui.ImVec4(70 / 255, 70 / 255, 70 / 255, 255 / 255)), u8"ФУНКЦИИ")
        draw:AddText({position.x + 20, position.y + 210 }, imgui.ColorConvertFloat4ToU32(imgui.ImVec4(70 / 255, 70 / 255, 70 / 255, 255 / 255)), u8"ИНФОРМАЦИЯ")
        draw:AddText({position.x + 20, position.y + 50 / 2 - imgui.CalcTextSize("BEBRA HACK").y/2}, imgui.ColorConvertFloat4ToU32(imgui.ImVec4(70 / 255, 70 / 255, 70 / 255, 255 / 255)), "BEBRA HACK")
        imgui.SetCursorPos(imgui.ImVec2(20, 90))
        if imgui.Button('Aimbot', imgui.ImVec2(140, 25)) then
            tab = 0
            subtab = 0
        end
        imgui.SetCursorPos(imgui.ImVec2(20, 120))
        if imgui.Button("Visuals", imgui.ImVec2(140, 25)) then
            tab = 1
            subtab = 0
        end
        imgui.SetCursorPos(imgui.ImVec2(20, 150))
        if imgui.Button("Misc", imgui.ImVec2(140, 25)) then
            tab = 2
            subtab = 0
        end
        imgui.SetCursorPos(imgui.ImVec2(20, 180))
        if imgui.Button("Settings", imgui.ImVec2(140, 25)) then
            tab = 3
            subtab = 0
        end
        imgui.SetCursorPos(imgui.ImVec2(20, 230))
        if imgui.Button(u8"О скрипте", imgui.ImVec2(140, 25)) then
            tab = 4
            subtab = 0
        end
        if (tab == 0) then
            imgui.SetCursorPos(imgui.ImVec2(200, 63))
            if imgui.AnimatedButton("SMOOTH", imgui.ImVec2(66, 25), 0.2) then
                subtab = 0
            end
            imgui.SetCursorPos(imgui.ImVec2(270, 63))
            if imgui.AnimatedButton("SILENT", imgui.ImVec2(66, 25), 0.2) then
                subtab = 1
            end
            imgui.SetCursorPos(imgui.ImVec2(340, 63))
            if imgui.AnimatedButton("MISC", imgui.ImVec2(66, 25), 0.2) then
                subtab = 2
            end
        end
        if (tab == 1) then
            imgui.SetCursorPos(imgui.ImVec2(200, 63))
            if imgui.AnimatedButton("ESP", imgui.ImVec2(66, 25), 0.2) then
                subtab = 0
            end
        end
        if (tab == 2) then
            imgui.SetCursorPos(imgui.ImVec2(200, 63))
            if imgui.AnimatedButton("PLAYER", imgui.ImVec2(66, 25), 0.2) then
                subtab = 0
            end
            imgui.SetCursorPos(imgui.ImVec2(270, 63))
            if imgui.AnimatedButton("VEHICLE", imgui.ImVec2(66, 25), 0.2) then
                subtab = 1
            end
        end
        if (tab == 3) then
            imgui.SetCursorPos(imgui.ImVec2(200, 63))
            if imgui.AnimatedButton("SETTINGS", imgui.ImVec2(66, 25), 0.2) then
                subtab = 0
            end
        end
        imgui.SetCursorPos(imgui.ImVec2(200, 100))
        imgui.BeginChild("", imgui.ImVec2(580, 440))
        if (tab == 0) then
            if(subtab == 0) then
            end
        end
        if (tab == 0) then
            if(subtab == 1) then
            end
        end
        if(tab == 0) then
            if(subtab == 2) then
            end
        end
        if (tab == 1) then
            if(subtab == 0) then
            end
        end
        if (tab == 2) then
            if(subtab == 0) then
            end
        end
        if (tab == 2) then
            if(subtab == 1) then
            end
        end
        if(tab == 3) then
            if(subtab == 0) then
            end
        end
        imgui.EndChild()
        imgui.End()
    end
)


function main()
    addEventHandler('onWindowMessage', function(msg, wparam, lparam) -- Сама функция, в которой будем обрабатывать горячие клавиши. Обратите внимание, что данный способ является наиболее верным в плане оптимизации.
        if msg == wm.WM_KEYDOWN or msg == wm.WM_SYSKEYDOWN then -- Если клавиша нажата
            if wparam == vkeys.VK_X then -- И если это клавиша X
                renderWindow[0] = not renderWindow[0] -- Переключаем состояние рендера
            end
        end
    end)
    while true do
        wait(0)
    end
end

function white_style()
    imgui.SwitchContext()
    imgui.GetStyle().WindowRounding        = 4.0
    imgui.GetStyle().ChildRounding        = 7.0
    imgui.GetStyle().FrameRounding        = 10.0
    imgui.GetStyle().FramePadding        = imgui.ImVec2(0, 0)
    imgui.GetStyle().WindowPadding        = imgui.ImVec2(0, 0)
    imgui.GetStyle().ButtonTextAlign    = imgui.ImVec2(0.5, 0.5)
    imgui.GetStyle().GrabMinSize        = 7
    imgui.GetStyle().GrabRounding        = 15
    imgui.GetStyle().WindowBorderSize = 0
    imgui.GetStyle().ScrollbarSize = 1.0

    imgui.GetStyle().Colors[imgui.Col.Text]                    = imgui.ImVec4(0.27, 0.27, 0.27, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TextDisabled]            = imgui.ImVec4(1.00, 1.00, 1.00, 0.20)
    imgui.GetStyle().Colors[imgui.Col.WindowBg]                = imgui.ImVec4(0.92, 0.92, 0.92, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PopupBg]                = imgui.ImVec4(0.90, 0.90, 0.90, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Border]                = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
    imgui.GetStyle().Colors[imgui.Col.SliderGrab]            = imgui.ImVec4(0.90, 0.90, 0.90, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SliderGrabActive]        = imgui.ImVec4(0.70, 0.70, 0.70, 1.00)
    imgui.GetStyle().Colors[imgui.Col.BorderShadow]            = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarBg]            = imgui.ImVec4(0.13, 0.13, 0.13, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab]        = imgui.ImVec4(0.90, 0.90, 0.90, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered]    = imgui.ImVec4(0.80, 0.80, 0.80, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive]    = imgui.ImVec4(0.70, 0.70, 0.70, 1.00)
    imgui.GetStyle().Colors[imgui.Col.FrameBg]                = imgui.ImVec4(0.20, 0.20, 0.20, 1.00)
    imgui.GetStyle().Colors[imgui.Col.FrameBgHovered]        = imgui.ImVec4(0.20, 0.20, 0.20, 0.80)
    imgui.GetStyle().Colors[imgui.Col.FrameBgActive]        = imgui.ImVec4(0.20, 0.20, 0.20, 0.60)
    imgui.GetStyle().Colors[imgui.Col.CheckMark]            = imgui.ImVec4(1.00, 1.00, 1.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Button]                = imgui.ImVec4(0.20, 0.20, 0.20, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonHovered]        = imgui.ImVec4(0.15, 0.15, 0.15, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonActive]            = imgui.ImVec4(0.10, 0.10, 0.10, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TextSelectedBg]        = imgui.ImVec4(0.80, 0.80, 0.80, 0.80)

    local but_orig = imgui.Button
    imgui.Button = function(...)
        imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(0.07, 0.07, 0.09, 1.00))
        imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.80, 0.80, 0.80, 1.00))
        imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(0.80, 0.80, 0.80, 1.00))
        imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(0.70, 0.70, 0.70, 1.00))
        local result = but_orig(...)
        imgui.PopStyleColor(4)
        return result
    end
    local slf_orig = imgui.SliderFloat
    imgui.SliderFloat = function(...)
        imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(1.0, 1.0, 1.0, 1.00))
        local result = slf_orig(...)
        imgui.PopStyleColor(1)
        return result
    end
end

function imgui.AnimatedButton(label, size, speed, rounded) -- circles -> rect
    local size = size or imgui.ImVec2(0, 0)
    local bool = false
    local text = label:gsub('##.+$', '')
    local ts = imgui.CalcTextSize(text)
    speed = speed and speed or 0.4
    if not AnimatedButtons then AnimatedButtons = {} end
    if not AnimatedButtons[label] then
        local color = imgui.GetStyle().Colors[imgui.Col.ButtonHovered]
        AnimatedButtons[label] = {circles = {}, hovered = false, state = false, time = os.clock(), color = imgui.ImVec4(color.x, color.y, color.z, 0.2)}
    end
    local button = AnimatedButtons[label]
    local dl = imgui.GetWindowDrawList()
    local p = imgui.GetCursorScreenPos()
    local c = imgui.GetCursorPos()
    local CalcItemSize = function(size, width, height)
        local region = imgui.GetContentRegionMax()
        if (size.x == 0) then
            size.x = width
        elseif (size.x < 0) then
            size.x = math.max(4.0, region.x - c.x + size.x);
        end
        if (size.y == 0) then
            size.y = height;
        elseif (size.y < 0) then
            size.y = math.max(4.0, region.y - c.y + size.y);
        end
        return size
    end
    size = CalcItemSize(size, ts.x+imgui.GetStyle().FramePadding.x*2, ts.y+imgui.GetStyle().FramePadding.y*2)
    local ImSaturate = function(f) return f < 0.0 and 0.0 or (f > 1.0 and 1.0 or f) end
    if #button.circles > 0 then
        local PathInvertedRect = function(a, b, col)
            local rounding = rounded and imgui.GetStyle().FrameRounding or 0
            if rounding <= 0 or not rounded then return end
            local dl = imgui.GetWindowDrawList()
            dl:PathLineTo(a)
            dl:PathArcTo(imgui.ImVec2(a.x + rounding, a.y + rounding), rounding, -3.0, -1.5)
            dl:PathFillConvex(col)

            dl:PathLineTo(imgui.ImVec2(b.x, a.y))
            dl:PathArcTo(imgui.ImVec2(b.x - rounding, a.y + rounding), rounding, -1.5, -0.205)
            dl:PathFillConvex(col)

            dl:PathLineTo(imgui.ImVec2(b.x, b.y))
            dl:PathArcTo(imgui.ImVec2(b.x - rounding, b.y - rounding), rounding, 1.5, 0.205)
            dl:PathFillConvex(col)

            dl:PathLineTo(imgui.ImVec2(a.x, b.y))
            dl:PathArcTo(imgui.ImVec2(a.x + rounding, b.y - rounding), rounding, 3.0, 1.5)
            dl:PathFillConvex(col)
        end
        for i, circle in ipairs(button.circles) do
            local time = os.clock() - circle.time
            local t = ImSaturate(time / speed)
            local color = imgui.GetStyle().Colors[imgui.Col.ButtonActive]
            local color = imgui.GetColorU32Vec4(imgui.ImVec4(color.x, color.y, color.z, (circle.reverse and (255-255*t) or (255*t))/255))
            local radius = math.max(size.x, size.y) * (circle.reverse and 1.5 or t)
            imgui.PushClipRect(p, imgui.ImVec2(p.x+size.x, p.y+size.y), true)
            dl:AddRectFilled(p, imgui.ImVec2(p.x+size.x, p.y+size.y), color)
            PathInvertedRect(p, imgui.ImVec2(p.x+size.x, p.y+size.y), imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.WindowBg]))
            imgui.PopClipRect()
            if t == 1 then
                if not circle.reverse then
                    circle.reverse = true
                    circle.time = os.clock()
                else
                    table.remove(button.circles, i)
                end
            end
        end
    end
    local t = ImSaturate((os.clock()-button.time) / speed)
    button.color.w = button.color.w + (button.hovered and 0.8 or -0.8)*t
    button.color.w = button.color.w < 0.2 and 0.2 or (button.color.w > 1 and 1 or button.color.w)
    color = imgui.GetStyle().Colors[imgui.Col.Button]
    color = imgui.GetColorU32Vec4(imgui.ImVec4(color.x, color.y, color.z, 0.2))
    dl:AddRectFilled(p, imgui.ImVec2(p.x+size.x, p.y+size.y), color, rounded and imgui.GetStyle().FrameRounding or 0)
    dl:AddRect(p, imgui.ImVec2(p.x+size.x, p.y+size.y), imgui.GetColorU32Vec4(button.color), rounded and imgui.GetStyle().FrameRounding or 0)
    local align = imgui.GetStyle().ButtonTextAlign
    imgui.SetCursorPos(imgui.ImVec2(c.x+(size.x-ts.x)*align.x, c.y+(size.y-ts.y)*align.y))
    imgui.Text(text)
    imgui.SetCursorPos(c)
    if imgui.InvisibleButton(label, size) then
        bool = true
        table.insert(button.circles, {animate = true, reverse = false, time = os.clock(), clickpos = imgui.ImVec2(getCursorPos())})
    end
    button.hovered = imgui.IsItemHovered()
    if button.hovered ~= button.state then
        button.state = button.hovered
        button.time = os.clock()
    end
    return bool
end

ладно.
 
Последнее редактирование:
У

Удалённый пользователь 439480

Гость
спасибо что написал про белую тему, я уже за очками тянулся)
 

deadfamq

Участник
108
22
где найти уроки по мимгуи?