Skip to content

Commit

Permalink
#192 - no-advance plays output adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
AloisSeckar committed Jan 16, 2024
1 parent d6281a7 commit 41e04ce
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 12 deletions.
Binary file modified backstop_data/bitmaps_reference/action-1b-9-94e3-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-cs-26e5t-r2-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-cs-2e1-r3-na-r1-o_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-cs-2e4-r1-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-error-23e4-r1-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-error-25e1t-r3-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-error-poa-r1-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-error-poa-r2-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-error-poa-r3-na_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backstop_data/bitmaps_reference/action-pocsen-r3_m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions utils/wbsc-eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,11 @@ function processInput (input: WBSCInput, batter: number): WBSCOutput {
output.base = input.origBase + 1
}
possibleConcurrentPlay = true
// do not wrap "short" no-advance plays
if (output.na && output.text1.length < 3 && output.text2.length < 4) {
output.text1 += output.text2
output.text2 = undefined
}
break
case 'POEN':
case 'POCSEN':
Expand Down
24 changes: 12 additions & 12 deletions utils/wbsc-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function writeSituation (output: WBSCOutput) {
const sub = output.sub
const na = output.na

let text1 = output.text1
const text1 = output.text1
const text2 = output.text2

const ctx = useCanvasStore().ctx
Expand Down Expand Up @@ -356,13 +356,13 @@ function writeSituation (output: WBSCOutput) {
break
case 1:
if (na) {
if (text2) {
text1 += text2
}
ctx.font = FONT_EXTRA_TINY
locHOffset = (text1.length - 3) * 6
ctx.fillStyle = '#303030'
ctx.fillText(text1, w2 * 1.5 + 25 - locHOffset + hOffset, h2 + 24 + vOffset)
ctx.fillText(text1, w2 * 1.5 + 25 - locHOffset + hOffset, h2 + 23 + vOffset)
if (text2) {
ctx.fillText(text2, w2 * 1.5 + 25 - locHOffset + hOffset, h2 + 44 + vOffset)
}
} else {
if (hit) {
drawHitSymbol(1)
Expand Down Expand Up @@ -431,12 +431,12 @@ function writeSituation (output: WBSCOutput) {
break
case 2:
if (na) {
if (text2) {
text1 += text2
}
ctx.font = FONT_EXTRA_TINY
ctx.fillStyle = '#303030'
ctx.fillText(text1, w2 + hOffset, offset + 10 + vOffset)
if (text2) {
ctx.fillText(text2, w2 + hOffset, offset + 32 + vOffset)
}
} else {
if (hit) {
drawHitSymbol(2)
Expand Down Expand Up @@ -541,13 +541,13 @@ function writeSituation (output: WBSCOutput) {
break
case 3:
if (na) {
if (text2) {
text1 += text2
}
ctx.font = FONT_EXTRA_TINY
locHOffset = (text1.length - 3) * 6
ctx.fillStyle = '#303030'
ctx.fillText(text1, w2 * 0.5 - 25 + locHOffset + hOffset, h2 - 8 + vOffset)
ctx.fillText(text1, w2 * 0.5 - 25 + locHOffset + hOffset, h2 - 5 + vOffset)
if (text2) {
ctx.fillText(text2, w2 * 0.5 - 25 + locHOffset + hOffset, h2 + 20 + vOffset)
}
} else {
if (hit) {
drawHitSymbol(3)
Expand Down

0 comments on commit 41e04ce

Please # to comment.