From 2b6a8e49d1417a3a2b751b57b66948a6b1d46e7e Mon Sep 17 00:00:00 2001 From: Joker_vD Date: Thu, 18 Jun 2020 22:26:15 +0300 Subject: [PATCH] Only 14 characters for labels? That's 1/10 of a twit! --- src/js/game/hud/parts/waypoints.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/game/hud/parts/waypoints.js b/src/js/game/hud/parts/waypoints.js index ebd8ec6a..2472e57a 100644 --- a/src/js/game/hud/parts/waypoints.js +++ b/src/js/game/hud/parts/waypoints.js @@ -28,6 +28,8 @@ import { ShapeDefinition } from "../../shape_definition"; */ const SHAPE_LABEL_PLACEHOLDER = " "; +const MAX_LABEL_LENGTH = 71; + export class HUDWaypoints extends BaseHUDPart { /** * Creates the overview of waypoints @@ -220,7 +222,8 @@ export class HUDWaypoints extends BaseHUDPart { id: "markerName", label: null, placeholder: "", - validator: val => val.length > 0 && (val.length < 15 || ShapeDefinition.isValidShortKey(val)), + validator: val => + val.length > 0 && (val.length < MAX_LABEL_LENGTH || ShapeDefinition.isValidShortKey(val)), }); const dialog = new DialogWithForm({ app: this.root.app, @@ -270,8 +273,8 @@ export class HUDWaypoints extends BaseHUDPart { return 1; } return this.getWaypointLabel(a) - .padEnd(20, "0") - .localeCompare(this.getWaypointLabel(b).padEnd(20, "0")); + .padEnd(MAX_LABEL_LENGTH, "0") + .localeCompare(this.getWaypointLabel(b).padEnd(MAX_LABEL_LENGTH, "0")); }); // Show notification about creation