diff --git a/Models/Constants.ts b/Models/Constants.ts index 599384c..1ede26d 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.6.9"; + public static vNumber = "0.6.9a"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/UI/Input/DirectionInput.ts b/UI/Input/DirectionInput.ts index 83b18a1..008d75b 100644 --- a/UI/Input/DirectionInput.ts +++ b/UI/Input/DirectionInput.ts @@ -23,7 +23,7 @@ export default class DirectionInput extends InputElement { return; } const cone = selfElement.getElementsByClassName("direction-svg")[0] as HTMLElement - cone.style.rotate = rotation + "deg"; + cone.style.transform = `rotate(${rotation}deg)`; }) @@ -38,7 +38,7 @@ export default class DirectionInput extends InputElement { return new Combine([ `
`, Svg.direction_svg().SetStyle( - `position: absolute;top: 0;left: 0;width: 100%;height: 100%;rotate:${this.value.data}deg;`) + `position: absolute;top: 0;left: 0;width: 100%;height: 100%;transform:rotate(${this.value.data ?? 0}deg);`) .SetClass("direction-svg"), Svg.compass_svg().SetStyle( "position: absolute;top: 0;left: 0;width: 100%;height: 100%;") @@ -74,7 +74,7 @@ export default class DirectionInput extends InputElement { htmlElement.onmousedown = (ev: MouseEvent) => { isDown = true; - onPosChange(ev.x, ev.y); + onPosChange(ev.clientX, ev.clientY); ev.preventDefault(); } @@ -84,7 +84,7 @@ export default class DirectionInput extends InputElement { htmlElement.onmousemove = (ev: MouseEvent) => { if (isDown) { - onPosChange(ev.x, ev.y); + onPosChange(ev.clientX, ev.clientY); } ev.preventDefault(); } } diff --git a/index.ts b/index.ts index b85cf1d..c83772f 100644 --- a/index.ts +++ b/index.ts @@ -84,13 +84,17 @@ if (layoutFromBase64.startsWith("http")) { success: (data) => { try { - const parsed = JSON.parse(data); + console.log("Received ", data) + let parsed = data; + if(typeof parsed == "string"){ + parsed = JSON.parse(data); + } // Overwrite the id to the wiki:value parsed.id = link; const layout = new LayoutConfig(parsed, false).patchImages(link, data); InitUiElements.InitAll(layout, layoutFromBase64, testing, layoutFromBase64, btoa(data)); } catch (e) { - new FixedUiElement(`${link} is invalid:
${e}
Go back")`) + new FixedUiElement(`${link} is invalid:
${e}
Go back`) .SetClass("clickable") .AttachTo("centermessage"); console.error("Could not parse the text", data) diff --git a/package.json b/package.json index 5d2f6ad..26ac357 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "generate:images": "ts-node scripts/generateIncludedImages.ts", "generate:translations": "ts-node scripts/generateTranslations.ts", "generate:layouts": "ts-node scripts/generateLayouts.ts", - "generate:docs": "ts-node scripts/generateDocs.ts", + "generate:docs": "ts-node scripts/generateDocs.ts && ts-node scripts/generateTaginfoProjectFiles.ts", "generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail", "generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail", "validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report",