-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
3,842 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Bug Report | ||
about: Create a bug report to help solve an issue | ||
title: 'Bug: TITLE' | ||
labels: New Issue | ||
assignees: '' | ||
--- | ||
|
||
**Describe the issue** | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
**Expected behavior** | ||
|
||
A clear and concise description of what you expected to happen. | ||
|
||
**To Reproduce** | ||
|
||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
|
||
**Media** | ||
|
||
If applicable, add a screenshot or a video to help explain your problem. | ||
|
||
**Needed information (please complete the following information):** | ||
- **Client Version:**: [e.g. Canary or Release] | ||
- **Release Version:**: [e.g 1.0] | ||
|
||
**Additional context** | ||
Add any other context about the issue here. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
on: | ||
push: | ||
paths: | ||
- 'ui/**' | ||
- '.github/workflows/ci.yml' | ||
pull_request: | ||
paths: | ||
- 'ui/**' | ||
- '.github/workflows/ci.yml' | ||
jobs: | ||
build: | ||
name: Build Test | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ui | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Setup node environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "ui/pnpm-lock.yaml" | ||
|
||
- name: Install deps | ||
run: pnpm install --frozen-lockfile | ||
working-directory: ui | ||
|
||
- name: Try build | ||
run: pnpm build | ||
working-directory: ui | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Debug Build Action" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
debug-build: | ||
name: "Create Debug Build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Install ZIP | ||
run: sudo apt install zip | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 9 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "ui/pnpm-lock.yaml" | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
working-directory: ui | ||
|
||
- name: Run build | ||
run: pnpm build | ||
working-directory: ui | ||
env: | ||
CI: false | ||
|
||
- name: Bundle files | ||
run: | | ||
shopt -s extglob | ||
mkdir -p ./temp/${{ github.event.repository.name }} | ||
mkdir -p ./temp/${{ github.event.repository.name }}/ui | ||
cp ./{README.md,LICENSE,fxmanifest.lua} ./temp/${{ github.event.repository.name }} | ||
cp -r ./{client,bridge,server} ./temp/${{ github.event.repository.name }} | ||
cp -r ./ui/dist ./temp/${{ github.event.repository.name }}/ui/ | ||
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} | ||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: ./temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,37 @@ jobs: | |
- name: Install ZIP | ||
run: sudo apt install zip | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 9 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "ui/pnpm-lock.yaml" | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
working-directory: ui | ||
|
||
- name: Run build | ||
run: pnpm build | ||
working-directory: ui | ||
env: | ||
CI: false | ||
|
||
- name: Bundle files | ||
run: | | ||
rm -rf ./.github ./.vscode ./.git | ||
shopt -s extglob | ||
mkdir ./${{ github.event.repository.name }} | ||
cp -r !(${{ github.event.repository.name }}) ${{ github.event.repository.name }} | ||
zip -r ./${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} | ||
mkdir -p ./temp/${{ github.event.repository.name }} | ||
mkdir -p ./temp/${{ github.event.repository.name }}/ui | ||
cp ./{README.md,LICENSE,fxmanifest.lua} ./temp/${{ github.event.repository.name }} | ||
cp -r ./{client,bridge,server} ./temp/${{ github.event.repository.name }} | ||
cp -r ./ui/dist ./temp/${{ github.event.repository.name }}/ui/dist | ||
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} | ||
- name: Get App Token | ||
uses: actions/create-github-app-token@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if GetResourceState('es_extended') ~= 'started' then return end | ||
|
||
if not IsDuplicityVersion() then return end | ||
|
||
local ESX = exports.es_extended:getSharedObject() | ||
|
||
local function getPlayer(source) | ||
return ESX.GetPlayerFromId(source) | ||
end | ||
|
||
---Get the player data from the source | ||
---@param source number | ||
---@return string | ||
function GetPlayerName(source) | ||
local xPlayer = getPlayer(source) | ||
return xPlayer.getName() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
if not lib.checkDependency('ND_Core', '2.0.0') then return end | ||
|
||
if not IsDuplicityVersion() then return end | ||
|
||
NDCore = {} | ||
|
||
lib.load('@ND_Core.init') | ||
|
||
function GetPlayer(id) | ||
return NDCore.getPlayer(id) | ||
end | ||
|
||
---Get the player data from the source | ||
---@param source number | ||
---@return string | ||
function GetPlayerName(source) | ||
local player = GetPlayer(source) | ||
return player.fullname | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if GetResourceState('ox_core') ~= 'started' then return end | ||
|
||
local isServer = IsDuplicityVersion() | ||
|
||
local Ox = require '@ox_core.lib.init' | ||
|
||
--TODO: Add ox_core support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
if GetResourceState('qb-core') ~= 'started' or GetResourceState('qbx_core') == 'started' then return end | ||
|
||
QBCore = exports['qb-core']:GetCoreObject() | ||
local isServer = IsDuplicityVersion() | ||
|
||
|
||
function GetJobs() | ||
return QBCore.Shared.Jobs | ||
end | ||
|
||
JOBS = GetJobs() | ||
|
||
if isServer then | ||
function GetPlayer(source) | ||
return QBCore.Functions.GetPlayer(source) | ||
end | ||
|
||
function GetPlayerData(source) | ||
return GetPlayer(source).PlayerData | ||
end | ||
|
||
function Notify(source, message, type) | ||
return QBCore.Functions.Notify(source, message, type) | ||
end | ||
|
||
function CheckCurrentJob(source, job) | ||
local playerData = GetPlayerData(source) | ||
return playerData.job.name == job | ||
end | ||
|
||
function CanSetJob(source, jobName) | ||
local playerData = GetPlayerData(source) | ||
local jobs = playerData.jobs | ||
for job, _ in pairs(jobs) do | ||
if jobName == job then | ||
return true | ||
end | ||
end | ||
return false | ||
end | ||
|
||
function SetPlayerJob(source, job) | ||
return exports.qbx_core:SetPlayerPrimaryJob(GetPlayerData(source).citizenid, job) | ||
end | ||
|
||
function RemovePlayerFromJob(source, job) | ||
return exports.qbx_core:RemovePlayerFromJob(GetPlayerData(source).citizenid, job) | ||
end | ||
|
||
function SetPlayerDuty(source, duty) | ||
return GetPlayer(source).Functions.SetJobDuty(duty) | ||
end | ||
|
||
AddEventHandler('QBCore:Server:OnJobUpdate', function(playerSource, job) | ||
local citizenid = GetPlayerData(playerSource).citizenid | ||
if GetPlayerJob(citizenid, job) or GetPlayerJobCount(citizenid) then return end | ||
AddPlayerJob(citizenid, job.name, job.grade) | ||
end) | ||
|
||
AddEventHandler('QBCore:Server:UpdateObject', function() | ||
JOBS = GetJobs() | ||
end) | ||
|
||
AddEventHandler('onResourceStart', function(resource) | ||
if resource ~= GetCurrentResourceName() then return end | ||
MySQL.query([=[ | ||
CREATE TABLE IF NOT EXISTS `save_jobs` ( | ||
`cid` VARCHAR(100) NOT NULL, | ||
`job` VARCHAR(100) NOT NULL, | ||
`grade` INT(11) NOT NULL, | ||
UNIQUE KEY `cid_job` (`cid`,`job`) | ||
); | ||
]=]) | ||
end) | ||
|
||
else | ||
function GetPlayerData() | ||
return QBCore.Functions.GetPlayerData() | ||
end | ||
|
||
function Notify(message, type) | ||
return QBCore.Functions.Notify(message, type) | ||
end | ||
|
||
AddEventHandler('QBCore:Client:OnSharedUpdate', function(data) | ||
Wait(0) | ||
if data ~= 'Jobs' then return end | ||
JOBS = GetJobs() | ||
end) | ||
|
||
AddEventHandler('QBCore:Client:OnSharedUpdateMultiple', function(data) | ||
Wait(0) | ||
if data ~= 'Jobs' then return end | ||
JOBS = GetJobs() | ||
end) | ||
end |
Oops, something went wrong.