record raw events everywhere
Some checks are pending
record-daemon / Build, check and test (push) Waiting to run
Some checks are pending
record-daemon / Build, check and test (push) Waiting to run
This commit is contained in:
@@ -94,10 +94,11 @@ function getEventColor(event: TimestampedEvent): string {
|
||||
case "phase_change":
|
||||
return "#60a5fa"; // blue
|
||||
case "kill":
|
||||
case "champions_killed":
|
||||
return getKillEventColor(event);
|
||||
case "objective":
|
||||
return "#fbbf24"; // yellow
|
||||
case "lp_change":
|
||||
return "#a78bfa"; // purple
|
||||
default:
|
||||
return "#9ca3af"; // gray
|
||||
}
|
||||
@@ -105,14 +106,13 @@ function getEventColor(event: TimestampedEvent): string {
|
||||
|
||||
// Get kill event color based on player involvement
|
||||
function getKillEventColor(event: TimestampedEvent): string {
|
||||
const rawEvent = event.event as { killer?: string; victim?: string } | null;
|
||||
const rawData = event.raw_data as { Assisters?: string[] } | null;
|
||||
const rawData = event.raw_data as { KillerName?: string; VictimName?: string; Assisters?: string[] } | null;
|
||||
|
||||
if (!rawEvent) return "#9ca3af"; // gray for unknown
|
||||
if (!rawData) return "#9ca3af"; // gray for unknown
|
||||
|
||||
const killer = rawEvent.killer;
|
||||
const victim = rawEvent.victim;
|
||||
const assisters = rawData?.Assisters || [];
|
||||
const killer = rawData.KillerName;
|
||||
const victim = rawData.VictimName;
|
||||
const assisters = rawData.Assisters || [];
|
||||
|
||||
// Get local player's summoner name
|
||||
const localPlayerName = localPlayer.value?.riotIdGameName;
|
||||
|
||||
@@ -13,10 +13,14 @@ export interface TimestampedEvent {
|
||||
game_timestamp: [number, number] | null;
|
||||
/** Real-world timestamp (ISO 8601). */
|
||||
timestamp: string;
|
||||
/** Event type name. */
|
||||
/** Event type name (e.g. "game_start", "lp_change", "kill"). */
|
||||
event_type: string;
|
||||
/** Human-readable description. */
|
||||
description: string;
|
||||
/** Raw JSON data from the League Client API — the single source of truth. */
|
||||
raw_data: Record<string, unknown>;
|
||||
/** URI of the endpoint that triggered this event. */
|
||||
uri: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,12 +605,19 @@ export function getEventCategory(eventType: string): EventCategory {
|
||||
return "death";
|
||||
case "objective":
|
||||
return "objective";
|
||||
case "gameend":
|
||||
case "gamestart":
|
||||
case "matchfound":
|
||||
case "game_end":
|
||||
case "game_start":
|
||||
case "match_found":
|
||||
return "game";
|
||||
case "phasechange":
|
||||
case "phase_change":
|
||||
return "phase";
|
||||
case "lp_change":
|
||||
return "game";
|
||||
case "champ_select_start":
|
||||
case "champion_pick":
|
||||
return "phase";
|
||||
case "stats_update":
|
||||
return "unknown";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
@@ -623,14 +634,22 @@ export function getEventLabel(eventType: string): string {
|
||||
return "Death";
|
||||
case "objective":
|
||||
return "Objective";
|
||||
case "gameend":
|
||||
case "game_end":
|
||||
return "Game End";
|
||||
case "gamestart":
|
||||
case "game_start":
|
||||
return "Game Start";
|
||||
case "matchfound":
|
||||
case "match_found":
|
||||
return "Match Found";
|
||||
case "phasechange":
|
||||
case "phase_change":
|
||||
return "Phase Change";
|
||||
case "lp_change":
|
||||
return "LP Change";
|
||||
case "champ_select_start":
|
||||
return "Champ Select";
|
||||
case "champion_pick":
|
||||
return "Champion Pick";
|
||||
case "stats_update":
|
||||
return "Stats Update";
|
||||
default:
|
||||
return eventType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user