Us curly brackets on property label switch case blocks
This commit is contained in:
@@ -130,45 +130,48 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
|
if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
|
||||||
let infoText = "";
|
let infoText = "";
|
||||||
switch(labelInfoType) {
|
switch(labelInfoType) {
|
||||||
case VRR_PROPLABEL_INFO_ENTER:
|
case VRR_PROPLABEL_INFO_ENTER: {
|
||||||
if(enterPropertyKey) {
|
if(enterPropertyKey) {
|
||||||
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
||||||
} else {
|
} else {
|
||||||
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUY:
|
case VRR_PROPLABEL_INFO_BUY: {
|
||||||
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
|
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUYBIZ:
|
case VRR_PROPLABEL_INFO_BUYBIZ: {
|
||||||
infoText = getLocaleString("BuyBusinessLabel", price);
|
infoText = getLocaleString("BuyBusinessLabel", price);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//case VRR_PROPLABEL_INFO_RENTBIZ:
|
case VRR_PROPLABEL_INFO_BUYHOUSE: {
|
||||||
// infoText = `Use /bizrent to buy this business`;
|
|
||||||
// break;
|
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_BUYHOUSE:
|
|
||||||
infoText = getLocaleString("PropertyForSaleLabel", price);
|
infoText = getLocaleString("PropertyForSaleLabel", price);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_RENTHOUSE:
|
case VRR_PROPLABEL_INFO_RENTHOUSE: {
|
||||||
infoText = getLocaleString("PropertyForRentLabel", rentPrice);
|
infoText = getLocaleString("PropertyForRentLabel", rentPrice);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_PROPLABEL_INFO_ENTERVEHICLE:
|
case VRR_PROPLABEL_INFO_ENTERVEHICLE: {
|
||||||
infoText = getLocaleString("VehicleDealershipLabel");
|
infoText = getLocaleString("VehicleDealershipLabel");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
if(enterPropertyKey) {
|
if(enterPropertyKey) {
|
||||||
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
|
||||||
} else {
|
} else {
|
||||||
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
infoText = getLocaleString("PropertyEnterCommandLabel", "/enter");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) {
|
if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) {
|
||||||
let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
|
let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true);
|
||||||
@@ -349,21 +352,25 @@ function processLabelRendering() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch(pickups[i].getData("vrr.label.type")) {
|
switch(pickups[i].getData("vrr.label.type")) {
|
||||||
case VRR_LABEL_BUSINESS:
|
case VRR_LABEL_BUSINESS: {
|
||||||
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
|
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_LABEL_HOUSE:
|
case VRR_LABEL_HOUSE: {
|
||||||
renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
|
renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_LABEL_JOB:
|
case VRR_LABEL_JOB: {
|
||||||
renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
|
renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case VRR_LABEL_EXIT:
|
case VRR_LABEL_EXIT: {
|
||||||
renderPropertyExitLabel(pickups[i].position);
|
renderPropertyExitLabel(pickups[i].position);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user