Skip to content

Commit

Permalink
Merge branch 'avater-icon-fix' of https://github.com/mexikoedi/TTT2 i…
Browse files Browse the repository at this point in the history
…nto avater-icon-fix
  • Loading branch information
mexikoedi committed Aug 22, 2024
2 parents e1cc37f + 9e7b520 commit 0438a77
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 188 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Added the option to assign random unique models at round start (by @Exonen2)
- Added a new voice chat UI (by @TimGoll)
- Added `TTT2CanTakeCredits` hook for overriding whether a player is allowed to take credits from a given corpse. (by @Spanospy)
- Added `GM:TTT2OnGiveFoundCredits()` hook which is called when a player has been given credits for searching a corpse.
- Added `GM:TTT2OnReceiveKillCredits()` hook which is called when a player recieves credits for a kill.
- Added `GM:TTT2OnReceiveTeamAwardCredits()` hook which is called when a player recieves credits as a team award.
- Added `GM:TTT2OnTransferCredits()` hook which is called when a player has successfully transfered a credit to another player.
- Disabled locational voice during the preparing phase by default
- Added a ConVar `ttt_locational_voice_prep` to reenable it
- Added `SWEP.EnableConfigurableClip` and `SWEP.ConfigurableClip` to set the weapon's clip on buy via the equipment editor (by @TimGoll)
Expand Down Expand Up @@ -77,6 +81,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Corpses on fire display that information in targetID and MStack (by @TimGoll)
- Updated Russian and English localization files (by @Satton2)
- Made `ply:IsReviving` a shared player variable (by @TimGoll)
- Updated and improved the Simplified Chinese localization file (by @sbzlzh and @TheOnly8Z)

### Fixed

Expand Down
17 changes: 17 additions & 0 deletions gamemodes/terrortown/gamemode/server/sv_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1919,3 +1919,20 @@ function GM:TTT2SetDefaultCredits(ply) end
-- @hook
-- @realm server
function GM:TTT2ModifyDefaultTraitorCredits(ply, credits) end

---
-- Hook that is called when a player recieves credits for a kill.
-- @param Player ply The player who killed another player
-- @param Player victim The player who was killed
-- @param number credits The amount of credits the player received
-- @hook
-- @realm server
function GM:TTT2OnReceiveKillCredits(ply, victim, credits) end

---
-- Hook that is called when a player recieves credits as a team award.
-- @param Player ply The player who was awarded the credits
-- @param number credits The amount of credits the player received
-- @hook
-- @realm server
function GM:TTT2OnReceiveTeamAwardCredits(ply, credits) end
10 changes: 10 additions & 0 deletions gamemodes/terrortown/gamemode/server/sv_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ concommand.Add("ttt_cheat_credits", CheatCredits, nil, nil, FCVAR_CHEAT)
-- @realm server
function GM:TTT2CanTransferCredits(sender, recipient, credits_per_xfer) end

---
-- Called when a player has successfully transfered a credit to another player.
-- @param Player sender Player that has sent the credits.
-- @param Player recipient Player that has received the credits.
-- @param number credits Amount of credits that have been transferred.
-- @param boolean isRecipientDead If the recipient is dead or not.
-- @hook
-- @realm server
function GM:TTT2OnTransferCredits(sender, recipient, credits, isRecipientDead) end

local function TransferCredits(ply, cmd, args)
if #args ~= 2 then
return
Expand Down
12 changes: 12 additions & 0 deletions gamemodes/terrortown/gamemode/shared/sh_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ function shop.TryRerollShop(ply)
else
ply:SubtractCredits(GetGlobalInt("ttt2_random_shop_reroll_cost"))
shop.ForceRerollShop(ply)
---
-- @realm server
-- stylua: ignore
hook.Run("TTT2OrderedEquipment", ply, "reroll_shop", false, GetGlobalInt("ttt2_random_shop_reroll_cost"), false)
end

return true
Expand Down Expand Up @@ -436,13 +440,21 @@ function shop.TransferCredits(ply, targetPlyId64, credits)

if target:IsTerror() and target:Alive() then
target:AddCredits(credits)
---
-- @realm server
-- stylua: ignore
hook.Run("TTT2OnTransferCredits", ply, target, credits, false)
else
-- The would be recipient is dead, which the sender may not know.
-- Instead attempt to send the credits to the target's corpse, where they can be picked up.
local rag = target:FindCorpse()

if IsValid(rag) then
CORPSE.SetCredits(rag, CORPSE.GetCredits(rag, 0) + credits)
---
-- @realm server
-- stylua: ignore
hook.Run("TTT2OnTransferCredits", ply, target, credits, false)
end
end

Expand Down
6 changes: 3 additions & 3 deletions lua/terrortown/lang/tr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2347,8 +2347,8 @@ L.button_rotating = "Devreye sokmak için [{usekey}] tuşuna bas"
L.undefined_key = "???"

-- 2024-08-18
--L.header_commands_player_force_role = "Force Player Role"
L.header_commands_player_force_role = "Oyuncu Rolünü Zorla"

--L.label_button_player_force_role = "force role"
L.label_button_player_force_role = "rolü zorla"

--L.label_player_role = "Select role"
L.label_player_role = "Rol seç"
Loading

0 comments on commit 0438a77

Please sign in to comment.