Помогите исрпавить код бота на ферму

angel.wqxx

Новичок
Автор темы
8
2
Всем привет! Решил создать бота для проекта "Жизнь в деревне (1 сервер) ферма номер 2" из исходного кода для Аризоны. Поменял координаты, добавил imgui, но... После запуска бота: он телепортировался на ферму и его сразу кикает (а мне нужно, чтобы он шел, ну это я потом заменю) и просто стоит. Посмотрите, кто может, исправьте ошибки.


FarmBot:
script_name('FarmBot')
script_author('angel.wqxx')
script_version(1.3)
local farms = {
    [1] = {
        farm = {x = 433.85577392578, y = 1518.6507568359, z = 11.826860427856},
        barn = {x = 438.37326049805, y = 1551.1828613281, z = 11.510150909424},
        barrel = {x = 446.02053833008, y = 1569.9761962891, z = 11.510150909424},
        corners = {
            {x = 449.27932739258, y = 1528.5333251953, z = 8.4226112365723},
            {x = 460.7633972168, y = 1488.54455566411, z = 5.0918140411377}
        },
        tasks = 0,
        selected = false
    },
}

local samp = require 'samp.events'
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local window = imgui.ImBool(false)
local stats = imgui.ImBool(false)
local active = imgui.ImBool(false)
local SelectedCrop = imgui.ImInt(0)
local SelectedFarm = imgui.ImInt(0)

local crops = {
    [0] = u8'Автоматически',
}
local LabelFarms = {
    [0] = u8'Автоматически',
    u8'Ферма №2',
}

local states = {u8'Выкапывание', u8'Посев', u8'Полив', u8'Прополка', u8'Сбор урожая'}
local labels = {}
local loop = 0
local hands = true
local processed = false
local filled = false

local farm = 0
local scrop = ''
local choosing = false
local start = os.clock()
local status = ''
local tasks = 0
local income = 0
local count = 0
local bed = 0
local stuck_count = 0
local stuck_timer = os.clock()+15
local stuck_pos = {}
local tasklist = {}

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("БОТ: Ферма [BY ANGEL]", 0x00DD00)
    sampRegisterChatCommand('fbot', function()
        window.v = not window.v
    end)
    while true do
        wait(0)
        imgui.Process = window.v or stats.v
        imgui.ShowCursor = window.v
        farm = SelectedFarm.v ~= 0 and SelectedFarm.v or farm
        scrop = SelectedCrop.v ~= 0 and crops[SelectedCrop.v] or scrop
        if active.v then
            for i, v in ipairs(getAllVehicles()) do deleteCar(v) end
            if stuck_timer-os.clock() <= 0 then
                local x, y, z = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(x, y, z, stuck_pos[1], stuck_pos[2], stuck_pos[3]) <= 3 then
                    stuck_count = stuck_count + 1
                    stuck_timer = os.clock()+15
                    stuck_pos = {getCharCoordinates(PLAYER_PED)}
                    if stuck_count >= 8 then
                        print('Сработала защита от простоя. Перезапуск бота.')
                        sampAddChatMessage('[FarmBot] {FFFFFF}Сработала защита от простоя. Перезапуск бота.', 0x993066)
                        if bot_thread then bot_thread:terminate() loop = 0 end
                        bot_thread = lua_thread.create(bot)
                    end
                else
                    stuck_count = 0
                    stuck_timer = os.clock()+15
                    stuck_pos = {getCharCoordinates(PLAYER_PED)}
                end
            end
        end
    end
end

