mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-01-06 17:13:01 +05:00
Compare commits
1 commit
3a64960c3d
...
148a75ad05
Author | SHA1 | Date | |
---|---|---|---|
|
148a75ad05 |
3 changed files with 28 additions and 28 deletions
|
@ -6,34 +6,24 @@ local color_black = Color(0, 0, 0)
|
||||||
local color_black_t = Color(0, 0, 0, 100)
|
local color_black_t = Color(0, 0, 0, 100)
|
||||||
local size = 35
|
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()
|
local function ShowKeyStrokes()
|
||||||
if showKeystrokes:GetBool() and GetConVar("Beatrun_HUDHidden"):GetInt() == 0 then
|
if showKeystrokes:GetBool() and GetConVar("Beatrun_HUDHidden"):GetInt() == 0 then
|
||||||
local forward = GetFormattedKey("+forward")
|
local forward = string.upper(input.LookupBinding("+forward"))
|
||||||
local back = GetFormattedKey("+back")
|
local back = string.upper(input.LookupBinding("+back"))
|
||||||
local moveleft = GetFormattedKey("+moveleft")
|
local moveleft = string.upper(input.LookupBinding("+moveleft"))
|
||||||
local moveright = GetFormattedKey("+moveright")
|
local moveright = string.upper(input.LookupBinding("+moveright"))
|
||||||
local use = GetFormattedKey("+use")
|
local use = string.upper(input.LookupBinding("+use"))
|
||||||
local reload = GetFormattedKey("+reload")
|
local reload = string.upper(input.LookupBinding("+reload"))
|
||||||
local jump = GetFormattedKey("+jump")
|
local jump = string.upper(input.LookupBinding("+jump"))
|
||||||
local speed = GetFormattedKey("+speed")
|
local speed = string.upper(input.LookupBinding("+speed"))
|
||||||
local duck = GetFormattedKey("+duck")
|
local duck = string.upper(input.LookupBinding("+duck"))
|
||||||
local attack = GetFormattedKey("+attack")
|
local attack = string.upper(input.LookupBinding("+attack"))
|
||||||
local attack2 = GetFormattedKey("+attack2")
|
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
|
if LocalPlayer():KeyDown(IN_FORWARD) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size, 0, size, size)
|
surface.DrawRect(size, 0, size, size)
|
||||||
|
@ -44,6 +34,7 @@ local function ShowKeyStrokes()
|
||||||
draw.SimpleText(forward, "BeatrunHUD", size + 10, size - 30, color_white)
|
draw.SimpleText(forward, "BeatrunHUD", size + 10, size - 30, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Key E
|
||||||
if LocalPlayer():KeyDown(IN_USE) then
|
if LocalPlayer():KeyDown(IN_USE) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size * 2, 0, size, size)
|
surface.DrawRect(size * 2, 0, size, size)
|
||||||
|
@ -54,6 +45,7 @@ local function ShowKeyStrokes()
|
||||||
draw.SimpleText(use, "BeatrunHUD", size + 48, size - 30, color_white)
|
draw.SimpleText(use, "BeatrunHUD", size + 48, size - 30, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Key R
|
||||||
if LocalPlayer():KeyDown(IN_RELOAD) then
|
if LocalPlayer():KeyDown(IN_RELOAD) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size * 3, 0, size, size)
|
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)
|
draw.SimpleText(reload, "BeatrunHUD", size * 3 + 12, size - 30, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Key A
|
||||||
if LocalPlayer():KeyDown(IN_MOVELEFT) then
|
if LocalPlayer():KeyDown(IN_MOVELEFT) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(0, size, size, size)
|
surface.DrawRect(0, size, size, size)
|
||||||
|
@ -74,6 +67,7 @@ local function ShowKeyStrokes()
|
||||||
draw.SimpleText(moveleft, "BeatrunHUD", size - 23, size + 8, color_white)
|
draw.SimpleText(moveleft, "BeatrunHUD", size - 23, size + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Key S
|
||||||
if LocalPlayer():KeyDown(IN_BACK) then
|
if LocalPlayer():KeyDown(IN_BACK) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size, size, size, size)
|
surface.DrawRect(size, size, size, size)
|
||||||
|
@ -84,6 +78,7 @@ local function ShowKeyStrokes()
|
||||||
draw.SimpleText(back, "BeatrunHUD", size + 12, size + 8, color_white)
|
draw.SimpleText(back, "BeatrunHUD", size + 12, size + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Key D
|
||||||
if LocalPlayer():KeyDown(IN_MOVERIGHT) then
|
if LocalPlayer():KeyDown(IN_MOVERIGHT) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size * 2, size, size, size)
|
surface.DrawRect(size * 2, size, size, size)
|
||||||
|
@ -94,6 +89,7 @@ local function ShowKeyStrokes()
|
||||||
draw.SimpleText(moveright, "BeatrunHUD", size + 48, size + 8, color_white)
|
draw.SimpleText(moveright, "BeatrunHUD", size + 48, size + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Space
|
||||||
if LocalPlayer():KeyDown(IN_JUMP) then
|
if LocalPlayer():KeyDown(IN_JUMP) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(0, size * 2, size * 3, size)
|
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)
|
draw.SimpleText(jump, "BeatrunHUD", 28, size * 2 + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Shift
|
||||||
if LocalPlayer():KeyDown(IN_SPEED) then
|
if LocalPlayer():KeyDown(IN_SPEED) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(0, size * 3, size * 3, size)
|
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)
|
draw.SimpleText(speed, "BeatrunHUD", 28, size * 3 + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Ctrl
|
||||||
if LocalPlayer():KeyDown(IN_DUCK) then
|
if LocalPlayer():KeyDown(IN_DUCK) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(0, size * 4, size * 3, size)
|
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)
|
draw.SimpleText(duck, "BeatrunHUD", 32, size * 4 + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Left Mouse
|
||||||
if LocalPlayer():KeyDown(IN_ATTACK) then
|
if LocalPlayer():KeyDown(IN_ATTACK) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size * 3, size, size * 2, size)
|
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)
|
draw.SimpleText(attack, "BeatrunHUD", size + 87, size + 8, color_white)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Right Mouse
|
||||||
if LocalPlayer():KeyDown(IN_ATTACK2) then
|
if LocalPlayer():KeyDown(IN_ATTACK2) then
|
||||||
surface.SetDrawColor(color_white_t)
|
surface.SetDrawColor(color_white_t)
|
||||||
surface.DrawRect(size * 3, size * 2, size * 2, size)
|
surface.DrawRect(size * 3, size * 2, size * 2, size)
|
||||||
|
@ -146,4 +146,4 @@ local function ShowKeyStrokes()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("HUDPaint", "KeyStrokes", ShowKeyStrokes)
|
hook.Add("HUDPaint", "KeyStrokes", ShowKeyStrokes)
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION_GLOBAL = "1.0.15"
|
VERSION_GLOBAL = "1.0.14"
|
||||||
VERSION_LATEST = ""
|
VERSION_LATEST = ""
|
||||||
VERSION_CHECKED = false
|
VERSION_CHECKED = false
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1.0.15
|
1.0.14
|
Loading…
Reference in a new issue