@armoury/fivem-framework-server 1.0.44 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,18 +9,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.Blip = void 0;
|
|
10
10
|
const injection_js_1 = require("injection-js");
|
|
11
11
|
let Blip = class Blip {
|
|
12
|
-
static createLocalized(x, y, z, localizationKey,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
static createLocalized(x, y, z, localizationKey, options) {
|
|
13
|
+
var _a;
|
|
14
|
+
const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey, localizationParameters: (_a = options === null || options === void 0 ? void 0 : options.localizationParameters) !== null && _a !== void 0 ? _a : {} });
|
|
15
15
|
return this.create(x, y, z, newOptions);
|
|
16
16
|
}
|
|
17
17
|
static create(x, y, z, options) {
|
|
18
18
|
var _a, _b, _c, _d;
|
|
19
|
-
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
|
|
19
|
+
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1, localizationParameters: (_b = options === null || options === void 0 ? void 0 : options.localizationParameters) !== null && _b !== void 0 ? _b : {} });
|
|
20
20
|
const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
|
|
21
21
|
const blipId = lastBlipId + 1;
|
|
22
22
|
this._blipIds.push(blipId);
|
|
23
|
-
|
|
23
|
+
const newLocalizationKey = options.localizationKey
|
|
24
|
+
? `${Cfx.Server.GetCurrentResourceName()}.${options.localizationKey}`
|
|
25
|
+
: undefined;
|
|
26
|
+
Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_c = options.spriteId) !== null && _c !== void 0 ? _c : undefined, newLocalizationKey, (_d = options.localizationParameters) !== null && _d !== void 0 ? _d : undefined);
|
|
24
27
|
Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
|
|
25
28
|
return blipId;
|
|
26
29
|
}
|
|
@@ -6,18 +6,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { Injectable } from 'injection-js';
|
|
8
8
|
let Blip = class Blip {
|
|
9
|
-
static createLocalized(x, y, z, localizationKey,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
static createLocalized(x, y, z, localizationKey, options) {
|
|
10
|
+
var _a;
|
|
11
|
+
const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey, localizationParameters: (_a = options === null || options === void 0 ? void 0 : options.localizationParameters) !== null && _a !== void 0 ? _a : {} });
|
|
12
12
|
return this.create(x, y, z, newOptions);
|
|
13
13
|
}
|
|
14
14
|
static create(x, y, z, options) {
|
|
15
15
|
var _a, _b, _c, _d;
|
|
16
|
-
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
|
|
16
|
+
options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1, localizationParameters: (_b = options === null || options === void 0 ? void 0 : options.localizationParameters) !== null && _b !== void 0 ? _b : {} });
|
|
17
17
|
const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
|
|
18
18
|
const blipId = lastBlipId + 1;
|
|
19
19
|
this._blipIds.push(blipId);
|
|
20
|
-
|
|
20
|
+
const newLocalizationKey = options.localizationKey
|
|
21
|
+
? `${Cfx.Server.GetCurrentResourceName()}.${options.localizationKey}`
|
|
22
|
+
: undefined;
|
|
23
|
+
Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_c = options.spriteId) !== null && _c !== void 0 ? _c : undefined, newLocalizationKey, (_d = options.localizationParameters) !== null && _d !== void 0 ? _d : undefined);
|
|
21
24
|
Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
|
|
22
25
|
return blipId;
|
|
23
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class Blip {
|
|
2
2
|
private static _blipIds;
|
|
3
|
-
static createLocalized(x: number, y: number, z: number, localizationKey: string,
|
|
3
|
+
static createLocalized(x: number, y: number, z: number, localizationKey: string, options?: Omit<BlipCreateOptions, 'localizationKey'>): number;
|
|
4
4
|
static create(x: number, y: number, z: number, options?: BlipCreateOptions): number;
|
|
5
5
|
}
|
|
6
6
|
type BlipCreateOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armoury/fivem-framework-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.46",
|
|
4
4
|
"description": "Server APIs for the Armoury FiveM framework",
|
|
5
5
|
"main": "dist/cjs/server/index.js",
|
|
6
6
|
"module": "dist/esm/server/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"rxjs": "^7.8.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@armoury/fivem-framework-common": "1.0.
|
|
30
|
+
"@armoury/fivem-framework-common": "1.0.46"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|