Browse Source

fix: Use relative path import

master
Dale 8 months ago
parent
commit
3eaf711ada
Signed by: Deiru GPG Key ID: AA250C0277B927E1
22 changed files with 842 additions and 73 deletions
  1. +1
    -0
      package.json
  2. +2
    -2
      src/engine/Engine.ts
  3. +2
    -2
      src/engine/store/actions.ts
  4. +3
    -3
      src/engine/store/reducer.ts
  5. +1
    -1
      src/engine/store/selectors.ts
  6. +1
    -1
      src/engine/util/saves.ts
  7. +1
    -1
      src/engine/util/skills.ts
  8. +1
    -1
      src/playback/components/Dropdown.tsx
  9. +2
    -2
      src/playback/components/Renderer/Backlog.tsx
  10. +1
    -1
      src/playback/components/Renderer/MainMenu.tsx
  11. +0
    -0
      src/playback/components/Renderer/Options.tsx
  12. +5
    -5
      src/playback/components/Renderer/SaveModal.tsx
  13. +0
    -0
      src/playback/components/Renderer/Skills.tsx
  14. +1
    -1
      src/playback/components/Renderer/Status.tsx
  15. +4
    -4
      src/playback/components/Renderer/Toolbar.tsx
  16. +6
    -6
      src/playback/components/Renderer/index.tsx
  17. +4
    -3
      src/playback/components/Skills.tsx
  18. +5
    -5
      src/playback/index.tsx
  19. +1
    -1
      src/playback/theme/index.ts
  20. +18
    -23
      src/test-game/game.tsx
  21. +11
    -0
      src/test-game/nodes.ts
  22. +772
    -11
      yarn.lock

+ 1
- 0
package.json View File

@ -40,6 +40,7 @@
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"styled-components": "^5.2.0",
"tspath": "^1.3.7",
"uuid": "^8.3.1"
},
"devDependencies": {


+ 2
- 2
src/engine/Engine.ts View File

@ -4,8 +4,8 @@ import {
EngineConfig, LineRaw, Line,
Node, Actor, LineObject, Location,
EngineState, isLineFn, LineFunction, OptionObject, Chrono,
} from "@/engine/types";
import reducer from "@/engine/store/reducer";
} from "./types";
import reducer from "./store/reducer";
import { pathOr, propOr, reduce } from "ramda";
import { changeNode, changeLine, changeLocation, expandBacklog, setChrono, init } from "./store/actions";


+ 2
- 2
src/engine/store/actions.ts View File

