- 34
- 3
- Версия MoonLoader
- .026-beta
Подскажите что делаю не так,почему не работает отрывок кода (Онлайн банд). Скрипт работает, команда находится, но в чат не чего не выводится,а так же не открывается
imgui.OpenPopup
Полностью код скинул. Кто разбирается, подскажите в чём у меня ошибка. Выделил участок кода который должен работать, но не работает
imgui.OpenPopup
Полностью код скинул. Кто разбирается, подскажите в чём у меня ошибка. Выделил участок кода который должен работать, но не работает
Код:
require 'moonloader'
local imgui = require 'mimgui'
local inicfg = require 'inicfg'
local sampev = require('lib.samp.events')
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new = imgui.new
local sc_name, tab = 'Test.ini', 1
local WinState = imgui.new.bool()
local active_scriptU = imgui.new.bool()
local active_scriptUU = imgui.new.bool()
local active_scriptUUU = imgui.new.bool()
local active_scriptUUUU = imgui.new.bool()
local settings = inicfg.load({
main = {
active_invite = false,
active_scriptuval = false,
active_probiv = false,
onlineB = false,
onlineGrove = false,
onlineBallas = false,
onlineVagos = false,
onlineRifa = false,
onlineWolfs = false,
onlineAztec = false,
OPX = 13,
OPY = 992,
CPX = 13,
CPY = 992,
}
}, sc_name);
local active_invite = imgui.new.bool(settings.main.active_invite)
local active_scriptuval = imgui.new.bool(settings.main.active_scriptuval)
local active_probiv = imgui.new.bool(settings.main.active_probiv)
local onlineB = imgui.new.bool(settings.main.onlineB)
local onlineGrove = imgui.new.bool(settings.main.onlineGrove)
local onlineBallas = imgui.new.bool(settings.main.onlineBallas)
local onlineVagos = imgui.new.bool(settings.main.onlineVagos)
local onlineRifa = imgui.new.bool(settings.main.onlineRifa)
local onlineWolfs = imgui.new.bool(settings.main.onlineWolfs)
local onlineAztec = imgui.new.bool(settings.main.onlineAztec)
local grove = imgui.new.bool()
local ballas = imgui.new.bool()
local rifa = imgui.new.bool()
local aztec = imgui.new.bool()
local wolfs = imgui.new.bool()
local vagos = imgui.new.bool()
local words = {'псж','psj','увал','увольте'}
local font = renderCreateFont('TimesNewRoman', 12, 5)
local st = {
nick = '',
bool = false,
timer = -1,
id = -1,
}
local colorList = {u8'Красная', u8'Зелёная',u8'Синяя', u8'Тёмно-красная'} -- создаём таблицу с названиями тем
local colorListNumber = new.int() -- создаём буфер где будет хранится номер выбранной темы
local colorListBuffer = new['const char*'][#colorList](colorList) -- создаём буфер для списка
local clistgrove = 0x99009327
local clistballas = 0x99CC00CC
local clistrifa = 0x996666FF
local clistvagos = 0x99D1DB1C
local clistaztec = 0x9900FFE2
local clistnightwolfs = 0x807F6464
ogrove = 0
oballas = 0
orifa = 0
ovagos = 0
oaztec = 0
onightwolfs = 0
function imgui.Link(link, text) -- link
text = text or link
local tSize = imgui.CalcTextSize(text)
local p = imgui.GetCursorScreenPos()
local DL = imgui.GetWindowDrawList()
local col = { 0xFFFF7700, 0xFFFF9900 }
if imgui.InvisibleButton("##" .. link, tSize) then os.execute("explorer " .. link) end
local color = imgui.IsItemHovered() and col[1] or col[2]
DL:AddText(p, color, text)
DL:AddLine(imgui.ImVec2(p.x, p.y + tSize.y), imgui.ImVec2(p.x + tSize.x, p.y + tSize.y), color)
end
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(700, 420), imgui.Cond.Always)
imgui.Begin(u8'Пример', nil, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoTitleBar)
imgui.SameLine()
imgui.SetCursorPos(imgui.ImVec2(5, 8))
imgui.BeginChild('##left', imgui.ImVec2(160, 305), true)
for numberTab, nameTab in pairs({ 'Инфо','Основное','Для 9+ рангов', 'Другое', 'Настройки'}) do
if imgui.Button(u8(nameTab), imgui.ImVec2(148,55)) then
tab = numberTab
end
end
imgui.EndChild()
imgui.SameLine()
imgui.SetCursorPos(imgui.ImVec2(170, 8))
if imgui.BeginChild('right'..tab, imgui.ImVec2(510, 305), true) then
-- Содержимое вкладок
if tab == 1 then
imgui.Text(u8'text')
imgui.Link("https://vk.com",u8'vk')
imgui.Text(u8'И')
imgui.Text(u8'text')
imgui.Text(u8'text')
imgui.Text(u8'text')
end
if tab == 2 then
if imgui.Checkbox(u8'Авто пробив игрока', active_probiv) then
settings.main.active_probiv = active_probiv[0]
inicfg.save(settings, sc_name)
end
end
if tab == 3 then
if imgui.Checkbox(u8'Быстрый инвайт', active_invite) then
settings.main.active_invite = active_invite[0]
inicfg.save(settings, sc_name)
end
if imgui.Checkbox(u8'Быстрое увольнение', active_scriptuval) then
settings.main.active_scriptuval = active_scriptuval[0]
inicfg.save(settings, sc_name)
end
imgui.Checkbox(u8'Тест1', active_scriptU)
imgui.Checkbox(u8'Тест2', active_scriptUU)
imgui.Checkbox(u8'Тест3', active_scriptUUU)
imgui.Checkbox(u8'Тест4', active_scriptUUUU)
end
end
if tab == 4 then
if imgui.Checkbox(u8'Онлайн банд', onlineB) then
settings.main.onlineB = onlineB[0]
inicfg.save(settings, sc_name)
end
imgui.SameLine()
imgui.Text(u8'Онлайн банд')
imgui.SameLine()
if imgui.Button('+') then imgui.OpenPopup(u8'onlineB') end
if imgui.BeginPopup(u8'checkonline') then
imgui.Text(u8'Кол-во участников банд\nТакже по команде /cho')
if imgui.Button(u8'Изменить пoзицию##sa') then
changecheckonlinepos = true
msg('Нажмите ЛКМ чтобы сохранить позицию.')
end
if imgui.Text(u8'Изменить отображение банд:') then
imgui.Text(u8'Grove')
imgui.SameLine()
if imgui.Checkbox('##Grove', grove) then settings.main.onlineGrove = onlineGrove[0] inicfg.save(settings, sc_name) end
imgui.Text(u8'Ballas')
imgui.SameLine()
if imgui.Checkbox('##Ballas', ballas) then settings.main.onlineBallas = onlineBallas[0] inicfg.save(settings, sc_name) end
imgui.Text(u8'Los Santos Vagos')
imgui.SameLine()
if imgui.Checkbox('##Vagos', vagos) then settings.main.onlineVagos = onlineVagos[0] inicfg.save(settings, sc_name) end
imgui.Text(u8'Varrios Los Aztecaz')
imgui.SameLine()
if imgui.Checkbox('##Aztec', aztec) then settings.main.onlineAztec = onlineAztec[0] inicfg.save(settings, sc_name) end
imgui.Text(u8'Rifa')
imgui.SameLine()
if imgui.Checkbox('##Rifa', rifa) then settings.main.onlineRifa = onlineRifa[0] inicfg.save(settings, sc_name) end
imgui.Text(u8'Night Wolfs')
imgui.SameLine()
if imgui.Checkbox('##Night Wolfs', wolfs) then settings.main.onlineWolfs = onlineWolfs[0] inicfg.save(settings, sc_name) end
imgui.EndPopup()
end
end
--[[settings.main.onlineGrove = onlineGrove[0]
inicfg.save(settings, sc_name)
settings.main.onlineBallas = onlineBallas[0]
inicfg.save(settings, sc_name)
settings.main.onlineVagos = nlineVagos[0]
inicfg.save(settings, sc_name)
settings.main.onlineRifa = onlineRifa[0]
inicfg.save(settings, sc_name)
settings.main.onlineWolfs = onlineWolfs[0] ]] --ХЗ НУЖНО ЛИ ПРОПИСЫВАТЬ ЭТО ТУТ ЕЩЁ
end
if tab == 5 then
imgui.Text(u8'Текущая тема: '..colorList[colorListNumber[0]+1])
if imgui.Combo(u8'Темы',colorListNumber,colorListBuffer, #colorList) then
theme[colorListNumber[0]+1].change()
end
end
imgui.EndChild()
imgui.SetCursorPosY(imgui.GetCursorPosY()+10)
imgui.SetCursorPosX(imgui.GetCursorPosX()+5)
imgui.Text(u8("text"))
imgui.SameLine(95)
imgui.SetCursorPosY(imgui.GetCursorPosY()-6)
imgui.SetCursorPosX(imgui.GetCursorPosX()-23)
if imgui.Button("text", imgui.ImVec2(90, 25)) then
os.execute(("start %s"):format('https://'))
end
imgui.SameLine(95)
imgui.SetCursorPosY(imgui.GetCursorPosY()-1)
imgui.SetCursorPosX(imgui.GetCursorPosX()+80)
if imgui.Button("Blasthak", imgui.ImVec2(503, 25)) then
os.execute(("start %s"):format('https://'))
end
imgui.End()
end)
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('ghelper', function() WinState[0] = not WinState[0] end)
while true do
wait(0)
if active_invite[0] then
if wasKeyPressed(0x31) and not sampIsChatInputActive() and not sampIsDialogActive() then
local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if result then
_, id = sampGetPlayerIdByCharHandle(ped)
sampSendChat('/me передал бандану')
wait(1000)
sampSendChat('/givecbook '..id..' 100')
wait(100)
sampSendChat('/invite '..id)
setVirtualKeyDown(13, true)
wait(100)
setVirtualKeyDown(13, false)
if accept and t:find("(%S+)_(%S+) принял ваше предложение вступить к вам в организацию.") then
sampSendChat("/giverank "..id.." 6")
accept = false
end
accept = true
end
end
end
end
end
if active_scriptuval[0] then
if st.bool and st.timer ~= -1 then
timer = os.clock()-st.timer
renderFontDrawText(font,'Нажми Y чтоб уволить '..st.nick..' или N чтоб не увольнять\nВремени на раздумья 6 сек, прошло: '..tostring(os.date("!*t", timer).sec), 500, 500, 0xFFFFFFFF)
if timer > 5 or wasKeyPressed(0x59) or wasKeyPressed(0x4E) then
if wasKeyPressed(0x59) then
sampSendChat('/uninvite '..st.id..' ПСЖ')
end
st.bool = false
st.timer = -1
end
end
end
function sampev.onServerMessage(color, text)
for k, v in pairs(words) do
local nick, msg = text:match('(.+) говорит: (.+)')
if nick and msg:find(v) then
st.nick = nick
st.id = sampGetPlayerIdByNickname(nick:gsub(' ','_'))
st.bool = true
st.timer = os.clock()
end
end
end
function sampGetPlayerIdByNickname(nick)
local _, myid = sampGetPlayerIdByCharHandle(playerPed)
if tostring(nick:gsub('%[%d+%]','')) == sampGetPlayerNickname(myid):gsub('%[%d+%]','') then return myid end
for i = 0, sampGetMaxPlayerId() do
if sampIsPlayerConnected(i) and sampGetPlayerNickname(i):gsub('%[%d+%]','') == nick then return i end
end
end
local on = require('lib.samp.events')
local damag_status = false
function on.onSendTakeDamage(playerId, damage, weapon)
if active_probiv[0] then
if playerId ~= 65535 and damag_status then
local kd = os.clock()
local id = playerId
sampSendChat("/time")
sampSendChat("/id " .. id)
damag_status = false
end
end
end
function probiv()
repeat wait(0) until isSampAvailable()
while true do
wait(0)
if isKeyDown(57) then
damag_status = not damag_status
end
end
end
sampRegisterChatCommand("cho", function()
if onlineB[0] then
ogrove,oballas,orifa,ovagos,oaztec,onightwolfs = 0,0,0,0,0,0
for l = 0, 1004 do
if sampIsPlayerConnected(l) then
if sampGetPlayerColor(l) == clistgrove then
ogrove = ogrove + 1
elseif sampGetPlayerColor(l) == clistballas then
oballas = oballas + 1
elseif sampGetPlayerColor(l) == clistrifa then
orifa = orifa + 1
elseif sampGetPlayerColor(l) == clistvagos then
ovagos = ovagos + 1
elseif sampGetPlayerColor(l) == clistaztec then
oaztec = oaztec + 1
elseif sampGetPlayerColor(l) == clistnightwolfs then
onightwolfs = onightwolfs + 1
end
end
end
msg('')
if settings.main.onlineGrove then msg("{009327}Grove Str: {ef3226}"..ogrove) end
if settings.main.onlineBallas then msg("{CC00CC}Ballas: {ef3226}"..oballas) end
if settings.main.onlineVagos then msg("{D1DB1C}Los Santos Vagos: {ef3226}"..ovagos) end
if settings.main.onlineAztec then msg("{00FFE2}Varrios Los Aztecaz: {ef3226}"..oaztec) end
if settings.main.onlineRifa then msg("{6666FF}Rifa: {ef3226}"..orifa) end
if settings.main.onlineNightWolfs then msg("{7F6464}Night Wolfs: {ef3226}"..onightwolfs) end
msg('')
end
end)
function onlineupdate()
while true do wait(0)
if settings.main.onlineB then
renderFontDrawText(font, (settings.main.onlineGrove and "{009327}Grove Str: {ef3226}"..ogrove or '')..(settings.main.onlineBallas and "\n{CC00CC}Ballas: {ef3226}"..oballas or '')..(settings.mainmain.onlineVagos and "\n{D1DB1C}Los Santos Vagos: {ef3226}"..ovagos or '')..(settings.main.onlineAztec and "\n{00FFE2}Varrios Los Aztecaz: {ef3226}"..oaztec or '')..(settings.main.onlineRifa and "\n{6666FF}Rifa: {ef3226}"..orifa or '')..(settings.main.OnlineNightWolfs and "\n{7F6464}Night Wolfs: {ef3226}"..onightwolfs or ''), cfg.config.OPX, cfg.config.OPY,0xffffffff)
ogrove,oballas,orifa,ovagos,oaztec,onightwolfs = 0,0,0,0,0,0
for l = 0, 1004 do
if sampIsPlayerConnected(l) then
if sampGetPlayerColor(l) == clistgrove then
ogrove = ogrove + 1
elseif sampGetPlayerColor(l) == clistballas then
oballas = oballas + 1
elseif sampGetPlayerColor(l) == clistrifa then
orifa = orifa + 1
elseif sampGetPlayerColor(l) == clistvagos then
ovagos = ovagos + 1
elseif sampGetPlayerColor(l) == clistaztec then
oaztec = oaztec + 1
elseif sampGetPlayerColor(l) == clistnightwolfs then
onightwolfs = onightwolfs + 1
end
end
end
end
end
end
if changestatspos then
sampToggleCursor(true)
local CPX, CPY = getCursorPos()
settings.main.CPX = CPX
settings.main.CPY = CPY
inicfg.save(settings, sc_name)
end
if isKeyJustPressed(VK_LBUTTON) and changecheckonlinepos then
changecheckonlinepos = false
sampToggleCursor(false)
msg('Позиция сохранена.')
end
if changecheckonlinepos then
sampToggleCursor(true)
local CPX, CPY = getCursorPos()
settings.main.OPX = CPX
settings.main.OPY = CPY
inicfg.save(settings, sc_name)
end
if isKeyJustPressed(VK_LBUTTON) and changestatspos then
changestatspos = false
sampToggleCursor(false)
msg('Позиция сохранена.')
end
theme = { -- style
{
change = function()
local ImVec4 = imgui.ImVec4
imgui.SwitchContext()
imgui.GetStyle().Colors[imgui.Col.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.06, 0.06, 0.06, 0.94)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = ImVec4(1.00, 1.00, 1.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
imgui.GetStyle().Colors[imgui.Col.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = ImVec4(0.48, 0.16, 0.16, 0.54)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = ImVec4(0.98, 0.26, 0.26, 0.67)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = ImVec4(0.48, 0.16, 0.16, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = ImVec4(0.31, 0.31, 0.31, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = ImVec4(0.41, 0.41, 0.41, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = ImVec4(0.51, 0.51, 0.51, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = ImVec4(0.88, 0.26, 0.24, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = ImVec4(0.98, 0.06, 0.06, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = ImVec4(0.98, 0.26, 0.26, 0.31)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = ImVec4(0.98, 0.26, 0.26, 0.80)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.Separator] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = ImVec4(0.75, 0.10, 0.10, 0.78)
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = ImVec4(0.75, 0.10, 0.10, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = ImVec4(0.98, 0.26, 0.26, 0.25)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = ImVec4(0.98, 0.26, 0.26, 0.67)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = ImVec4(0.98, 0.26, 0.26, 0.95)
imgui.GetStyle().Colors[imgui.Col.Tab] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.TabHovered] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabActive] = ImVec4(0.98, 0.06, 0.06, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabUnfocused] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabUnfocusedActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 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.98, 0.26, 0.26, 0.35)
end
},
{
change = function()
local ImVec4 = imgui.ImVec4
imgui.SwitchContext()
imgui.GetStyle().Colors[imgui.Col.Text] = ImVec4(0.90, 0.90, 0.90, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = ImVec4(0.60, 0.60, 0.60, 1.00)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.08, 0.08, 0.08, 1.00)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = ImVec4(0.10, 0.10, 0.10, 1.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = ImVec4(0.08, 0.08, 0.08, 1.00)
imgui.GetStyle().Colors[imgui.Col.Border] = ImVec4(0.70, 0.70, 0.70, 0.40)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = ImVec4(0.15, 0.15, 0.15, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = ImVec4(0.19, 0.19, 0.19, 0.71)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = ImVec4(0.34, 0.34, 0.34, 0.79)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = ImVec4(0.00, 0.69, 0.33, 0.80)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = ImVec4(0.00, 0.74, 0.36, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = ImVec4(0.00, 0.69, 0.33, 0.50)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = ImVec4(0.00, 0.80, 0.38, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = ImVec4(0.16, 0.16, 0.16, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = ImVec4(0.00, 0.82, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = ImVec4(0.00, 1.00, 0.48, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = ImVec4(0.00, 0.77, 0.37, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = ImVec4(0.00, 0.82, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = ImVec4(0.00, 0.87, 0.42, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = ImVec4(0.00, 0.76, 0.37, 0.57)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = ImVec4(0.00, 0.88, 0.42, 0.89)
imgui.GetStyle().Colors[imgui.Col.Separator] = ImVec4(1.00, 1.00, 1.00, 0.40)
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = ImVec4(1.00, 1.00, 1.00, 0.60)
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = ImVec4(1.00, 1.00, 1.00, 0.80)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = ImVec4(0.00, 0.76, 0.37, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = ImVec4(0.00, 0.86, 0.41, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = ImVec4(0.00, 0.74, 0.36, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogram] = ImVec4(0.00, 0.69, 0.33, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered] = ImVec4(0.00, 0.80, 0.38, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextSelectedBg] = ImVec4(0.00, 0.69, 0.33, 0.72)
end
},
{
change = function()
local ImVec4 = imgui.ImVec4
imgui.SwitchContext()
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.08, 0.08, 0.08, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = ImVec4(0.16, 0.29, 0.48, 0.54)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = ImVec4(0.26, 0.59, 0.98, 0.40)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = ImVec4(0.26, 0.59, 0.98, 0.67)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = ImVec4(0.16, 0.29, 0.48, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = ImVec4(0.24, 0.52, 0.88, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = ImVec4(0.26, 0.59, 0.98, 0.40)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = ImVec4(0.06, 0.53, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = ImVec4(0.26, 0.59, 0.98, 0.31)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = ImVec4(0.26, 0.59, 0.98, 0.80)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.Separator] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = ImVec4(0.26, 0.59, 0.98, 0.78)
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = ImVec4(0.26, 0.59, 0.98, 0.25)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = ImVec4(0.26, 0.59, 0.98, 0.67)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = ImVec4(0.26, 0.59, 0.98, 0.95)
imgui.GetStyle().Colors[imgui.Col.TextSelectedBg] = ImVec4(0.26, 0.59, 0.98, 0.35)
imgui.GetStyle().Colors[imgui.Col.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.06, 0.53, 0.98, 0.70)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = ImVec4(0.10, 0.10, 0.10, 1.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = ImVec4(0.06, 0.53, 0.98, 0.70)
imgui.GetStyle().Colors[imgui.Col.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = ImVec4(0.31, 0.31, 0.31, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = ImVec4(0.41, 0.41, 0.41, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = ImVec4(0.51, 0.51, 0.51, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 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)
end
},
{
change = function()
local ImVec4 = imgui.ImVec4
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(1.00, 1.00, 1.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = ImVec4(1.00, 1.00, 1.00, 0.43);
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.00, 0.00, 0.00, 0.90);
imgui.GetStyle().Colors[imgui.Col.ChildBg] = ImVec4(1.00, 1.00, 1.00, 0.07);
imgui.GetStyle().Colors[imgui.Col.PopupBg] = ImVec4(0.00, 0.00, 0.00, 0.94);
imgui.GetStyle().Colors[imgui.Col.Border] = ImVec4(1.00, 1.00, 1.00, 0.00);
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = ImVec4(1.00, 0.00, 0.00, 0.32);
imgui.GetStyle().Colors[imgui.Col.FrameBg] = ImVec4(1.00, 1.00, 1.00, 0.09);
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = ImVec4(1.00, 1.00, 1.00, 0.17);
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = ImVec4(1.00, 1.00, 1.00, 0.26);
imgui.GetStyle().Colors[imgui.Col.TitleBg] = ImVec4(0.19, 0.00, 0.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = ImVec4(0.46, 0.00, 0.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = ImVec4(0.20, 0.00, 0.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = ImVec4(0.14, 0.03, 0.03, 1.00);
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = ImVec4(0.19, 0.00, 0.00, 0.53);
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = ImVec4(1.00, 1.00, 1.00, 0.11);
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = ImVec4(1.00, 1.00, 1.00, 0.24);
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = ImVec4(1.00, 1.00, 1.00, 0.35);
imgui.GetStyle().Colors[imgui.Col.CheckMark] = ImVec4(1.00, 1.00, 1.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = ImVec4(1.00, 0.00, 0.00, 0.34);
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = ImVec4(1.00, 0.00, 0.00, 0.51);
imgui.GetStyle().Colors[imgui.Col.Button] = ImVec4(1.00, 0.00, 0.00, 0.19);
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = ImVec4(1.00, 0.00, 0.00, 0.31);
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = ImVec4(1.00, 0.00, 0.00, 0.46);
imgui.GetStyle().Colors[imgui.Col.Header] = ImVec4(1.00, 0.00, 0.00, 0.19);
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = ImVec4(1.00, 0.00, 0.00, 0.30);
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = ImVec4(1.00, 0.00, 0.00, 0.50);
imgui.GetStyle().Colors[imgui.Col.Separator] = ImVec4(1.00, 0.00, 0.00, 0.41);
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = ImVec4(1.00, 1.00, 1.00, 0.78);
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = ImVec4(1.00, 1.00, 1.00, 1.00);
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = ImVec4(0.19, 0.00, 0.00, 0.53);
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = ImVec4(0.43, 0.00, 0.00, 0.75);
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = ImVec4(0.53, 0.00, 0.00, 0.95);
imgui.GetStyle().Colors[imgui.Col.Tab] = ImVec4(1.00, 0.00, 0.00, 0.27);
imgui.GetStyle().Colors[imgui.Col.TabHovered] = ImVec4(1.00, 0.00, 0.00, 0.48);
imgui.GetStyle().Colors[imgui.Col.TabActive] = ImVec4(1.00, 0.00, 0.00, 0.60);
imgui.GetStyle().Colors[imgui.Col.TabUnfocused] = ImVec4(1.00, 0.00, 0.00, 0.27);
imgui.GetStyle().Colors[imgui.Col.TabUnfocusedActive] = ImVec4(1.00, 0.00, 0.00, 0.54);
imgui.GetStyle().Colors[imgui.Col.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00);
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 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(1.00, 1.00, 1.00, 0.35);
imgui.GetStyle().Colors[imgui.Col.DragDropTarget] = ImVec4(1.00, 1.00, 0.00, 0.90);
imgui.GetStyle().Colors[imgui.Col.NavHighlight] = ImVec4(0.26, 0.59, 0.98, 1.00);
imgui.GetStyle().Colors[imgui.Col.NavWindowingHighlight] = ImVec4(1.00, 1.00, 1.00, 0.70);
imgui.GetStyle().Colors[imgui.Col.NavWindowingDimBg] = ImVec4(0.80, 0.80, 0.80, 0.20);
imgui.GetStyle().Colors[imgui.Col.ModalWindowDimBg] = ImVec4(0.80, 0.80, 0.80, 0.35);
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(1.00, 1.00, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = ImVec4(0.06, 0.06, 0.06, 0.94)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = ImVec4(1.00, 1.00, 1.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
imgui.GetStyle().Colors[imgui.Col.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = ImVec4(0.48, 0.16, 0.16, 0.54)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = ImVec4(0.98, 0.26, 0.26, 0.67)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = ImVec4(0.48, 0.16, 0.16, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = ImVec4(0.31, 0.31, 0.31, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = ImVec4(0.41, 0.41, 0.41, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = ImVec4(0.51, 0.51, 0.51, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = ImVec4(0.88, 0.26, 0.24, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = ImVec4(0.98, 0.06, 0.06, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = ImVec4(0.98, 0.26, 0.26, 0.31)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = ImVec4(0.98, 0.26, 0.26, 0.80)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.Separator] = ImVec4(0.43, 0.43, 0.50, 0.50)
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = ImVec4(0.75, 0.10, 0.10, 0.78)
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = ImVec4(0.75, 0.10, 0.10, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = ImVec4(0.98, 0.26, 0.26, 0.25)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = ImVec4(0.98, 0.26, 0.26, 0.67)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = ImVec4(0.98, 0.26, 0.26, 0.95)
imgui.GetStyle().Colors[imgui.Col.Tab] = ImVec4(0.98, 0.26, 0.26, 0.40)
imgui.GetStyle().Colors[imgui.Col.TabHovered] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabActive] = ImVec4(0.98, 0.06, 0.06, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabUnfocused] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabUnfocusedActive] = ImVec4(0.98, 0.26, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 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.98, 0.26, 0.26, 0.35)
end