Skip to content

Commit

Permalink
refactor(playeravatar): Replace b-draw_lib with library
Browse files Browse the repository at this point in the history
This fixes #1676 by removing the file conflict.
  • Loading branch information
Histalek committed Nov 27, 2024
1 parent 2493ff1 commit 63fed09
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 260 deletions.
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/cl_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ local function CacheAllPlayerAvatars(ply)

for i = 1, #plys do
local plyid64 = plys[i]:SteamID64()
draw.RefreshAvatars(plyid64)
playeravatar.Refresh(plyid64)
end
end

Expand Down
4 changes: 2 additions & 2 deletions gamemodes/terrortown/gamemode/client/cl_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ net.Receive("TTT2SendConfirmMsg", function()
sid64 = nil
end

local img = draw.GetAvatarMaterial(sid64, "medium")
local img = playeravatar.GetMaterial(sid64, PLAYERAVATAR_SIZE.medium)

---
-- @realm client
Expand Down Expand Up @@ -214,7 +214,7 @@ function SEARCHSCREEN:Show(data)
profileBox:Dock(LEFT)
profileBox:SetModel(data.playerModel)
profileBox:SetPlayerIcon(
playerDataKnown and draw.GetAvatarMaterial(data.sid64, "medium")
playerDataKnown and playeravatar.GetMaterial(data.sid64, PLAYERAVATAR_SIZE.medium)
or materialPlayerIconUnknown
)
profileBox:SetPlayerRoleColor(playerDataKnown and data.roleColor or COLOR_SLATEGRAY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if CLIENT then
yPos,
h,
h,
draw.GetAvatarMaterial(ply:SteamID64(), "medium"),
playeravatar.GetMaterial(ply:SteamID64(), PLAYERAVATAR_SIZE.medium),
255,
COLOR_WHITE
)
Expand Down
1 change: 1 addition & 0 deletions gamemodes/terrortown/gamemode/shared/sh_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ include("ttt2/libraries/events.lua")
include("ttt2/libraries/eventdata.lua")
include("ttt2/libraries/targetid.lua")
include("ttt2/libraries/playermodels.lua")
include("ttt2/libraries/playeravatar.lua")
include("ttt2/libraries/entspawnscript.lua")
include("ttt2/libraries/bodysearch.lua")
include("ttt2/libraries/keyhelp.lua")
Expand Down
256 changes: 0 additions & 256 deletions lua/autorun/client/b-draw_lib.lua

This file was deleted.

Loading

0 comments on commit 63fed09

Please sign in to comment.