почему не робит код

Oki_Bern

Участник
Автор темы
247
6
Lua:
local imgui = require 'mimgui'
local new = imgui.new

local WinState = new.bool()

imgui.OnFrame(function() return WinState[0] end, function(player)
    imgui.SetNextWindowPos(imgui.ImVec2(500,500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    imgui.SetNextWindowSize(imgui.ImVec2(245, 270), imgui.Cond.Always)
    imgui.Begin('##Window', WinState, imgui.WindowFlags.NoResize)
    imgui.End()
end)

function main()
    sampRegisterChatCommand('cmde', function() WinState[0] = not WinState[0] end)
    wait(-1)
end
-- == Ниже задаётся тема == --
imgui.OnInitialize(function()
    themeExample()
end)
function themeExample()
    imgui.SwitchContext()
    local ImVec4 = imgui.ImVec4
    imgui.GetStyle().WindowPadding = imgui.ImVec2(5, 5)
    imgui.GetStyle().FramePadding = imgui.ImVec2(5, 5)
    imgui.GetStyle().ItemSpacing = imgui.ImVec2(5, 5)
    imgui.GetStyle().ItemInnerSpacing = imgui.ImVec2(2, 2)
    imgui.GetStyle().TouchExtraPadding = imgui.ImVec2(0, 0)
    imgui.GetStyle().IndentSpacing = 0
    imgui.GetStyle().ScrollbarSize = 10
    imgui.GetStyle().GrabMinSize = 10
    imgui.GetStyle().WindowBorderSize = 1
    imgui.GetStyle().ChildBorderSize = 1
    imgui.GetStyle().PopupBorderSize = 1
    imgui.GetStyle().FrameBorderSize = 1
    imgui.GetStyle().TabBorderSize = 1
    imgui.GetStyle().WindowRounding = 8
    imgui.GetStyle().ChildRounding = 8
    imgui.GetStyle().FrameRounding = 8
    imgui.GetStyle().PopupRounding = 8
    imgui.GetStyle().ScrollbarRounding = 8
    imgui.GetStyle().GrabRounding = 8
    imgui.GetStyle().TabRounding = 8
 
    imgui.GetStyle().Colors[imgui.Col.Text]                   = ImVec4(0.90, 0.90, 0.90, 1.00)     
    imgui.GetStyle().Colors[imgui.Col.TextDisabled]           = ImVec4(0.90, 0.90, 0.90, 1.00)     
    imgui.GetStyle().Colors[imgui.Col.WindowBg]               = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ChildWindowBg]          = ImVec4(0.3, 0.3, 0.3, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PopupBg]                = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Border]                 = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.BorderShadow]           = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.FrameBg]                = ImVec4(0.26, 0.46, 0.82, 0.59)
    imgui.GetStyle().Colors[imgui.Col.FrameBgHovered]         = ImVec4(0.26, 0.46, 0.82, 0.88)
    imgui.GetStyle().Colors[imgui.Col.FrameBgActive]          = ImVec4(0.28, 0.53, 1.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TitleBg]                = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed]       = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.MenuBarBg]              = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarBg]            = ImVec4(0.26, 0.46, 0.82, 0.75)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab]          = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered]   = ImVec4(0.26, 0.46, 0.82, 0.68)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive]    = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ComboBg]                = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.CheckMark]              = ImVec4(0.26, 0.46, 0.82, 0.79)
    imgui.GetStyle().Colors[imgui.Col.SliderGrab]             = ImVec4(1.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SliderGrabActive]       = ImVec4(0.26, 0.45, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Button]                 = ImVec4(0.66, 0.66, 0.66, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonHovered]          = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonActive]           = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Header]                 = ImVec4(0.26, 0.46, 0.82, 0.74)
    imgui.GetStyle().Colors[imgui.Col.HeaderHovered]          = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.HeaderActive]           = ImVec4(0.37, 0.37, 0.37, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SeparatorHovered]       = ImVec4(0.60, 0.60, 0.70, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SeparatorActive]        = ImVec4(0.70, 0.70, 0.90, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ResizeGrip]             = ImVec4(1.00, 1.00, 1.00, 0.30)
    imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered]      = ImVec4(1.00, 1.00, 1.00, 0.60)
    imgui.GetStyle().Colors[imgui.Col.ResizeGripActive]       = ImVec4(1.00, 1.00, 1.00, 0.90)
    imgui.GetStyle().Colors[imgui.Col.CloseButton]            = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.CloseButtonHovered]     = ImVec4(0.00, 0.00, 0.00, 0.60)
    imgui.GetStyle().Colors[imgui.Col.CloseButtonActive]      = ImVec4(0.35, 0.35, 0.35, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered]       = ImVec4(1.00, 1.00, 1.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PlotHistogram]          = ImVec4(0.90, 0.70, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered]   = ImVec4(1.00, 0.60, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TextSelectedBg]         = ImVec4(0.00, 0.00, 1.00, 0.35)
    imgui.GetStyle().Colors[imgui.Col.ModalWindowDarkening]   = ImVec4(0.20, 0.20, 0.20, 0.35)