function imgui.OnDrawFrame()
    if window.v then
        local X, Y = getScreenResolution()
        imgui.SetNextWindowSize(imgui.ImVec2(227, 145), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2(X / 2, Y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.Begin(u8'Бот Фермер', window, imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysAutoResize)
            if imgui.Checkbox(u8'Включить бота', active) then
                sampAddChatMessage('[FarmBot] {FFFFFF}'..(active.v and 'Включен' or 'Выключен'), 0x993066)
                if active.v then
                    start = os.clock()
                    stuck_count = 0
                    stuck_timer = os.clock()+15
                    stuck_pos = {getCharCoordinates(PLAYER_PED)}
                    tasks = 0
                    income = 0
                    bot_thread = lua_thread.create(bot)
                else
                    if bot_thread then bot_thread:terminate() loop = 0 end
                end
            end
            imgui.Checkbox(u8'Статистика', stats)
            imgui.PushItemWidth(155)
            imgui.Combo(u8'Ферма', SelectedFarm, LabelFarms)
            imgui.Combo(u8'Культура', SelectedCrop, crops)
            imgui.PopItemWidth()
            imgui.SetCursorPosX((imgui.GetWindowSize().x-imgui.CalcTextSize('by angel.wqxx').x)/2)
            imgui.TextDisabled('by angel.wqxx')
        imgui.End()
    end
    if stats.v then
        local X, Y = getScreenResolution()
        imgui.SetNextWindowSize(imgui.ImVec2(190, 148), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2(convertGameScreenCoordsToWindowScreenCoords(560, 350)), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.Begin('##stats', _, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoScrollbar)
            imgui.SetCursorPosX((190-imgui.CalcTextSize(u8'Статистика бота').x)/2)
            imgui.Text(u8'Статистика бота')
            imgui.Text(u8'Прошло:') imgui.SameLine()
            imgui.TextDisabled(active.v and os.date('!%H:%M:%S', os.clock()-start) or '00:00:00')
            imgui.Text(u8'Заработано:') imgui.SameLine()
            imgui.TextDisabled(splitMoney(income)..'$')
            imgui.Text(u8'Статус:') imgui.SameLine()
            imgui.TextDisabled(active.v and status or u8'Выключен')
            imgui.Text(u8'Этап:') imgui.SameLine()
            imgui.TextDisabled((active.v and loop ~= 0) and states[loop]..' ('..bed..'/'..(bed > count and bed or count)..')' or u8'Ожидание')
            imgui.Text(u8'Ферма:') imgui.SameLine()
            imgui.TextDisabled(tostring(farm))
            imgui.Text(u8'Культура:') imgui.SameLine()
            imgui.TextDisabled(scrop)
            imgui.SetCursorPosX((imgui.GetWindowSize().x-imgui.CalcTextSize('angel.wqxx').x)/2)
            imgui.TextDisabled('angel.wqxx')
        imgui.End()
    end
end

function samp.onShowDialog(id, s, t, b1, b2 ,text)
    if active.v then
        if id == 15182 then
            sampSendDialogResponse(id, (SelectedCrop.v == 0 and choosing) and 1 or (getCharModel(PLAYER_PED) == 132 and 0 or 1), (SelectedCrop.v == 0 and choosing) and 1 or 0, _)
            choosing = SelectedCrop.v == 0 and choosing or false
            return false
        end
        if id == 15161 then
            if loop == 2 then
                sampSendDialogResponse(id, 1, 0, _)
            else
                sampSendDialogResponse(id, 1, 1, _)
            end
            return false
        elseif id == 15162 then
            if loop == 1 or loop == 5 then
                sampSendDialogResponse(id, 1, 0, _)
                hands = false
                return false
            elseif loop == 2 then
                local i = 0
                for n in text:gmatch('[^\r\n]+') do
                    if n:find(u8:decode(scrop)) then
                        sampSendDialogResponse(id, 1, i-1, _)
                        hands = false
                        return false
                    end
                    i = i + 1
                end
            elseif loop == 3 then
                sampSendDialogResponse(id, 1, 2, _)
                hands = false
                return false
            elseif loop == 4 then
                sampSendDialogResponse(id, 1, 1, _)
                hands = false
                return false
            end
        elseif id == 15184 then
            local i = 0
            for n in text:gmatch('[^\r\n]+') do
                if n:find(u8:decode(scrop)) then
                    sampSendDialogResponse(id, 1, i, _)
                    return false
                end
                i = i + 1
            end
        end
        if t:find('Багажник') then sampSendDialogResponse(id, 0) return false end -- Фикс хуйни
        if choosing then
            if id == 705 then sampSendDialogResponse(id, 1, 7) return false end
            if id == 15160 then
                local t = {}
                for n in text:gmatch('[^\r\n]+') do
                    if n:find('Ферма №') then
                        local farm, tasks = n:match('Ферма №(%d)%s*(%d+)')
                        table.insert(t, {farm = tonumber(farm), tasks = tonumber(tasks), selected = farms[tonumber(farm)].selected})
                    end
                end
                table.sort(t, function(a, b)
                    if not a.selected and b.selected then return true
                    elseif a.selected and not b.selected then return false end
                    return a.tasks > b.tasks
                end)
                if t[1].selected then
                    for i = 1, 5 do
                        farms[i].selected = false
                    end
                    table.sort(t, function(a, b)
                        if not a.selected and b.selected then return true
                        elseif a.selected and not b.selected then return false end
                        return a.tasks > b.tasks
                    end)
                end
                farm = t[1].farm
                farms[farm].selected = true
                choosing = false
                sampSendDialogResponse(id, 1, farm-1)
                return false
            end
            if id == 15183 then
                tasklist = {}
                for n in text:gmatch('[^\r\n]+') do
                    if n:find('^%d+%.%s*(.-)%s*(%d+)%s*(.-)%s*%d+') then
                        local task, tasks, crop = n:match('^%d+%.%s*(.-)%s*(%d+)%s*(.-)%s*%d+')
                        local found = false
                        for i, v in ipairs(tasklist) do
                            if v.crop == crop then
                                v.tasks = v.tasks + 1
                                v.total = v.total + tonumber(tasks)
                                found = true
                            end
                        end
                        if not found then
                            table.insert(tasklist, {crop = crop, tasks = 1, total = tonumber(tasks)})
                        end
                    end
                end
                table.sort(tasklist, function(a, b)
                    if a.tasks > b.tasks then return true
                    elseif a.tasks < b.tasks then return false end
                    return a.total > b.total
                end)
                if #tasklist == 0 or tasklist[1].tasks < 5 then
                    lua_thread.create(function()
                        wait(0)
                        if bot_thread then bot_thread:terminate() loop = 0 end
                        wait(100)
                        bot_thread = lua_thread.create(bot)
                        print('На ферме кончились задания. Меняем ферму...')
                        sampAddChatMessage('[FarmBot] {FFFFFF}На ферме кончились задания. Меняем ферму...', 0x993066)
                    end)
                end
                choosing = false
                sampSendDialogResponse(id, 0, 0, _)
                return false
            end
        end
    end
    --print(text)
end

function samp.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text)
    if text:find('Бочка с водой  {31B404}%( {ffffff}ферма №'..farm) and active.v then
        local water = text:match('(%d+) из %d+ литров')
        if tonumber(water) < 10 then -- Скип фермы, если в бочке меньше 10л воды
            lua_thread.create(function()
                if bot_thread then bot_thread:terminate() loop = 0 end
                wait(100)
                bot_thread = lua_thread.create(bot)
                print('На ферме закончилась вода. Меняем ферму...')
                sampAddChatMessage('[FarmBot] {FFFFFF}На ферме закончилась вода. Меняем ферму...', 0x993066)
            end)
        end
    end
    if text:find('выкопана ямка') then
        local crop = text:match('для посадки саженца "(.-)"')
        for i, v in ipairs(labels) do
            if getDistanceBetweenCoords3d(position.x, position.y, position.z, v.pos.x, v.pos.y, v.pos.z) <= 1 then
                v.state = 'seeding'
                v.crop = crop
                return true
            end
        end
        table.insert(labels, {state = 'seeding', crop = crop, pos = position})
    elseif text:find('посажено') then
        local crop = text:match('посажено: %"(.-)%"')
        local state = 'none'
        if text:find('до сбора урожая') then
            state = 'growing'
        elseif text:find('полить') then
            state = 'watering'
        elseif text:find('прополоть') then
            state = 'weeding'
        elseif text:find('урожай') then
            state = 'harvesting'
        end
        for i, v in ipairs(labels) do
            if getDistanceBetweenCoords3d(position.x, position.y, position.z, v.pos.x, v.pos.y, v.pos.z) <= 1 then
                v.state = state
                v.crop = crop
                return true
            end
        end
        table.insert(labels, {state = state, crop = crop, pos = position})
    elseif text:find('свободное место') then
        for i, v in ipairs(labels) do
            if getDistanceBetweenCoords3d(position.x, position.y, position.z, v.pos.x, v.pos.y, v.pos.z) <= 1 then
                v.state = 'free'
                v.crop = 'none'
                return true
            end
        end
        table.insert(labels, {state = 'free', crop = 'none', pos = position})
    end
end

function samp.onServerMessage(color, text)
    if active.v then
        if text:find('Вы выполнили задание') and loop == 2 then
            hands = true
        end
        if text:find('Вы взяли') then
            hands = false
        elseif text:find('Вы вернули') or text:find('Вы не можете набрать воды без ведра') then
            hands = true
        elseif text:find('Вы набрали полное ведро воды') or text:find('У вас итак полное ведро') then
            filled = true
        elseif text:find('Вы выполнили задание, получено: (%d+)%$') then
            local salary = text:match('Вы выполнили задание, получено: (%d+)%$')
            income = income + tonumber(salary)
            if not pocessed then processed = true end
        elseif (text:find('Вы не можете выкопать ямку без лопаты')
            or text:find('У вас нет саженца')
            or text:find('Для начала возьмите ведро')
            or text:find('Для прополки нужны грабли')
            or text:find('Тут еще рано собирать урожай')
            or text:find('У вас должно быть полное ведро воды')
            or text:find('Вы не можете выкопать урожай без лопаты')
            or text:find('у вас уже есть в руках урожай')
            or text:find('Тут уже работает другой игрок'))
        and not processed then
            processed = true
        elseif text:find('Вы не можете работать, так как владельцу этой фермы нечем оплачивать вашу работу') then
            lua_thread.create(function()
                if bot_thread then bot_thread:terminate() loop = 0 end
                wait(100)
                bot_thread = lua_thread.create(bot)
                print('У владельца фермы кончились деньги. Меняем ферму...')
                sampAddChatMessage('[FarmBot] {FFFFFF}У владельца фермы кончились деньги. Меняем ферму...', 0x993066)
            end)
        elseif text:find('Сейчас нет заданий на') then
            lua_thread.create(function()
                if bot_thread then bot_thread:terminate() loop = 0 end
                wait(100)
                bot_thread = lua_thread.create(bot)
                print('Кончились заданияна на '..u8:decode(scrop)..'. Обновляем список...')
                sampAddChatMessage('[FarmBot] {FFFFFF}Кончились задания на {993066}'..u8:decode(scrop)..'{FFFFFF}. Обновляем список...', 0x993066)
            end)
        end
    end
end

function bot()
    status = ''
    wait(500)
    local x, y, z = getCharCoordinates(PLAYER_PED)
    if getDistanceBetweenCoords3d(x, y, z, 728.13690185547, 1799.5808105469, 1602.0047607422) <= 10 then
        status = u8'Выходим из фермы'
        runToPoint(728.51934814453, 1799.4985351563, 1602.0047607422)
        setGameKeyState(21, 255)
        wait(5000)
    end
    if SelectedFarm.v == 0 then
        status = u8'Выбираем ферму'
        choosing = true
        sampSendChat('/gps')
        while choosing do wait(0) end
        print('Теперь бот будет работать на ферме №'..farm)
        sampAddChatMessage('[FarmBot] {FFFFFF}Теперь бот будет работать на {993066}ферме №'..farm, 0x993066)
    end
    teleport(farms[farm].farm.x, farms[farm].farm.y, farms[farm].farm.z)
    if getCharModel(PLAYER_PED) ~= 132 or SelectedCrop.v == 0 then
        status = u8'Заходим в ферму'
        runToPoint(438.58700561523, 1530.0145263672, 10.813278198242)
        runToPoint(433.9250793457, 1518.7917480469, 11.826860427856)
        wait(500)
        setGameKeyState(21, 255)
        wait(5000)
        runToPoint(731.12725830078, 1799.9642333984, 1602.0047607422)
        wait(1000)
        setGameKeyState(21, 255)
        wait(500)
        setVirtualKeyDown(13, false)
        while choosing do wait(0) pressAlt() end
        status = u8'Выходим из фермы'
        runToPoint(728.51934814453, 1799.4985351563, 1602.0047607422)
        setGameKeyState(21, 255)
        wait(5000)
    end
    loop = 1
    hands = true
    while true do
        wait(0)
        for i, v in ipairs(tasklist) do
            if v.tasks >= 5 then
                scrop = u8(v.crop)
                status = u8'Ищем грядки'
                count = checkLabels()
                wait(0)
                teleport(farms[farm].barn.x, farms[farm].barn.y, farms[farm].barn.z) -- амбар
                if count > 0 then
                    while hands do wait(500) if hands then pressAlt() status = u8'Берём '..(loop == 2 and u8'саженец' or u8'инструмент') end end
                    if loop == 1 then
                        for i, v in ipairs(labels) do
                            if checkSquare(v.pos.x, v.pos.y) then
                                if v.state == 'free' then
                                    status = u8'Вскапываем грядку'
                                    bed = bed + 1
                                    teleport(v.pos.x, v.pos.y, v.pos.z)
                                    wait(500)
                                    pressAlt()
                                    wait(500)
                                    processed = false
                                    while not processed do wait(500) if not processed then pressAlt() end end
                                end
                            end
                        end
                    elseif loop == 2 then
                        for i, v in ipairs(labels) do
                            if checkSquare(v.pos.x, v.pos.y) then
                                if v.state == 'seeding' and v.crop == u8:decode(scrop) then
                                    status = u8'Сажаем саженец'
                                    bed = bed + 1
                                    teleport(v.pos.x, v.pos.y, v.pos.z)
                                    wait(500)
                                    processed = false
                                    while not processed do wait(500) if not processed then pressAlt() end end
                                    status = u8'Берём саженец'
                                    teleport(farms[farm].barn.x, farms[farm].barn.y, farms[farm].barn.z) -- амбар
                                    wait(500)
                                    hands = true
                                    while hands do wait(0) pressAlt() end
                                end
                            end
                        end
                    elseif loop == 3 then
                        for i, v in ipairs(labels) do
                            if checkSquare(v.pos.x, v.pos.y) then
                                if v.state == 'watering' and v.crop == u8:decode(scrop) then
                                    status = u8'Набираем ведро'
                                    bed = bed + 1
                                    teleport(farms[farm].barrel.x, farms[farm].barrel.y, farms[farm].barrel.z) -- бочка
                                    wait(500)
                                    filled = false
                                    while not filled do
                                        wait(0)
                                        status = u8'Набираем ведро'
                                        teleport(farms[farm].barrel.x, farms[farm].barrel.y, farms[farm].barrel.z)
                                        pressAlt()
                                        while hands do -- Фикс хуйни
                                            wait(500)
                                            status = u8'Берём '..(loop == 2 and u8'саженец' or u8'инструмент')
                                            teleport(farms[farm].barn.x, farms[farm].barn.y, farms[farm].barn.z)
                                            if hands then pressAlt() end
                                        end
                                    end
                                    status = u8'Поливаем грядку'
                                    wait(100)
                                    teleport(v.pos.x, v.pos.y, v.pos.z)
                                    wait(500)
                                    processed = false
                                    while not processed do wait(500) if not processed then pressAlt() end end
                                    wait(200)
                                end
                            end
                        end
                    elseif loop == 4 then
                        for i, v in ipairs(labels) do
                            if checkSquare(v.pos.x, v.pos.y) then
                                if v.state == 'weeding' and v.crop == u8:decode(scrop) then
                                    status = u8'Пропалываем грядку'
                                    bed = bed + 1
                                    teleport(v.pos.x, v.pos.y, v.pos.z)
                                    wait(500)
                                    processed = false
                                    while not processed do wait(500) if not processed then pressAlt() end end
                                end
                            end
                        end
                    elseif loop == 5 then
                        for i, v in ipairs(labels) do
                            if checkSquare(v.pos.x, v.pos.y) then
                                if v.state == 'harvesting' and v.crop == u8:decode(scrop) then
                                    status = u8'Собираем урожай'
                                    bed = bed + 1
                                    teleport(v.pos.x, v.pos.y, v.pos.z)
                                    wait(500)
                                    processed = false
                                    while not processed do wait(500) if not processed then pressAlt() end end
                                    status = u8'Относим урожай'
                                    teleport(farms[farm].barn.x, farms[farm].barn.y, farms[farm].barn.z) -- амбар
                                    hands = true
                                    while hands do wait(500) if hands then pressAlt() end end
                                end
                            end
                        end
                    end
                end
            end
            loop = loop >= 5 and 1 or loop + 1
            hands = true
            bed = 0
        end
    end
end

function teleport(x, y, z) setCharCoordinates(PLAYER_PED, x, y, z) end
function pressAlt()
    --setGameKeyState(21, 1)
    local x, y, z = getCharCoordinates(PLAYER_PED)
    local data = allocateMemory(18)
    setStructElement(data, 4, 2, 1024, true)
    setStructFloatElement(data, 6, x, true)
    setStructFloatElement(data, 10, y, true)
    setStructFloatElement(data, 14, z, true)
    sampSendSpectatorData(data)
    freeMemory(data)
end

function checkLabels()
    local num = 0
    for i, label in ipairs(labels) do
        if checkSquare(label.pos.x, label.pos.y) then
            if (loop == 1 and label.state == 'free')
                or (loop == 2 and label.state == 'seeding' and label.crop == u8:decode(scrop))
                or (loop == 3 and label.state == 'watering' and label.crop == u8:decode(scrop))
                or (loop == 4 and label.state == 'weeding' and label.crop == u8:decode(scrop))
                or (loop == 5 and label.state == 'harvesting' and label.crop == u8:decode(scrop))
            then
                num = num + 1
            end
        end
    end
    return num
end

function checkSquare(x, y)
    return x > farms[farm].corners[1].x and
        x < farms[farm].corners[2].x and
        y > farms[farm].corners[1].y and
        y < farms[farm].corners[2].y
end

function splitMoney(n)
    local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
    return left..(num:reverse():gsub('(%d%d%d)','%1.'):reverse())..right
end

function purple_style()
    imgui.SwitchContext()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local clr = imgui.Col
    local ImVec4 = imgui.ImVec4

    style.WindowRounding = 10
    style.ChildWindowRounding = 10
    style.FrameRounding = 6.0
    style.ItemSpacing = imgui.ImVec2(9.0, 3.0)
    style.ItemInnerSpacing = imgui.ImVec2(3.0, 3.0)
    style.IndentSpacing = 21
    style.ScrollbarSize = 10.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.FrameBg]                = ImVec4(0.46, 0.11, 0.29, 1.00)
    colors[clr.FrameBgHovered]         = ImVec4(0.69, 0.16, 0.43, 1.00)
    colors[clr.FrameBgActive]          = ImVec4(0.58, 0.10, 0.35, 1.00)
    colors[clr.TitleBg]                = ImVec4(0.00, 0.00, 0.00, 1.00)
    colors[clr.TitleBgActive]          = ImVec4(0.61, 0.16, 0.39, 1.00)
    colors[clr.TitleBgCollapsed]       = ImVec4(0.00, 0.00, 0.00, 0.51)
    colors[clr.CheckMark]              = ImVec4(0.94, 0.30, 0.63, 1.00)
    colors[clr.SliderGrab]             = ImVec4(0.85, 0.11, 0.49, 1.00)
    colors[clr.SliderGrabActive]       = ImVec4(0.89, 0.24, 0.58, 1.00)
    colors[clr.Button]                 = ImVec4(0.46, 0.11, 0.29, 1.00)
    colors[clr.ButtonHovered]          = ImVec4(0.69, 0.17, 0.43, 1.00)
    colors[clr.ButtonActive]           = ImVec4(0.59, 0.10, 0.35, 1.00)
    colors[clr.Header]                 = ImVec4(0.46, 0.11, 0.29, 1.00)
    colors[clr.HeaderHovered]          = ImVec4(0.69, 0.16, 0.43, 1.00)
    colors[clr.HeaderActive]           = ImVec4(0.58, 0.10, 0.35, 1.00)
    colors[clr.Separator]              = ImVec4(0.69, 0.16, 0.43, 1.00)
    colors[clr.SeparatorHovered]       = ImVec4(0.58, 0.10, 0.35, 1.00)
    colors[clr.SeparatorActive]        = ImVec4(0.58, 0.10, 0.35, 1.00)
    colors[clr.ResizeGrip]             = ImVec4(0.46, 0.11, 0.29, 0.70)
    colors[clr.ResizeGripHovered]      = ImVec4(0.69, 0.16, 0.43, 0.67)
    colors[clr.ResizeGripActive]       = ImVec4(0.70, 0.13, 0.42, 1.00)
    colors[clr.TextSelectedBg]         = ImVec4(1.00, 0.78, 0.90, 0.35)
    colors[clr.Text]                   = ImVec4(1.00, 1.00, 1.00, 1.00)
    colors[clr.TextDisabled]           = ImVec4(0.60, 0.19, 0.40, 1.00)
    colors[clr.WindowBg]               = ImVec4(0.06, 0.06, 0.06, 0.94)
    colors[clr.ChildWindowBg]          = ImVec4(1.00, 1.00, 1.00, 0.00)
    colors[clr.PopupBg]                = ImVec4(0.08, 0.08, 0.08, 0.94)
    colors[clr.ComboBg]                = ImVec4(0.08, 0.08, 0.08, 0.94)
    colors[clr.Border]                 = ImVec4(0.49, 0.14, 0.31, 1.00)
    colors[clr.BorderShadow]           = ImVec4(0.49, 0.14, 0.31, 0.00)
    colors[clr.MenuBarBg]              = ImVec4(0.15, 0.15, 0.15, 1.00)
    colors[clr.ScrollbarBg]            = ImVec4(0.02, 0.02, 0.02, 0.53)
    colors[clr.ScrollbarGrab]          = ImVec4(0.31, 0.31, 0.31, 1.00)
    colors[clr.ScrollbarGrabHovered]   = ImVec4(0.41, 0.41, 0.41, 1.00)
    colors[clr.ScrollbarGrabActive]    = ImVec4(0.51, 0.51, 0.51, 1.00)
    colors[clr.CloseButton]            = ImVec4(0.20, 0.20, 0.20, 0.50)
    colors[clr.CloseButtonHovered]     = ImVec4(0.98, 0.39, 0.36, 1.00)
    colors[clr.CloseButtonActive]      = ImVec4(0.98, 0.39, 0.36, 1.00)
    colors[clr.ModalWindowDarkening]   = ImVec4(0.80, 0.80, 0.80, 0.35)
end
purple_style()
 
Последнее редактирование: