Skip to content

Commit

Permalink
Merge pull request #543 from bemusic/release-train/proposed
Browse files Browse the repository at this point in the history
Prepare release of Bemuse v44.4.0
  • Loading branch information
dtinth committed Aug 29, 2019
2 parents 8c50a98 + 0d7b6ea commit 50a0708
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 26 deletions.
24 changes: 19 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@
[@thakkaryash94]: https://github.com/thakkaryash94
[@hajimehoshi]: https://github.com/hajimehoshi

## v44.4.0-pre.201908292114

### New stuff

- The TUTORIAL now displays a tooltip that teaches new players how to exit the
game. [#542], by [@dtinth]

### Internals

- Added release dates to CHANGELOG sections. [#541], by [@dtinth]

[#541]: https://github.com/bemusic/bemuse/pull/541
[#542]: https://github.com/bemusic/bemuse/pull/542

## v44.3.0 (2019-08-29)

### Internals

Expand All @@ -23,7 +37,7 @@
[#538]: https://github.com/bemusic/bemuse/pull/538
[#539]: https://github.com/bemusic/bemuse/pull/539

## v44.2.4
## v44.2.4 (2019-08-29)

### Internals

Expand All @@ -33,7 +47,7 @@

[#536]: https://github.com/bemusic/bemuse/pull/536

## v44.1.0
## v44.1.0 (2019-08-29)

### New stuff

Expand All @@ -60,7 +74,7 @@
[#533]: https://github.com/bemusic/bemuse/pull/533
[#534]: https://github.com/bemusic/bemuse/pull/534

## v44
## v44 (2019-08-27)

This release contains no new features, just a lot of codebase modernizations.

Expand Down Expand Up @@ -105,7 +119,7 @@ This release contains no new features, just a lot of codebase modernizations.
[#525]: https://github.com/bemusic/bemuse/pull/525
[#524]: https://github.com/bemusic/bemuse/pull/524

## v43
## v43 (2018-11-11)

This release contains multiple contributions from the community! Many thanks to
everyone who helped contributing to this release.
Expand Down Expand Up @@ -153,7 +167,7 @@ from our contributors.
[#510]: https://github.com/bemusic/bemuse/pull/510
[#511]: https://github.com/bemusic/bemuse/pull/511

## v42
## v42 (2018-08-08)

This update took a really long time as I (dtinth) was busy with other things in
life. Also, this release contains many internal changes to the code
Expand Down
6 changes: 5 additions & 1 deletion bin/strip-changelog-pre-version-postfix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env node
const fs = require('fs')
const data = fs.readFileSync('CHANGELOG.md', 'utf8')
fs.writeFileSync('CHANGELOG.md', data.replace(/(## v[\d.]+)-pre\.\d+/g, ''))
const date = new Date().toJSON().split('T')[0]
fs.writeFileSync(
'CHANGELOG.md',
data.replace(/(## v[\d.]+)-pre\.\d+/g, `$1 (${date})`)
)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bemuse",
"version": "44.3.0",
"version": "44.4.0-pre.201908292114",
"description": "BEAT☆MUSIC☆SEQUENCE, a web-based music game of the future",
"main": "index.js",
"private": true,
Expand Down
31 changes: 31 additions & 0 deletions src/game/display/game-display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,37 @@
display: none;
}
}
&--escape-hint {
position: absolute;
left: 12px;
top: 56px;
display: none;
background: #b61a44;
padding: 8px 12px;
color: white;
white-space: nowrap;
border-radius: 8px;
font-weight: bold;
font-size: 1rem;
pointer-events: none;
&.is-shown {
display: block;
}
&::after {
content: '';
display: block;
position: absolute;
width: 0;
height: 0;
top: -8px;
left: 16px;
margin-left: -8px;
border-width: 0 8px 8px 8px;
border-style: solid;
border-color: transparent;
border-bottom-color: #b61a44;
}
}
}

@keyframes game-display--bg-default {
Expand Down
45 changes: 26 additions & 19 deletions src/game/display/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ export class GameDisplay {
panelPlacement: game.players[0].options.placement,
infoPanelPosition: skinData.infoPanelPosition,
})
this._createTouchEscapeButton({
displayByDefault: skinData.mainInputDevice === 'touch',
})
this._createTouchEscapeButton()
this._createFullScreenButton()
this._escapeHintShown = false
}
setEscapeHandler(escapeHandler) {
this._onEscape = escapeHandler
Expand All @@ -49,13 +48,29 @@ export class GameDisplay {
let data = this._getData(time, gameTime, gameState)
this._updateStatefulData(time, gameTime, gameState)
this._context.render(Object.assign({}, this._stateful, data))
this._synchronizeVideo(gameTime)
this._synchronizeTutorialEscapeHint(gameTime)
}
_synchronizeVideo(gameTime) {
if (this._video && !this._videoStarted && gameTime >= this._videoOffset) {
this._video.volume = 0
this._video.play()
this._video.classList.add('is-playing')
this._videoStarted = true
}
}
_synchronizeTutorialEscapeHint(gameTime) {
if (this._game.options.tutorial) {
const TUTORIAL_ESCAPE_HINT_SHOW_TIME = 101.123595506
if (
gameTime >= TUTORIAL_ESCAPE_HINT_SHOW_TIME &&
!this._escapeHintShown
) {
this._escapeHintShown = true
this._escapeHint.classList.add('is-shown')
}
}
}
_getData(time, gameTime, gameState) {
let data = {}
data['tutorial'] = this._game.options.tutorial ? 'yes' : 'no'
Expand Down Expand Up @@ -117,32 +132,24 @@ export class GameDisplay {
}
return $wrapper[0]
}
_createTouchEscapeButton({ displayByDefault }) {
_createTouchEscapeButton() {
const touchButtons = document.createElement('div')
touchButtons.className = 'game-display--touch-buttons is-left'
this.wrapper.appendChild(touchButtons)
if (displayByDefault) {
touchButtons.classList.add('is-visible')
} else {
let shown = false
this.wrapper.addEventListener(
'touchstart',
() => {
if (shown) return
shown = true
touchButtons.classList.add('is-visible')
},
true
)
}
touchButtons.classList.add('is-visible')
const addTouchButton = (className, onClick) => {
let button = createTouchButton(onClick, className)
touchButtons.appendChild(button)
}
addTouchButton('game-display--touch-escape-button', () => this._onEscape())
addTouchButton('game-display--touch-replay-button', () => this._onReplay())
}

const escapeHint = document.createElement('div')
escapeHint.textContent = 'Click or press Esc to exit the tutorial'
escapeHint.className = 'game-display--escape-hint'
this._escapeHint = escapeHint
touchButtons.appendChild(escapeHint)
}
_createFullScreenButton() {
if (shouldDisableFullScreen() || !screenfull.enabled) {
return
Expand Down

0 comments on commit 50a0708

Please sign in to comment.