Skip to content

Commit

Permalink
Merge branch 'master' into loadout-support
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
#	package.json
#	src/loaders/scenes/GameFieldAssets.ts
  • Loading branch information
Longi94 committed Nov 21, 2019
2 parents 6b0163d + b98f197 commit 437a7c1
Show file tree
Hide file tree
Showing 13 changed files with 3,417 additions and 4,534 deletions.
5,403 changes: 2,241 additions & 3,162 deletions docs/package-lock.json

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@
],
"author": "Saltie",
"license": "MIT",
"dependencies": {
"@material-ui/core": "^3.9.3",
"@material-ui/lab": "^3.0.0-alpha.30",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"three": "^0.108.0"
},
"dependencies": {},
"devDependencies": {
"@types/react-dom": "^16.8.4",
"@types/react-dom": "^16.9.4",
"autodll-webpack-plugin": "^0.4.2",
"awesome-typescript-loader": "^5.2.1",
"file-loader": "^3.0.1",
"file-loader": "^4.2.0",
"html-webpack-plugin": "^3.2.0",
"typescript": "^3.4.5",
"webpack": "^4.30.0",
"webpack-dev-server": "^3.3.1"
"typescript": "^3.7.2",
"webpack": "^4.41.2",
"webpack-dev-server": "^3.9.0"
},
"browserslist": [
">0.2%",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/CompactViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CompactViewer extends Component<Props, State> {
}

return (
<Grid container direction="column" justify="center" spacing={24}>
<Grid container direction="column" justify="center" spacing={3}>
<Grid item style={{ minHeight: 0, maxWidth: 900, width: "100%" }}>
<ReplayViewer gameManager={gameManager}>
<CompactPlayControls />
Expand Down
23 changes: 13 additions & 10 deletions docs/src/components/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import React, { Component } from "react"

import {
FPSClock,
GameBuilderOptions,
loadReplay,
ReplayData,
ReplayMetadata,
} from "../../../src"
import React, { Component, ErrorInfo } from "react"

import { FPSClock, GameBuilderOptions, loadReplay } from "../../../src"
import CompactViewer from "./CompactViewer"
import Viewer from "./Viewer"

Expand All @@ -16,6 +10,8 @@ interface Props {

interface State {
options?: GameBuilderOptions
error?: Error
errorInfo?: ErrorInfo
}

class Main extends Component<Props, State> {
Expand All @@ -39,12 +35,19 @@ class Main extends Component<Props, State> {
})
}

componentDidCatch(error: Error, errorInfo: ErrorInfo) {
this.setState({ error, errorInfo })
}

render() {
const { options } = this.state
const { options, error, errorInfo } = this.state

if (!options) {
return "Loading..."
} else if (error || errorInfo) {
return JSON.stringify(error)
}

return this.props.compact ? (
<CompactViewer options={options} />
) : (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Viewer extends Component<Props, State> {
className={root}
direction="column"
justify="center"
spacing={24}
spacing={3}
>
<Grid item style={{ minHeight: 0, maxWidth: 900, width: "100%" }}>
<ReplayViewer gameManager={gameManager} autoplay />
Expand All @@ -51,7 +51,7 @@ class Viewer extends Component<Props, State> {
container
justify="space-between"
alignItems="center"
spacing={24}
spacing={3}
>
<Grid item>
<PlayControls />
Expand Down
Loading

0 comments on commit 437a7c1

Please sign in to comment.