forked from DragonHiveSolutions/IIS-EmergencyLS-ELS-FiveM
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from matsn0w/develop
v2.1.0
- Loading branch information
Showing
25 changed files
with
19,612 additions
and
147 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,28 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
FiveM build: xxxx | ||
MISS ELS version: x.x.x |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,31 @@ | ||
## Type of change | ||
|
||
- [ ] Bug fix | ||
- [ ] New feature | ||
- [ ] Documentation update | ||
- [ ] Other | ||
|
||
## Description | ||
|
||
<!-- Please describe your PR. What does this? Why should this be added? Why should this be fixed? What could be improved later? --> | ||
|
||
## Issue | ||
|
||
<!-- Please link to any relevant issue(s) --> | ||
|
||
Fixes #xx | ||
|
||
## Screenshots | ||
|
||
<!-- Please add some screenshots or videos when relevant --> | ||
|
||
## Checklist | ||
|
||
- [ ] My code follows the code style of this project | ||
- [ ] I have performed a self-review of my code | ||
- [ ] I have tested my code | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] Any dependent changes have been merged and published in downstream modules | ||
|
||
@matsn0w |
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,21 @@ | ||
## Merged Pull Requests for this release | ||
|
||
### rc.1 | ||
|
||
- # | ||
- ... | ||
|
||
### Final | ||
|
||
- # | ||
- ... | ||
|
||
## Release candidates | ||
|
||
- [vX.X.X-rc.X](https://github.com/matsn0w/MISS-ELS/releases/tag/X.X.X-rc.X) | ||
- ... | ||
|
||
## Todo for final release | ||
|
||
- [ ] update changelog | ||
- [ ] update docs |
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
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,21 @@ | ||
<template> | ||
<label class="import-button"> | ||
Import Existing VCF | ||
<input type="file" @change="loadVCF"> | ||
</label> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ImportButton', | ||
methods: { | ||
loadVCF (ev) { | ||
const file = ev.target.files[0] | ||
const reader = new FileReader() | ||
reader.onload = e => this.$emit('load', e.target.result) | ||
reader.readAsText(file) | ||
} | ||
} | ||
} | ||
</script> |
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,92 @@ | ||
/** | ||
* This method takes in an existing VCF file (as XML string), parses the XML | ||
* and maps it to an expected format for the VueX store. | ||
* | ||
*/ | ||
export default function generateStoreAttributesFromExistingVCF (data) { | ||
const vcf = { | ||
flashID: 1, | ||
author: null, | ||
description: null, | ||
extras: [], | ||
statics: [], | ||
useServerSirens: false, | ||
sounds: [], | ||
patterns: [], | ||
flashes: [] | ||
} | ||
|
||
// parse the XML string | ||
const parsedVCF = new DOMParser().parseFromString(data, 'text/xml') | ||
|
||
// get basic document info | ||
vcf.description = parsedVCF.querySelector('vcfroot').getAttribute('Description') | ||
vcf.author = parsedVCF.querySelector('vcfroot').getAttribute('Author') | ||
|
||
// EOVERRIDE section | ||
const eoverride = parsedVCF.querySelector('EOVERRIDE') | ||
const extras = eoverride.querySelectorAll('*') | ||
|
||
extras.forEach((extra) => { | ||
vcf.extras.push({ | ||
id: parseInt(extra.nodeName.match(/([0-9]|[1-9][0-9])$/g)[0]), | ||
enabled: extra.getAttribute('IsElsControlled') === 'true', | ||
allowEnv: extra.getAttribute('AllowEnvLight') === 'true', | ||
color: extra.getAttribute('Color') ?? null | ||
}) | ||
}) | ||
|
||
// STATICS section | ||
const staticsObject = parsedVCF.querySelector('STATIC') | ||
const statics = staticsObject.querySelectorAll('*') | ||
|
||
statics.forEach((staticExtra) => { | ||
vcf.statics.push({ | ||
extra: parseInt(staticExtra.nodeName.match(/([0-9]|[1-9][0-9])$/g)[0]), | ||
name: staticExtra.getAttribute('Name') ?? staticExtra.nodeName | ||
}) | ||
}) | ||
|
||
// SOUNDS section | ||
const soundsObject = parsedVCF.querySelector('SOUNDS') | ||
const sounds = soundsObject.querySelectorAll('*') | ||
|
||
sounds.forEach((sound) => { | ||
vcf.sounds.push({ | ||
name: sound.nodeName, | ||
allowUse: sound.getAttribute('AllowUse') === 'true', | ||
audioString: sound.getAttribute('AudioString') ?? null, | ||
soundSet: sound.getAttribute('SoundSet') ?? null | ||
}) | ||
}) | ||
|
||
// determine whether a SoundSet is present | ||
sounds.forEach((sound) => { | ||
if (sound.getAttribute('SoundSet') !== null) { | ||
vcf.useServerSirens = true | ||
} | ||
}) | ||
|
||
// PATTERN section | ||
const patternsObject = parsedVCF.querySelector('PATTERN') | ||
|
||
for (const pattern of patternsObject.children) { | ||
vcf.patterns.push({ | ||
name: pattern.nodeName, | ||
isEmergency: pattern.getAttribute('IsEmergency') === 'true' | ||
}) | ||
|
||
for (const flash of pattern.children) { | ||
const enabledExtras = flash.getAttribute('Extras')?.split(',') ?? [] | ||
|
||
vcf.flashes.push({ | ||
id: vcf.flashID++, | ||
duration: parseInt(flash.getAttribute('Duration')) ?? 100, | ||
extras: enabledExtras.map(extra => parseInt(extra)) ?? [], | ||
pattern: pattern.nodeName | ||
}) | ||
} | ||
} | ||
|
||
return vcf | ||
} |
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
Oops, something went wrong.