Skip to content

Commit 7fcd62d

Browse files
committed
feat: add optional icons before group name
1 parent 555a2a7 commit 7fcd62d

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ return {
5454
label = 'Police',
5555
groups = {'police', 'sheriff'},
5656
includeOffDuty = false,
57+
icon = 'ic:round-local-police',
5758
},
5859
{
5960
label = 'EMS',
@@ -64,6 +65,7 @@ return {
6465
label = 'Mechanics',
6566
groups = {'lsc', 'bennys', 'hayes'},
6667
includeOffDuty = true,
68+
icon = 'mdi:wrench',
6769
},
6870
{
6971
label = 'Taxi',

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use_experimental_fxv2_oal 'yes'
55

66
name 'ac_scoreboard'
77
author 'AC Scripts'
8-
version '2.1.0'
8+
version '2.2.0'
99
description 'A framework-standalone scoreboard UI for FiveM.'
1010
repository 'https://github.com/acscripts/ac_scoreboard'
1111

modules/client/main.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ local function openScoreboard()
2222
groups[index] = {
2323
label = group.label,
2424
count = data.groups[index],
25+
icon = group.icon,
2526
}
2627
end
2728

web/src/components/groups.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import Icon from '@iconify/svelte';
23
import data from '$store/data';
34
import config from '$store/config';
45
import locales from '$store/locales';
@@ -17,7 +18,12 @@
1718
$config.compactGroups ? 'py-1' : 'py-2'
1819
)}
1920
>
20-
<span class="truncate">{group.label}</span>
21+
<div class="flex items-center gap-2 truncate">
22+
{#if group.icon}
23+
<Icon icon={group.icon} class="h-4 min-w-4" />
24+
{/if}
25+
<span class="truncate">{group.label}</span>
26+
</div>
2127
<span
2228
class={cn(
2329
'min-w-9 flex-shrink-0 select-none rounded-md bg-slate-800 px-2 text-center',

web/src/store/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default writable<SheetData>({
88
maxPlayers: 100,
99
},
1010
groups: [
11-
{ label: 'Police', count: 7 },
11+
{ label: 'Police', count: 7, icon: 'ic:round-local-police' },
1212
{ label: 'EMS', count: 6 },
13-
{ label: 'Mechanics', count: 2 },
13+
{ label: 'Mechanics', count: 2, icon: 'mdi:wrench' },
1414
{ label: 'Taxi', count: 0 },
1515
{ label: 'Unemployed', count: 47 },
1616
],

web/src/types/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Footer = {
77
type Group = {
88
label: string;
99
count: number;
10+
icon?: string;
1011
};
1112

1213
type Player = {

0 commit comments

Comments
 (0)