remove resolution

This commit is contained in:
ntr
2019-08-09 15:38:09 +10:00
parent ee032696da
commit b8d1c78f61
9 changed files with 32 additions and 69 deletions
-1
View File
@@ -26,7 +26,6 @@ export const setNav = value => ({ type: 'SET_NAV', value });
export const setPing = value => ({ type: 'SET_PING', value });
export const setPlayer = value => ({ type: 'SET_PLAYER', value });
export const setReclaiming = value => ({ type: 'SET_RECLAIMING', value });
export const setResolution = value => ({ type: 'SET_RESOLUTION', value });
export const setShowLog = value => ({ type: 'SET_SHOW_LOG', value });
export const setShowNav = value => ({ type: 'SET_SHOW_NAV', value });
export const setSkip = value => ({ type: 'SET_SKIP', value });
-2
View File
@@ -18,7 +18,6 @@ const addState = connect(
account,
activeSkill,
animFocus,
resolution,
animating,
animText,
} = state;
@@ -37,7 +36,6 @@ const addState = connect(
return {
game,
account,
resolution,
animating,
animFocus,
animText,
+4 -1
View File
@@ -5,6 +5,7 @@ const addState = connect(
function receiveState(state) {
const {
ws,
animating,
game,
} = state;
@@ -15,6 +16,7 @@ const addState = connect(
return {
game,
animating,
sendGameReady,
};
},
@@ -23,12 +25,13 @@ const addState = connect(
function Controls(args) {
const {
game,
animating,
sendGameReady
} = args;
return (
<aside class="controls">
<button class="ready" onClick={() => sendGameReady()}>Ready</button>
<button disabled={animating} class="ready" onClick={() => sendGameReady()}>Ready</button>
</aside>
);
}
+2 -14
View File
@@ -9,7 +9,6 @@ const addState = connect(
ws,
game,
account,
resolution,
showNav,
} = state;
@@ -25,7 +24,6 @@ const addState = connect(
return {
game,
account,
resolution,
sendInstanceState,
sendGameReady,
showNav,
@@ -55,7 +53,6 @@ function GameFooter(props) {
const {
game,
account,
resolution,
showNav,
quit,
@@ -88,14 +85,6 @@ function GameFooter(props) {
</button>
);
const skipBtn = (
<button
onClick={skip}>
Skip
</button>
);
const readyBtn = (
<button
class={`${playerTeam.ready ? 'ready' : ''} ready-btn`}
@@ -108,7 +97,7 @@ function GameFooter(props) {
const now = Date.now();
const end = Date.parse(game.phase_end);
const timerPct = ((now - zero) / (end - zero) * 100);
const displayPct = resolution || game.phase === 'Finish' || !game.phase_end
const displayPct = game.phase === 'Finish' || !game.phase_end
? 0
: Math.min(timerPct, 100);
@@ -135,9 +124,8 @@ function GameFooter(props) {
<footer>
{timer}
<button id="nav-btn" onClick={() => setShowNav(!showNav)} ></button>
{resolution && skipBtn}
{game.phase === 'Finish' && quitBtn }
{!resolution && game.phase === 'Skill' && readyBtn }
{game.phase === 'Skill' && readyBtn }
</footer>
);
}
-1
View File
@@ -84,7 +84,6 @@ function registerEvents(store) {
store.dispatch(actions.setAnimating(false));
store.dispatch(actions.setSkip(false));
store.dispatch(actions.setResolution(null));
// set the game state so resolutions don't fire twice
store.dispatch(actions.setGame(game));
-1
View File
@@ -40,7 +40,6 @@ module.exports = {
ping: createReducer(null, 'SET_PING'),
player: createReducer(null, 'SET_PLAYER'),
reclaiming: createReducer(false, 'SET_RECLAIMING'),
resolution: createReducer(null, 'SET_RESOLUTION'),
skip: createReducer(false, 'SET_SKIP'),
shop: createReducer(false, 'SET_SHOP'),