MCPcopy Create free account
hub / github.com/JKPotato-Computer/SignMaker / constructor

Method constructor

js/Sign.js:16–101  ·  view source on GitHub ↗

* Cretes a new sign. * @param {Object} [opt] - Optional parameters. * @param {string} [opt.controlText="New Sign"] - Control cities to display on the sign. * @param {string} [opt.shieldPosition] - Where the shields should be displayed relative to the control cities. * @param {boolean} [opt.s

({
			// shield
			shieldPosition,
			shieldBacks = false,
			
			// arrow
			arrowMode = "Standard",
			arrows = [],
			guideArrow,
			guideArrowLanes = 1,
			exitguideArrows = "Down Arrow",
            exitOnlyPadding = 0,
			
			// other
			otherSymbol,
			oSNum = "",
			
			// subpanel
			subPanels = [],
			
			// global settings
			
			// shields
			shields = [],
			shieldDistance = 0.8,
			
			// main info
			controlText = "",
			
			// settings
			globalPositioning = "Top",
			
			// action message
            actionMessage = "",
			advisoryMessage = true,
			advisoryText = "",
			
			// panel
			padding = "0.5rem 0.75rem 0.5rem 0.75rem",
			arrowPosition = "Middle"
		} = {}
	)

Source from the content-addressed store, hash-verified

14 * @param {Shield[]} [opt.shields] - Array of shields to include on sign.
15 */
16 constructor({
17 // shield
18 shieldPosition,
19 shieldBacks = false,
20
21 // arrow
22 arrowMode = "Standard",
23 arrows = [],
24 guideArrow,
25 guideArrowLanes = 1,
26 exitguideArrows = "Down Arrow",
27 exitOnlyPadding = 0,
28
29 // other
30 otherSymbol,
31 oSNum = "",
32
33 // subpanel
34 subPanels = [],
35
36 // global settings
37
38 // shields
39 shields = [],
40 shieldDistance = 0.8,
41
42 // main info
43 controlText = "",
44
45 // settings
46 globalPositioning = "Top",
47
48 // action message
49 actionMessage = "",
50 advisoryMessage = true,
51 advisoryText = "",
52
53 // panel
54 padding = "0.5rem 0.75rem 0.5rem 0.75rem",
55 arrowPosition = "Middle"
56 } = {}
57 ) {
58 if (this.shieldPositions.includes(shieldPosition)) {
59 this.shieldPosition = shieldPosition;
60 } else {
61 this.shieldPosition = "Above";
62 }
63 if (this.otherSymbols.includes(otherSymbol)) {
64 this.otherSymbol = otherSymbol;
65 }
66 else {
67 this.otherSymbol = "None";
68 }
69 this.shieldBacks = shieldBacks;
70 if (this.guideArrows.includes(guideArrow)) {
71 this.guideArrow = guideArrow;
72 } else {
73 this.guideArrow = "None";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected