Compare commits

..

1 commit

Author SHA1 Message Date
LostTrackpad
148a75ad05
Merge 2d46b1fc30 into ec38d2d230 2024-10-04 09:44:38 +05:00
3 changed files with 28 additions and 28 deletions

View file

@ -6,34 +6,24 @@ local color_black = Color(0, 0, 0)
local color_black_t = Color(0, 0, 0, 100)
local size = 35
local function GetFormattedKey(bind)
local keyBind = input.LookupBinding(bind)
if keyBind == "MOUSE1" then keyBind = "LMB"
elseif keyBind == "MOUSE2" then keyBind = "RMB"
elseif keyBind == "MOUSE3" then keyBind = "MMB" end
if keyBind then
return string.upper(keyBind)
else
return "?"
end
end
local function ShowKeyStrokes()
if showKeystrokes:GetBool() and GetConVar("Beatrun_HUDHidden"):GetInt() == 0 then
local forward = GetFormattedKey("+forward")
local back = GetFormattedKey("+back")
local moveleft = GetFormattedKey("+moveleft")
local moveright = GetFormattedKey("+moveright")
local use = GetFormattedKey("+use")
local reload = GetFormattedKey("+reload")
local jump = GetFormattedKey("+jump")
local speed = GetFormattedKey("+speed")
local duck = GetFormattedKey("+duck")
local attack = GetFormattedKey("+attack")
local attack2 = GetFormattedKey("+attack2")
local forward = string.upper(input.LookupBinding("+forward"))
local back = string.upper(input.LookupBinding("+back"))
local moveleft = string.upper(input.LookupBinding("+moveleft"))
local moveright = string.upper(input.LookupBinding("+moveright"))
local use = string.upper(input.LookupBinding("+use"))
local reload = string.upper(input.LookupBinding("+reload"))
local jump = string.upper(input.LookupBinding("+jump"))
local speed = string.upper(input.LookupBinding("+speed"))
local duck = string.upper(input.LookupBinding("+duck"))
local attack = string.upper(input.LookupBinding("+attack"))
local attack2 = string.upper(input.LookupBinding("+attack2"))
if attack == "MOUSE1" then attack = "LMB" end
if attack2 == "MOUSE2" then attack2 = "RMB" end
-- Key W
if LocalPlayer():KeyDown(IN_FORWARD) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size, 0, size, size)
@ -44,6 +34,7 @@ local function ShowKeyStrokes()
draw.SimpleText(forward, "BeatrunHUD", size + 10, size - 30, color_white)
end
-- Key E
if LocalPlayer():KeyDown(IN_USE) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 2, 0, size, size)
@ -54,6 +45,7 @@ local function ShowKeyStrokes()
draw.SimpleText(use, "BeatrunHUD", size + 48, size - 30, color_white)
end
-- Key R
if LocalPlayer():KeyDown(IN_RELOAD) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, 0, size, size)
@ -64,6 +56,7 @@ local function ShowKeyStrokes()
draw.SimpleText(reload, "BeatrunHUD", size * 3 + 12, size - 30, color_white)
end
-- Key A
if LocalPlayer():KeyDown(IN_MOVELEFT) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size, size, size)
@ -74,6 +67,7 @@ local function ShowKeyStrokes()
draw.SimpleText(moveleft, "BeatrunHUD", size - 23, size + 8, color_white)
end
-- Key S
if LocalPlayer():KeyDown(IN_BACK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size, size, size, size)
@ -84,6 +78,7 @@ local function ShowKeyStrokes()
draw.SimpleText(back, "BeatrunHUD", size + 12, size + 8, color_white)
end
-- Key D
if LocalPlayer():KeyDown(IN_MOVERIGHT) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 2, size, size, size)
@ -94,6 +89,7 @@ local function ShowKeyStrokes()
draw.SimpleText(moveright, "BeatrunHUD", size + 48, size + 8, color_white)
end
-- Space
if LocalPlayer():KeyDown(IN_JUMP) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 2, size * 3, size)
@ -104,6 +100,7 @@ local function ShowKeyStrokes()
draw.SimpleText(jump, "BeatrunHUD", 28, size * 2 + 8, color_white)
end
-- Shift
if LocalPlayer():KeyDown(IN_SPEED) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 3, size * 3, size)
@ -114,6 +111,7 @@ local function ShowKeyStrokes()
draw.SimpleText(speed, "BeatrunHUD", 28, size * 3 + 8, color_white)
end
-- Ctrl
if LocalPlayer():KeyDown(IN_DUCK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(0, size * 4, size * 3, size)
@ -124,6 +122,7 @@ local function ShowKeyStrokes()
draw.SimpleText(duck, "BeatrunHUD", 32, size * 4 + 8, color_white)
end
-- Left Mouse
if LocalPlayer():KeyDown(IN_ATTACK) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, size, size * 2, size)
@ -134,6 +133,7 @@ local function ShowKeyStrokes()
draw.SimpleText(attack, "BeatrunHUD", size + 87, size + 8, color_white)
end
-- Right Mouse
if LocalPlayer():KeyDown(IN_ATTACK2) then
surface.SetDrawColor(color_white_t)
surface.DrawRect(size * 3, size * 2, size * 2, size)
@ -146,4 +146,4 @@ local function ShowKeyStrokes()
end
end
hook.Add("HUDPaint", "KeyStrokes", ShowKeyStrokes)
hook.Add("HUDPaint", "KeyStrokes", ShowKeyStrokes)

View file

@ -1,4 +1,4 @@
VERSION_GLOBAL = "1.0.15"
VERSION_GLOBAL = "1.0.14"
VERSION_LATEST = ""
VERSION_CHECKED = false

View file

@ -1 +1 @@
1.0.15
1.0.14