- 138
- 21
как сделать так что при появлении слайдера(он появляется по чекбоксу) изменялось положение 2 чекбокса
govnokod:
script_author('arc warden')
script_version('1.0.0')
script_description('123')
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new = imgui.new
local tab = 1
local checkboxone = new.bool()
local checkboxtwo = new.bool()
local WinState = new.bool()
local kolich_avtoreisov = new.int(2)
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(550, 150), imgui.Cond.Always)
imgui.Begin(u8'Begin', WinState, imgui.WindowFlags.NoResize)
if imgui.Button(u8'Основное', imgui.ImVec2(90, 50)) then tab = 1 end
if imgui.Button(u8'Информация', imgui.ImVec2(90, 50)) then tab = 2 end
if tab == 1 then
imgui.SameLine()
imgui.SetCursorPos(imgui.ImVec2(120, 30))
imgui.Checkbox(u8'Автопринятие рейса', checkboxone)
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Автоматическое принятие рейса после предыдущего')
imgui.EndTooltip()
end
if checkboxone[0] then
imgui.SetCursorPos(imgui.ImVec2(120, 60))
imgui.PushItemWidth(200)
imgui.SliderInt(u8'Количество авто-рейсов', kolich_avtoreisov, 0, 10)
imgui.PopItemWidth()
end
imgui.SetCursorPos(imgui.ImVec2(120, 70))
imgui.Checkbox(u8'Мгновенная остановка', checkboxtwo)
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Мгновенная остановка по нажатию клавиши H')
imgui.EndTooltip()
end
elseif tab == 2 then
imgui.SameLine()
imgui.SetCursorPos(imgui.ImVec2(120, 20))
imgui.Text(u8'TramHelper - хелпер для работы "Водитель трамвая".')
imgui.SetCursorPos(imgui.ImVec2(120, 40))
imgui.Text(u8' Это обычный хелпер(не бот).')
imgui.SetCursorPos(imgui.ImVec2(124, 50))
imgui.Text(u8'Автор - arc warden')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'https://www.blast.hk/members/499101/')
imgui.EndTooltip()
end
imgui.SetCursorPos(imgui.ImVec2(124, 60))
imgui.Text(u8'Версия 1.0.0')
end
imgui.End()
end
)
function main()
sampRegisterChatCommand('tramhelp', function() WinState[0] = not WinState[0] end)
wait(-1)
end
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
blue_theme()
end)
function blue_theme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
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
--==[ BORDER ]==--
imgui.GetStyle().WindowBorderSize = 1
imgui.GetStyle().ChildBorderSize = 1
imgui.GetStyle().PopupBorderSize = 1
imgui.GetStyle().FrameBorderSize = 1
imgui.GetStyle().TabBorderSize = 1
--==[ ROUNDING ]==--
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
colors[clr.FrameBg] = ImVec4(0.16, 0.29, 0.48, 0.54)
colors[clr.FrameBgHovered] = ImVec4(0.26, 0.59, 0.98, 0.40)
colors[clr.FrameBgActive] = ImVec4(0.26, 0.59, 0.98, 0.67)
colors[clr.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.16, 0.29, 0.48, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
colors[clr.CheckMark] = ImVec4(0.26, 0.59, 0.98, 1.00)
colors[clr.SliderGrab] = ImVec4(0.24, 0.52, 0.88, 1.00)
colors[clr.SliderGrabActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
colors[clr.Button] = ImVec4(0.26, 0.59, 0.98, 0.40)
colors[clr.ButtonHovered] = ImVec4(0.26, 0.59, 0.98, 1.00)
colors[clr.ButtonActive] = ImVec4(0.06, 0.53, 0.98, 1.00)
colors[clr.Header] = ImVec4(0.26, 0.59, 0.98, 0.31)
colors[clr.HeaderHovered] = ImVec4(0.26, 0.59, 0.98, 0.80)
colors[clr.HeaderActive] = ImVec4(0.26, 0.59, 0.98, 1.00)
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(0.26, 0.59, 0.98, 0.25)
colors[clr.ResizeGripHovered] = ImVec4(0.26, 0.59, 0.98, 0.67)
colors[clr.ResizeGripActive] = ImVec4(0.26, 0.59, 0.98, 0.95)
colors[clr.TextSelectedBg] = ImVec4(0.26, 0.59, 0.98, 0.35)
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.06, 0.06, 0.06, 0.94)
colors[clr.ChildBg] = ImVec4(1.00, 1.00, 1.00, 0.00)
colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
colors[clr.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
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(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.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)
end
up
Последнее редактирование: