UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

38 lines (37 loc) 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CCMPBlipsManager = void 0; const CCMPWorldObjectsManager_1 = require("../worldObject/CCMPWorldObjectsManager"); const CCMPBlip_1 = require("./CCMPBlip"); class CCMPBlipsManager extends CCMPWorldObjectsManager_1.CCMPWorldObjectsManager { constructor() { super({ baseObjectsType: "blip", }); } create(options) { const { position, dimension, sprite, color = 0, scale = 1, alpha = 255, drawDistance = 0, global = false, name = "", shortRange = false, } = options; const createOptions = { name, alpha, drawDistance, global, shortRange, dimension, }; if (options.rotation !== undefined) { createOptions.rotation = options.rotation; } const ccmpBlip = ccmp.blips.create(sprite, position.x, position.y, position.z, color, scale, createOptions); if (!ccmpBlip) { throw new Error("CCMPBlipsManager.create: ccmp.blips.create failed (server full?)"); } const blip = new CCMPBlip_1.CCMPBlip({ ccmpBlip, onDestroy: (b) => this.unregisterBaseObject(b), }); this.registerBaseObject(blip); return blip; } } exports.CCMPBlipsManager = CCMPBlipsManager;