Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ local function setupDispatch()
player = PlayerData,
keybind = Config.RespondKeybind,
maxCallList = Config.MaxCallList,
shortCalls = Config.ShortCalls,
}
})
end
Expand Down
12 changes: 6 additions & 6 deletions html/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions shared/config.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Config = Config or {}

Config.ShortCalls = false -- Dispatch notifications are sent containing only the alert name, omitting additional details. For more information, the dispatch menu can be accessed.
Config.Debug = false -- Enables debug and send alerts when leo break the law.

Config.RespondKeybind = 'E'
Expand Down
13 changes: 10 additions & 3 deletions ui/src/components/Main.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { onMount, afterUpdate } from 'svelte';
import { DISPATCH, removeDispatch, RESPOND_KEYBIND, IS_RIGHT_MARGIN } from '@store/stores';
import { DISPATCH, removeDispatch, RESPOND_KEYBIND, IS_RIGHT_MARGIN, shortCalls } from '@store/stores';
import { fly } from 'svelte/transition';
import { timeAgo } from '@utils/timeAgo';

Expand Down Expand Up @@ -34,7 +34,13 @@
});

function getDispatchData(dispatch) {
return [
if ($shortCalls) {
return [
{ label: 'Call', value: dispatch.data.message },
{ icon: 'fas fa-comment', label: 'Information', value: dispatch.data.information },
];
} else {
return [
{ icon: 'fas fa-clock', label: 'Time', value: timeAgo(dispatch.data.time) },
{ icon: 'fas fa-user', label: 'Name', value: dispatch.data.name },
{ icon: 'fas fa-phone', label: 'Number', value: dispatch.data.number },
Expand All @@ -49,7 +55,8 @@
{ icon: 'fas fa-car', label: 'Class', value: dispatch.data.class },
{ icon: 'fas fa-door-open', label: 'Doors', value: dispatch.data.doors },
{ icon: 'fas fa-compass', label: 'Heading', value: dispatch.data.heading },
];
];
}
}
</script>

Expand Down
3 changes: 2 additions & 1 deletion ui/src/providers/AlwaysListener.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { ReceiveNUI } from '@utils/ReceiveNUI'
import { debugData } from '@utils/debugData'
import { VISIBILITY, BROWSER_MODE, DISPATCH_MENU, DISPATCH_MENUS, DISPATCH, PLAYER, Locale, RESPOND_KEYBIND, MAX_CALL_LIST} from '@store/stores'
import { VISIBILITY, BROWSER_MODE, DISPATCH_MENU, DISPATCH_MENUS, DISPATCH, PLAYER, Locale, RESPOND_KEYBIND, MAX_CALL_LIST, shortCalls } from '@store/stores';

debugData([
{
Expand Down Expand Up @@ -50,6 +50,7 @@
Locale.set(data.locales)
RESPOND_KEYBIND.set(data.keybind)
MAX_CALL_LIST.set(data.maxCallList)
shortCalls.set(data.shortCalls)
});

</script>
2 changes: 2 additions & 0 deletions ui/src/store/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const DISPATCH = writable<any[]>(null);

export const IS_RIGHT_MARGIN = writable(true);

export const shortCalls = writable(true);

export function removeDispatch(callID) {
DISPATCH.update(dispatches => {
return dispatches.filter(dispatch => dispatch.data.id !== callID);
Expand Down