- 28
- 9
- Версия SA-MP
-
- Любая
- Другая
Как подключить визуальный стиль меню
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
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('cmd', function() WinState[0] = not WinState[0] end)
wait(-1)
end
function SoftBlueTheme()
imgui.SwitchContext()
local style = imgui.GetStyle()
style.WindowPadding = imgui.ImVec2(15, 15)
style.WindowRounding = 10.0
style.ChildRounding = 6.0
style.FramePadding = imgui.ImVec2(8, 7)
style.FrameRounding = 8.0
style.ItemSpacing = imgui.ImVec2(8, 8)
style.ItemInnerSpacing = imgui.ImVec2(10, 6)
style.IndentSpacing = 25.0
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 12.0
style.GrabMinSize = 10.0
style.GrabRounding = 6.0
style.PopupRounding = 8
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
style.Colors[imgui.Col.Text] = imgui.ImVec4(0.90, 0.90, 0.93, 1.00)
style.Colors[imgui.Col.TextDisabled] = imgui.ImVec4(0.40, 0.40, 0.45, 1.00)
style.Colors[imgui.Col.WindowBg] = imgui.ImVec4(0.12, 0.12, 0.14, 1.00)
style.Colors[imgui.Col.ChildBg] = imgui.ImVec4(0.18, 0.20, 0.22, 0.30)
style.Colors[imgui.Col.PopupBg] = imgui.ImVec4(0.13, 0.13, 0.15, 1.00)
style.Colors[imgui.Col.Border] = imgui.ImVec4(0.30, 0.30, 0.35, 1.00)
style.Colors[imgui.Col.BorderShadow] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
style.Colors[imgui.Col.FrameBg] = imgui.ImVec4(0.18, 0.18, 0.20, 1.00)
style.Colors[imgui.Col.FrameBgHovered] = imgui.ImVec4(0.25, 0.25, 0.28, 1.00)
style.Colors[imgui.Col.FrameBgActive] = imgui.ImVec4(0.30, 0.30, 0.34, 1.00)
style.Colors[imgui.Col.TitleBg] = imgui.ImVec4(0.15, 0.15, 0.17, 1.00)
style.Colors[imgui.Col.TitleBgCollapsed] = imgui.ImVec4(0.10, 0.10, 0.12, 1.00)
style.Colors[imgui.Col.TitleBgActive] = imgui.ImVec4(0.15, 0.15, 0.17, 1.00)
style.Colors[imgui.Col.MenuBarBg] = imgui.ImVec4(0.12, 0.12, 0.14, 1.00)
style.Colors[imgui.Col.ScrollbarBg] = imgui.ImVec4(0.12, 0.12, 0.14, 1.00)
style.Colors[imgui.Col.ScrollbarGrab] = imgui.ImVec4(0.30, 0.30, 0.35, 1.00)
style.Colors[imgui.Col.ScrollbarGrabHovered] = imgui.ImVec4(0.40, 0.40, 0.45, 1.00)
style.Colors[imgui.Col.ScrollbarGrabActive] = imgui.ImVec4(0.50, 0.50, 0.55, 1.00)
style.Colors[imgui.Col.CheckMark] = imgui.ImVec4(0.70, 0.70, 0.90, 1.00)
style.Colors[imgui.Col.SliderGrab] = imgui.ImVec4(0.70, 0.70, 0.90, 1.00)
style.Colors[imgui.Col.SliderGrabActive] = imgui.ImVec4(0.80, 0.80, 0.90, 1.00)
style.Colors[imgui.Col.Button] = imgui.ImVec4(0.18, 0.18, 0.20, 1.00)
style.Colors[imgui.Col.ButtonHovered] = imgui.ImVec4(0.60, 0.60, 0.90, 1.00)
style.Colors[imgui.Col.ButtonActive] = imgui.ImVec4(0.28, 0.56, 0.96, 1.00)
style.Colors[imgui.Col.Header] = imgui.ImVec4(0.20, 0.20, 0.23, 1.00)
style.Colors[imgui.Col.HeaderHovered] = imgui.ImVec4(0.25, 0.25, 0.28, 1.00)
style.Colors[imgui.Col.HeaderActive] = imgui.ImVec4(0.30, 0.30, 0.34, 1.00)
style.Colors[imgui.Col.Separator] = imgui.ImVec4(0.40, 0.40, 0.45, 1.00)
style.Colors[imgui.Col.SeparatorHovered] = imgui.ImVec4(0.50, 0.50, 0.55, 1.00)
style.Colors[imgui.Col.SeparatorActive] = imgui.ImVec4(0.60, 0.60, 0.65, 1.00)
style.Colors[imgui.Col.ResizeGrip] = imgui.ImVec4(0.20, 0.20, 0.23, 1.00)
style.Colors[imgui.Col.ResizeGripHovered] = imgui.ImVec4(0.25, 0.25, 0.28, 1.00)
style.Colors[imgui.Col.ResizeGripActive] = imgui.ImVec4(0.30, 0.30, 0.34, 1.00)
style.Colors[imgui.Col.PlotLines] = imgui.ImVec4(0.61, 0.61, 0.64, 1.00)
style.Colors[imgui.Col.PlotLinesHovered] = imgui.ImVec4(0.70, 0.70, 0.75, 1.00)
style.Colors[imgui.Col.PlotHistogram] = imgui.ImVec4(0.61, 0.61, 0.64, 1.00)
style.Colors[imgui.Col.PlotHistogramHovered] = imgui.ImVec4(0.70, 0.70, 0.75, 1.00)
style.Colors[imgui.Col.TextSelectedBg] = imgui.ImVec4(0.30, 0.30, 0.34, 1.00)
style.Colors[imgui.Col.ModalWindowDimBg] = imgui.ImVec4(0.10, 0.10, 0.12, 0.80)
style.Colors[imgui.Col.Tab] = imgui.ImVec4(0.18, 0.20, 0.22, 1.00)
style.Colors[imgui.Col.TabHovered] = imgui.ImVec4(0.60, 0.60, 0.90, 1.00)
style.Colors[imgui.Col.TabActive] = imgui.ImVec4(0.28, 0.56, 0.96, 1.00)
end