Browse Source

feat: start proofing extra menues; bump discoteque

develop
Dale 3 months ago
parent
commit
b0b479d8d6
Signed by: Deiru GPG Key ID: AA250C0277B927E1
7 changed files with 138 additions and 13 deletions
  1. +5
    -1
      package.json
  2. +33
    -0
      src/components/Menu/index.tsx
  3. +48
    -0
      src/components/Menu/styles.ts
  4. +19
    -1
      src/game.tsx
  5. +1
    -2
      src/index.ts
  6. +28
    -5
      yarn.lock
  7. +4
    -4
      yarn.nix

+ 5
- 1
package.json View File

@@ -10,11 +10,13 @@
},
"dependencies": {
"@emotion/core": "^10.0.35",
"discoteque": "^1.0.7",
"classnames": "^2.2.6",
"discoteque": "^1.1.7",
"emotion": "^10.0.27",
"ramda": "^0.27.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.1",
"react-toastify": "^6.0.8",
"redux": "^4.0.5",
"typescript": "^4.0.3",
@@ -22,9 +24,11 @@
"webpack-dev-server": "^3.11.0"
},
"devDependencies": {
"@types/classnames": "^2.2.10",
"@types/ramda": "^0.27.19",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"@types/react-redux": "^7.1.9",
"css-loader": "^4.2.2",
"file-loader": "^6.1.0",
"html-webpack-plugin": "^4.4.1",


+ 33
- 0
src/components/Menu/index.tsx View File

@@ -0,0 +1,33 @@
import React, { FC, useState } from 'react';
import { useDispatch } from 'react-redux';

type Tabs = 'tasks' | 'characters';

import cn from 'classnames';
import * as styles from './styles';
import { setShowCustom } from 'discoteque/lib/engine/lib/store';

const TabMenu: FC = () => {
const dispatch = useDispatch();
const [openTab, setOpenTab] = useState<Tabs>('tasks');

const openTasks = () => setOpenTab('tasks');
const openChars = () => setOpenTab('characters');

const closeMenu = () => dispatch(setShowCustom(false));

return (
<div className={styles.menuContainer}>
<ul className={styles.menuTabList}>
<li className={styles.menuClose} onClick={closeMenu}>X</li>
<li className={cn({ [styles.active]: openTab === 'tasks' })} onClick={openTasks}>Tasks</li>
<li className={cn({ [styles.active]: openTab === 'characters' })} onClick={openChars}>Characters</li>
</ul>
<div>
{openTab}
</div>
</div>
);
}

export default TabMenu;

+ 48
- 0
src/components/Menu/styles.ts View File

@@ -0,0 +1,48 @@
import { css } from 'emotion';
import { colors } from 'discoteque/lib/assets/style-vars';

export const menuContainer = css`
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
`;

export const menuTabList = css`
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: space-betwee;
box-sizing: border-box;
border-bottom: 2px dashed ${colors.MainBgColorDark};
& > li {
width: 100%;
text-align: center;
padding: 5px 15px 5px 15px;
cursor: pointer;
transition: all 0.4s ease-out;
}
& > li.active {
background-color: ${colors.MainBgColorDark};
color: ${colors.MainBgColor};
transition: all 0.4s ease-in;
}
`;

export const menuClose = css`
max-width: 40px !important;
padding: 0px !important;
height: 40px !important;
min-height: 40px !important;
line-height: 40px;
font-size: 40px;
box-sizing: border-box;
border-right: 1px solid ${colors.MainBgColorDark};
`;

export const active = "active";

src/game.ts → src/game.tsx View File

@@ -1,7 +1,11 @@
import React from 'react';

import { IGameState, setState, reducer } from '@/lib/store';
import { INode, IActor, EngineConfig, ILineOption, ILocation } from 'discoteque/lib/engine/types';
import { INode, IActor, EngineConfig, ILineOption, ILocation, RendererFN, ToolbarOptionsFN } from 'discoteque/lib/engine/types';
import { setShowCustom } from 'discoteque/lib/engine/lib/store';

import skills, { GameSkills } from './lib/skills';
import Menu from './components/Menu';
import { awardSkill } from 'discoteque/lib/engine/lib/utils';
import { lockSkills } from 'discoteque/lib/engine/lib/store';

@@ -304,6 +308,18 @@ const locations: ILocation<IGameState>[] = [
interface IGameConfig extends EngineConfig<IGameState, undefined, GameSkills> {
}

const renderFn: RendererFN<IGameState, undefined, GameSkills> = () => {
return (
<Menu />
);
};

const optionsFn: ToolbarOptionsFN<IGameState, undefined, GameSkills> = (_engine, _engineConfig, _gameState, dispatch) => {
return [
{ label: 'Journal', onClick: () => dispatch(setShowCustom(true)) },
]
}

export const config: IGameConfig = {
reducer: reducer,
startNode: 'trying_out',
@@ -327,6 +343,8 @@ export const config: IGameConfig = {
},
skills,
skillPointsOnStart: 5,
customRenderer: renderFn,
customOptions: optionsFn,
skillDescriptoins: {
'manic': 'Out of this world at the highest pace',
'tired': 'Slow burning and contemplation',

+ 1
- 2
src/index.ts View File

@@ -9,8 +9,7 @@ injectGlobal`
@font-face {
font-family: 'Antic Slab Regular';
src: url(${font}) format('woff2');
}
body {
} body {
font-family: 'Antic Slab Regular';
}
`;


+ 28
- 5
yarn.lock View File

@@ -203,6 +203,11 @@
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==

"@types/classnames@^2.2.10":
version "2.2.10"
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.10.tgz#cc658ca319b6355399efc1f5b9e818f1a24bf999"
integrity sha512-1UzDldn9GfYYEsWWnn/P4wkTlkZDH7lDb0wBMGbtIQc9zXEQq7FlKBdZUn6OBqD8sKZZ2RQO2mAjGpXiDGoRmQ==

"@types/glob@^7.1.1":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183"
@@ -211,6 +216,14 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/hoist-non-react-statics@^3.3.0":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
dependencies:
"@types/react" "*"
hoist-non-react-statics "^3.3.0"

"@types/html-minifier-terser@^5.0.0":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50"
@@ -255,6 +268,16 @@
dependencies:
"@types/react" "*"

"@types/react-redux@^7.1.9":
version "7.1.9"
resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.9.tgz#280c13565c9f13ceb727ec21e767abe0e9b4aec3"
integrity sha512-mpC0jqxhP4mhmOl3P4ipRsgTgbNofMRXJb08Ms6gekViLj61v1hOZEKWDCyWsdONr6EjEA6ZHXC446wdywDe0w==
dependencies:
"@types/hoist-non-react-statics" "^3.3.0"
"@types/react" "*"
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"

"@types/react@*", "@types/react@^16.9.49":
version "16.9.49"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.49.tgz#09db021cf8089aba0cdb12a49f8021a69cce4872"
@@ -1562,10 +1585,10 @@ diffie-hellman@^5.0.0:
miller-rabin "^4.0.0"
randombytes "^2.0.0"

discoteque@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/discoteque/-/discoteque-1.0.7.tgz#2ea634534a63241703f7bfb486c4f6035c6e8d9d"
integrity sha512-Nc9g0MxD58bD/gSkt/8cqMNok/X6tw1A6oCc+iVN1iRQVs3hJdKIhMS/v+6ENuL67YpdH2SAxY/WWKdlANsSmg==
discoteque@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/discoteque/-/discoteque-1.1.7.tgz#8ac504cf7abcc0d6800282414b4ce653a42e2bf7"
integrity sha512-pGcoVGzFQxCow/LaWe9Ays7xD9s3doZSAXMQZ4F9aUL3lTMncnYP2BGMi6CurkBGO58RN9ETjKtLn+AfGjzYqg==
dependencies:
"@emotion/core" "^10.0.35"
classnames "^2.2.6"
@@ -4050,7 +4073,7 @@ readdirp@~3.4.0:
dependencies:
picomatch "^2.2.1"

redux@^4.0.5:
redux@^4.0.0, redux@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f"
integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==


+ 4
- 4
yarn.nix View File

@@ -1690,11 +1690,11 @@
};
}
{
name = "discoteque___discoteque_1.0.7.tgz";
name = "discoteque___discoteque_1.0.8.tgz";
path = fetchurl {
name = "discoteque___discoteque_1.0.7.tgz";
url = "https://registry.yarnpkg.com/discoteque/-/discoteque-1.0.7.tgz";
sha1 = "2ea634534a63241703f7bfb486c4f6035c6e8d9d";
name = "discoteque___discoteque_1.0.8.tgz";
url = "https://registry.yarnpkg.com/discoteque/-/discoteque-1.0.8.tgz";
sha1 = "128339730195d7461254986a39c561d7c8c5fa2b";
};
}
{


Loading…
Cancel
Save