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AAIsH,YAC1BrK,KAAK+C,IAAIsH,YAAcH,EAAiBI,QACxCtK,KAAK+C,IAAIwH,UAAUJ,EAAYJ,EAAIhG,EAAGgG,EAAIjG,EAAGtB,EAAKuB,EAAGvB,EAAKsB,GAC1D9D,KAAK+C,IAAIsH,YAAcD,CACxB,CACA,MAAMI,GAAqB,QAAYvI,EAAciG,GACrD,GAA2B,OAAvBsC,EAA6B,CAChC,MAAMtI,EAAWsI,EAAmBtI,SAC9BC,EAAYqI,EAAmBrI,UAC/BsI,EAAezK,KAAK+C,IAAI2H,gBAC9B,QAAe1K,KAAK+C,IAAKZ,GACzBD,EAASyI,KAAK3K,KAAK+C,IAAK,EAAG,EAAGb,EAASM,KAAKuB,EAAG7B,EAASM,KAAKsB,GAC7D9D,KAAK+C,IAAI6H,aAAaH,EACvB,CACA,MAAMI,GAAwB,QAAY,KAAiB3C,GAC3D,GAA8B,OAA1B2C,EAAgC,CACnC,MAAMJ,EAAezK,KAAK+C,IAAI2H,gBAC9B,QAAe1K,KAAK+C,IAAK8H,EAAsB1I,WAC/CnC,KAAK6H,eAAegD,EAAsBjF,KAAM,MAChD5F,KAAK+C,IAAI6H,aAAaH,EACvB,IAEF,CAEA,OAAAK,GACC9K,KAAK4E,UAAY,CAAC,IAAI,IAAkB,IAAK,IAAI,IAAkB,IACpE,CAEA,UAAAuC,GACC,GAAInH,KAAK2E,UACR,OAAO,IAAI,KAAK,EAAG,EAAG3E,KAAKmE,OAAOR,MAAO3D,KAAKmE,OAAOM,QAC/C,CACN,MAAMkD,EAAO3H,KAAKmE,OAAO4G,wBACzB,OAAO,IAAI,KAAKpD,EAAK5D,EAAG4D,EAAK7D,EAAG6D,EAAKhE,MAAOgE,EAAKlD,OAClD,CACD,E","sources":["webpack://ch.enlightware.gamecreator/./src/blocks/actions/variable/change-variable-block.ts","webpack://ch.enlightware.gamecreator/./src/imgui/canvas-renderer.ts"],"sourcesContent":["/**\n * action: set or, increment or decrement variable\n * @module block-change-variable\n * @preferred\n */\n/** comment to work-around limitation of typedoc module plugin */\n\n// Copyright 2018-2024 Enlightware GmbH, Switzerland\n\nimport { CandliBlock } from 'game/game-block-definition';\nimport * as flatbuffers from 'flatbuffers';\nimport * as CandliFB from 'flatbuffers/all';\nimport { assertFalse, assertInteger, assertIntegerRange } from 'utils/assert';\nimport { BlockKind, ValuePortPresence } from 'vpl/block';\nimport { validateAddress, variableAddress, variableIndex, variableScope, VariableScope, variableScopeAndIndex } from 'runtime/variable';\nimport { varIndexToText, varLongNameAcc, varShortName } from 'blocks/common/variable/variable-block';\n\nexport import ChangeVariableOperation = CandliFB.ChangeVariableOperation;\nimport { qsT, qsTr } from 'translator/translator';\nimport { EditedObjectContext } from 'level/behaviour-editor-interface';\nimport { CoreGame } from 'game/game-core';\n\nexport const ModifyVariableText = qsT('Modify variable');\n\nexport class ChangeVariableBlock extends CandliBlock {\n\tpublic address: number;\n\tpublic value: number;\n\tpublic operation: ChangeVariableOperation;\n\n\tconstructor(address: number, value: number, operation?: ChangeVariableOperation, lockState?: CandliBlock);\n\tconstructor(fbVariable: CandliFB.ChangeVariable, fromVersion: number);\n\tconstructor(\n\t\taddressOrFbVariable: number | CandliFB.ChangeVariable,\n\t\tvalueOrFromVersion: number,\n\t\toperation: ChangeVariableOperation = ChangeVariableOperation.ADD,\n\t\tlockState?: CandliBlock\n\t) {\n\t\tsuper('ChangeVariable', lockState);\n\t\tif (addressOrFbVariable instanceof CandliFB.ChangeVariable) {\n\t\t\tthis.address = addressOrFbVariable.address();\n\t\t\tthis.value = addressOrFbVariable.value();\n\t\t\tthis.operation = addressOrFbVariable.operation();\n\t\t\tif (valueOrFromVersion < 3) { // see version history in game-core.ts\n\t\t\t\tconst scope = variableScope(this.address);\n\t\t\t\tlet index = variableIndex(this.address);\n\t\t\t\tif (scope !== VariableScope.Game) {\n\t\t\t\t\t// We have to fix index, because old format did not reserve index 0\n\t\t\t\t\t// for score when not in game scope.\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t\tthis.address = variableAddress(scope, index);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.address = addressOrFbVariable;\n\t\t\tthis.value = valueOrFromVersion;\n\t\t\tthis.operation = operation;\n\t\t}\n\t\tthis.validate();\n\t}\n\n\tclone(): ChangeVariableBlock {\n\t\treturn new ChangeVariableBlock(this.address, this.value, this.operation, this);\n\t}\n\n\tget name() {\n\t\treturn ModifyVariableText;\n\t}\n\n\tget inputValuePortPresence() {\n\t\treturn ValuePortPresence.Optional;\n\t}\n\n\tsummaryText(_userContext: EditedObjectContext | null, valueIn: boolean) {\n\t\tif (valueIn) {\n\t\t\treturn this.valueInputOperationToStringShort(varShortName(this.address));\n\t\t} else {\n\t\t\treturn this.operationToStringShort(varShortName(this.address));\n\t\t}\n\t}\n\n\tdetailedTextIfConfigured(userContext: EditedObjectContext | null, valueIn: boolean) {\n\t\tif (valueIn) {\n\t\t\treturn this.valueInputOperationToStringLong(userContext?.game);\n\t\t} else {\n\t\t\treturn this.operationToStringLong(varLongNameAcc(this.address, userContext?.game));\n\t\t}\n\t}\n\n\tprivate operationToStringShort(label: string) {\n\t\tswitch (this.operation) {\n\t\t\tcase ChangeVariableOperation.SET:\n\t\t\t\treturn `${this.value} -> ${label}`;\n\t\t\tcase ChangeVariableOperation.ADD:\n\t\t\t\tif (this.value >= 0) {\n\t\t\t\t\treturn `${label} += ${this.value}`;\n\t\t\t\t} else {\n\t\t\t\t\treturn `${label} -= ${-this.value}`;\n\t\t\t\t}\n\t\t}\n\t}\n\n\tprivate valueInputOperationToStringShort(label: string) {\n\t\tswitch (this.operation) {\n\t\t\tcase ChangeVariableOperation.SET:\n\t\t\t\treturn `-> ${label}`;\n\t\t\tcase ChangeVariableOperation.ADD:\n\t\t\t\treturn `+ ${label}`;\n\t\t}\n\t}\n\n\tprivate operationToStringLong(label: string) {\n\t\tswitch (this.operation) {\n\t\t\tcase ChangeVariableOperation.SET: {\n\t\t\t\treturn qsTr('set %1 to %2').args(label, this.value);\n\t\t\t}\n\t\t\tcase ChangeVariableOperation.ADD: {\n\t\t\t\tif (this.value >= 0) {\n\t\t\t\t\treturn qsTr('increase %1 by %2').args(label, this.value);\n\t\t\t\t} else {\n\t\t\t\t\treturn qsTr('decrease %1 by %2').args(label, -this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate valueInputOperationToStringLong(game?: CoreGame) {\n\t\tconst [scope, index] = variableScopeAndIndex(this.address);\n\t\tswitch (this.operation) {\n\t\t\tcase ChangeVariableOperation.SET: {\n\t\t\t\tif (scope === VariableScope.Game && index === 0) {\n\t\t\t\t\treturn qsT('put the result into the score');\n\t\t\t\t}\n\t\t\t\tconst namePart = varIndexToText(index, game);\n\t\t\t\tswitch (scope) {\n\t\t\t\t\tcase VariableScope.Game: return qsTr('put the result into the game variable %1').args(namePart);\n\t\t\t\t\tcase VariableScope.ObjectType: return qsTr('put the result into the object type variable %1').args(namePart);\n\t\t\t\t\tcase VariableScope.ObjectInstance: return qsTr('put the result into the object variable %1').args(namePart);\n\t\t\t\t\tdefault: assertFalse(`Invalid scope: ${scope}`);\n\t\t\t\t};\n\t\t\t\tbreak; // unreachable break to make linter no-fallthrough happy\n\t\t\t}\n\t\t\tcase ChangeVariableOperation.ADD: {\n\t\t\t\tif (scope === VariableScope.Game && index === 0) {\n\t\t\t\t\treturn qsT('add the result to the score');\n\t\t\t\t}\n\t\t\t\tconst namePart = varIndexToText(index, game);\n\t\t\t\tswitch (scope) {\n\t\t\t\t\tcase VariableScope.Game: return qsTr('add the result to the game variable %1').args(namePart);\n\t\t\t\t\tcase VariableScope.ObjectType: return qsTr('add the result to the object type variable %1').args(namePart);\n\t\t\t\t\tcase VariableScope.ObjectInstance: return qsTr('add the result to the object variable %1').args(namePart);\n\t\t\t\t\tdefault: assertFalse(`Invalid scope: ${scope}`);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tserialise(builder: flatbuffers.Builder) {\n\t\treturn CandliFB.ChangeVariable.createChangeVariable(builder,\n\t\t\tthis.address,\n\t\t\tthis.value,\n\t\t\tthis.operation\n\t\t);\n\t}\n\n\tget fbActionType() {\n\t\treturn CandliFB.AnyAction.ChangeVariable;\n\t}\n\n\tget kind() {\n\t\treturn BlockKind.InstantaneousAction;\n\t}\n\n\tneedsConfiguration() {\n\t\treturn this.operation === ChangeVariableOperation.ADD && this.value === 0;\n\t}\n\n\tneedsConfigurationFix() {\n\t\treturn qsT('choose a value different from 0');\n\t}\n\n\tvalidate() {\n\t\tsuper.validate();\n\t\tvalidateAddress(this.address);\n\t\tassertInteger(this.value, 'value');\n\t\tassertIntegerRange(this.operation, 0, 1, 'operation');\n\t}\n\n\tgetMiniatureKey(_userContext: unknown, valueIn: boolean) {\n\t\treturn `changeVar ${valueIn ? 'value ' : ''}${this.address} ${this.value} ${this.operation}`;\n\t}\n\n\tactionEffects() {\n\t\tconst [scope, index] = variableScopeAndIndex(this.address);\n\t\tif (scope === VariableScope.Game && index === 0) {\n\t\t\t// we touch the score, so report effects\n\t\t\tif (this.operation === ChangeVariableOperation.SET) {\n\t\t\t\treturn {\n\t\t\t\t\toverrides: ['SCORE'] as const\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tmodifies: ['SCORE'] as const\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {};\n\t}\n}\n","/**\n * @module imgui\n */\n\n// Copyright 2018-2024 Enlightware GmbH, Switzerland\n\nimport { SimilarityTransform, Vector2 } from 'math/linalg';\nimport { Drawable, applyTransform } from 'utils/render';\nimport { imageDataToCanvas } from 'utils/conversion';\nimport { downcast, dynamicCast } from 'utils/types';\nimport { DrawLineList, DrawLineStrip, DrawSprite, DrawText, FillCircle, FillConvexPolygon, FillRect, StrokeCircle, StrokeRect, TransformedList } from './display-actions';\nimport { DisplayAction, SealedDisplayList } from './display-list';\nimport { Font, RenderContext, Sprite, TextSize } from './render-context';\nimport { AnyCanvas, AnyCanvasRenderingContext2D, DebugOptions } from './imgui-types';\nimport { Rect } from 'math/geometry';\nimport { genIndex } from 'utils/array-types';\nimport { assert } from 'utils/assert';\n\nexport class DrawDrawable extends DisplayAction {\n\treadonly extent: Rect;\n\n\tconstructor(public drawable: Drawable, public transform: SimilarityTransform) {\n\t\tsuper();\n\t\tconst drawableRect = Rect.fromTopLeftAndSize(Vector2.zeros(), drawable.size);\n\t\tthis.extent = drawableRect.transformAsAABB(this.transform);\n\t}\n\n\tisEqual(other: DisplayAction): boolean {\n\t\tconst that = dynamicCast(DrawDrawable, other);\n\t\tif (that === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.transform.isEqual(that.transform) &&\n\t\t\tthis.drawable === that.drawable;\n\t}\n\n\ttoString() {\n\t\treturn `DrawDrawable ${this.transform.toString()} ${this.drawable.size.toString()}`;\n\t}\n}\n\nexport class CanvasFont extends Font {\n\tprivate cache: Map = new Map();\n\n\tconstructor(private ctx: AnyCanvasRenderingContext2D, readonly name: string) { super(); }\n\n\tsize(text: string): TextSize {\n\t\tconst cached = this.cache.get(text);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\t\tthis.ctx.font = this.name;\n\t\tconst metrics = this.ctx.measureText(text);\n\t\tlet baseline = metrics.actualBoundingBoxAscent;\n\t\tconst size = new Vector2(metrics.width, baseline + metrics.actualBoundingBoxDescent);\n\t\t// MacOS Safari is buggy with Material icon font, manually patching the height\n\t\tif (this.name.includes('Material Icons')) {\n\t\t\tsize.y = size.x;\n\t\t\tbaseline = size.x;\n\t\t}\n\t\tconst textSize = { size, baseline };\n\t\tthis.cache.set(text, textSize)\n\t\treturn textSize;\n\t}\n}\n\nexport class CanvasSprite extends Sprite {\n\tprivate dprUponCreation: number;\n\tconstructor(readonly canvas: AnyCanvas, readonly hiDPI: boolean) {\n\t\tsuper();\n\t\tthis.dprUponCreation = hiDPI ? (window.devicePixelRatio || 1) : 1;}\n\n\tget size() {\n\t\tconst dpr = this.dprUponCreation;\n\t\treturn new Vector2(this.canvas.width / dpr, this.canvas.height / dpr);\n\t}\n}\n\nexport class CanvasRenderContext extends RenderContext {\n\tprivate lastLists: [SealedDisplayList, SealedDisplayList] = [new SealedDisplayList([]), new SealedDisplayList([])];\n\n\tconstructor(public canvas: HTMLCanvasElement, private ctx: AnyCanvasRenderingContext2D, private offscreen: boolean) {\n\t\tsuper();\n\t}\n\n\tloadFont(family: string, size: number, style = 'normal', weight = 'normal') {\n\t\tconst name = `${style} normal ${weight} ${size}px ${family}`;\n\t\treturn new CanvasFont(this.ctx, name);\n\t}\n\n\taddSprite(sprite: AnyCanvas | ImageData, hiDPI: boolean) {\n\t\tif (sprite instanceof HTMLCanvasElement || sprite instanceof OffscreenCanvas) {\n\t\t\treturn new CanvasSprite(sprite, hiDPI);\n\t\t} else {\n\t\t\treturn new CanvasSprite(imageDataToCanvas(sprite), hiDPI);\n\t\t}\n\t}\n\n\treleaseSprite(sprite: Sprite) {}\n\n\trender(lists: [SealedDisplayList, SealedDisplayList], scale: number) {\n\t\tlet dirtyRect: Rect | null = null;\n\t\t// iterate over main and overlay\n\t\tfor (const i of genIndex(lists.length)) {\n\t\t\tconst list = lists[i];\n\t\t\tconst lastList = this.lastLists[i];\n\t\t\t// Compare list and last list to decide what to draw based on changes\n\t\t\t// This is a naive diff, a more elaborate one would lead to less redraw\n\t\t\tconst newActions = list.getActions();\n\t\t\tconst newLength = newActions.length;\n\t\t\tconst oldActions = lastList.getActions();\n\t\t\tconst oldLength = oldActions.length;\n\t\t\tconst minLength = Math.min(newLength, oldLength);\n\t\t\t// find first diff\n\t\t\tlet firstDiff = minLength;\n\t\t\tfor (let i = 0; i < minLength; ++i) {\n\t\t\t\tif (!newActions[i]!.isEqual(oldActions[i]!)) {\n\t\t\t\t\tfirstDiff = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// find last diff\n\t\t\tlet lastDiff = minLength;\n\t\t\tfor (let i = 0; i < minLength; ++i) {\n\t\t\t\tconst newIndex = newLength - 1 - i;\n\t\t\t\tconst oldIndex = oldLength - 1 - i;\n\t\t\t\tif (!newActions[newIndex]!.isEqual(oldActions[oldIndex]!)) {\n\t\t\t\t\tlastDiff = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (i + firstDiff >= minLength) {\n\t\t\t\t\tlastDiff = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// compute the range of different actions for both\n\t\t\tconst lastNewIndex = newLength - lastDiff;\n\t\t\tconst newDirty = firstDiff < lastNewIndex ? list.getExtentForRange(firstDiff, lastNewIndex) : null;\n\t\t\tconst lastOldIndex = oldLength - lastDiff;\n\t\t\tconst oldDirty = firstDiff < lastOldIndex ? lastList.getExtentForRange(firstDiff, lastOldIndex) : null;\n\t\t\t// the union of these range is the dirty rect\n\t\t\tlet thisDirtyRect: Rect;\n\t\t\tif (newDirty !== null) {\n\t\t\t\tif (oldDirty !== null) {\n\t\t\t\t\tthisDirtyRect = newDirty.union(oldDirty);\n\t\t\t\t} else {\n\t\t\t\t\tthisDirtyRect = newDirty;\n\t\t\t\t}\n\t\t\t} else if (oldDirty !== null) {\n\t\t\t\tthisDirtyRect = oldDirty;\n\t\t\t} else {\n\t\t\t\t// no change, return\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// merge dirty rects\n\t\t\tdirtyRect = dirtyRect === null ? thisDirtyRect : dirtyRect.union(thisDirtyRect);\n\t\t\t// if debug mode, show diff\n\t\t\tif (DebugOptions.showPaints) {\n\t\t\t\tconst name = i === 0 ? 'main' : 'overlay';\n\t\t\t\tconsole.debug(\n\t\t\t\t\t`Diff ${name}: old [${firstDiff},${lastOldIndex}[ out of ${oldActions.length}, new [${firstDiff},${lastNewIndex}[ out of ${newActions.length}\\n` +\n\t\t\t\t\t`First diff:\\n ${oldDirty ? oldActions[firstDiff]!.toString() : null}\\n=>\\n ${newDirty ? newActions[firstDiff]!.toString() : null}\\n` +\n\t\t\t\t\t`Last diff:\\n ${oldDirty ? oldActions[lastOldIndex - 1]!.toString() : null}\\n=>\\n ${newDirty ? newActions[lastNewIndex - 1]!.toString() : null}`\n\t\t\t\t);\n\t\t\t}\n\t\t\t// replace list for next time\n\t\t\tthis.lastLists[i] = list;\n\t\t}\n\t\t// if nothing to redraw, return\n\t\tif (dirtyRect === null) {\n\t\t\treturn;\n\t\t}\n\t\t// setup clipping, before scale to avoid sub-pixel artefacts\n\t\tconst clientRect = this.clientRect();\n\t\tconst widgetRect = new Rect(0, 0, clientRect.width / scale, clientRect.height / scale);\n\t\tlet renderRect = dirtyRect.intersection(widgetRect);\n\t\tif (renderRect === null) {\n\t\t\treturn;\n\t\t}\n\t\tthis.ctx.save();\n\t\tif (!DebugOptions.showPaints) {\n\t\t\tconst clipRect = renderRect.scale(scale).boundingIntegerCoordRect();\n\t\t\tthis.ctx.beginPath();\n\t\t\tthis.ctx.rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);\n\t\t\tthis.ctx.clip();\n\t\t}\n\t\trenderRect = renderRect.boundingIntegerCoordRect();\n\t\t// draw, first setup scale\n\t\tthis.ctx.scale(scale, scale);\n\t\t// do the rendering, main and overlay\n\t\t// console.log('list:\\n' + list.toString());\n\t\tthis.renderInternal(lists[0], DebugOptions.showPaints ? null : renderRect);\n\t\tthis.renderInternal(lists[1], DebugOptions.showPaints ? null : renderRect);\n\t\t// show what has been redrawn if in debug\n\t\tif (DebugOptions.showPaints) {\n\t\t\tthis.ctx.fillStyle = 'rgba(255,0,0,0.2)';\n\t\t\tthis.ctx.fillRect(renderRect.x, renderRect.y, renderRect.width, renderRect.height);\n\t\t}\n\t\t// restore\n\t\tthis.ctx.restore();\n\t}\n\n\tprivate renderInternal(list: SealedDisplayList, clip: Rect | null) {\n\t\tlist.forEach((action) => {\n\t\t\tif (clip !== null && !action.extent.intersectsRect(clip)) {\n\t\t\t\t// console.log('skipped', action.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fillRectAction = dynamicCast(FillRect, action);\n\t\t\tif (fillRectAction !== null) {\n\t\t\t\tthis.ctx.fillStyle = fillRectAction.color.rgbaHexString;\n\t\t\t\tconst rect = fillRectAction.rect;\n\t\t\t\tthis.ctx.fillRect(rect.x, rect.y, rect.width, rect.height);\n\t\t\t}\n\t\t\tconst strokeRectAction = dynamicCast(StrokeRect, action);\n\t\t\tif (strokeRectAction !== null) {\n\t\t\t\tthis.ctx.strokeStyle = strokeRectAction.color.rgbaHexString;\n\t\t\t\tthis.ctx.lineWidth = strokeRectAction.lineWidth;\n\t\t\t\tconst rect = strokeRectAction.rect;\n\t\t\t\tif (strokeRectAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([5, 15]);\n\t\t\t\t}\n\t\t\t\tthis.ctx.strokeRect(rect.x, rect.y, rect.width, rect.height);\n\t\t\t\tif (strokeRectAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst fillCircleAction = dynamicCast(FillCircle, action);\n\t\t\tif (fillCircleAction !== null) {\n\t\t\t\tthis.ctx.fillStyle = fillCircleAction.color.rgbaHexString;\n\t\t\t\tconst center = fillCircleAction.center;\n\t\t\t\tconst r = fillCircleAction.radius;\n\t\t\t\tthis.ctx.beginPath();\n\t\t\t\tthis.ctx.ellipse(center.x, center.y, r, r, 0, 0, 2 * Math.PI);\n\t\t\t\tthis.ctx.fill();\n\t\t\t}\n\t\t\tconst strokeCircleAction = dynamicCast(StrokeCircle, action);\n\t\t\tif (strokeCircleAction !== null) {\n\t\t\t\tthis.ctx.strokeStyle = strokeCircleAction.color.rgbaHexString;\n\t\t\t\tthis.ctx.lineWidth = strokeCircleAction.lineWidth;\n\t\t\t\tconst center = strokeCircleAction.center;\n\t\t\t\tconst r = strokeCircleAction.radius;\n\t\t\t\tif (strokeCircleAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([5, 15]);\n\t\t\t\t}\n\t\t\t\tthis.ctx.beginPath();\n\t\t\t\tthis.ctx.ellipse(center.x, center.y, r, r, 0, 0, 2 * Math.PI);\n\t\t\t\tthis.ctx.stroke();\n\t\t\t\tif (strokeCircleAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst drawLineListAction = dynamicCast(DrawLineList, action);\n\t\t\tif (drawLineListAction !== null) {\n\t\t\t\tthis.ctx.strokeStyle = drawLineListAction.color.rgbaHexString;\n\t\t\t\tthis.ctx.lineWidth = drawLineListAction.width;\n\t\t\t\tif (drawLineListAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([5, 15]);\n\t\t\t\t}\n\t\t\t\tthis.ctx.beginPath();\n\t\t\t\tconst points = drawLineListAction.points;\n\t\t\t\tassert(points.length % 4 === 0);\n\t\t\t\tfor (let i = 0; i < points.length; i += 4) {\n\t\t\t\t\tthis.ctx.moveTo(points[i]!, points[i + 1]!);\n\t\t\t\t\tthis.ctx.lineTo(points[i + 2]!, points[i + 3]!);\n\t\t\t\t}\n\t\t\t\tthis.ctx.stroke();\n\t\t\t\tif (drawLineListAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst drawLineStripAction = dynamicCast(DrawLineStrip, action);\n\t\t\tif (drawLineStripAction !== null) {\n\t\t\t\tthis.ctx.strokeStyle = drawLineStripAction.color.rgbaHexString;\n\t\t\t\tthis.ctx.lineWidth = drawLineStripAction.width;\n\t\t\t\tif (drawLineStripAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([5, 15]);\n\t\t\t\t}\n\t\t\t\tthis.ctx.beginPath();\n\t\t\t\tconst points = drawLineStripAction.points;\n\t\t\t\tconst closedPath = // detect closed path\n\t\t\t\t\tpoints.length > 4 &&\n\t\t\t\t\tpoints[0] === points[points.length - 2] &&\n\t\t\t\t\tpoints[1] === points[points.length - 1]\n\t\t\t\t;\n\t\t\t\tassert(points.length >= 2 && points.length % 2 === 0);\n\t\t\t\tthis.ctx.moveTo(points[0]!, points[1]!);\n\t\t\t\tfor (let i = 2; i < points.length; i += 2) {\n\t\t\t\t\tif (closedPath && i + 2 === points.length) {\n\t\t\t\t\t\tthis.ctx.closePath();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.ctx.lineTo(points[i]!, points[i + 1]!);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.ctx.stroke();\n\t\t\t\tif (drawLineStripAction.dashed) {\n\t\t\t\t\tthis.ctx.setLineDash([]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst fillConvexPolygon = dynamicCast(FillConvexPolygon, action);\n\t\t\tif (fillConvexPolygon !== null) {\n\t\t\t\tthis.ctx.fillStyle = fillConvexPolygon.color.rgbaHexString;\n\t\t\t\tthis.ctx.beginPath();\n\t\t\t\tconst points = fillConvexPolygon.points;\n\t\t\t\tassert(points.length >= 2 && points.length % 2 === 0);\n\t\t\t\tthis.ctx.moveTo(points[0]!, points[1]!);\n\t\t\t\tfor (let i = 2; i < points.length; i += 2) {\n\t\t\t\t\tthis.ctx.lineTo(points[i]!, points[i + 1]!);\n\t\t\t\t}\n\t\t\t\tthis.ctx.closePath();\n\t\t\t\tthis.ctx.fill();\n\t\t\t}\n\t\t\tconst drawTextAction = dynamicCast(DrawText, action);\n\t\t\tif (drawTextAction !== null) {\n\t\t\t\tthis.ctx.font = downcast(CanvasFont, drawTextAction.font).name;\n\t\t\t\tconst pos = drawTextAction.position;\n\t\t\t\tthis.ctx.fillStyle = drawTextAction.color.rgbaHexString;\n\t\t\t\tthis.ctx.fillText(drawTextAction.text, pos.x, pos.y);\n\t\t\t}\n\t\t\tconst drawSpriteAction = dynamicCast(DrawSprite, action);\n\t\t\tif (drawSpriteAction !== null) {\n\t\t\t\tconst sprite = downcast(CanvasSprite, drawSpriteAction.sprite);\n\t\t\t\tconst thatCanvas = sprite.canvas;\n\t\t\t\tconst pos = drawSpriteAction.position;\n\t\t\t\tconst size = sprite.size;\n\t\t\t\tconst oldAlpha = this.ctx.globalAlpha;\n\t\t\t\tthis.ctx.globalAlpha = drawSpriteAction.opacity;\n\t\t\t\tthis.ctx.drawImage(thatCanvas, pos.x, pos.y, size.x, size.y);\n\t\t\t\tthis.ctx.globalAlpha = oldAlpha;\n\t\t\t}\n\t\t\tconst drawDrawableAction = dynamicCast(DrawDrawable, action);\n\t\t\tif (drawDrawableAction !== null) {\n\t\t\t\tconst drawable = drawDrawableAction.drawable;\n\t\t\t\tconst transform = drawDrawableAction.transform;\n\t\t\t\tconst ctxTransform = this.ctx.getTransform();\n\t\t\t\tapplyTransform(this.ctx, transform);\n\t\t\t\tdrawable.draw(this.ctx, 0, 0, drawable.size.x, drawable.size.y);\n\t\t\t\tthis.ctx.setTransform(ctxTransform);\n\t\t\t}\n\t\t\tconst transformedListAction = dynamicCast(TransformedList, action);\n\t\t\tif (transformedListAction !== null) {\n\t\t\t\tconst ctxTransform = this.ctx.getTransform();\n\t\t\t\tapplyTransform(this.ctx, transformedListAction.transform);\n\t\t\t\tthis.renderInternal(transformedListAction.list, null);\n\t\t\t\tthis.ctx.setTransform(ctxTransform);\n\t\t\t}\n\t\t});\n\t}\n\n\tpresent() {\n\t\tthis.lastLists = [new SealedDisplayList([]), new SealedDisplayList([])];\n\t}\n\n\tclientRect() {\n\t\tif (this.offscreen) {\n\t\t\treturn new Rect(0, 0, this.canvas.width, this.canvas.height);\n\t\t} else {\n\t\t\tconst rect = this.canvas.getBoundingClientRect()\n\t\t\treturn new Rect(rect.x, rect.y, rect.width, rect.height);\n\t\t}\n\t}\n}"],"names":["ChangeVariableOperation","ModifyVariableText","ChangeVariableBlock","address","value","operation","constructor","addressOrFbVariable","valueOrFromVersion","ADD","lockState","super","this","scope","index","validate","clone","name","inputValuePortPresence","summaryText","_userContext","valueIn","valueInputOperationToStringShort","operationToStringShort","detailedTextIfConfigured","userContext","valueInputOperationToStringLong","game","operationToStringLong","label","SET","args","namePart","serialise","builder","createChangeVariable","fbActionType","ChangeVariable","kind","needsConfiguration","needsConfigurationFix","getMiniatureKey","actionEffects","overrides","modifies","DrawDrawable","drawable","transform","extent","drawableRect","fromTopLeftAndSize","zeros","size","transformAsAABB","isEqual","other","that","toString","CanvasFont","ctx","cache","Map","text","cached","get","undefined","font","metrics","measureText","baseline","actualBoundingBoxAscent","width","actualBoundingBoxDescent","includes","y","x","textSize","set","CanvasSprite","canvas","hiDPI","dprUponCreation","window","devicePixelRatio","dpr","height","CanvasRenderContext","offscreen","lastLists","loadFont","family","style","weight","addSprite","sprite","HTMLCanvasElement","OffscreenCanvas","releaseSprite","render","lists","scale","dirtyRect","i","length","list","lastList","newActions","getActions","newLength","oldActions","oldLength","minLength","Math","min","firstDiff","lastDiff","oldIndex","lastNewIndex","newDirty","getExtentForRange","lastOldIndex","oldDirty","thisDirtyRect","union","showPaints","console","debug","clientRect","widgetRect","renderRect","intersection","save","clipRect","boundingIntegerCoordRect","beginPath","rect","clip","renderInternal","fillStyle","fillRect","restore","forEach","action","intersectsRect","fillRectAction","color","rgbaHexString","strokeRectAction","strokeStyle","lineWidth","dashed","setLineDash","strokeRect","fillCircleAction","center","r","radius","ellipse","PI","fill","strokeCircleAction","stroke","drawLineListAction","points","moveTo","lineTo","drawLineStripAction","closedPath","closePath","fillConvexPolygon","drawTextAction","pos","position","fillText","drawSpriteAction","thatCanvas","oldAlpha","globalAlpha","opacity","drawImage","drawDrawableAction","ctxTransform","getTransform","draw","setTransform","transformedListAction","present","getBoundingClientRect"],"sourceRoot":""}