-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d39643e
commit e3cc676
Showing
63 changed files
with
30,248 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BROWSER=none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vscode | ||
build | ||
!package-lock.json | ||
src/Fonts.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Kiosk | ||
|
||
## config.json settings | ||
|
||
These settings apply only to the kiosk user experience and do not impact sim gameplay. It's assumed all gamepads use the same configuration. | ||
|
||
|Key|Purpose| | ||
|---------------------------------|-| | ||
|GameDataUrl | Path to the game data JSON file with details about the games to include.| | ||
|PlayUrlRoot | Left part of the embedded player URL up to and including --run.| | ||
|Debug | Uses debug settings, such as figuring out where the game data URL is in production vs. local debugging.| | ||
|HighScoresToKeep | The maximum number of high scores to keep for a given game.| | ||
|HighScoreInitialsLength | The number of initials to allow users to enter.| | ||
|HighScoreInitialAllowedCharacters| The list and order of characters to allow in high scores.| | ||
|GamepadPollLoopMilli | How often the gamepads are polled for user interaction with the kiosk menus and other inputs. If this is too large, actions may be missed, such as a quick button press. If it's too small, then a single action may be interpretted as multiple (like a single button press counting twice).| | ||
|GamepadCacheMilli | How often the gamepad state is cached. Since multiple components access the browser's Navigator.getGamepads() API, we use a caching mechanism to optimize how often they're accessed. This value should be smaller than the gamepad polling loop.| | ||
|GamepadAButtonPin | The pin index for the A button. | | ||
|GamepadBButtonPin | The pin index for the B button.| | ||
|GamepadEscapeButtonPin | The pin index for the Escape button. This button leaves a game without waiting and returns the user to the menu.| | ||
|GamepadResetButtonPin | The pin index for the Reset button.| | ||
|GamepadMenuButtonPin | The pin index for the Menu button. Note that since this menu is used by games, it does not return the user to the kiosk menu. | | ||
|GamepadLeftRightAxis | The gamepad axis index for left/right detection.| | ||
|GamepadLeftRightThreshold | The threshold to detect for a "right" action. It's negated to detect "left" actions.| | ||
|GamepadUpDownAxis | The gamepad axis index for up/down detection.| | ||
|GamepadUpDownThreshold | The threshold to detect for a "down" action. It's negated to detect "up" actions.| | ||
|Keyboard`Input`Keys | Each is an array of string arrays matching the browser keys that map to the target behavior. The index of a list maps to the same gamepad index (player 1 is the first array at index 0, etc.) | | ||
|
||
## Localhost testing | ||
|
||
To test Kiosk locally: | ||
|
||
1. Ensure your pxt repo is up to date and has been built recently. | ||
2. In a command shell, in the `pxt` repo, cd into the `kiosk` folder and start the Kiosk dev server: `npm run start`. This will *not* open a browser window. | ||
3. In another command shell, in the `pxt-arcade` repo, start the Arcade dev server: `pxt serve --rebundle`. This will open the Arcade webapp in a browser. | ||
|
||
Requests to the `/kiosk` endpoint will be routed to the Kiosk dev server. | ||
|
||
Debug and step through Kiosk code using the browser dev tools (F12 to open). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const { aliasWebpack } = require("react-app-alias"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
|
||
module.exports = function (config, env) { | ||
const isEnvProduction = env === "production"; | ||
const aliasFn = aliasWebpack({}); | ||
config = { | ||
...aliasFn(config), | ||
plugins: [ | ||
...config.plugins.filter((p) => !(p instanceof HtmlWebpackPlugin)), | ||
new HtmlWebpackPlugin( | ||
Object.assign( | ||
{}, | ||
{ | ||
inject: true, | ||
template: "./public/index.html", | ||
}, | ||
isEnvProduction | ||
? { | ||
minify: { | ||
removeComments: false, | ||
collapseWhitespace: false, | ||
removeRedundantAttributes: true, | ||
useShortDoctype: true, | ||
removeEmptyAttributes: true, | ||
removeStyleLinkTypeAttributes: true, | ||
keepClosingSlash: true, | ||
minifyJS: true, | ||
minifyCSS: true, | ||
minifyURLs: true, | ||
}, | ||
} | ||
: undefined | ||
) | ||
), | ||
], | ||
module: { | ||
...config.module, | ||
rules: config.module.rules.filter(el => !(el.use && el.use.some(item => !!(item.options && item.options.eslintPath)))), | ||
} | ||
}; | ||
return config; | ||
}; |
Oops, something went wrong.