mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Only 14 characters for labels? That's 1/10 of a twit!
This commit is contained in:
parent
d6c1cb15f6
commit
2b6a8e49d1
@ -28,6 +28,8 @@ import { ShapeDefinition } from "../../shape_definition";
|
|||||||
*/
|
*/
|
||||||
const SHAPE_LABEL_PLACEHOLDER = " ";
|
const SHAPE_LABEL_PLACEHOLDER = " ";
|
||||||
|
|
||||||
|
const MAX_LABEL_LENGTH = 71;
|
||||||
|
|
||||||
export class HUDWaypoints extends BaseHUDPart {
|
export class HUDWaypoints extends BaseHUDPart {
|
||||||
/**
|
/**
|
||||||
* Creates the overview of waypoints
|
* Creates the overview of waypoints
|
||||||
@ -220,7 +222,8 @@ export class HUDWaypoints extends BaseHUDPart {
|
|||||||
id: "markerName",
|
id: "markerName",
|
||||||
label: null,
|
label: null,
|
||||||
placeholder: "",
|
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({
|
const dialog = new DialogWithForm({
|
||||||
app: this.root.app,
|
app: this.root.app,
|
||||||
@ -270,8 +273,8 @@ export class HUDWaypoints extends BaseHUDPart {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return this.getWaypointLabel(a)
|
return this.getWaypointLabel(a)
|
||||||
.padEnd(20, "0")
|
.padEnd(MAX_LABEL_LENGTH, "0")
|
||||||
.localeCompare(this.getWaypointLabel(b).padEnd(20, "0"));
|
.localeCompare(this.getWaypointLabel(b).padEnd(MAX_LABEL_LENGTH, "0"));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show notification about creation
|
// Show notification about creation
|
||||||
|
Loading…
Reference in New Issue
Block a user