Skip to content

Commit

Permalink
Merge branch 'master' into continous-use
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll authored Jan 3, 2025
2 parents 105bf0f + 880ac92 commit 4a093ca
Show file tree
Hide file tree
Showing 128 changed files with 3,544 additions and 914 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
#
# Run stylua formatter on entire codebase
df7bf4216cf31d680c0d95bd576e46193ce2dcd6
# Run stylua after removing many `-- stylua: ignore` statements
cd4b56c390418d14bfa69e511ea9b8405eff12a0
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI

env:
GLUALINT_VERSION: 1.26.0
NEODOC_VERSION: 0.1.6
STYLUA_VERSION: 0.20.0
GLUALINT_VERSION: 1.29.0
NEODOC_VERSION: 0.2.0
STYLUA_VERSION: 2.0.0

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: JohnnyMorganz/stylua-action@v3
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.STYLUA_VERSION }}
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,48 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel

## Unreleased

### Added

- Added Korean translation (by @Kojap)
- Added diagnostic information to the addonchecker output.
- This also includes a Garry's Mod version check which triggers a warning if TTT2 is not compatible. First baseline version is '240313' (by @NickCloudAT)
- Added `GM:TTT2PlayDeathScream` hook to cancel or overwrite/change the deathscream sound that plays, when you die (by @NickCloudAT)
- Added support for "toggle_zoom" binds to trigger the radio commands menu (by @TW1STaL1CKY)

### Fixed

- Fixed missing translation for None role error by removing it (by @mexikoedi)
- Fixed sometimes entity use triggering the wrong or no entity (by @TimGoll)
- Fixed translation of muting Terrorists and Spectators (by @mexikoedi)
- Fixed continuous use being broken, meaing that holding E on a health station did nothing (by @TimGoll)
- Fixed the loadingscreen disable causing an error (by @TimGoll)
- Fixed the rounds left always displaying one less than actually left (by @TimGoll)
- Fixed rendering glitches in the loading screen (by @TimGoll)
- Fixed weapon pickup through walls (by @MrXonte)
- Fixed spectating player still being visible through thermalvision after killing that player (by @MrXonte)
- Fixed Magneto-stick not using C_Hands (by @SvveetMavis)
- Fixed console error when dropping ammo for weapons with no AmmoEnt (by @MrXonte)
- Fixed client error for a not fully initialized client (by @Histalek)
- Fixed the targetID corpse hint not respecting `ttt_identify_body_woconfirm` (by @Histalek)
- Fixed the beacon not being properly translated when placed (by @Histalek)
- Fixed binoculars zooming not being predicted (by @Histalek)
- Fixed an error when trying to pickup a placed equipment (e.g. beacon) (by @Histalek)
- Fixed corpse searching sound playing when searched by a spectator, searched covertly, or searched long range (by @TW1STaL1CKY)
- Fixed the mute button in the scoreboard not working (by @TW1STaL1CKY)

### Changed

- Updated French translation (by @MisterClems)
- Updated Turkish localization (by @NovaDiablox)
- Changed it so that continous use doesn't require direct focus; healing at a health station also works when looking around as long as you stay close by (by @TimGoll)
- Updated Russian localization (by @Satton2)
- Updated targetID to use `Vehicle:GetDriver` instead of the `ttt_driver` NWEntity (by @Histalek)
- Updated Russian and English localization files (by @Satton2)
- Updated old TTT HUD to show name of spectated player (by @somefnfplayerlol)
- Changes to the enabled map prefixes will not be announced to players anymore (by @Histalek)
- By default only `ttt` and `ttt2` map prefixes are enabled (by @Histalek)
- Updated `ttt_identify_body_woconfirm` to be replicated across the server and client (by @Wryyyong)
- Changed how Ammo is dropped; if drop should be from reserve ammo, now tries to drop a full ammo box instead of a full clip. (by @MrXonte)

## [v0.14.0b](https://github.com/TTT-2/TTT2/tree/v0.14.0b) (2024-09-20)

Expand Down
1 change: 0 additions & 1 deletion gamemodes/terrortown/entities/entities/base_ammo_ttt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function ENT:PlayerCanPickup(ply)

---
-- @realm shared
-- stylua: ignore
local result = hook.Run("TTTCanPickupAmmo", ply, self)
if result then
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if CLIENT then
end

if not self:PlayerCanPickupWeapon(client) then
LANG.Msg(client, "pickup_fail", nil, MSG_MSTACK_WARN)
LANG.Msg("pickup_fail", nil, MSG_MSTACK_WARN)

