- 63
- 1
- Версия MoonLoader
- .026-beta
Писал свой небольшой скрипт. Захотелось красоты и я попытался добавить fAwesome 6. Подключил либы, добавил нужный код в imgui.OnInitialize, но вместо иконки идёт вопрос. Что делать?
Скрин:
up
----------------------------------------------
Всё решил. Подключил вместо этой либы fAwesome6_solid. После чего в НАЧАЛО imgui.OnInitialize вставил fa.init().
Скрин:
Сам код:
script_name("{fbff00}NotHelper")
script_author("{fbff00}NotBartu")
-- Либы
local RakLua = require 'lib.RakLua'
local sampev = require 'lib.samp.events'
local vkeys = require 'vkeys'
local imgui = require 'mimgui'
local wm = require 'windows.message'
local encoding = require 'encoding'
local memory = require 'memory'
local inicfg = require 'inicfg'
local faicons = require 'fAwesome6'
-- IniCfg
local directIni = 'NotHelper.ini'
local ini = inicfg.load(inicfg.load({
main = {
sbiv = true,
gmCar = true,
tirAim = false,
gymBot = false,
botOneShot = false,
},
}, directIni))
inicfg.save(ini, directIni)
-- Константы
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local font = renderCreateFont("Arial", 9, 5)
local isFarmActive = false
-- Помощь к Imgui
local imNew = imgui.new
local mainWindow = imNew.bool()
local infoWindow = imNew.bool()
local sbivCheckBox = imNew.bool(ini.main.sbiv)
local gmCarCheckBox = imNew.bool(ini.main.gmCar)
local tirAimCheckBox = imNew.bool(ini.main.tirAim)
local gymBotCheckBox = imNew.bool(ini.main.gymBot)
local botOneShotCheckBox = imNew.bool(ini.main.botOneShot)
local textDrawCheckBox = imNew.bool()
local sizeX, sizeY = getScreenResolution()
-- При начале
imgui.OnInitialize(function()
imgui.DarkRedTheme()
imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 14.0, nil, glyph_ranges)
small = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 10.0, _, glyph_ranges)
big = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 18.0, _, glyph_ranges)
sobig = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. '\\trebucbd.ttf', 36.0, _, glyph_ranges)
-- fAwesome6
imgui.GetIO().IniFilename = nil
local config = imgui.ImFontConfig()
config.MergeMode = true
config.PixelSnapH = true
iconRanges = imgui.new.ImWchar[3](faicons.min_range, faicons.max_range, 0)
imgui.GetIO().Fonts:AddFontFromMemoryCompressedBase85TTF(faicons.get_font_data_base85('solid'), 14, config, iconRanges)
end)
-- Основное меню
local mainFrame = imgui.OnFrame(
function() return mainWindow[0] and not isPauseMenuActive() and not sampIsScoreboardOpen() end,
function()
imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.Always, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(250, 350), imgui.Cond.Always)
imgui.Begin("Main Window", mainWindow, imgui.WindowFlags.NoMove + imgui.WindowFlags.NoResize + imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoTitleBar)
imgui.Text(faicons('USER'))
imgui.PushFont(sobig)
imgui.CenterText("NotHelper")
imgui.PopFont()
if imgui.Button("Info") then
mainWindow[0] = false
infoWindow[0] = true
end
if imgui.Checkbox("Sbiv", sbivCheckBox) then
ini.main.sbiv = sbivCheckBox[0]
sampAddChatMessage("{adadad} Сбив: " .. (sbivCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end
if imgui.Checkbox("GmCar", gmCarCheckBox) then
ini.main.gmCar = gmCarCheckBox[0]
sampAddChatMessage("{adadad} GmCar: " .. (gmCarCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end
if imgui.Checkbox("TirAim", tirAimCheckBox) then
ini.main.tirAim = tirAimCheckBox[0]
sampAddChatMessage("{adadad} TirAim: " .. (tirAimCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end
if imgui.Checkbox("Gym Bot", gymBotCheckBox) then
ini.main.gymBot = gymBotCheckBox[0]
sampAddChatMessage("{adadad} Gym Bot: " .. (gymBotCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end
if imgui.Checkbox("1 Shot Bot", botOneShotCheckBox) then
ini.main.botOneShot = botOneShotCheckBox[0]
sampAddChatMessage("{adadad} 1 Shot Bot: " .. (botOneShotCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end
if imgui.Button("Save Settings") then
inicfg.save(ini, directIni)
sampAddChatMessage("{adadad} Настройки: {8cff00}Сохранены", -1)
end
imgui.End()
end
)
-- Окно с инфой
local infoFrame = imgui.OnFrame(
function() return infoWindow[0] and not isPauseMenuActive() and not sampIsScoreboardOpen() end,
function(self)
imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.Once, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(350, 350), imgui.Cond.Always)
imgui.Begin("Info", infoWindow, imgui.WindowFlags.NoResize)
imgui.CenterText("Coordinates")
local x, y, z = getCharCoordinates(PLAYER_PED)
imgui.Text("X: ") imgui.SameLine() imgui.CenterText(x)
imgui.Text("Y: ") imgui.SameLine() imgui.CenterText(y)
imgui.Text("Z: ") imgui.SameLine() imgui.CenterText(z)
imgui.Separator()
imgui.Text(string.format("Current interior: %s", getActiveInterior()))
if imgui.Checkbox("TextDraw Id", textDrawCheckBox) then sampAddChatMessage("{adadad} Показ Id TextDraw: " .. (textDrawCheckBox[0] and "{8cff00}Включён" or "{ff0000}Выключен"), -1) end
if imgui.Button("Hide cursor") then
self.HideCursor = true
end
imgui.End()
end
)
-- Маин функция
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(0) end
memory.fill(0x00531155, 0x90, 5, true)
sampRegisterChatCommand("noth", function() mainWindow[0] = not mainWindow[0] end)
sampRegisterChatCommand("saveh", function() inicfg.save(ini, directIni) sampAddChatMessage("{adadad} Настройки: {8cff00}Сохранены", -1) end)
sampRegisterChatCommand("farmbot", function()
isFarmActive = not isFarmActive
sampAddChatMessage("{adadad} Бот начальной фермы: " .. (isFarmActive and "{8cff00}Включён" or "{ff0000}Выключен"), -1)
end)
wait(1000)
sampAddChatMessage("{fbff00}Загружены все скрипты! By NotBartu", -1)
-- Обработка клавиш
addEventHandler("onWindowMessage", function(msg, wparam, lparam)
if msg == wm.WM_KEYDOWN or msg == wm.WM_SYSKEYDOWN then
-- Основное меню
if wparam == vkeys.VK_NUMPAD0 then
mainWindow[0] = not mainWindow[0]
-- Бот фермы
elseif wparam == vkeys.VK_2 and isFarmActive and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
sendPacket({220, 18, 29, 0, 0, 0, 109, 105, 110, 105, 71, 97, 109, 101, 46, 107, 101, 121, 82, 101, 97, 99, 116, 105, 111, 110, 46, 102, 105, 110, 105, 115, 104, 124, 55, 0, 0, 0, 0})
-- Сбив
elseif wparam == vkeys.VK_1 and sbivCheckBox[0] and not isCharInAnyCar(PLAYER_PED) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
clearCharTasksImmediately(PLAYER_PED) freezeCharPosition(PLAYER_PED, false) setPlayerControl(player, true)
end
-- Убрать мышь с экрана
elseif wparam == vkeys.VK_DELETE and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
if infoFrame.HideCursor == true then infoFrame.HideCursor = false return end
if sampIsCursorActive() then sampToggleCursor(false) else sampToggleCursor(true) end
end
end)
while true do wait(0)
if gmCarCheckBox[0] and isCharInAnyCar(PLAYER_PED) then
setCarProofs(storeCarCharIsInNoSave(PLAYER_PED), true, true, true, true, true)
end
if tirAimCheckBox[0] then
local obj = getAllObjects()
for i, val in ipairs(obj) do
local obs = val
if doesObjectExist(obs) == true then
if isObjectOnScreen(obs) == true and not isObjectAttached(obs) then
local model = getObjectModel(obs)
local _, x,y,z = getObjectCoordinates(obs)
local playerX, playerY, playerZ = getCharCoordinates(playerPed)
local dist = getDistanceBetweenCoords3d(x,y,z, playerX, playerY, playerZ)
--local px, py = convert3DCoordsToScreen(x,y,z)
if model == 1589 or model == 1590 or model == 1591 or model == 1592 or model == 1588 then
local ofX = 0.62
local ofY = 4
local ofZ = 0.7
if model == 1588 then ofX = 0.2 ofZ=-0.3
elseif model == 1592 then ofX = 0.5
elseif model == 1591 then ofX = 0.2
elseif model == 1590 then ofX = 0.2
end
local ox, oy, oz = getOffsetFromCharInWorldCoords(playerPed, ofX, ofY, ofZ)
local pos = val
setObjectCoordinates(pos, ox, oy, oz)
setObjectHeading(pos, getCharHeading(playerPed) )
end
end
end
end
end
if gymBotCheckBox[0] and sampTextdrawIsExists(2062) then
setGameKeyState(16, 32)
wait(1)
setGameKeyState(16, 0)
end
if textDrawCheckBox[0] then
for a = 0, 2304 do
if sampTextdrawIsExists(a) then
x, y = sampTextdrawGetPos(a)
x1, y1 = convertGameScreenCoordsToWindowScreenCoords(x, y)
renderFontDrawText(font, a, x1, y1, 0xFFBEBEBE)
end
end
end
end
end
-- Функции
function sendPacket(packetData)
-- Создаем новый BitStream
local bs = RakLuaBitStream.new()
for _, byte in ipairs(packetData) do
bs:writeInt8(byte)
end
-- Отправляем пакет через RakNet
bs:sendPacket()
end
function imgui.CenterText(text)
imgui.SetCursorPosX(imgui.GetWindowWidth()/2-imgui.CalcTextSize(u8(text)).x/2)
imgui.Text(u8(text))
end
function imgui.TextColoredRGB(text)
local style = imgui.GetStyle()
local colors = style.Colors
local ImVec4 = imgui.ImVec4
local explode_argb = function(argb)
local a = bit.band(bit.rshift(argb, 24), 0xFF)
local r = bit.band(bit.rshift(argb, 16), 0xFF)
local g = bit.band(bit.rshift(argb, 8), 0xFF)
local b = bit.band(argb, 0xFF)
return a, r, g, b
end
local getcolor = function(color)
if color:sub(1, 6):upper() == 'SSSSSS' then
local r, g, b = colors[1].x, colors[1].y, colors[1].z
local a = tonumber(color:sub(7, 8), 16) or colors[1].w * 255
return ImVec4(r, g, b, a / 255)
end
local color = type(color) == 'string' and tonumber(color, 16) or color
if type(color) ~= 'number' then return end
local r, g, b, a = explode_argb(color)
return imgui.ImVec4(r/255, g/255, b/255, a/255)
end
local render_text = function(text_)
for w in text_:gmatch('[^\r\n]+') do
local text, colors_, m = {}, {}, 1
w = w:gsub('{(......)}', '{%1FF}')
while w:find('{........}') do
local n, k = w:find('{........}')
local color = getcolor(w:sub(n + 1, k - 1))
if color then
text[#text], text[#text + 1] = w:sub(m, n - 1), w:sub(k + 1, #w)
colors_[#colors_ + 1] = color
m = n
end
w = w:sub(1, n - 1) .. w:sub(k + 1, #w)
end
if text[0] then
for i = 0, #text do
imgui.TextColored(colors_[i] or colors[1], u8(text[i]))
imgui.SameLine(nil, 0)
end
imgui.NewLine()
else imgui.Text(u8(w)) end
end
end
render_text(text)
end
function samp_create_sync_data(sync_type, copy_from_player)
local ffi = require 'ffi'
local sampfuncs = require 'sampfuncs'
-- from SAMP.Lua
local raknet = require 'samp.raknet'
require 'samp.synchronization'
copy_from_player = copy_from_player or true
local sync_traits = {
player = {'PlayerSyncData', raknet.PACKET.PLAYER_SYNC, sampStorePlayerOnfootData},
vehicle = {'VehicleSyncData', raknet.PACKET.VEHICLE_SYNC, sampStorePlayerIncarData},
passenger = {'PassengerSyncData', raknet.PACKET.PASSENGER_SYNC, sampStorePlayerPassengerData},
aim = {'AimSyncData', raknet.PACKET.AIM_SYNC, sampStorePlayerAimData},
trailer = {'TrailerSyncData', raknet.PACKET.TRAILER_SYNC, sampStorePlayerTrailerData},
unoccupied = {'UnoccupiedSyncData', raknet.PACKET.UNOCCUPIED_SYNC, nil},
bullet = {'BulletSyncData', raknet.PACKET.BULLET_SYNC, nil},
spectator = {'SpectatorSyncData', raknet.PACKET.SPECTATOR_SYNC, nil}
}
local sync_info = sync_traits[sync_type]
local data_type = 'struct ' .. sync_info[1]
local data = ffi.new(data_type, {})
local raw_data_ptr = tonumber(ffi.cast('uintptr_t', ffi.new(data_type .. '*', data)))
-- copy player's sync data to the allocated memory
if copy_from_player then
local copy_func = sync_info[3]
if copy_func then
local _, player_id
if copy_from_player == true then
_, player_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
else
player_id = tonumber(copy_from_player)
end
copy_func(player_id, raw_data_ptr)
end
end
-- function to send packet
local func_send = function()
local bs = raknetNewBitStream()
raknetBitStreamWriteInt8(bs, sync_info[2])
raknetBitStreamWriteBuffer(bs, raw_data_ptr, ffi.sizeof(data))
raknetSendBitStreamEx(bs, sampfuncs.HIGH_PRIORITY, sampfuncs.UNRELIABLE_SEQUENCED, 1)
raknetDeleteBitStream(bs)
end
-- metatable to access sync data and 'send' function
local mt = {
__index = function(t, index)
return data[index]
end,
__newindex = function(t, index, value)
data[index] = value
end
}
return setmetatable({send = func_send}, mt)
end
-- События
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if dialogId == 15253 then
sampSendDialogResponse(15253, 1, 1)
return false
elseif dialogId == 15254 then
sampSendDialogResponse(15254, 1, 0)
return false
end
return {dialogId, style, dialogId .. " - " .. title, button1, button2, text}
end
function sampev.onTextDrawShow(textDrawId, positionX, positionY, textDrawString)
return {textDrawId, positionX, positionY, textDrawString}
end
function sampev.onTextDrawHide(textDrawId)
return {textDrawId}
end
function onSendPacket(id, bs)
if id == 221 and botOneShotCheckBox[0] then
raknetBitStreamSetReadOffset(bs, 8)
if raknetBitStreamReadInt16(bs) == 73 then
local data = {}
for i = 1, (raknetBitStreamGetNumberOfUnreadBits(bs)/8) do table.insert(data, raknetBitStreamReadInt8(bs)) end
local damage_bs = raknetNewBitStream()
raknetBitStreamWriteInt8(damage_bs, 221)
raknetBitStreamWriteInt16(damage_bs, 73)
for i = 1, 2 do raknetBitStreamWriteInt8(damage_bs, data[i]) end
raknetBitStreamWriteInt8(damage_bs, 0)
raknetBitStreamWriteInt8(damage_bs, 6)
raknetBitStreamWriteInt8(damage_bs, 62)
raknetBitStreamWriteInt8(damage_bs, 62)
for i = 7, #data do raknetBitStreamWriteInt8(damage_bs, data[i]) end
raknetSendBitStreamEx(damage_bs, 1, 7, 1)
raknetDeleteBitStream(damage_bs)
return false
end
end
end
-- Тема
function imgui.DarkTheme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
-->> Sizez
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(5, 5)
imgui.GetStyle().TouchExtraPadding = imgui.ImVec2(5, 5)
imgui.GetStyle().IndentSpacing = 21
imgui.GetStyle().ScrollbarSize = 14
imgui.GetStyle().GrabMinSize = 10
imgui.GetStyle().WindowBorderSize = 0
imgui.GetStyle().ChildBorderSize = 1
imgui.GetStyle().PopupBorderSize = 1
imgui.GetStyle().FrameBorderSize = 1
imgui.GetStyle().TabBorderSize = 0
imgui.GetStyle().WindowRounding = 5
imgui.GetStyle().ChildRounding = 5
imgui.GetStyle().PopupRounding = 5
imgui.GetStyle().FrameRounding = 5
imgui.GetStyle().ScrollbarRounding = 2.5
imgui.GetStyle().GrabRounding = 5
imgui.GetStyle().TabRounding = 5
imgui.GetStyle().WindowTitleAlign = imgui.ImVec2(0.50, 0.50)
-->> Colors
imgui.GetStyle().Colors[imgui.Col.Text] = imgui.ImVec4(1.00, 1.00, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextDisabled] = imgui.ImVec4(0.50, 0.50, 0.50, 1.00)
imgui.GetStyle().Colors[imgui.Col.WindowBg] = imgui.ImVec4(0.07, 0.07, 0.07, 1.00)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = imgui.ImVec4(0.07, 0.07, 0.07, 1.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = imgui.ImVec4(0.07, 0.07, 0.07, 1.00)
imgui.GetStyle().Colors[imgui.Col.Border] = imgui.ImVec4(0.25, 0.25, 0.26, 0.54)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = imgui.ImVec4(0.25, 0.25, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = imgui.ImVec4(0.25, 0.25, 0.26, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = imgui.ImVec4(0.2, 0.2, 0.2, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = imgui.ImVec4(0.25, 0.25, 0.25, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = imgui.ImVec4(0.25, 0.25, 0.25, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = imgui.ImVec4(1.00, 1.00, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = imgui.ImVec4(0.21, 0.20, 0.20, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = imgui.ImVec4(0.21, 0.20, 0.20, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = imgui.ImVec4(0.21, 0.20, 0.20, 1.00)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = imgui.ImVec4(0.41, 0.41, 0.41, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = imgui.ImVec4(0.20, 0.20, 0.20, 1.00)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = imgui.ImVec4(0.47, 0.47, 0.47, 1.00)
imgui.GetStyle().Colors[imgui.Col.Separator] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.SeparatorHovered] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.SeparatorActive] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = imgui.ImVec4(1.00, 1.00, 1.00, 0.25)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = imgui.ImVec4(1.00, 1.00, 1.00, 0.67)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = imgui.ImVec4(1.00, 1.00, 1.00, 0.95)
imgui.GetStyle().Colors[imgui.Col.Tab] = imgui.ImVec4(0.12, 0.12, 0.12, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabHovered] = imgui.ImVec4(0.28, 0.28, 0.28, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabActive] = imgui.ImVec4(0.30, 0.30, 0.30, 1.00)
imgui.GetStyle().Colors[imgui.Col.TabUnfocused] = imgui.ImVec4(0.07, 0.10, 0.15, 0.97)
imgui.GetStyle().Colors[imgui.Col.TabUnfocusedActive] = imgui.ImVec4(0.14, 0.26, 0.42, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = imgui.ImVec4(0.61, 0.61, 0.61, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = imgui.ImVec4(1.00, 0.43, 0.35, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogram] = imgui.ImVec4(0.90, 0.70, 0.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered] = imgui.ImVec4(1.00, 0.60, 0.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextSelectedBg] = imgui.ImVec4(0.5, 0.5, 0.5, 0.35)
imgui.GetStyle().Colors[imgui.Col.DragDropTarget] = imgui.ImVec4(1.00, 1.00, 0.00, 0.90)
imgui.GetStyle().Colors[imgui.Col.NavHighlight] = imgui.ImVec4(0.26, 0.59, 0.98, 1.00)
imgui.GetStyle().Colors[imgui.Col.NavWindowingHighlight] = imgui.ImVec4(1.00, 1.00, 1.00, 0.70)
imgui.GetStyle().Colors[imgui.Col.NavWindowingDimBg] = imgui.ImVec4(0.80, 0.80, 0.80, 0.20)
imgui.GetStyle().Colors[imgui.Col.ModalWindowDimBg] = imgui.ImVec4(0.00, 0.00, 0.00, 0.70)
end
function imgui.DarkRedTheme()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
local ImVec2 = imgui.ImVec2
style.WindowPadding = imgui.ImVec2(8, 8)
style.WindowRounding = 6
style.FramePadding = imgui.ImVec2(5, 3)
style.FrameRounding = 3.0
style.ItemSpacing = imgui.ImVec2(5, 4)
style.ItemInnerSpacing = imgui.ImVec2(4, 4)
style.IndentSpacing = 21
style.ScrollbarSize = 10.0
style.ScrollbarRounding = 13
style.GrabMinSize = 8
style.GrabRounding = 1
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
colors[clr.Text] = ImVec4(0.95, 0.96, 0.98, 1.00);
colors[clr.TextDisabled] = ImVec4(0.29, 0.29, 0.29, 1.00);
colors[clr.WindowBg] = ImVec4(0.14, 0.14, 0.14, 1.00);
colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94);
colors[clr.Border] = ImVec4(0.14, 0.14, 0.14, 1.00);
colors[clr.BorderShadow] = ImVec4(1.00, 1.00, 1.00, 0.10);
colors[clr.FrameBg] = ImVec4(0.22, 0.22, 0.22, 1.00);
colors[clr.FrameBgHovered] = ImVec4(0.18, 0.18, 0.18, 1.00);
colors[clr.FrameBgActive] = ImVec4(0.09, 0.12, 0.14, 1.00);
colors[clr.TitleBg] = ImVec4(0.14, 0.14, 0.14, 0.81);
colors[clr.TitleBgActive] = ImVec4(0.14, 0.14, 0.14, 1.00);
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51);
colors[clr.MenuBarBg] = ImVec4(0.20, 0.20, 0.20, 1.00);
colors[clr.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.39);
colors[clr.ScrollbarGrab] = ImVec4(0.36, 0.36, 0.36, 1.00);
colors[clr.ScrollbarGrabHovered] = ImVec4(0.18, 0.22, 0.25, 1.00);
colors[clr.ScrollbarGrabActive] = ImVec4(0.24, 0.24, 0.24, 1.00);
colors[clr.CheckMark] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.SliderGrab] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.SliderGrabActive] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.Button] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.ButtonHovered] = ImVec4(1.00, 0.39, 0.39, 1.00);
colors[clr.ButtonActive] = ImVec4(1.00, 0.21, 0.21, 1.00);
colors[clr.Header] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.HeaderHovered] = ImVec4(1.00, 0.39, 0.39, 1.00);
colors[clr.HeaderActive] = ImVec4(1.00, 0.21, 0.21, 1.00);
colors[clr.ResizeGrip] = ImVec4(1.00, 0.28, 0.28, 1.00);
colors[clr.ResizeGripHovered] = ImVec4(1.00, 0.39, 0.39, 1.00);
colors[clr.ResizeGripActive] = ImVec4(1.00, 0.19, 0.19, 1.00);
colors[clr.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00);
colors[clr.PlotLinesHovered] = ImVec4(1.00, 0.43, 0.35, 1.00);
colors[clr.PlotHistogram] = ImVec4(1.00, 0.21, 0.21, 1.00);
colors[clr.PlotHistogramHovered] = ImVec4(1.00, 0.18, 0.18, 1.00);
colors[clr.TextSelectedBg] = ImVec4(1.00, 0.32, 0.32, 1.00);
end
up
----------------------------------------------
Всё решил. Подключил вместо этой либы fAwesome6_solid. После чего в НАЧАЛО imgui.OnInitialize вставил fa.init().
Последнее редактирование: