- 263
- 54
- Версия MoonLoader
- .026-beta
Lua:
local imgui = require("mimgui")
local ffi = require("ffi")
local new, str = imgui.new, ffi.string
local vkeys = require("vkeys")
local encoding = require("encoding")
encoding.default = "CP1251"
local u8 = encoding.UTF8
local fAwesome = require("fAwesome5")
local size = {getScreenResolution()}
local fAlpha = 1.00
local mainc = imgui.ImVec4(0.0, 0.52, 0.74, 1.0)
local GUI = {
renderWindow = new.bool()
}
function main()
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("imgui", function()
GUI.renderWindow[0] = not GUI.renderWindow[0]
end)
while true do
wait(0)
UpdateAlpha(GUI.renderWindow[0])
end
end
function UpdateAlpha(menustate)
if menustate then -- open
if fAlpha ~= 1.00 then
fAlpha = fAlpha + 0.05
end
else -- close
if fAlpha ~= 0.00 then
fAlpha = fAlpha - 0.05
end
end
if fAlpha > 1.00 then
fAlpha = 1.00
end
if fAlpha < 0.00 then
fAlpha = 0.00
end -- anti dowen fix
apply_custom_style()
end
function apply_custom_style()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
style.Alpha = fAlpha
style.WindowRounding = 1.5
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.FrameRounding = 1.0
style.ItemSpacing = imgui.ImVec2(4.0, 4.0)
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 0
style.GrabMinSize = 8.0
style.GrabRounding = 1.0
style.WindowBorderSize = 0.0
style.WindowPadding = imgui.ImVec2(4.0, 4.0)
style.FramePadding = imgui.ImVec2(2.5, 3.5)
style.ButtonTextAlign = imgui.ImVec2(0.5, 0.35)
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.7, 0.7, 0.7, 1.0)
colors[clr.WindowBg] = ImVec4(0.07, 0.07, 0.07, 1.0)
colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
colors[clr.Border] = ImVec4(mainc.x, mainc.y, mainc.z, 0.4)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.FrameBg] = ImVec4(mainc.x, mainc.y, mainc.z, 0.7)
colors[clr.FrameBgHovered] = ImVec4(mainc.x, mainc.y, mainc.z, 0.4)
colors[clr.FrameBgActive] = ImVec4(mainc.x, mainc.y, mainc.z, 0.9)
colors[clr.TitleBg] = ImVec4(mainc.x, mainc.y, mainc.z, 1.0)
colors[clr.TitleBgActive] = ImVec4(mainc.x, mainc.y, mainc.z, 1.0)
colors[clr.TitleBgCollapsed] = ImVec4(mainc.x, mainc.y, mainc.z, 0.79)
colors[clr.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
colors[clr.ScrollbarGrab] = ImVec4(mainc.x, mainc.y, mainc.z, 0.8)
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.CheckMark] = ImVec4(mainc.x + 0.13, mainc.y + 0.13, mainc.z + 0.13, 1.00)
colors[clr.SliderGrab] = ImVec4(0.28, 0.28, 0.28, 1.00)
colors[clr.SliderGrabActive] = ImVec4(0.35, 0.35, 0.35, 1.00)
colors[clr.Button] = ImVec4(mainc.x, mainc.y, mainc.z, 0.8)
colors[clr.ButtonHovered] = ImVec4(mainc.x, mainc.y, mainc.z, 0.63)
colors[clr.ButtonActive] = ImVec4(mainc.x, mainc.y, mainc.z, 1.0)
colors[clr.Header] = ImVec4(mainc.x, mainc.y, mainc.z, 0.6)
colors[clr.HeaderHovered] = ImVec4(mainc.x, mainc.y, mainc.z, 0.43)
colors[clr.HeaderActive] = ImVec4(mainc.x, mainc.y, mainc.z, 0.8)
colors[clr.Separator] = colors[clr.Border]
colors[clr.SeparatorHovered] = ImVec4(0.26, 0.59, 0.98, 0.78)
colors[clr.SeparatorActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
colors[clr.ResizeGrip] = ImVec4(mainc.x, mainc.y, mainc.z, 0.8)
colors[clr.ResizeGripHovered] = ImVec4(mainc.x, mainc.y, mainc.z, 0.63)
colors[clr.ResizeGripActive] = ImVec4(mainc.x, mainc.y, mainc.z, 1.0)
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.26, 0.59, 0.98, 0.35)
end
imgui.OnInitialize(function()
apply_custom_style()
imgui.GetIO().IniFilename = nil
local defGlyph = imgui.GetIO().Fonts.ConfigData.Data[0].GlyphRanges
imgui.GetIO().Fonts:Clear()
local font_config = imgui.ImFontConfig()
font_config.SizePixels = 14.0;
font_config.GlyphExtraSpacing.x = 0.1
local def = imgui.GetIO().Fonts:AddFontFromFileTTF(getFolderPath(0x14) .. "\\arialbd.ttf", font_config.SizePixels, font_config, defGlyph)
local config = imgui.ImFontConfig()
config.MergeMode = true
config.PixelSnapH = true
config.FontDataOwnedByAtlas = false
config.GlyphOffset.y = 1.0
local fa_glyph_ranges = new.ImWchar[3]({ fAwesome.min_range, fAwesome.max_range, 0 })
local fAwesomeV = imgui.GetIO().Fonts:AddFontFromMemoryCompressedBase85TTF(fAwesome.get_font_data_base85(), font_config.SizePixels, config, fa_glyph_ranges)
imgui.GetIO().ConfigWindowsMoveFromTitleBarOnly = true
end)
local newFrame = imgui.OnFrame(
function() return GUI.renderWindow[0] end,
function(player)
imgui.SetNextWindowPos(imgui.ImVec2(size[1]/2, size[2]/2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(300, 400), imgui.Cond.FirstUseEver)
imgui.Begin(u8"а как " .. fAwesome.ICON_POOP .. u8" какать", GUI.renderWindow, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize)
if imgui.CollapsingHeader(u8"Как какать") then
imgui.Text(u8"A KAK KAKATb")
end
imgui.End()
end
)
Табуляция сбивается багом сайта ес чо.