end
 

MLycoris

На вид оружие массового семяизвержения
Проверенный
1,992
2,187
тема немного жопная, попробуй этот вариант
Lua:
function themeExample()
    imgui.SwitchContext()
    local ImVec4 = imgui.ImVec4
    imgui.GetStyle().WindowPadding = imgui.ImVec2(5, 5)
    imgui.GetStyle().FramePadding = imgui.ImVec2(5, 5)
    imgui.GetStyle().ItemSpacing = imgui.ImVec2(5, 5)
    imgui.GetStyle().ItemInnerSpacing = imgui.ImVec2(2, 2)
    imgui.GetStyle().TouchExtraPadding = imgui.ImVec2(0, 0)
    imgui.GetStyle().IndentSpacing = 0
    imgui.GetStyle().ScrollbarSize = 10
    imgui.GetStyle().GrabMinSize = 10
    imgui.GetStyle().WindowBorderSize = 1
    imgui.GetStyle().ChildBorderSize = 1
    imgui.GetStyle().PopupBorderSize = 1
    imgui.GetStyle().FrameBorderSize = 1
    imgui.GetStyle().TabBorderSize = 1
    imgui.GetStyle().WindowRounding = 8
    imgui.GetStyle().ChildRounding = 8
    imgui.GetStyle().FrameRounding = 8
    imgui.GetStyle().PopupRounding = 8
    imgui.GetStyle().ScrollbarRounding = 8
    imgui.GetStyle().GrabRounding = 8
    imgui.GetStyle().TabRounding = 8
 
    imgui.GetStyle().Colors[imgui.Col.Text]                   = ImVec4(0.90, 0.90, 0.90, 1.00)     
    imgui.GetStyle().Colors[imgui.Col.TextDisabled]           = ImVec4(0.90, 0.90, 0.90, 1.00)     
    imgui.GetStyle().Colors[imgui.Col.WindowBg]               = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ChildBg]          = ImVec4(0.3, 0.3, 0.3, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PopupBg]                = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Border]                 = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.BorderShadow]           = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.FrameBg]                = ImVec4(0.26, 0.46, 0.82, 0.59)
    imgui.GetStyle().Colors[imgui.Col.FrameBgHovered]         = ImVec4(0.26, 0.46, 0.82, 0.88)
    imgui.GetStyle().Colors[imgui.Col.FrameBgActive]          = ImVec4(0.28, 0.53, 1.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TitleBg]                = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed]       = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.MenuBarBg]              = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarBg]            = ImVec4(0.26, 0.46, 0.82, 0.75)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab]          = ImVec4(0.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered]   = ImVec4(0.26, 0.46, 0.82, 0.68)
    imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive]    = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.CheckMark]              = ImVec4(0.26, 0.46, 0.82, 0.79)
    imgui.GetStyle().Colors[imgui.Col.SliderGrab]             = ImVec4(1.00, 0.00, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SliderGrabActive]       = ImVec4(0.26, 0.45, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Button]                 = ImVec4(0.66, 0.66, 0.66, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonHovered]          = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ButtonActive]           = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.Header]                 = ImVec4(0.26, 0.46, 0.82, 0.74)
    imgui.GetStyle().Colors[imgui.Col.HeaderHovered]          = ImVec4(0.26, 0.46, 0.82, 1.00)
    imgui.GetStyle().Colors[imgui.Col.HeaderActive]           = ImVec4(0.37, 0.37, 0.37, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SeparatorHovered]       = ImVec4(0.60, 0.60, 0.70, 1.00)
    imgui.GetStyle().Colors[imgui.Col.SeparatorActive]        = ImVec4(0.70, 0.70, 0.90, 1.00)
    imgui.GetStyle().Colors[imgui.Col.ResizeGrip]             = ImVec4(1.00, 1.00, 1.00, 0.30)
    imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered]      = ImVec4(1.00, 1.00, 1.00, 0.60)
    imgui.GetStyle().Colors[imgui.Col.ResizeGripActive]       = ImVec4(1.00, 1.00, 1.00, 0.90)
    imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered]       = ImVec4(1.00, 1.00, 1.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PlotHistogram]          = ImVec4(0.90, 0.70, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered]   = ImVec4(1.00, 0.60, 0.00, 1.00)
    imgui.GetStyle().Colors[imgui.Col.TextSelectedBg]         = ImVec4(0.00, 0.00, 1.00, 0.35)
end
 
  • Нравится
Реакции: Oki_Bern