- 67
- 7
- Версия MoonLoader
- .027.0-preview
как изменить цвет окна имгуи? вставляю код на смену цвета, в игре остается стандартный цвет
код:
код:
Код:
local imgui = require 'mimgui'
local sampev = require 'lib.samp.events'
local ffi = require 'ffi'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new, str = imgui.new, ffi.string
local inputField = new.char[256]()
local sizeX, sizeY = getScreenResolution()
local WinState, sec, min, vra, schat, jchat, dep = new.bool(), new.int(0), new.int(0), new.bool(), new.bool(), new.bool(), new.bool()
local status = false
local newFrame = imgui.OnFrame(
function() return WinState[0] end,
function(player)
imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 4, sizeY / 4), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(345, 150), imgui.Cond.Always)
imgui.Begin('AutoAD', WinState, imgui.WindowFlags.NoResize)
imgui.PushItemWidth(250)
imgui.InputText(" ", inputField, 256)
imgui.PopItemWidth()
if imgui.Button(u8"Запустить") and inputField ~= nil and status == false then
if sec[0] ~= 0 or min[0] ~= 0 then
status = true
end
end
imgui.SameLine()
if imgui.Button(u8"Остановить") then status = false end
imgui.SameLine()
imgui.Checkbox('/vr', vra)
imgui.SameLine()
imgui.Checkbox('/s', schat)
imgui.SameLine()
imgui.Checkbox('/j', jchat)
imgui.SameLine()
imgui.Checkbox('/d', dep)
imgui.SliderInt(u8'Секунды', sec, 0, 60)
imgui.SliderInt(u8'Минуты', min, 0, 60)
imgui.End()
end
)
function main()
while not isSampAvailable() do wait(50) end
sampRegisterChatCommand('aad', function() WinState[0] = not WinState[0] end)
while true do
if status then
wait((sec[0])*1000)
wait(min[0]*60000)
if vra[0] and status then
sampSendChat('/vr '..u8:decode(str(inputField)))
end
if schat[0] and status then
sampSendChat('/s '..u8:decode(str(inputField)))
end
if jchat[0] and status then
sampSendChat('/j ' ..u8:decode(str(inputField)))
end
if dep[0] and status then
sampSendChat('/d ' ..u8:decode(str(inputField)))
end
end
wait(0)
end
end
function sampev.onShowDialog(id, style, title, button1, button2, text)
if status and vra[0] then
if text:match('Ваше сообщение является рекламой') then
sampSendDialogResponse(id,1,0,'')
return false
end
end
end
function SetStyle()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
style.WindowPadding = imgui.ImVec2(9, 5)
style.WindowRounding = 10
style.ChildWindowRounding = 10
style.FramePadding = imgui.ImVec2(5, 3)
style.FrameRounding = 6.0
style.ItemSpacing = imgui.ImVec2(9.0, 3.0)
style.ItemInnerSpacing = imgui.ImVec2(9.0, 3.0)
style.IndentSpacing = 21
style.ScrollbarSize = 6.0
style.ScrollbarRounding = 13
style.GrabMinSize = 17.0
style.GrabRounding = 16.0
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
colors[clr.Text] = ImVec4(0.90, 0.90, 0.90, 1.00)
colors[clr.TextDisabled] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.WindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.PopupBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.Border] = ImVec4(0.82, 0.77, 0.78, 1.00)
colors[clr.BorderShadow] = ImVec4(0.35, 0.35, 0.35, 0.66)
colors[clr.FrameBg] = ImVec4(1.00, 1.00, 1.00, 0.28)
colors[clr.FrameBgHovered] = ImVec4(0.68, 0.68, 0.68, 0.67)
colors[clr.FrameBgActive] = ImVec4(0.79, 0.73, 0.73, 0.62)
colors[clr.TitleBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.46, 0.46, 0.46, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.MenuBarBg] = ImVec4(0.00, 0.00, 0.00, 0.80)
colors[clr.ScrollbarBg] = ImVec4(0.00, 0.00, 0.00, 0.60)
colors[clr.ScrollbarGrab] = ImVec4(1.00, 1.00, 1.00, 0.87)
colors[clr.ScrollbarGrabHovered] = ImVec4(1.00, 1.00, 1.00, 0.79)
colors[clr.ScrollbarGrabActive] = ImVec4(0.80, 0.50, 0.50, 0.40)
colors[clr.ComboBg] = ImVec4(0.24, 0.24, 0.24, 0.99)
colors[clr.CheckMark] = ImVec4(0.99, 0.99, 0.99, 0.52)
colors[clr.SliderGrab] = ImVec4(1.00, 1.00, 1.00, 0.42)
colors[clr.SliderGrabActive] = ImVec4(0.76, 0.76, 0.76, 1.00)
colors[clr.Button] = ImVec4(0.51, 0.51, 0.51, 0.60)
colors[clr.ButtonHovered] = ImVec4(0.68, 0.68, 0.68, 1.00)
colors[clr.ButtonActive] = ImVec4(0.67, 0.67, 0.67, 1.00)
colors[clr.Header] = ImVec4(0.72, 0.72, 0.72, 0.54)
colors[clr.HeaderHovered] = ImVec4(0.92, 0.92, 0.95, 0.77)
colors[clr.HeaderActive] = ImVec4(0.82, 0.82, 0.82, 0.80)
colors[clr.Separator] = ImVec4(0.73, 0.73, 0.73, 1.00)
colors[clr.SeparatorHovered] = ImVec4(0.81, 0.81, 0.81, 1.00)
colors[clr.SeparatorActive] = ImVec4(0.74, 0.74, 0.74, 1.00)
colors[clr.ResizeGrip] = ImVec4(0.80, 0.80, 0.80, 0.30)
colors[clr.ResizeGripHovered] = ImVec4(0.95, 0.95, 0.95, 0.60)
colors[clr.ResizeGripActive] = ImVec4(1.00, 1.00, 1.00, 0.90)
colors[clr.CloseButton] = ImVec4(0.45, 0.45, 0.45, 0.50)
colors[clr.CloseButtonHovered] = ImVec4(0.70, 0.70, 0.90, 0.60)
colors[clr.CloseButtonActive] = ImVec4(0.70, 0.70, 0.70, 1.00)
colors[clr.PlotLines] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.PlotLinesHovered] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.PlotHistogram] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextSelectedBg] = ImVec4(1.00, 1.00, 1.00, 0.35)
colors[clr.ModalWindowDarkening] = ImVec4(0.88, 0.88, 0.88, 0.35)
end