self:EmitSound(soundDeny)

Expand Down
12 changes: 7 additions & 5 deletions gamemodes/terrortown/entities/entities/ttt_beacon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DEFINE_BASECLASS("ttt_base_placeable")

if CLIENT then
ENT.Icon = "vgui/ttt/icon_beacon"
ENT.PrintName = "Beacon"
ENT.PrintName = "beacon_name"
end

ENT.Base = "ttt_base_placeable"
Expand Down Expand Up @@ -93,8 +93,9 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
if hook.Run("TTT2BeaconDetectPlayer", ent, self) == false then continue end
if hook.Run("TTT2BeaconDetectPlayer", ent, self) == false then
continue
end

plysFound[ent] = true
affectedPlayers[ent] = true
Expand Down Expand Up @@ -164,8 +165,9 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
if hook.Run("TTT2BeaconDeathNotify", victim, beacon) == false then continue end
if hook.Run("TTT2BeaconDeathNotify", victim, beacon) == false then
continue
end

LANG.Msg(beaconOwner, "msg_beacon_death", nil, MSG_MSTACK_WARN)

Expand Down
5 changes: 0 additions & 5 deletions gamemodes/terrortown/entities/entities/ttt_c4/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ local c4boom = Sound("c4.explode")
function ENT:Explode(tr)
---
-- @realm shared
-- stylua: ignore
local result, message = hook.Run("TTTC4Explode", self)

if result == false then
Expand Down Expand Up @@ -545,7 +544,6 @@ if SERVER then
else
---
-- @realm server
-- stylua: ignore
local result, message = hook.Run("TTTC4Arm", bomb, ply)

if result ~= false then
Expand All @@ -563,7 +561,6 @@ if SERVER then
local function SendDisarmResult(ply, bomb, disarmResult)
---
-- @realm server
-- stylua: ignore
local result, message = hook.Run("TTTC4Disarm", bomb, disarmResult, ply)

if result == false then
Expand Down Expand Up @@ -639,7 +636,6 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
local result, message = hook.Run("TTTC4Pickup", bomb, ply)

if result == false then
Expand Down Expand Up @@ -692,7 +688,6 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
local result, message = hook.Run("TTTC4Destroyed", bomb, ply)

