Fix job label rendering
This commit is contained in:
@@ -230,17 +230,12 @@ function renderPropertyExitLabel(position) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempPosition = position;
|
position = getPosAbovePos(position, propertyLabelHeight);
|
||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
|
||||||
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
||||||
if (getGame() == V_GAME_GTA_IV) {
|
if (getGame() == V_GAME_GTA_IV) {
|
||||||
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
|
||||||
} else {
|
} else {
|
||||||
screenPosition = getScreenFromWorldPosition(tempPosition);
|
screenPosition = getScreenFromWorldPosition(position);
|
||||||
}
|
|
||||||
|
|
||||||
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = "EXIT";
|
let text = "EXIT";
|
||||||
@@ -275,15 +270,16 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempPosition = position;
|
position = getPosAbovePos(position, propertyLabelHeight);
|
||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
|
||||||
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
let screenPosition = new Vec3(0.0, 0.0, 0.0);
|
||||||
if (getGame() == V_GAME_GTA_IV) {
|
if (getGame() == V_GAME_GTA_IV) {
|
||||||
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
|
screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
|
||||||
} else {
|
} else {
|
||||||
screenPosition = getScreenFromWorldPosition(tempPosition);
|
screenPosition = getScreenFromWorldPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_VERBOSE, `[V.RP.Label] World [${position.x}, ${position.y}, ${position.z}] to screen [${screenPosition.x}, ${screenPosition.y}, ${screenPosition.z}]`);
|
||||||
|
|
||||||
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
if (screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -325,9 +321,7 @@ function processLabelRendering() {
|
|||||||
natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
|
natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyLabelRenderDistance) {
|
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType, business.entranceFee);
|
||||||
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType, business.entranceFee);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -337,9 +331,7 @@ function processLabelRendering() {
|
|||||||
natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
|
natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyLabelRenderDistance) {
|
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
|
||||||
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -349,15 +341,13 @@ function processLabelRendering() {
|
|||||||
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDistance(localPlayer.position, job.position) <= propertyPickupRenderDistance) {
|
renderJobLabel(job.name, job.position, job.jobId);
|
||||||
renderJobLabel(job.name, job.position, job.jobType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (areWorldLabelsSupported()) {
|
if (arePickupsSupported() && areWorldLabelsSupported()) {
|
||||||
if (localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
let pickups = getElementsByType(ELEMENT_PICKUP);
|
let pickups = getElementsByType(ELEMENT_PICKUP);
|
||||||
for (let i in pickups) {
|
for (let i in pickups) {
|
||||||
|
|||||||
Reference in New Issue
Block a user