rock-mod 0.5.0 → 0.5.1
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.
- package/LICENSE +21 -21
- package/dist/server/entities/altv/blip/AltVBlip.d.ts +8 -4
- package/dist/server/entities/altv/blip/AltVBlip.js +23 -10
- package/dist/server/entities/altv/blip/AltVBlipsManager.js +8 -3
- package/dist/server/entities/common/blip/IBlip.d.ts +9 -4
- package/dist/server/entities/common/blip/IBlipsManager.d.ts +7 -1
- package/dist/server/entities/ragemp/blip/RageBlip.d.ts +8 -4
- package/dist/server/entities/ragemp/blip/RageBlip.js +22 -10
- package/dist/server/entities/ragemp/blip/RageBlipsManager.js +2 -5
- package/package.json +62 -62
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Carter
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Carter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -3,13 +3,17 @@ import { IBlip, IBlipColor, IBlipSprite } from "../../common";
|
|
|
3
3
|
export interface IAltVBlipOptions extends IAltVWorldObjectOptions<AltVServer.Blip> {
|
|
4
4
|
}
|
|
5
5
|
export declare class AltVBlip extends AltVWorldObject<AltVServer.Blip> implements IBlip {
|
|
6
|
-
get sprite(): IBlipSprite;
|
|
7
|
-
get alpha(): number;
|
|
8
6
|
get name(): string;
|
|
7
|
+
get sprite(): IBlipSprite;
|
|
9
8
|
get color(): IBlipColor;
|
|
9
|
+
get alpha(): number;
|
|
10
|
+
get scale(): number;
|
|
11
|
+
get drawDistance(): number;
|
|
12
|
+
get shortRange(): boolean;
|
|
13
|
+
get rotation(): number;
|
|
10
14
|
constructor(options: IAltVBlipOptions);
|
|
11
|
-
setSprite(value: IBlipSprite): void;
|
|
12
|
-
setAlpha(value: number): void;
|
|
13
15
|
setName(value: string): void;
|
|
16
|
+
setSprite(value: IBlipSprite): void;
|
|
14
17
|
setColor(value: IBlipColor): void;
|
|
18
|
+
setAlpha(value: number): void;
|
|
15
19
|
}
|
|
@@ -3,32 +3,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AltVBlip = void 0;
|
|
4
4
|
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
5
|
class AltVBlip extends AltVWorldObject_1.AltVWorldObject {
|
|
6
|
+
get name() {
|
|
7
|
+
return this.mpEntity.name;
|
|
8
|
+
}
|
|
6
9
|
get sprite() {
|
|
7
10
|
return this.mpEntity.sprite;
|
|
8
11
|
}
|
|
12
|
+
get color() {
|
|
13
|
+
return this.mpEntity.color;
|
|
14
|
+
}
|
|
9
15
|
get alpha() {
|
|
10
16
|
return this.mpEntity.alpha;
|
|
11
17
|
}
|
|
12
|
-
get
|
|
13
|
-
return this.mpEntity.
|
|
18
|
+
get scale() {
|
|
19
|
+
return this.mpEntity.scale;
|
|
14
20
|
}
|
|
15
|
-
get
|
|
16
|
-
|
|
21
|
+
get drawDistance() {
|
|
22
|
+
console.log("[RockMod] AltVBlip drawDistance is not implemented");
|
|
23
|
+
return 0;
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
get shortRange() {
|
|
26
|
+
return this.mpEntity.shortRange;
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
this.mpEntity.
|
|
28
|
+
get rotation() {
|
|
29
|
+
return this.mpEntity.heading;
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super(options);
|
|
26
33
|
}
|
|
27
34
|
setName(value) {
|
|
28
35
|
this.mpEntity.name = value;
|
|
29
36
|
}
|
|
37
|
+
setSprite(value) {
|
|
38
|
+
this.mpEntity.sprite = value;
|
|
39
|
+
}
|
|
30
40
|
setColor(value) {
|
|
31
41
|
this.mpEntity.color = value;
|
|
32
42
|
}
|
|
43
|
+
setAlpha(value) {
|
|
44
|
+
this.mpEntity.alpha = value;
|
|
45
|
+
}
|
|
33
46
|
}
|
|
34
47
|
exports.AltVBlip = AltVBlip;
|
|
@@ -12,11 +12,16 @@ class AltVBlipsManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
create(options) {
|
|
15
|
-
const {
|
|
15
|
+
const { alpha, color, dimension, name, position, rotation, scale, shortRange, sprite } = options;
|
|
16
16
|
const mpEntity = new PointBlip(new Vector3(position), true);
|
|
17
|
-
mpEntity.
|
|
17
|
+
mpEntity.alpha = alpha ?? 255;
|
|
18
|
+
mpEntity.color = color ?? 1;
|
|
18
19
|
mpEntity.dimension = dimension;
|
|
19
|
-
mpEntity.
|
|
20
|
+
mpEntity.name = name ?? "";
|
|
21
|
+
mpEntity.heading = rotation ?? 0;
|
|
22
|
+
mpEntity.scale = scale ?? 1;
|
|
23
|
+
mpEntity.shortRange = shortRange ?? false;
|
|
24
|
+
mpEntity.sprite = sprite;
|
|
20
25
|
const blip = new AltVBlip_1.AltVBlip({ mpEntity });
|
|
21
26
|
this.registerBaseObject(blip);
|
|
22
27
|
return blip;
|
|
@@ -800,12 +800,17 @@ export declare enum IBlipColor {
|
|
|
800
800
|
export interface IBlipOptions extends IWorldObjectOptions {
|
|
801
801
|
}
|
|
802
802
|
export interface IBlip extends IWorldObject {
|
|
803
|
+
get name(): string;
|
|
803
804
|
get sprite(): IBlipSprite;
|
|
805
|
+
get color(): number;
|
|
804
806
|
get alpha(): number;
|
|
805
|
-
get
|
|
806
|
-
get
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
get scale(): number;
|
|
808
|
+
get drawDistance(): number;
|
|
809
|
+
get shortRange(): boolean;
|
|
810
|
+
get rotation(): number;
|
|
811
|
+
get dimension(): number;
|
|
809
812
|
setName(value: string): void;
|
|
813
|
+
setSprite(value: IBlipSprite): void;
|
|
810
814
|
setColor(value: IBlipColor): void;
|
|
815
|
+
setAlpha(value: number): void;
|
|
811
816
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { IWorldObjectCreateOptions, IWorldObjectsManager } from "../worldObject";
|
|
2
2
|
import { IBlip } from "./IBlip";
|
|
3
3
|
export interface IBlipCreateOptions extends IWorldObjectCreateOptions {
|
|
4
|
+
alpha?: number;
|
|
5
|
+
color?: number;
|
|
6
|
+
drawDistance?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
rotation?: number;
|
|
9
|
+
scale?: number;
|
|
10
|
+
shortRange?: boolean;
|
|
4
11
|
sprite: number;
|
|
5
|
-
alpha: number;
|
|
6
12
|
}
|
|
7
13
|
export interface IBlipsManager extends IWorldObjectsManager<IBlip> {
|
|
8
14
|
create(options: IBlipCreateOptions): IBlip;
|
|
@@ -3,13 +3,17 @@ import { IBlip, IBlipColor, IBlipSprite } from "../../common";
|
|
|
3
3
|
export interface IRageBlipOptions extends IRageWorldObjectOptions<EntityMp> {
|
|
4
4
|
}
|
|
5
5
|
export declare class RageBlip extends RageWorldObject<EntityMp> implements IBlip {
|
|
6
|
-
get sprite(): IBlipSprite;
|
|
7
|
-
get alpha(): number;
|
|
8
6
|
get name(): string;
|
|
7
|
+
get sprite(): IBlipSprite;
|
|
9
8
|
get color(): IBlipColor;
|
|
9
|
+
get alpha(): number;
|
|
10
|
+
get scale(): number;
|
|
11
|
+
get drawDistance(): number;
|
|
12
|
+
get shortRange(): boolean;
|
|
13
|
+
get rotation(): number;
|
|
10
14
|
constructor(options: IRageBlipOptions);
|
|
11
|
-
setSprite(value: IBlipSprite): void;
|
|
12
|
-
setAlpha(value: number): void;
|
|
13
15
|
setName(value: string): void;
|
|
16
|
+
setSprite(value: IBlipSprite): void;
|
|
14
17
|
setColor(value: IBlipColor): void;
|
|
18
|
+
setAlpha(value: number): void;
|
|
15
19
|
}
|
|
@@ -3,32 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RageBlip = void 0;
|
|
4
4
|
const RageWorldObject_1 = require("../worldObject/RageWorldObject");
|
|
5
5
|
class RageBlip extends RageWorldObject_1.RageWorldObject {
|
|
6
|
+
get name() {
|
|
7
|
+
return this.mpEntity.name;
|
|
8
|
+
}
|
|
6
9
|
get sprite() {
|
|
7
10
|
return this.mpEntity.sprite;
|
|
8
11
|
}
|
|
12
|
+
get color() {
|
|
13
|
+
return this.mpEntity.color;
|
|
14
|
+
}
|
|
9
15
|
get alpha() {
|
|
10
16
|
return this.mpEntity.alpha;
|
|
11
17
|
}
|
|
12
|
-
get
|
|
13
|
-
return this.mpEntity.
|
|
18
|
+
get scale() {
|
|
19
|
+
return this.mpEntity.scale;
|
|
14
20
|
}
|
|
15
|
-
get
|
|
16
|
-
return this.mpEntity.
|
|
21
|
+
get drawDistance() {
|
|
22
|
+
return this.mpEntity.drawDistance;
|
|
17
23
|
}
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
get shortRange() {
|
|
25
|
+
return this.mpEntity.shortRange;
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
this.mpEntity.
|
|
27
|
+
get rotation() {
|
|
28
|
+
return this.mpEntity.rotation;
|
|
23
29
|
}
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
constructor(options) {
|
|
31
|
+
super(options);
|
|
26
32
|
}
|
|
27
33
|
setName(value) {
|
|
28
34
|
this.mpEntity.name = value;
|
|
29
35
|
}
|
|
36
|
+
setSprite(value) {
|
|
37
|
+
this.mpEntity.sprite = value;
|
|
38
|
+
}
|
|
30
39
|
setColor(value) {
|
|
31
40
|
this.mpEntity.color = value;
|
|
32
41
|
}
|
|
42
|
+
setAlpha(value) {
|
|
43
|
+
this.mpEntity.alpha = value;
|
|
44
|
+
}
|
|
33
45
|
}
|
|
34
46
|
exports.RageBlip = RageBlip;
|
|
@@ -10,11 +10,8 @@ class RageBlipsManager extends RageWorldObjectsManager_1.RageWorldObjectsManager
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
create(options) {
|
|
13
|
-
const { sprite, position
|
|
14
|
-
const mpEntity = mp.blips.new(sprite, new mp.Vector3(position),
|
|
15
|
-
dimension,
|
|
16
|
-
alpha,
|
|
17
|
-
});
|
|
13
|
+
const { sprite, position } = options;
|
|
14
|
+
const mpEntity = mp.blips.new(sprite, new mp.Vector3(position), options);
|
|
18
15
|
mpEntity.isExists = () => mp.blips.exists(mpEntity);
|
|
19
16
|
const blip = new RageBlip_1.RageBlip({
|
|
20
17
|
mpEntity: mpEntity,
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rock-mod",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "npx tsx src/server/index.ts",
|
|
9
|
-
"build": "npm run build:server && npm run build:client",
|
|
10
|
-
"build:server": "tsc --project src/server/tsconfig.json",
|
|
11
|
-
"build:client": "tsc --project src/client/tsconfig.json",
|
|
12
|
-
"lint:server:check": "cd src/server && eslint . --ext .ts",
|
|
13
|
-
"lint:server:fix": "cd src/server && eslint . --ext .ts --fix",
|
|
14
|
-
"lint:client:check": "cd src/client && eslint . --ext .ts",
|
|
15
|
-
"lint:client:fix": "cd src/client && eslint . --ext .ts --fix",
|
|
16
|
-
"lint:check": "npm run lint:server:check && npm run lint:client:check",
|
|
17
|
-
"lint:fix": "npm run lint:server:fix && npm run lint:client:fix",
|
|
18
|
-
"format:check": "prettier --check .",
|
|
19
|
-
"format:fix": "prettier --write .",
|
|
20
|
-
"type:server:check": "tsc --noEmit --project src/server/tsconfig.json",
|
|
21
|
-
"type:client:check": "tsc --noEmit --project src/client/tsconfig.json",
|
|
22
|
-
"type:check": "npm run type:server:check && npm run type:client:check",
|
|
23
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
24
|
-
"prepare": "husky"
|
|
25
|
-
},
|
|
26
|
-
"husky": {
|
|
27
|
-
"hooks": {
|
|
28
|
-
"pre-commit": "lint-staged"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"lint-staged": {
|
|
32
|
-
"*.{ts,json,md}": [
|
|
33
|
-
"npm run lint:fix",
|
|
34
|
-
"npm run format:fix"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
40
|
-
"keywords": [
|
|
41
|
-
"gta",
|
|
42
|
-
"multiplayer",
|
|
43
|
-
"altv",
|
|
44
|
-
"ragemp"
|
|
45
|
-
],
|
|
46
|
-
"author": "xvetal",
|
|
47
|
-
"license": "MIT",
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
50
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
51
|
-
"eslint": "^8.57.1",
|
|
52
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
53
|
-
"eslint-config-prettier": "^9.1.0",
|
|
54
|
-
"eslint-import-resolver-typescript": "^3.6.3",
|
|
55
|
-
"eslint-plugin-import": "^2.30.0",
|
|
56
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
57
|
-
"husky": "^9.1.6",
|
|
58
|
-
"lint-staged": "^15.2.10",
|
|
59
|
-
"prettier": "^3.3.3",
|
|
60
|
-
"typescript": "^5.6.2"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rock-mod",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "npx tsx src/server/index.ts",
|
|
9
|
+
"build": "npm run build:server && npm run build:client",
|
|
10
|
+
"build:server": "tsc --project src/server/tsconfig.json",
|
|
11
|
+
"build:client": "tsc --project src/client/tsconfig.json",
|
|
12
|
+
"lint:server:check": "cd src/server && eslint . --ext .ts",
|
|
13
|
+
"lint:server:fix": "cd src/server && eslint . --ext .ts --fix",
|
|
14
|
+
"lint:client:check": "cd src/client && eslint . --ext .ts",
|
|
15
|
+
"lint:client:fix": "cd src/client && eslint . --ext .ts --fix",
|
|
16
|
+
"lint:check": "npm run lint:server:check && npm run lint:client:check",
|
|
17
|
+
"lint:fix": "npm run lint:server:fix && npm run lint:client:fix",
|
|
18
|
+
"format:check": "prettier --check .",
|
|
19
|
+
"format:fix": "prettier --write .",
|
|
20
|
+
"type:server:check": "tsc --noEmit --project src/server/tsconfig.json",
|
|
21
|
+
"type:client:check": "tsc --noEmit --project src/client/tsconfig.json",
|
|
22
|
+
"type:check": "npm run type:server:check && npm run type:client:check",
|
|
23
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
24
|
+
"prepare": "husky"
|
|
25
|
+
},
|
|
26
|
+
"husky": {
|
|
27
|
+
"hooks": {
|
|
28
|
+
"pre-commit": "lint-staged"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"lint-staged": {
|
|
32
|
+
"*.{ts,json,md}": [
|
|
33
|
+
"npm run lint:fix",
|
|
34
|
+
"npm run format:fix"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"keywords": [
|
|
41
|
+
"gta",
|
|
42
|
+
"multiplayer",
|
|
43
|
+
"altv",
|
|
44
|
+
"ragemp"
|
|
45
|
+
],
|
|
46
|
+
"author": "xvetal",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
50
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
51
|
+
"eslint": "^8.57.1",
|
|
52
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
53
|
+
"eslint-config-prettier": "^9.1.0",
|
|
54
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
55
|
+
"eslint-plugin-import": "^2.30.0",
|
|
56
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
57
|
+
"husky": "^9.1.6",
|
|
58
|
+
"lint-staged": "^15.2.10",
|
|
59
|
+
"prettier": "^3.3.3",
|
|
60
|
+
"typescript": "^5.6.2"
|
|
61
|
+
}
|
|
62
|
+
}
|