if result == false then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
ttt_allow_jump = CreateConVar("ttt_allow_discomb_jump", "0", {FCVAR_ARCHIVE, FCVAR_NOTIFY})
ttt_allow_jump = CreateConVar("ttt_allow_discomb_jump", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
end

ENT.Type = "anim"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ end
if SERVER then
---
-- @realm server
-- stylua: ignore
local ttt_hats_reclaim = CreateConVar("ttt_detective_hats_reclaim", "1")

---
-- @realm server
-- stylua: ignore
local ttt_hats_innocent = CreateConVar("ttt_detective_hats_reclaim_any", "0")

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function ENT:GiveHealth(ply, healthMax)

---
-- @realm shared
-- stylua: ignore
if hook.Run("TTTPlayerUsedHealthStation", ply, self, healed) == false then
return false
end
Expand Down
4 changes: 2 additions & 2 deletions gamemodes/terrortown/entities/entities/ttt_logic_role.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function ENT:AcceptInput(name, activator, caller, data)

---
-- @realm server
-- stylua: ignore
local role, team = hook.Run("TTT2ModifyLogicRoleCheck", activator, self, activator, caller, data)
local role, team =
hook.Run("TTT2ModifyLogicRoleCheck", activator, self, activator, caller, data)
local activatorRole = roles.GetByIndex(role, roles.INNOCENT):GetBaseRole()
local activatorTeam = (gameloop.GetRoundState() == ROUND_PREP) and TEAM_INNOCENT or team

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ net.Receive("TTT2ToggleTButton", function(len, ply)

---
-- @realm server
-- stylua: ignore
local use, message = hook.Run("TTTCanToggleTraitorButton", ent, ply)

if not use then
Expand All @@ -150,7 +149,6 @@ local function ActivateTButton(ply, ent)

---
-- @realm server
-- stylua: ignore
local use, message = hook.Run("TTTCanUseTraitorButton", ent, ply)

if not use then
Expand Down Expand Up @@ -319,7 +317,6 @@ function ENT:TraitorUse(ply)

---
-- @realm server
-- stylua: ignore
hook.Run("TTTTraitorButtonActivated", self, ply)

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
if SERVER then
---
-- @realm server
-- stylua: ignore
local cv_tbutton = CreateConVar("ttt2_tbutton_admin_show", "0", {FCVAR_ARCHIVE, FCVAR_NOTIFY}, "Always show the buttons to admins in range", 0, 1)
local cv_tbutton = CreateConVar(
"ttt2_tbutton_admin_show",
"0",
{ FCVAR_ARCHIVE, FCVAR_NOTIFY },
"Always show the buttons to admins in range",
0,
1
)

hook.Add("TTT2SyncGlobals", "AddTButtonGlobals", function()
SetGlobalBool(cv_tbutton:GetName(), cv_tbutton:GetBool())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function ENT:CountValidPlayers(activator, caller, data)

---
-- @realm server
-- stylua: ignore
local _, team = hook.Run("TTT2ModifyLogicRoleCheck", ply, self, activator, caller, data)

-- only count if it is a evil role
Expand Down
11 changes: 4 additions & 7 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_binoculars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,12 @@ end
---
-- @ignore
function SWEP:SetZoomLevel(level)
if CLIENT then
return
end

local owner = self:GetOwner()

self:SetZoomAmount(level)

owner:SetFOV(self.ZoomLevels[level], 0.3)
local owner = self:GetOwner()
if IsValid(owner) then
owner:SetFOV(self.ZoomLevels[level], 0.3)
end
end

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ end
local SendScorches

if CLIENT then
-- @ignore
local function ReceiveScorches()
local ent = net.ReadEntity()
local num = net.ReadUInt(8)
Expand Down
4 changes: 2 additions & 2 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_teleport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ if SERVER then

---
-- @realm server
-- stylua: ignore
ttt_telefrags = CreateConVar("ttt_teleport_telefrags", "1", {FCVAR_ARCHIVE, FCVAR_NOTIFY})
ttt_telefrags = CreateConVar("ttt_teleport_telefrags", "1", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
end

DEFINE_BASECLASS("weapon_tttbase")
Expand Down Expand Up @@ -132,6 +131,7 @@ local shouldNotCollideList = {
[COLLISION_GROUP_DEBRIS_TRIGGER] = true,
[COLLISION_GROUP_INTERACTIVE_DEBRIS] = true,
}
-- @ignore
local function ShouldCollide(ent)
return not shouldNotCollideList[ent:GetCollisionGroup()]
end
Expand Down
26 changes: 18 additions & 8 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_wtester.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,30 @@ else

---
-- @realm server
-- stylua: ignore
local dna_mode = CreateConVar("ttt2_dna_radar", "0", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Toggles the DNA Scanner functionality")
local dna_mode = CreateConVar(
"ttt2_dna_radar",
"0",
{ FCVAR_NOTIFY, FCVAR_ARCHIVE },
"Toggles the DNA Scanner functionality"
)

---
-- @realm server
-- stylua: ignore
local dna_slots = CreateConVar("ttt2_dna_scanner_slots", "4", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Defines the maximum amount of DNA slots")
local dna_slots = CreateConVar(
"ttt2_dna_scanner_slots",
"4",
{ FCVAR_NOTIFY, FCVAR_ARCHIVE },
"Defines the maximum amount of DNA slots"
)

---
-- @realm server
-- stylua: ignore
local dna_radar_cd = CreateConVar("ttt2_dna_radar_cooldown", "5.0", {FCVAR_NOTIFY, FCVAR_ARCHIVE}, "Defines the cooldown in seconds")
local dna_radar_cd = CreateConVar(
"ttt2_dna_radar_cooldown",
"5.0",
{ FCVAR_NOTIFY, FCVAR_ARCHIVE },
"Defines the cooldown in seconds"
)

hook.Add("TTT2SyncGlobals", "TTT2SyncDNAScannerGlobals", function()
SetGlobalBool(dna_mode:GetName(), dna_mode:GetBool())
Expand Down Expand Up @@ -301,7 +313,6 @@ function SWEP:AddPlayerSample(corpse, killer)

---
-- @realm shared
-- stylua: ignore
hook.Run("TTTFoundDNA", owner, killer, corpse)

self:Report(true, "dna_killer")
Expand Down Expand Up @@ -355,7 +366,6 @@ function SWEP:AddItemSample(ent)

---
-- @realm shared
-- stylua: ignore
hook.Run("TTTFoundDNA", owner, ply, ent)

self:Report(true, "dna_object")
Expand Down
Loading

0 comments on commit 4a093ca

Please sign in to comment.