Map and clean deprecated functions (#175)

* add image and deprecated arrow functions

* update locales

* map basic.showArrow

* map arrow blocks

* map & remove arrow images

* remove arrow blocks

* update locales

* remove & patch:
rgbw -> rgb
button/pin pressed -> button/pin event
loudness -> soundLevel

* update ts mappings for arrows

* add wip ts patch rules

* update .blocks files

* use Click instead of Down as default in Documentation and tests

* patch test.blocks

* fix lowercase name tag

* update test.blocks

* update blocks test files

* update blocks test files

* format block files

* pass blocks file tests

* fix ts mapping

* fix color.defl value

closes https://github.com/microsoft/pxt-calliope/issues/136

* fix ts mappings

- add optional spacing at the end of rgbw()
- map up to v4.0.19

* add suggested changes

* replace innerText by textContent

Co-authored-by: JW <gitkraken@juriwolf.de>
Co-authored-by: Juri <info@juriwolf.de>
This commit is contained in:
Juri Wolf
2022-04-26 19:28:42 +02:00
committed by GitHub
parent 3b9d90e551
commit a93febb5b7
102 changed files with 1458 additions and 740 deletions

View File

@ -7,7 +7,7 @@ let level: number
let swapSpeed: number
initializeGame()
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
if (ballRevealing) {
index = index + 1
if (index > 2) {
@ -16,7 +16,7 @@ input.onButtonPressed(Button.A, () => {
basic.showString(cupSelect[index], 150)
}
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
if (ballRevealing) {
ballRevealing = false
if (correctBall == index) {

View File

@ -18,7 +18,7 @@ counter = 0
pause = 700
led.plot(oneX, oneY)
led.plot(twoX, twoY)
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
if (oneX > 0) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)
@ -28,7 +28,7 @@ input.onButtonPressed(Button.A, () => {
led.plot(twoX, twoY)
}
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
if (twoX < 4) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)

View File

@ -107,12 +107,12 @@ basic.forever(() => {
basic.pause(500)
}
})
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
let temp = Math.abs(person.dirX) * (-1)
person.dirX = Math.abs(person.dirY) * (-1)
person.dirY = temp
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
let temp1 = Math.abs(person.dirX)
person.dirX = Math.abs(person.dirY)
person.dirY = temp1

View File

@ -24,13 +24,13 @@ playOneGame(gameTime)
showFinalScores(scoreA, scoreB)
function startIOMonitor() {
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.onButtonPressed(Button.AB, () => {
input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
ABWasPressed = true
AWasPressed = false
BWasPressed = false

View File

@ -501,13 +501,13 @@ function convertPenaltyTimeToScore(penaltyTime: number): number {
}
function startIOMonitor() {
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.onButtonPressed(Button.AB, () => {
input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
ABWasPressed = true
})
input.onShake(() => {

View File

@ -377,11 +377,11 @@ function beepNTimesFor(times: number, duration: number) {
function startIOMonitor() {
aWasPressed = false
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
aWasPressed = true
})
bWasPressed = false
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
bWasPressed = true
})
wasTweezers = false

View File

@ -476,10 +476,10 @@ function testTiltZ() {
}
function startIOMonitor() {
input.onButtonPressed(Button.A, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.onButtonPressed(Button.B, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.onShake(() => {