@ -1,5 +1,5 @@
import { ENGINE_ACTION, actionTypes } from '@/engine/store/types';
import { EngineState, Chrono, EngineUIState, Line } from '@/engine/types';
import { ENGINE_ACTION, actionTypes } from './types';
import { EngineState, Chrono, EngineUIState, Line } from '../types';
import { Action } from 'redux';
export type SetSkillPayload = {


+ 3
- 3
src/engine/store/reducer.ts View File

@ -1,9 +1,9 @@
import { handleActions } from "redux-actions";
import { mergeDeepRight, append } from "ramda";
import { EngineState, EngineUIState, Line, Chrono } from "@/engine/types";
import { actionTypes } from "@/engine/store/types";
import { EngineActionPayload, SetSkillPayload, RestorePayload } from "@/engine/store/actions";
import { EngineState, EngineUIState, Line, Chrono } from "../types";
import { actionTypes } from "./types";
import { EngineActionPayload, SetSkillPayload, RestorePayload } from "./actions";
const reducer = handleActions<EngineState, EngineActionPayload>({
[actionTypes.ENGINE_INIT]: (_, action) => action.payload as EngineState,


+ 1
- 1
src/engine/store/selectors.ts View File

@ -1,5 +1,5 @@
import { prop } from "ramda";
import { EngineState } from "@/engine/types";
import { EngineState } from "../types";
export const selectEngine:
<GS extends object = object, ST extends string = string>(state: any) => EngineState<GS, ST> = prop('engine');


+ 1
- 1
src/engine/util/saves.ts View File

@ -1,4 +1,4 @@
import { SaveFiles, SaveFile, EngineState, Chrono } from "@/engine/types";
import { SaveFiles, SaveFile, EngineState, Chrono } from "../types";
import * as R from "ramda";
import { lensProp, takeLast } from "ramda";
import { DateTime } from "luxon";


+ 1
- 1
src/engine/util/skills.ts View File

@ -1,4 +1,4 @@
import { expandBacklog, addSkillPoint } from "@/engine/store/actions"
import { expandBacklog, addSkillPoint } from "../store/actions"
import { Dispatch } from "redux"
export const awardSkill = (dispatch: Dispatch) => {


+ 1
- 1
src/playback/components/Dropdown.tsx View File

@ -3,7 +3,7 @@ import styled from '@emotion/styled';
import cn from 'classnames';
import { OptionsButton } from './Button';
import { DropDownConfig } from '@/engine/types';
import { DropDownConfig } from '../../engine/types';
const DropdownMenuList = styled('ul')`
position: absolute;


+ 2
- 2
src/playback/components/Renderer/Backlog.tsx View File

@ -1,8 +1,8 @@
import React, { FC, useRef, useEffect } from 'react';
import styled from "@emotion/styled";
import { Line, OptionObject } from '@/engine/types';
import { scrollToBottom } from '@/playback/util/scroll';
import { Line, OptionObject } from '../../../engine/types';
import { scrollToBottom } from '../../util/scroll';
type Props = {
backlog: Line[];


+ 1
- 1
src/playback/components/Renderer/MainMenu.tsx View File

@ -1,7 +1,7 @@
import React, { FC, useState } from 'react';
import styled from '@emotion/styled';
import { MenuConfig } from '@/engine/types';
import { MenuConfig } from '../../../engine/types';
import Engine from '@/engine/Engine';
import SaveModal from './SaveModal';


+ 0
- 0
src/playback/components/Renderer/Options.tsx View File


+ 5
- 5
src/playback/components/Renderer/SaveModal.tsx View File

@ -3,11 +3,11 @@ import { useSelector, useDispatch } from "react-redux";
import { v4 as uuidv4 } from 'uuid';
import styled from "@emotion/styled";
import { selectEngine, selectGame } from "@/engine/store/selectors";
import { makeSave, storeSaves, getSaves, deleteSave } from "@/engine/util/saves";
import Engine from "@/engine/Engine";
import { restore } from "@/engine/store/actions";
import { scrollToBottom } from "@/playback/util/scroll";
import { selectEngine, selectGame } from "../../..//engine/store/selectors";
import { makeSave, storeSaves, getSaves, deleteSave } from "../../../engine/util/saves";
import Engine from "../../../engine/Engine";
import { restore } from "../../../engine/store/actions";
import { scrollToBottom } from "../../util/scroll";
import Button from "../Button";
import Modal from "../Modal";


+ 0
- 0
src/playback/components/Renderer/Skills.tsx View File


+ 1
- 1
src/playback/components/Renderer/Status.tsx View File

@ -1,6 +1,6 @@
import React, { FC } from 'react'
import styled from '@emotion/styled';
import { Location, Chrono } from '@/engine/types';
import { Location, Chrono } from '../../../engine/types';
import { DateTime } from 'luxon';


+ 4
- 4
src/playback/components/Renderer/Toolbar.tsx View File

@ -1,11 +1,11 @@
import React, { FC, useState } from 'react'
import styled from '@emotion/styled';
import Engine from '@/engine/Engine';
import Engine from '../../../engine/Engine';
import SaveModal from './SaveModal';
import Dropdown from '@/playback/components/Dropdown';
import { OptionsButton } from '@/playback/components/Button';
import { DropDownConfig } from '@/engine/types';
import Dropdown from '../../components/Dropdown';
import { OptionsButton } from '../../components/Button';
import { DropDownConfig } from '../../../engine/types';


+ 6
- 6
src/playback/components/Renderer/index.tsx View File

@ -3,16 +3,16 @@ import { Global, css } from "@emotion/core";
import styled from "@emotion/styled";
import { useSelector, useDispatch } from "react-redux";
import { Line, OptionObject } from "@/engine/types";
import { selectEngine, selectGame } from "@/engine/store/selectors";
import { Line, OptionObject } from "../../../engine/types";
import { selectEngine, selectGame } from "../../../engine/store/selectors";
import Backlog from "./Backlog";
import Status from "./Status";
import Toolbar from "./Toolbar";
import Engine from "@/engine/Engine";
import { setUI } from "@/engine/store/actions";
import MainMenu from "@/playback/components/Renderer/MainMenu";
import Skills from "@/playback/components/Skills";
import Engine from "../../../engine/Engine";
import { setUI } from "../../../engine/store/actions";
import MainMenu from "../../components/Renderer/MainMenu";
import Skills from "../../components/Skills";
type Props = {
engine: Engine<any, any>;


+ 4
- 3
src/playback/components/Skills.tsx View File

@ -1,11 +1,12 @@
import React, { FC, useState, useMemo } from 'react';
import styled from '@emotion/styled';
import { selectEngine } from '@/engine/store/selectors';
import { useSelector, useDispatch } from 'react-redux';
import { propOr, merge, equals } from 'ramda';
import { setSkill, setUI, setSkillPoints } from '@/engine/store/actions';
import styled from '@emotion/styled';
import cn from 'classnames';
import { selectEngine } from '../../engine/store/selectors';
import { setSkill, setUI, setSkillPoints } from '../../engine/store/actions';
const SkillsHeader = styled(`h1`)`
margin: 0;
padding: 15px;


+ 5
- 5
src/playback/index.tsx View File

@ -1,13 +1,13 @@
import React, { FC } from "react";
import Engine from "@/engine/Engine";
import Renderer from "@/playback/components/Renderer";
import { selectEngine } from "@/engine/store/selectors";
import { OptionObject } from "@/engine/types";
import Engine from "../engine/Engine";
import Renderer from "./components/Renderer";
import { selectEngine } from "../engine/store/selectors";
import { OptionObject } from "../engine/types";
import { useSelector } from "react-redux";
import { ThemeProvider } from "emotion-theming";
import defaultTheme, { Theme } from "@/playback/theme";
import defaultTheme, { Theme } from "./theme";
type Props = {


+ 1
- 1
src/playback/theme/index.ts View File

@ -1,4 +1,4 @@
import { Colors, FontSizes, UI } from "@/playback/theme/types";
import { Colors, FontSizes, UI } from "../theme/types";
export type Theme = {
colors: Colors,


+ 18
- 23
src/test-game/game.tsx View File

@ -22,22 +22,17 @@ const locations: Location[] = [
{
id: 'start',
kind: 'location',
name: 'Nowhere',
name: 'UAC Landing Pad #4',
next: 'pre_choice',
lines: [
{ actorId: Helper.id, text: "Hi!" },
{ actorId: Helper.id, text: 'I\'m Helper! I help people play this demo. (Not really...)' },
{ actorId: Helper.id, text: "Lets's start by advancing some lines!" },
{ actorId: Helper.id, text: "This should be easy enough for you!" },
{ actorId: Helper.id, text: "See?" },
{ text: "You think you're getting the hang of it!" },
(_, __, dispatch) => {
awardSkill(dispatch);
return null;
},
{ actorId: Helper.id, text: 'Oooh! You got a skill point! You can open skills screen again by clicking "Character" button from the top toolbar.' },
{ actorId: Helper.id, text: "Here's an exceptionally long line specifically designed to annoy me (and you!) and test us (and our patience!) on how long a single line could be. Turns out - pretty long!" },
{ actorId: Helper.id, text: "Now let's try something harder. Left, or right?" },
{ text: 'You find yourself standing atop a docking platform, fresh from your space shitp.' },
{ text: 'You have been sent here to investigate a sudden loss of communication from one of UAC\'s many facilities on Mars.' },
{ text: 'The lights flicker, as you hear faint moans coming from somewhere beyond the dark corridods. You cock your pistol.' },
{ text: 'You feel like danger lies ahead, and it\'s imminent. But you are not afraid' },
],
options: [
{ text: 'Venture forth into the facility', value: 'further' },
{ text: 'Retreat back', value: 'go-back' },
],
},
{
@ -75,15 +70,15 @@ const config: EngineConfig = {
// customDropdownFn: (_, _gameState, dispatch) => [
// { title: 'Journal', onClick: () => dispatch(openCustomScreen) },
// ],
chrono: {
date: DateTime.fromObject({
day: 18,
month: 12,
year: 1980,
hour: 15,
minute: 35,
}),
},
// chrono: {
// date: DateTime.fromObject({
// day: 18,
// month: 12,
// year: 1980,
// hour: 15,
// minute: 35,
// }),
// },
skills: {
'tired': 5,
'manic': 5,


+ 11
- 0
src/test-game/nodes.ts View File

@ -2,6 +2,17 @@ import { Node } from "@/engine/types";
import { endGame } from "@/engine/store/actions";
const nodes: Node[] = [
{
kind: 'node',
id: 'go-back',
lines: [
{ text: "No. You cannot turn back. Not now. However, somewhere outside the window, you catch a glimpse of a cash of items someone left behind." }
],
options: [
{ text: "Jump out the window and reach for the cache", value: "" },
{ text: "Proceede into facility as planned", value: "" },
]
},
{
kind: 'node',
id: 'failed_choice_tired',


+ 772
- 11
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save