local IniFilename = 'truckhelper.ini'
local ini = inicfg.load({
settings = {
themes = 2,
}
}, IniFilename)
local colorList = {u8'Зелёная', u8'Красная',u8'Синяя'} -- создаём таблицу с названиями тем
local colorListNumber = new.int() -- создаём буфер где будет хранится номер выбранной темы
local colorListBuffer = new['const char*'][#colorList](colorList) -- создаём буфер для списка
theme = {
{
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.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()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
-->> Sizez
imgui.GetStyle().WindowPadding = imgui.ImVec2(4, 4)
imgui.GetStyle().FramePadding = imgui.ImVec2(4, 3)
imgui.GetStyle().ItemSpacing = imgui.ImVec2(8, 4)
imgui.GetStyle().ItemInnerSpacing = imgui.ImVec2(4, 4)
imgui.GetStyle().TouchExtraPadding = imgui.ImVec2(0, 0)
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
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
colors[clr.WindowBg] = ImVec4(0.15, 0.16, 0.37, 1.00)
colors[clr.ChildBg] = ImVec4(0.17, 0.18, 0.43, 1.00)
colors[clr.PopupBg] = colors[clr.WindowBg]
colors[clr.Border] = ImVec4(0.33, 0.34, 0.62, 1.00)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.TitleBg] = ImVec4(0.18, 0.20, 0.46, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.18, 0.20, 0.46, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.18, 0.20, 0.46, 1.00)
colors[clr.MenuBarBg] = colors[clr.ChildBg]
colors[clr.ScrollbarBg] = ImVec4(0.14, 0.14, 0.36, 1.00)
colors[clr.ScrollbarGrab] = ImVec4(0.22, 0.22, 0.53, 1.00)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.20, 0.21, 0.53, 1.00)
colors[clr.ScrollbarGrabActive] = ImVec4(0.25, 0.25, 0.58, 1.00)
colors[clr.Button] = ImVec4(0.25, 0.25, 0.58, 1.00)
colors[clr.ButtonHovered] = ImVec4(0.23, 0.23, 0.55, 1.00)
colors[clr.ButtonActive] = ImVec4(0.27, 0.27, 0.62, 1.00)
colors[clr.CheckMark] = ImVec4(0.39, 0.39, 0.83, 1.00)
colors[clr.SliderGrab] = ImVec4(0.39, 0.39, 0.83, 1.00)
colors[clr.SliderGrabActive] = ImVec4(0.48, 0.48, 0.96, 1.00)
colors[clr.FrameBg] = colors[clr.Button]
colors[clr.FrameBgHovered] = colors[clr.ButtonHovered]
colors[clr.FrameBgActive] = colors[clr.ButtonActive]
colors[clr.Header] = colors[clr.Button]
colors[clr.HeaderHovered] = colors[clr.ButtonHovered]
colors[clr.HeaderActive] = colors[clr.ButtonActive]
colors[clr.Separator] = ImVec4(0.43, 0.43, 0.50, 0.50)
colors[clr.SeparatorHovered] = colors[clr.SliderGrabActive]
colors[clr.SeparatorActive] = colors[clr.SliderGrabActive]
colors[clr.ResizeGrip] = colors[clr.Button]
colors[clr.ResizeGripHovered] = colors[clr.ButtonHovered]
colors[clr.ResizeGripActive] = colors[clr.ButtonActive]
colors[clr.Tab] = colors[clr.Button]
colors[clr.TabHovered] = colors[clr.ButtonHovered]
colors[clr.TabActive] = colors[clr.ButtonActive]
colors[clr.TabUnfocused] = colors[clr.Button]
colors[clr.TabUnfocusedActive] = colors[clr.Button]
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(0.90, 0.70, 0.00, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(1.00, 0.60, 0.00, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.33, 0.33, 0.57, 1.00)
colors[clr.DragDropTarget] = ImVec4(1.00, 1.00, 0.00, 0.90)
colors[clr.NavHighlight] = ImVec4(0.26, 0.59, 0.98, 1.00)
colors[clr.NavWindowingHighlight] = ImVec4(1.00, 1.00, 1.00, 0.70)
colors[clr.NavWindowingDimBg] = ImVec4(0.80, 0.80, 0.80, 0.20)
colors[clr.ModalWindowDimBg] = ImVec4(0.00, 0.00, 0.00, 0.90)
end
}
}
imgui.OnInitialize(function()
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) -- solid - тип иконок, так же есть thin, regular, light и duotone
theme[colorListNumber[0]+1].change()
--[[ if doesFileExist(getWorkingDirectory()..'\\resource\\logo.png') then
imhandle = imgui.CreateTextureFromFile(getWorkingDirectory() .. '\\resource\\logo.png')
end
]]
end)