Skip to content

Commit

Permalink
fix: dont hide self player-name
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishqmanuja committed Jan 12, 2024
1 parent 81893ec commit 90d8fe3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/table/plugins/player-name.plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import chalk from "chalk";
import { match } from "ts-pattern";

import { ValorantApi } from "~/api";
import { GAMESTATES, type KnownGameStates } from "~/api/types";
import { NameEntity } from "~/entities/definitions/name.entity";
import { RemarksEntity } from "~/entities/definitions/remarks.entity";
import { inject } from "~/shared/dependencies";
import { isStreamerModeEnabled } from "~/shared/environment";
import type { RGBTuple } from "~/utils/colors";

Expand All @@ -15,6 +17,8 @@ export const PlayerNamePlugin = definePlugin({
id: PLUGIN_ID,
hooks: {
onState: async ({ data, table }) => {
const api = inject(ValorantApi);

const entities = await table.entityManager.getEntitiesForPlayers(data, [
NameEntity,
RemarksEntity,
Expand All @@ -29,7 +33,7 @@ export const PlayerNamePlugin = definePlugin({
value: formatName({
name: name.value,
state: data._state,
isHidden: name.isHidden,
isHidden: name.isHidden && puuid !== api.puuid,
isAlly: remarks?.isAlly,
}),
});
Expand Down

0 comments on commit 90d8fe3

Please sign in to comment.