Rename fix (#31654)
* Localize RenameCommand and delegate most of the process to MetaDataSystem.SetEntityName() * Make renaming rely on the EntityRenamedEvent. Fix issue where renaming would keep old Examine text Requires engine change * Fix localisation strings * Make PDA search be based on a renamed entity's Uid instead of its old name To do this the pda component now has an PdaOwner field which gets assigned when it is given as a loadout to a player * Fix bad merge??? huh * Use AllEntityQuery
This commit is contained in:
@@ -98,6 +98,7 @@ public sealed class AdminSystem : EntitySystem
|
||||
SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
|
||||
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);
|
||||
SubscribeLocalEvent<ActorComponent, EntityRenamedEvent>(OnPlayerRenamed);
|
||||
}
|
||||
|
||||
private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
|
||||
@@ -124,6 +125,11 @@ public sealed class AdminSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPlayerRenamed(Entity<ActorComponent> ent, ref EntityRenamedEvent args)
|
||||
{
|
||||
UpdatePlayerList(ent.Comp.PlayerSession);
|
||||
}
|
||||
|
||||
public void UpdatePlayerList(ICommonSession player)
|
||||
{
|
||||
_playerList[player.UserId] = GetPlayerInfo(player.Data, player);
|
||||
|
||||
Reference in New Issue
Block a user