keystrokes movage + grapple prettyness

This commit is contained in:
relaxtakenotes 2024-12-20 16:08:44 +05:00
parent 958f5676b5
commit 911bbb6bea
12 changed files with 135 additions and 71 deletions

View file

@ -121,6 +121,10 @@ beatrun.toolsmenu.hud.showSpeedometerDesc=Shows the speedometer on HUD (hiding H
beatrun.toolsmenu.hud.keystrokes=Show Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Shows keys that you press
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Offset
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Offset
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Alignment
beatrun.toolsmenu.hud.hidden=Hide HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Shown\n1 - Gamemode and speedometer only\n2 - Hidden

View file

@ -105,8 +105,12 @@ beatrun.toolsmenu.hud.nametagsdesc=Attiva/disattiva i nametag sopra i giocatori
beatrun.toolsmenu.hud.hudxp=Mostra XP HUD
beatrun.toolsmenu.hud.hudxpdesc=Mostra XP totali vicino al tuo nickname
beatrun.toolsmenu.hud.keystrokes=Show Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Shows keys that you press
beatrun.toolsmenu.hud.keystrokes=Spettacolo Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Mostra i tasti che premi
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Offset
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Offset
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Allineamento
beatrun.toolsmenu.hud.hidden=Nascondi HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Mostra\n1 - Solo Modalità di gioco\n2 - Nascosta

View file

@ -121,6 +121,10 @@ beatrun.toolsmenu.hud.showSpeedometerDesc=Pokazuje prędkościomierz na interfej
beatrun.toolsmenu.hud.keystrokes=Pokaż naciśnięte klawisze
beatrun.toolsmenu.hud.keystrokesdesc=Pokazuje na interfejsie klawisze, które wciskasz podczas gry
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Zrównoważyć
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Zrównoważyć
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Wyrównanie
beatrun.toolsmenu.hud.hidden=Ukryj interfejs
beatrun.toolsmenu.hud.hiddendesc=0 - Pokazany\n1 - Tylko poza rozgrywką swobodną\n2 - Ukryty

View file

@ -106,8 +106,12 @@ beatrun.toolsmenu.hud.nametagsdesc=Mostrar crachás acima dos nomes de jogadores
beatrun.toolsmenu.hud.hudxp=Mostrar XP
beatrun.toolsmenu.hud.hudxpdesc=Mostrar XP total perto do seu nome
beatrun.toolsmenu.hud.keystrokes=Show Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Shows keys that you press
beatrun.toolsmenu.hud.keystrokes=Mostrar Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Mostra as teclas que você pressiona
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Desvio
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Desvio
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Alinhamento
beatrun.toolsmenu.hud.hidden=Esconder a HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Mostrado\n1 - Gamemode apenas\n2 - Escondido

View file

@ -118,6 +118,10 @@ beatrun.toolsmenu.hud.speedometermodedesc=0 - км/ч, 1 - миль/ч, 2 - хе
beatrun.toolsmenu.hud.keystrokes=Показывать клавиши
beatrun.toolsmenu.hud.keystrokesdesc=Показывает нажатие клавиш в HUD
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Сдвиг
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Сдвиг
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Выравнивание
beatrun.toolsmenu.hud.hidden=Скрыть HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Показать\n1 - Только режим и спидометр\n2 - Скрыть полностью

View file

@ -106,8 +106,12 @@ beatrun.toolsmenu.hud.nametagsdesc=Oyuncuların üzerindeki ad etiketlerini aça
beatrun.toolsmenu.hud.hudxp=Arayüz XP'yi göster
beatrun.toolsmenu.hud.hudxpdesc=Takma adın yanında toplam XP'yi göster
beatrun.toolsmenu.hud.keystrokes=Show Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Shows keys that you press
beatrun.toolsmenu.hud.keystrokes=Göstermek Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Bastığınız tuşları gösterir
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Telafi etmek
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Telafi etmek
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Hizalama
beatrun.toolsmenu.hud.hidden=Arayüzü gizle
beatrun.toolsmenu.hud.hiddendesc=0 - Gösterilen\n1 - Yalnızca oyun\nmodu 2 - Gizli

View file

@ -110,8 +110,12 @@ beatrun.toolsmenu.hud.hudxpdesc=Показує весь XP в HUD
beatrun.toolsmenu.hud.showSpeedometer=Показувати швидкість (спідометр)
beatrun.toolsmenu.hud.showSpeedometerDesc=Показує спідометр на HUD (приховування HUD не впливає на видимість)
beatrun.toolsmenu.hud.keystrokes=Show Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Shows keys that you press
beatrun.toolsmenu.hud.keystrokes=Показати Keystrokes
beatrun.toolsmenu.hud.keystrokesdesc=Показує клавіші, які ви натискаєте
beatrun.toolsmenu.hud.keystrokes_x_offset=Keystrokes X Зсув
beatrun.toolsmenu.hud.keystrokes_y_offset=Keystrokes Y Зсув
beatrun.toolsmenu.hud.keystrokes_corner=Keystrokes Вирівнювання
beatrun.toolsmenu.hud.hidden=Приховати HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Показати\n1 - Тільки режим\n2 - Приховати повністю

View file

@ -20,8 +20,17 @@ local function GetFormattedKey(bind)
end
end
local Beatrun_HUDHidden = GetConVar("Beatrun_HUDHidden")
local xoff = 0
local yoff = 0
local Beatrun_KeystrokesXOffset = CreateClientConVar("Beatrun_KeystrokesXOffset", 0, true, true)
local Beatrun_KeystrokesYOffset = CreateClientConVar("Beatrun_KeystrokesYOffset", 0, true, true)
local Beatrun_KeystrokesCorner = CreateClientConVar("Beatrun_KeystrokesCorner", 0, true, true)
local function ShowKeyStrokes()
if showKeystrokes:GetBool() and GetConVar("Beatrun_HUDHidden"):GetInt() == 0 then
if showKeystrokes:GetBool() and Beatrun_HUDHidden:GetInt() == 0 then
local forward = GetFormattedKey("+forward")
local back = GetFormattedKey("+back")
local moveleft = GetFormattedKey("+moveleft")
@ -34,114 +43,134 @@ local function ShowKeyStrokes()
local attack = GetFormattedKey("+attack")
local attack2 = GetFormattedKey("+attack2")
if LocalPlayer():KeyDown(IN_FORWARD) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size, 0, size, size)
draw.SimpleText(forward, "BeatrunHUD", size + 10, size - 30, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size, 0, size, size)
draw.SimpleText(forward, "BeatrunHUD", size + 10, size - 30, color_white)
local h = ScrH()
local w = ScrW()
local lp = LocalPlayer()
if Beatrun_KeystrokesCorner:GetInt() == 0 then
xoff = Beatrun_KeystrokesXOffset:GetFloat()
yoff = Beatrun_KeystrokesYOffset:GetFloat()
elseif Beatrun_KeystrokesCorner:GetInt() == 1 then
xoff = w - Beatrun_KeystrokesXOffset:GetFloat() - size * 5
yoff = Beatrun_KeystrokesYOffset:GetFloat()
elseif Beatrun_KeystrokesCorner:GetInt() == 2 then
xoff = Beatrun_KeystrokesXOffset:GetFloat()
yoff = h - Beatrun_KeystrokesYOffset:GetFloat() - size * 5
elseif Beatrun_KeystrokesCorner:GetInt() == 3 then
xoff = w - Beatrun_KeystrokesXOffset:GetFloat() - size * 5
yoff = h - Beatrun_KeystrokesYOffset:GetFloat() - size * 5
end
if LocalPlayer():KeyDown(IN_USE) then
if lp:KeyDown(IN_FORWARD) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 2, 0, size, size)
draw.SimpleText(use, "BeatrunHUD", size + 48, size - 30, color_black)
surface.DrawRect(xoff + size, yoff + 0, size, size)
draw.SimpleText(forward, "BeatrunHUD", xoff + size + 10, yoff + size - 30, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size * 2, 0, size, size)
draw.SimpleText(use, "BeatrunHUD", size + 48, size - 30, color_white)
surface.DrawRect(xoff + size, yoff + 0, size, size)
draw.SimpleText(forward, "BeatrunHUD", xoff + size + 10, yoff + size - 30, color_white)
end
if LocalPlayer():KeyDown(IN_RELOAD) then
if lp:KeyDown(IN_USE) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, 0, size, size)
draw.SimpleText(reload, "BeatrunHUD", size * 3 + 12, size - 30, color_black)
surface.DrawRect(xoff + size * 2, yoff + 0, size, size)
draw.SimpleText(use, "BeatrunHUD", xoff + size + 48, yoff + size - 30, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size * 3, 0, size, size)
draw.SimpleText(reload, "BeatrunHUD", size * 3 + 12, size - 30, color_white)
surface.DrawRect(xoff + size * 2, yoff + 0, size, size)
draw.SimpleText(use, "BeatrunHUD", xoff + size + 48, yoff + size - 30, color_white)
end
if LocalPlayer():KeyDown(IN_MOVELEFT) then
if lp:KeyDown(IN_RELOAD) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size, size, size)
draw.SimpleText(moveleft, "BeatrunHUD", size - 23, size + 8, color_black)
surface.DrawRect(xoff + size * 3, yoff + 0, size, size)
draw.SimpleText(reload, "BeatrunHUD", xoff + size * 3 + 12, yoff + size - 30, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(0, size, size, size)
draw.SimpleText(moveleft, "BeatrunHUD", size - 23, size + 8, color_white)
surface.DrawRect(xoff + size * 3, yoff + 0, size, size)
draw.SimpleText(reload, "BeatrunHUD", xoff + size * 3 + 12, yoff + size - 30, color_white)
end
if LocalPlayer():KeyDown(IN_BACK) then
if lp:KeyDown(IN_MOVELEFT) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size, size, size, size)
draw.SimpleText(back, "BeatrunHUD", size + 12, size + 8, color_black)
surface.DrawRect(xoff + 0, yoff + size, size, size)
draw.SimpleText(moveleft, "BeatrunHUD", xoff + size - 23, yoff + size + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size, size, size, size)
draw.SimpleText(back, "BeatrunHUD", size + 12, size + 8, color_white)
surface.DrawRect(xoff + 0, yoff + size, size, size)
draw.SimpleText(moveleft, "BeatrunHUD", xoff + size - 23, yoff + size + 8, color_white)
end
if LocalPlayer():KeyDown(IN_MOVERIGHT) then
if lp:KeyDown(IN_BACK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 2, size, size, size)
draw.SimpleText(moveright, "BeatrunHUD", size + 48, size + 8, color_black)
surface.DrawRect(xoff + size, yoff + size, size, size)
draw.SimpleText(back, "BeatrunHUD", xoff + size + 12, yoff + size + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size * 2, size, size, size)
draw.SimpleText(moveright, "BeatrunHUD", size + 48, size + 8, color_white)
surface.DrawRect(xoff + size, yoff + size, size, size)
draw.SimpleText(back, "BeatrunHUD", xoff + size + 12, yoff + size + 8, color_white)
end
if LocalPlayer():KeyDown(IN_JUMP) then
if lp:KeyDown(IN_MOVERIGHT) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 2, size * 3, size)
draw.SimpleText(jump, "BeatrunHUD", 28, size * 2 + 8, color_black)
surface.DrawRect(xoff + size * 2, yoff + size, size, size)
draw.SimpleText(moveright, "BeatrunHUD", xoff + size + 48, yoff + size + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(0, size * 2, size * 3, size)
draw.SimpleText(jump, "BeatrunHUD", 28, size * 2 + 8, color_white)
surface.DrawRect(xoff + size * 2, yoff + size, size, size)
draw.SimpleText(moveright, "BeatrunHUD", xoff + size + 48, yoff + size + 8, color_white)
end
if LocalPlayer():KeyDown(IN_SPEED) then
if lp:KeyDown(IN_JUMP) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 3, size * 3, size)
draw.SimpleText(speed, "BeatrunHUD", 28, size * 3 + 8, color_black)
surface.DrawRect(xoff + 0 , yoff + size * 2, size * 3, size)
draw.SimpleText(jump, "BeatrunHUD", xoff + 25, yoff + size * 2 + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(0, size * 3, size * 3, size)
draw.SimpleText(speed, "BeatrunHUD", 28, size * 3 + 8, color_white)
surface.DrawRect(xoff + 0, yoff + size * 2, size * 3, size)
draw.SimpleText(jump, "BeatrunHUD", xoff + 25, yoff + size * 2 + 8, color_white)
end
if LocalPlayer():KeyDown(IN_DUCK) then
if lp:KeyDown(IN_SPEED) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 4, size * 3, size)
draw.SimpleText(duck, "BeatrunHUD", 32, size * 4 + 8, color_black)
surface.DrawRect(xoff + 0, yoff + size * 3, size * 3, size)
draw.SimpleText(speed, "BeatrunHUD", xoff + 25, yoff + size * 3 + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(0, size * 4, size * 3, size)
draw.SimpleText(duck, "BeatrunHUD", 32, size * 4 + 8, color_white)
surface.DrawRect(xoff + 0, yoff + size * 3, size * 3, size)
draw.SimpleText(speed, "BeatrunHUD", xoff + 25, yoff + size * 3 + 8, color_white)
end
if LocalPlayer():KeyDown(IN_ATTACK) then
if lp:KeyDown(IN_DUCK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, size, size * 2, size)
draw.SimpleText(attack, "BeatrunHUD", size + 87, size + 8, color_black)
surface.DrawRect(xoff + 0, yoff + size * 4, size * 3, size)
draw.SimpleText(duck, "BeatrunHUD", xoff + 32, yoff + size * 4 + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size * 3, size, size * 2, size)
draw.SimpleText(attack, "BeatrunHUD", size + 87, size + 8, color_white)
surface.DrawRect(xoff + 0, yoff + size * 4, size * 3, size)
draw.SimpleText(duck, "BeatrunHUD", xoff + 32, yoff + size * 4 + 8, color_white)
end
if LocalPlayer():KeyDown(IN_ATTACK2) then
if lp:KeyDown(IN_ATTACK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, size * 2, size * 2, size)
draw.SimpleText(attack2, "BeatrunHUD", size + 86, size * 2 + 8, color_black)
surface.DrawRect(xoff + size * 3, yoff + size, size * 2, size)
draw.SimpleText(attack, "BeatrunHUD", xoff + size + 87, yoff + size + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(size * 3, size * 2, size * 2, size)
draw.SimpleText(attack2, "BeatrunHUD", size + 86, size * 2 + 8, color_white)
surface.DrawRect(xoff + size * 3, yoff + size, size * 2, size)
draw.SimpleText(attack, "BeatrunHUD", xoff + size + 87, yoff + size + 8, color_white)
end
if lp:KeyDown(IN_ATTACK2) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(xoff + size * 3, yoff + size * 2, size * 2, size)
draw.SimpleText(attack2, "BeatrunHUD", xoff + size + 86, yoff + size * 2 + 8, color_black)
else
surface.SetDrawColor(color_black_t)
surface.DrawRect(xoff + size * 3, yoff + size * 2, size * 2, size)
draw.SimpleText(attack2, "BeatrunHUD", xoff + size + 86, yoff + size * 2 + 8, color_white)
end
end
end

View file

@ -170,6 +170,10 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function()
panel:CheckBox("#beatrun.toolsmenu.hud.keystrokes", "Beatrun_ShowKeystrokes")
panel:ControlHelp("#beatrun.toolsmenu.hud.keystrokesdesc")
panel:NumSlider("#beatrun.toolsmenu.hud.keystrokes_x_offset", "Beatrun_KeystrokesXOffset", 0, ScrW(), 0)
panel:NumSlider("#beatrun.toolsmenu.hud.keystrokes_y_offset", "Beatrun_KeystrokesYOffset", 0, ScrH(), 0)
panel:NumSlider("#beatrun.toolsmenu.hud.keystrokes_corner", "Beatrun_KeystrokesCorner", 0, 3, 0)
panel:NumSlider("#beatrun.toolsmenu.hud.speedometermode", "Beatrun_SpeedometerMode", 0, 2, 0)
panel:ControlHelp("#beatrun.toolsmenu.hud.speedometermodedesc")

View file

@ -5,6 +5,7 @@ if CLIENT then
local brcross = Material("brcross.png", "nocull smooth")
local rotate_timer = 0
local scale = 1
hook.Add("HUDPaint", "grappleicon", function()
local ply = LocalPlayer()
@ -30,7 +31,7 @@ if CLIENT then
surface.SetDrawColor(255, 255, 255)
surface.SetMaterial(brcross)
surface.DrawTexturedRectRotated(w2s.x, w2s.y, SScaleX(32), SScaleY(32), math.fmod(rotate_timer * 100, 360))
surface.DrawTexturedRectRotated(w2s.x, w2s.y, SScaleX(32 * scale), SScaleY(32 * scale), math.fmod(rotate_timer * 100, 360))
return
end
@ -40,16 +41,18 @@ if CLIENT then
local trout = ply:GetEyeTrace()
local dist = trout.HitPos:DistToSqr(ply:GetPos())
if not trout.HitSky and trout.Fraction > 0 and dist < 2750000 and dist > 90000 then
cam.Start3D()
local w2s = trout.HitPos:ToScreen()
cam.End3D()
scale = math.Remap(dist, 90000, 2750000, 1.3, 0.7)
rotate_timer = rotate_timer + FrameTime()
surface.SetDrawColor(255, 255, 255)
surface.SetMaterial(brcross)
surface.DrawTexturedRectRotated(w2s.x, w2s.y, SScaleX(32), SScaleY(32), math.fmod(rotate_timer * 100, 360))
surface.DrawTexturedRectRotated(w2s.x, w2s.y, SScaleX(32 * scale), SScaleY(32 * scale), math.fmod(rotate_timer * 100, 360))
end
end)
end

View file

@ -1,4 +1,4 @@
VERSION_GLOBAL = "1.0.24"
VERSION_GLOBAL = "1.0.25"
VERSION_LATEST = ""
VERSION_CHECKED = false

View file

@ -1 +1 @@
1.0.24
1.0.25