Show player name based on nametag

This commit is contained in:
Jean-Patrick Guerrero 2022-12-01 20:23:53 +01:00
parent b711f8f195
commit 080579b2a4

View File

@ -421,7 +421,8 @@ local function get_bag_fs(fs, data, name, esc_name, bag_size, yextra)
end end
local function get_container(fs, data, player, yoffset, ctn_len, award_list, awards_unlocked, award_list_nb, bag_size) local function get_container(fs, data, player, yoffset, ctn_len, award_list, awards_unlocked, award_list_nb, bag_size)
local name = data.player_name local nametag = player:get_nametag_attributes()
local name = true_str(nametag.text) and nametag.text or data.player_name
local esc_name = ESC(name) local esc_name = ESC(name)
add_subtitle(fs, "player_name", 0, ctn_len, 22, true, esc_name) add_subtitle(fs, "player_name", 0, ctn_len, 22, true, esc_name)
@ -474,14 +475,14 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa
end end
if data.subcat == 1 then if data.subcat == 1 then
get_bag_fs(fs, data, name, esc_name, bag_size, yextra) get_bag_fs(fs, data, data.player_name, esc_name, bag_size, yextra)
elseif data.subcat == 2 then elseif data.subcat == 2 then
if not i3.modules.armor then if not i3.modules.armor then
return not_installed "3d_armor" return not_installed "3d_armor"
end end
local armor_def = armor.def[name] local armor_def = armor.def[data.player_name]
local _, armor_inv = armor:get_valid_player(player, "3d_armor") local _, armor_inv = armor:get_valid_player(player, "3d_armor")
fs("list[detached:%s_armor;armor;0,%f;5,1;]", esc_name, yextra + 0.7) fs("list[detached:%s_armor;armor;0,%f;5,1;]", esc_name, yextra + 0.7)
@ -522,7 +523,7 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa
return not_installed "skinsdb" return not_installed "skinsdb"
end end
local _skins = skins.get_skinlist_for_player(name) local _skins = skins.get_skinlist_for_player(data.player_name)
local skin_name = skins.get_player_skin(player).name local skin_name = skins.get_player_skin(player).name
local spp, add_y = 24, 0 local spp, add_y = 24, 0