Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into deathscream-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCloudAT committed Nov 2, 2024
2 parents 93f91a1 + d6c1627 commit 1459a95
Show file tree
Hide file tree
Showing 8 changed files with 2,398 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel

### 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)

Expand All @@ -18,13 +19,15 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- 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)

### Changed

- Updated French translation (by @MisterClems)
- Updated Turkish localization (by @NovaDiablox)
- 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)

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

Expand Down
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/cl_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end
---
-- Adds a @{WEAPON} or an @{ITEM} into the fav table
-- @param string equipmentId the @{WEAPON} or @{ITEM} id
-- @param bool isFavorite If the equipmentId is a favorite
-- @param boolean isFavorite If the equipmentId is a favorite
-- @realm client
function shop.SetFavoriteState(equipmentId, isFavorite)
local favOrm = shop.favorites.orm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@ if CLIENT then
local hastewidth = self.hastewidth
local bg_colors = self.bg_colors
local round_y = y + height - self.bgheight
local screenwidth = ScrW()

height = self.bgheight

-- move up a little on low resolutions to allow space for spectator hints
if ScrW() < 1000 then
if screenwidth < 1000 then
round_y = round_y - 15
end

Expand Down Expand Up @@ -303,6 +304,20 @@ if CLIENT then
COLOR_WHITE,
TEXT_ALIGN_CENTER
)

-- Draw name of spectated player
local tgt = client:GetObserverTarget()
if IsValid(tgt) and tgt:IsPlayer() then
self:ShadowedText(
tgt:Nick(),
"TimeLeft",
screenwidth / 2,
margin,
COLOR_WHITE,
TEXT_ALIGN_CENTER,
TEXT_ALIGN_TOP
)
end
end
end
end
20 changes: 10 additions & 10 deletions gamemodes/terrortown/gamemode/shared/sh_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end
-- Returns if the equipment is already bought for the player
-- @param Player ply The player to check
-- @param string equipmentName The name of the equipment to check
-- @return bool If the Equipment was bought
-- @return boolean If the Equipment was bought
-- @realm shared
function shop.IsBoughtFor(ply, equipmentName)
return shop.buyTable[ply] and shop.buyTable[ply][equipmentName]
Expand All @@ -76,7 +76,7 @@ end
---
-- Returns if the equipment is already globally bought by a player
-- @param string equipmentName The name of the equipment to check
-- @return bool If the Equipment was globally bought
-- @return boolean If the Equipment was globally bought
-- @realm shared
function shop.IsGlobalBought(equipmentName)
return shop.globalBuyTable[equipmentName]
Expand All @@ -86,7 +86,7 @@ end
-- Returns if the equipment is already bought for the players team
-- @param Player ply The player to check the team of
-- @param string equipmentName The name of the equipment to check
-- @return bool If the Equipment was bought by a teammate
-- @return boolean If the Equipment was bought by a teammate
-- @realm shared
function shop.IsTeamBoughtFor(ply, equipmentName)
local team = ply:GetTeam()
Expand Down Expand Up @@ -150,7 +150,7 @@ end
-- Check if an equipment is currently buyable for a player
-- @param Player ply The player to buy the equipment for
-- @param string equipmentName The name of the equipment to buy
-- @return bool True, if equipment can be bought
-- @return boolean True, if equipment can be bought
-- @return number The shop.statusCode, that lead to the decision
-- @realm shared
function shop.CanBuyEquipment(ply, equipmentName)
Expand Down Expand Up @@ -274,7 +274,7 @@ end
-- Buys for player the equipment with the corresponding Id
-- @param Player ply The player to buy the equipment for
-- @param string equipmentName The name of the equipment to buy
-- @return bool True, if equipment can be bought
-- @return boolean True, if equipment can be bought
-- @return number The shop.statusCode, that lead to the decision
-- @realm shared
function shop.BuyEquipment(ply, equipmentName)
Expand Down Expand Up @@ -355,7 +355,7 @@ end
---
-- Check if the player can reroll their shop
-- @param Player ply The player to reroll the shop for
-- @return bool True, if shop can be rerolled
-- @return boolean True, if shop can be rerolled
-- @realm shared
function shop.CanRerollShop(ply)
return GetGlobalBool("ttt2_random_shops")
Expand All @@ -369,7 +369,7 @@ end
-- Reroll shop for player and subtract the credits of it
-- @note Use `shop.ForceRerollShop(ply)` to reroll without cost and restrictions
-- @param Player ply The player to reroll the shop for
-- @return bool True, if shop was successfully rerolled
-- @return boolean True, if shop was successfully rerolled
-- @realm shared
function shop.TryRerollShop(ply)
if not shop.CanRerollShop(ply) then
Expand Down Expand Up @@ -398,9 +398,9 @@ end

---
-- Transfer credits from one player to another
-- @param Player The player to transfer the credits from
-- @param string The SteamID64 of the player to transfer the credits to
-- @param number The number of credits to transfer
-- @param Player ply The player to transfer the credits from
-- @param string targetPlyId64 The SteamID64 of the player to transfer the credits to
-- @param number credits The number of credits to transfer
-- @realm shared
function shop.TransferCredits(ply, targetPlyId64, credits)
if not IsValid(ply) or not isstring(targetPlyId64) or not isnumber(credits) or credits <= 0 then
Expand Down
Loading

0 comments on commit 1459a95

Please sign in to comment.