Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radar move from shop UI #1624

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
473 changes: 473 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_radar.lua

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions gamemodes/terrortown/gamemode/client/cl_equip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -837,20 +837,6 @@ function TraitorMenuPopup()
GetTranslation("equip_tooltip_main")
)

-- Item control
if client:HasEquipmentItem("item_ttt_radar") then
local dradar = RADAR.CreateMenu(dsheet, dframe)

dsheet:AddSheet(
GetTranslation("radar_name"),
dradar,
"icon16/magnifier.png",
false,
false,
GetTranslation("equip_tooltip_radar")
)
end

-- Credit transferring
if credits > 0 then
local dtransfer = CreateTransferMenu(dsheet)
Expand Down
1 change: 0 additions & 1 deletion gamemodes/terrortown/gamemode/server/sv_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ util.AddNetworkString("TTT_Credits")
util.AddNetworkString("TTT_Bought")
util.AddNetworkString("TTT_BoughtItem")
util.AddNetworkString("TTT_InterruptChat")
util.AddNetworkString("TTT_CorpseCall")
util.AddNetworkString("TTT_PerformGesture")
util.AddNetworkString("TTT_Role")
util.AddNetworkString("TTT_RoleList")
Expand Down
1 change: 0 additions & 1 deletion gamemodes/terrortown/gamemode/server/sv_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ function plymeta:ResetRoundFlags()

-- equipment stuff
self.bomb_wire = nil
self.radar_charge = 0
self.decoy = nil

timer.Remove("give_equipment" .. self:UniqueID())
Expand Down
4 changes: 0 additions & 4 deletions gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
-- All replicated convars are handled in this file

-- @realm shared
-- stylua: ignore
CreateConVar("ttt2_radar_charge_time", "30", {FCVAR_NOTIFY, FCVAR_ARCHIVE, FCVAR_REPLICATED})

---
-- @realm shared
-- stylua: ignore
Expand Down
5 changes: 3 additions & 2 deletions gamemodes/terrortown/gamemode/shared/sh_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ SPECIAL_EQUIPMENT = {
"weapon_ttt_stungun",
"weapon_ttt_cse",
"weapon_ttt_teleport",
"weapon_ttt_radar",
"item_ttt_armor",
"item_ttt_radar",
"item_ttt_nodrowningdmg",
"item_ttt_noenergydmg",
"item_ttt_noexplosiondmg",
Expand All @@ -72,8 +72,8 @@ TRAITOR_EQUIPMENT = {
"weapon_ttt_sipistol",
"weapon_ttt_teleport",
"weapon_ttt_decoy",
"weapon_ttt_radar",
"item_ttt_armor",
"item_ttt_radar",
"item_ttt_disguiser",
}

Expand Down Expand Up @@ -601,6 +601,7 @@ include("ttt2/libraries/marker_vision.lua")
include("ttt2/libraries/weaponrenderer.lua")
include("ttt2/libraries/game_effects.lua")
include("ttt2/libraries/voicebattery.lua")
include("ttt2/libraries/radar.lua")

-- include ttt required files
ttt_include("sh_decal")
Expand Down
8 changes: 7 additions & 1 deletion gamemodes/terrortown/gamemode/shared/sh_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,10 @@

---
-- Returns whether a @{Player} carries a @{Weapon}
-- @param[opt] string className
-- @return boolean
-- @realm shared
function plymeta:HasEquipmentWeapon()
function plymeta:HasEquipmentWeapon(className)
local weps = self:GetWeapons()

for i = 1, #weps do
Expand All @@ -696,6 +697,11 @@
continue
end

-- Check for specifc class
if className and not WEPS.GetClass(wep) == className then

Check warning on line 701 in gamemodes/terrortown/gamemode/shared/sh_player_ext.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary negation"

Silly negation. Use '~='
continue
end

return true
end

Expand Down
Loading
Loading