Решил попробывать написать drag для индикаторов в чите Neverlose.cc
Буду рад любым советам и исправлениям, так как уверен что есть огромное кол-во недочетов и говнокода.
Буду рад любым советам и исправлениям, так как уверен что есть огромное кол-во недочетов и говнокода.
Code:
local colorLine = Menu.ColorEdit("Indicators | Fereline", "Line color", Color.RGBA(255, 255, 255, 255))
local colorFont = Menu.ColorEdit("Indicators | Fereline", "Font color", Color.RGBA(255, 255, 255, 255))
local colorBlur = Menu.ColorEdit("Indicators | Fereline", "Blur color", Color.RGBA(0, 0, 0, 100))
local screen = EngineClient.GetScreenSize()
local username = Cheat.GetCheatUserName()
local font = Render.InitFont("Verdana", 30)
local clickedWatermark = true
local changePositionWatermark = Vector2.new(screen.x, 0)
function visuals()
local fps = math.floor(1000 / (GlobalVars.frametime * 1000))
local watermarkValue = "fereline.lua | " .. username .. " | " .. fps .. " fps"
local watermarkSize = Render.CalcTextSize(watermarkValue, 16, font)
local watermarkPosition = Vector2.new(screen.x - watermarkSize.x - 20, 5)
if watermarkPosition.x - 20 - (screen.x - changePositionWatermark.x) >= screen.x / 2 then
Render.Line(Vector2.new(watermarkPosition.x - 21 - (screen.x - changePositionWatermark.x), watermarkPosition.y - 5 + changePositionWatermark.y), Vector2.new(watermarkPosition.x - 21 - (screen.x - changePositionWatermark.x), watermarkSize.y + watermarkPosition.y + 5 + changePositionWatermark.y), colorLine:Get())
else
Render.Line(Vector2.new(watermarkPosition.x + watermarkSize.x + 21 - (screen.x - changePositionWatermark.x), watermarkPosition.y - 5 + changePositionWatermark.y), Vector2.new(watermarkPosition.x + watermarkSize.x + 21 - (screen.x - changePositionWatermark.x), watermarkSize.y + watermarkPosition.y + 5 + changePositionWatermark.y), colorLine:Get())
end
Render.Blur(Vector2.new(watermarkPosition.x - 20 - (screen.x - changePositionWatermark.x), watermarkPosition.y - 5 + changePositionWatermark.y), Vector2.new(watermarkPosition.x + watermarkSize.x + 20 - (screen.x - changePositionWatermark.x), watermarkSize.y + watermarkPosition.y + 5 + changePositionWatermark.y), colorBlur:Get())
Render.Text(watermarkValue, Vector2.new(watermarkPosition.x - (screen.x - changePositionWatermark.x), watermarkPosition.y + changePositionWatermark.y), colorFont:Get(), 16, font)
if Cheat.IsMenuVisible() then
local mousePattern = Cheat.GetMousePos()
if Cheat.IsKeyDown(0x1) then
if clickedWatermark == true then
if mousePattern.x >= watermarkPosition.x - 20 - (screen.x - changePositionWatermark.x) and mousePattern.x <= watermarkPosition.x + watermarkSize.x + 20 - (screen.x - changePositionWatermark.x) and mousePattern.y >= watermarkPosition.y - 5 + changePositionWatermark.y and mousePattern.y <= watermarkSize.y + watermarkPosition.y + 5 + changePositionWatermark.y then
clickedWatermark = false
end
else
changePositionWatermark.x = mousePattern.x
changePositionWatermark.y = mousePattern.y
end
else
clickedWatermark = true
end
end
end
function drawMain()
visuals()
end
Cheat.RegisterCallback("draw", drawMain)
Последнее редактирование: