Skip to content

Commit

Permalink
Dynamic Max distance code correction (#26)
Browse files Browse the repository at this point in the history
* Dynamic Max Distance for  Global Markers and  Global Textlabel

user can specify the distance to show markers and Text label. if the specified value is greater than 50 it will reset to default value of 50.

* Update src/main/server/controllers/markers.ts

Co-authored-by: Stuyk <[email protected]>

* Update src/main/server/controllers/markers.ts

Co-authored-by: Stuyk <[email protected]>

* Update src/main/server/controllers/textlabel.ts

Co-authored-by: Stuyk <[email protected]>

* Update src/main/server/controllers/textlabel.ts

Co-authored-by: Stuyk <[email protected]>

* Update docs/api/server/controllers/marker.md

Co-authored-by: Stuyk <[email protected]>

* Update docs/api/server/controllers/textlabel.md

Co-authored-by: Stuyk <[email protected]>

* Update src/main/server/controllers/markers.ts

* Update src/main/server/controllers/textlabel.ts

* Dynamic Max distance code correction

Dynamic Max distance code correction

---------

Co-authored-by: Stuyk <[email protected]>
  • Loading branch information
battlezoneyt and Stuyk authored Jun 3, 2024
1 parent 908cff0 commit b385039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/server/controllers/markers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useMarkerGlobal(marker: Marker, maxDistance: number = 50) {
marker.dimension = 0;
}

let entity = new alt.VirtualEntity(markerGroup, new alt.Vector3(marker.pos), MAX_STREAM_DISTANCE, {
let entity = new alt.VirtualEntity(markerGroup, new alt.Vector3(marker.pos), maxDistance, {
type: GroupType,
marker,
});
Expand All @@ -45,7 +45,7 @@ export function useMarkerGlobal(marker: Marker, maxDistance: number = 50) {
entity.destroy();
} catch (err) {}

entity = new alt.VirtualEntity(markerGroup, new alt.Vector3(marker.pos), MAX_STREAM_DISTANCE, {
entity = new alt.VirtualEntity(markerGroup, new alt.Vector3(marker.pos), maxDistance, {
type: GroupType,
marker,
});
Expand Down
4 changes: 2 additions & 2 deletions src/main/server/controllers/textlabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function useTextLabelGlobal(label: TextLabel, maxDistance: number = 50) {
label.uid = Utility.uid.generate();
}

let entity = new alt.VirtualEntity(labelGroup, new alt.Vector3(label.pos), MAX_STREAM_DISTANCE, {
let entity = new alt.VirtualEntity(labelGroup, new alt.Vector3(label.pos), maxDistance, {
type: GroupType,
textlabel: label,
});
Expand All @@ -41,7 +41,7 @@ export function useTextLabelGlobal(label: TextLabel, maxDistance: number = 50) {
entity.destroy();
} catch (err) {}

entity = new alt.VirtualEntity(labelGroup, new alt.Vector3(label.pos), MAX_STREAM_DISTANCE, {
entity = new alt.VirtualEntity(labelGroup, new alt.Vector3(label.pos), maxDistance, {
type: GroupType,
textlabel: label,
});
Expand Down

0 comments on commit b385039

Please sign in to comment.