Initial target repo setup to move to master (v3.10)
This commit is contained in:
		@@ -1,4 +1,3 @@
 | 
			
		||||
/// <reference path="../../node_modules/pxt-core/typings/globals/bluebird/index.d.ts"/>
 | 
			
		||||
/// <reference path="../../node_modules/pxt-core/built/pxtsim.d.ts"/>
 | 
			
		||||
 | 
			
		||||
namespace pxsim.visuals {
 | 
			
		||||
@@ -40,7 +39,7 @@ namespace pxsim.visuals {
 | 
			
		||||
        svg.fills(result.ledsOuter, defaultLedMatrixTheme.ledOff);
 | 
			
		||||
 | 
			
		||||
        //turn off LEDs
 | 
			
		||||
        result.leds.forEach(l => (<SVGStylable><any>l).style.opacity = 0 + "");
 | 
			
		||||
        result.leds.forEach(l => (<SVGStyleElement><any>l).style.opacity = 0 + "");
 | 
			
		||||
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
@@ -103,7 +102,7 @@ namespace pxsim.visuals {
 | 
			
		||||
        public updateState() {
 | 
			
		||||
            if (this.state.disabled) {
 | 
			
		||||
                this.leds.forEach((led, i) => {
 | 
			
		||||
                    let sel = (<SVGStylable><any>led)
 | 
			
		||||
                    let sel = (<SVGStyleElement><any>led)
 | 
			
		||||
                    sel.style.opacity = 0 + "";
 | 
			
		||||
                });
 | 
			
		||||
                return;
 | 
			
		||||
@@ -112,7 +111,7 @@ namespace pxsim.visuals {
 | 
			
		||||
            const bw = this.state.displayMode == pxsim.DisplayMode.bw
 | 
			
		||||
            const img = this.state.image;
 | 
			
		||||
            this.leds.forEach((led, i) => {
 | 
			
		||||
                let sel = (<SVGStylable><any>led)
 | 
			
		||||
                let sel = (<SVGStyleElement><any>led)
 | 
			
		||||
                let dx = i % this.DRAW_SIZE;
 | 
			
		||||
                let dy = (i - dx) / this.DRAW_SIZE;
 | 
			
		||||
                if (dx < this.ACTIVE_SIZE && dy < this.ACTIVE_SIZE) {
 | 
			
		||||
 
 | 
			
		||||
@@ -381,7 +381,7 @@ namespace pxsim.visuals {
 | 
			
		||||
 | 
			
		||||
            if (state.ledMatrixState.disabled) {
 | 
			
		||||
                this.leds.forEach((led, i) => {
 | 
			
		||||
                    const sel = (<SVGStylable><any>led)
 | 
			
		||||
                    const sel = (<SVGStyleElement><any>led)
 | 
			
		||||
                    sel.style.opacity = "0";
 | 
			
		||||
                })
 | 
			
		||||
            } else {
 | 
			
		||||
@@ -389,7 +389,7 @@ namespace pxsim.visuals {
 | 
			
		||||
                const img = state.ledMatrixState.image;
 | 
			
		||||
                const br = state.ledMatrixState.brigthness != undefined ? state.ledMatrixState.brigthness : 255;
 | 
			
		||||
                this.leds.forEach((led, i) => {
 | 
			
		||||
                    const sel = (<SVGStylable><any>led)
 | 
			
		||||
                    const sel = (<SVGStyleElement><any>led)
 | 
			
		||||
                    let imgbr = bw ? (img.data[i] > 0 ? br : 0) : img.data[i];
 | 
			
		||||
                    // correct brightness
 | 
			
		||||
                    const opacity = imgbr > 0 ? imgbr / 255 * 155 + 100 : 0;
 | 
			
		||||
@@ -420,10 +420,10 @@ namespace pxsim.visuals {
 | 
			
		||||
                this.shakeButton = svg.child(this.g, "circle", { cx: 380, cy: 100, r: 16.5, class: "sim-shake" }) as SVGCircleElement;
 | 
			
		||||
                accessibility.makeFocusable(this.shakeButton);
 | 
			
		||||
                svg.fill(this.shakeButton, this.props.theme.virtualButtonUp)
 | 
			
		||||
                this.shakeButton.addEventListener(pointerEvents.down, ev => {
 | 
			
		||||
                pointerEvents.down.forEach(evid => this.shakeButton.addEventListener(evid, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    svg.fill(this.shakeButton, this.props.theme.buttonDown);
 | 
			
		||||
                })
 | 
			
		||||
                }));
 | 
			
		||||
                this.shakeButton.addEventListener(pointerEvents.leave, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    svg.fill(this.shakeButton, this.props.theme.virtualButtonUp);
 | 
			
		||||
@@ -955,11 +955,11 @@ namespace pxsim.visuals {
 | 
			
		||||
                    });
 | 
			
		||||
            })
 | 
			
		||||
            this.pins.slice(0, 3).forEach((btn, index) => {
 | 
			
		||||
                btn.addEventListener(pointerEvents.down, ev => {
 | 
			
		||||
                pointerEvents.down.forEach(evid => btn.addEventListener(evid, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    state.edgeConnectorState.pins[index].touched = true;
 | 
			
		||||
                    this.updatePin(state.edgeConnectorState.pins[index], index);
 | 
			
		||||
                })
 | 
			
		||||
                }));
 | 
			
		||||
                btn.addEventListener(pointerEvents.leave, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    state.edgeConnectorState.pins[index].touched = false;
 | 
			
		||||
@@ -982,11 +982,11 @@ namespace pxsim.visuals {
 | 
			
		||||
            let bpState = this.board.buttonPairState;
 | 
			
		||||
            let stateButtons = [bpState.aBtn, bpState.bBtn, bpState.abBtn];
 | 
			
		||||
            this.buttonsOuter.slice(0, 2).forEach((btn, index) => {
 | 
			
		||||
                btn.addEventListener(pointerEvents.down, ev => {
 | 
			
		||||
                pointerEvents.down.forEach(evid => btn.addEventListener(evid, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    stateButtons[index].pressed = true;
 | 
			
		||||
                    svg.fill(this.buttons[index], this.props.theme.buttonDown);
 | 
			
		||||
                })
 | 
			
		||||
                }));
 | 
			
		||||
                btn.addEventListener(pointerEvents.leave, ev => {
 | 
			
		||||
                    let state = this.board;
 | 
			
		||||
                    stateButtons[index].pressed = false;
 | 
			
		||||
@@ -1004,7 +1004,7 @@ namespace pxsim.visuals {
 | 
			
		||||
                    this.board.bus.queue(stateButtons[index].id, DAL.MICROBIT_BUTTON_EVT_CLICK);
 | 
			
		||||
                });
 | 
			
		||||
            })
 | 
			
		||||
            this.buttonsOuter[2].addEventListener(pointerEvents.down, ev => {
 | 
			
		||||
            pointerEvents.down.forEach(evid => this.buttonsOuter[2].addEventListener(evid, ev => {
 | 
			
		||||
                let state = this.board;
 | 
			
		||||
                stateButtons[0].pressed = true;
 | 
			
		||||
                stateButtons[1].pressed = true;
 | 
			
		||||
@@ -1012,7 +1012,7 @@ namespace pxsim.visuals {
 | 
			
		||||
                svg.fill(this.buttons[0], this.props.theme.buttonDown);
 | 
			
		||||
                svg.fill(this.buttons[1], this.props.theme.buttonDown);
 | 
			
		||||
                svg.fill(this.buttons[2], this.props.theme.buttonDown);
 | 
			
		||||
            })
 | 
			
		||||
            }));
 | 
			
		||||
            this.buttonsOuter[2].addEventListener(pointerEvents.leave, ev => {
 | 
			
		||||
                let state = this.board;
 | 
			
		||||
                stateButtons[0].pressed = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user