(v0.7.0) Used shenanigans-manager@0.2 instead of Gulp

This commit is contained in:
Josh Goldberg
2017-12-26 12:47:31 -08:00
parent 58401ff0df
commit 467ee28f03
12 changed files with 609 additions and 8628 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "7"
- "node"
- "5"
script:
node_modules/gulp/bin/gulp.js
npm run verify
+7
View File
@@ -0,0 +1,7 @@
{
"editor.tabSize": 4,
"editor.trimAutoWhitespace": true,
"tslint.alwaysShowRuleFailuresAsWarnings": true,
"tslint.autoFixOnSave": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
-1
View File
@@ -1 +0,0 @@
require("gulp-shenanigans").initialize(require("gulp"));
+456 -8428
View File
File diff suppressed because it is too large Load Diff
+68 -55
View File
@@ -1,56 +1,69 @@
{
"name": "menugraphr",
"description": "In-game menu and dialog creation and management for GameStartr.",
"version": "0.6.4",
"author": {
"name": "Josh Goldberg",
"email": "joshuakgoldberg@outlook.com"
},
"repository": {
"type": "git",
"url": "ssh://git@github.com:FullScreenShenanigans/MenuGraphr.git"
},
"bugs": {
"url": "https://github.com/FullScreenShenanigans/MenuGraphr/issues"
},
"license": "MIT",
"dependencies": {
"areaspawnr": "0.6.X",
"audioplayr": "0.6.X",
"changelinr": "0.6.X",
"devicelayr": "0.6.X",
"eightbittr": "0.6.X",
"fpsanalyzr": "0.6.X",
"gamesrunnr": "0.6.X",
"gamestartr": "0.6.X",
"groupholdr": "0.6.X",
"inputwritr": "0.6.X",
"itemsholdr": "0.6.X",
"mapscreatr": "0.6.X",
"mapscreenr": "0.6.X",
"mathdecidr": "0.6.X",
"modattachr": "0.6.X",
"numbermakr": "0.6.X",
"objectmakr": "0.6.X",
"pixeldrawr": "0.6.X",
"pixelrendr": "0.6.X",
"quadskeepr": "0.6.X",
"sceneplayr": "0.6.X",
"stringfilr": "0.6.X",
"thinghittr": "0.6.X",
"timehandlr": "0.6.X",
"touchpassr": "0.6.X",
"worldseedr": "0.6.X"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-shenanigans": "^0.6.17"
},
"scripts": {
"gulp": "gulp",
"test": "gulp test"
},
"shenanigans": {
"name": "MenuGraphr"
}
}
"author": {
"email": "joshuakgoldberg@outlook.com",
"name": "Josh Goldberg"
},
"browser": "./src/index.js",
"bugs": {
"url": "https://github.com/FullScreenShenanigans/MenuGraphr/issues"
},
"dependencies": {
"gamestartr": "^0.7.0"
},
"description": "In-game menu and dialog creation and management for GameStartr.",
"devDependencies": {
"@types/chai": "^4.0.4",
"@types/lolex": "^1.5.32",
"@types/mocha": "^2.2.44",
"@types/sinon": "^4.0.0",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"glob": "^7.1.2",
"lolex": "^2.3.0",
"mocha": "^4.0.1",
"mocha-headless-chrome": "^1.7.1",
"requirejs": "^2.3.5",
"run-for-every-file": "^1.1.0",
"shenanigans-manager": "^0.2.0",
"sinon": "^4.1.2",
"sinon-chai": "^2.14.0",
"tslint": "5.8.0",
"typedoc": "^0.9.0",
"typescript": "^2.6.2",
"webpack": "^3.10.0"
},
"license": "MIT",
"name": "menugraphr",
"repository": {
"type": "git",
"url": "ssh://git@github.com:FullScreenShenanigans/MenuGraphr.git"
},
"scripts": {
"dist": "npm run dist:webpack",
"dist:webpack": "webpack --config webpack.config.js",
"docs": "npm run docs:typedoc",
"docs:typedoc": "typedoc src/ --out docs/generated",
"init": "npm install && npm run setup && npm run verify",
"setup": "npm run setup:copy && npm run setup:package",
"setup:copy": "npm run setup:copy:default",
"setup:copy:default": "run-for-every-file --dot --src \"node_modules/shenanigans-manager/setup/default/\" --file \"**/*\" --run \"mustache package.json {{src-file}} {{file}}\" --dest \".\" --only-files",
"setup:package": "shenanigans-manager hydrate-package-json",
"src": "npm run src:tsc && npm run src:tslint",
"src:tsc": "tsc -p .",
"src:tslint": "tslint -c tslint.json --exclude ./node_modules/**/*.ts* -p tsconfig.json -t stylish",
"test": "npm run test:setup && npm run test:run",
"test:run": "mocha-headless-chrome --file test/index.html",
"test:setup": "npm run test:setup:copy && npm run test:setup:html && npm run test:setup:tsc",
"test:setup:copy": "npm run test:setup:copy:default",
"test:setup:copy:default": "run-for-every-file --dot --src \"node_modules/shenanigans-manager/setup/test/\" --file \"**/*\" --run \"mustache package.json {{src-file}} ./test/{{file}}\" --dest \".\" --only-files",
"test:setup:html": "shenanigans-manager generate-test-html",
"test:setup:tsc": "tsc -p test",
"verify": "npm run src && npm run test && npm run dist && npm run docs",
"watch": "run-p \"tsc -p . -w\" \"echo sup\""
},
"shenanigans": {
"name": "MenuGraphr"
},
"types": "./src/index.d.ts",
"version": "0.7.0"
}
+14 -19
View File
@@ -1,5 +1,4 @@
import { GameStartr } from "gamestartr/lib/GameStartr";
import { IThing } from "gamestartr/lib/IGameStartr";
import { GameStartr, IThing } from "gamestartr";
/**
* General attributes for both Menus and MenuSchemas.
@@ -13,7 +12,7 @@ export interface IMenuBase {
/**
* A callback for when this menu is set as active.
*/
callback?: (...args: any[]) => void;
callback?(...args: any[]): void;
/**
* Schemas of children to add on creation.
@@ -74,42 +73,42 @@ export interface IMenuBase {
/**
* A callback for when this becomes active.
*/
onActive?: (name: string) => void;
onActive?(name: string): void;
/**
* A callback for when this is deselected.
*/
onBPress?: (name: string) => void;
onBPress?(name: string): void;
/**
* A callback for a user event directing down.
*/
onDown?: (GameStartr: GameStartr) => void;
onDown?(gameStarter: GameStartr): void;
/**
* A callback for when this becomes inactive.
*/
onInactive?: (name: string) => void;
onInactive?(name: string): void;
/**
* A callback for a user event directing to the left.
*/
onLeft?: (GameStartr: GameStartr) => void;
onLeft?(gameStarter: GameStartr): void;
/**
* A callback for when this is deleted.
*/
onMenuDelete?: (GameStartr: GameStartr) => void;
onMenuDelete?(gameStarter: GameStartr): void;
/**
* A callback for a user event directing to the right.
*/
onRight?: (GameStartr: GameStartr) => void;
onRight?(gameStarter: GameStartr): void;
/**
* A callback for a user event directing up.
*/
onUp?: (GameStartr: GameStartr) => void;
onUp?(gameStarter: GameStartr): void;
/**
* A sizing description for this, including width and height.
@@ -211,7 +210,7 @@ export interface IMenuProgress {
/**
* A callback for when the dialog completes.
*/
onCompletion?: (...args: any[]) => void;
onCompletion?(...args: any[]): void;
/**
* Whether the dialog is currently being added to the menu.
@@ -602,7 +601,7 @@ export interface IGridCell {
/**
* A callback for selecting this cell with a user selection event.
*/
callback?: (...args: any[]) => void;
callback?(...args: any[]): void;
/**
* The column containing this option.
@@ -672,9 +671,7 @@ export interface IListMenuOptions {
/**
* Options within the menu, or a Function to generate them.
*/
options: any[] | {
(): any[];
};
options: any[] | (() => any[]);
/**
* A default starting selected index.
@@ -735,9 +732,7 @@ export interface IReplacements {
/**
* A Function to generate a word replacement based on the GameStarter's state.
*/
export interface IReplacerFunction {
(gameStarter: GameStartr): string[];
}
export type IReplacerFunction = (gameStarter: GameStartr) => string[];
/**
* Settings to initialize a new IMenuGraphr.
+34 -48
View File
@@ -1,5 +1,4 @@
import { GameStartr } from "gamestartr/lib/GameStartr";
import { IThing } from "gamestartr/lib/IGameStartr";
import { GameStartr, IThing } from "gamestartr";
import {
IAliases, IGridCell, IListMenu, IListMenuOptions, IListMenuProgress,
@@ -8,7 +7,7 @@ import {
IMenuSchemaPositionOffset, IMenuSchemas, IMenuSchemaSize,
IMenusContainer, IMenuThingSchema, IMenuWordCommand, IMenuWordCommandBase,
IMenuWordPadLeftCommand, IMenuWordPosition, IMenuWordSchema, IReplacements,
IReplacerFunction, ISoundNames, IText
IReplacerFunction, ISoundNames, IText,
} from "./IMenuGraphr";
/**
@@ -18,7 +17,7 @@ export enum Direction {
Top = 0,
Right = 1,
Bottom = 2,
Left = 3
Left = 3,
}
/**
@@ -56,11 +55,6 @@ export class MenuGraphr implements IMenuGraphr {
*/
private readonly replacements: IReplacements;
/**
* Separator for words to replace using replacements.
*/
private readonly replacerKey: string;
/**
* The currently "active" (user-selected) menu.
*/
@@ -84,7 +78,6 @@ export class MenuGraphr implements IMenuGraphr {
this.schemas = settings.schemas || {};
this.aliases = settings.aliases || {};
this.replacements = settings.replacements || {};
this.replacerKey = settings.replacerKey || "%%%%%%%";
this.sounds = settings.sounds || {};
this.menus = {};
@@ -175,7 +168,7 @@ export class MenuGraphr implements IMenuGraphr {
left: 0,
width: this.gameStarter.mapScreener.width,
height: this.gameStarter.mapScreener.height,
children: []
children: [],
} as any;
this.deleteMenu(name);
@@ -221,7 +214,7 @@ export class MenuGraphr implements IMenuGraphr {
return this.createMenuThing(name, schema as IMenuThingSchema);
default:
throw new Error("Unknown schema type: " + schema.type);
throw new Error(`Unknown schema type: '${schema.type}'.`);
}
}
@@ -327,7 +320,7 @@ export class MenuGraphr implements IMenuGraphr {
*/
public addMenuDialog(name: string, dialog: IMenuDialogRaw, onCompletion?: () => any): void {
const dialogParsed: (string[] | IMenuWordCommand)[][] = this.parseRawDialog(dialog);
let currentLine: number = 1;
let currentLine = 1;
const callback: () => void = (): void => {
// If all dialog has been exhausted, delete the menu and finish
@@ -344,7 +337,7 @@ export class MenuGraphr implements IMenuGraphr {
currentLine += 1;
// Delete any previous texts. This is only done if continuing
// so that when the dialog is finished, the last text remains
// So that when the dialog is finished, the last text remains
this.deleteMenuChildren(name);
// This continues the dialog with the next iteration (word)
@@ -352,8 +345,8 @@ export class MenuGraphr implements IMenuGraphr {
};
// This first call to addMenuText shouldn't be the callback, because if
// being called from a childrenSchema of type "text", it shouldn't delete
// any other menu children from childrenSchemas.
// Being called from a childrenSchema of type "text", it shouldn't delete
// Any other menu children from childrenSchemas.
this.addMenuText(name, dialogParsed[0], callback);
}
@@ -418,7 +411,7 @@ export class MenuGraphr implements IMenuGraphr {
const textPaddingY: number = menu.textPaddingY || textProperties.paddingY;
const selectedIndex: [number, number] = settings.selectedIndex || [0, 0];
const optionChildren: any[] = [];
let index: number = 0;
let index = 0;
let y: number = top;
let option: any;
let optionChild: any;
@@ -450,8 +443,8 @@ export class MenuGraphr implements IMenuGraphr {
x = left;
option = options[i];
optionChild = {
"option": option,
"things": []
option,
things: [],
};
optionChildren.push(optionChild);
@@ -502,7 +495,7 @@ export class MenuGraphr implements IMenuGraphr {
y += schema[j][k].y;
}
} else {
option.title = title = "Char" + this.getCharacterEquivalent(schema[j][k]);
option.title = title = `Char${this.getCharacterEquivalent(schema[j][k])}`;
character = this.gameStarter.objectMaker.make<IText>(title);
menu.children.push(character);
optionChild.things.push(character);
@@ -535,8 +528,8 @@ export class MenuGraphr implements IMenuGraphr {
option.schema = schema = this.filterText(option.text);
optionChild = {
"option": option,
"things": []
option,
things: [],
};
optionChildren.push(optionChild);
@@ -599,7 +592,7 @@ export class MenuGraphr implements IMenuGraphr {
} else {
menu.selectedIndex = selectedIndex;
this.gameStarter.itemsHolder.addItem(name, {
"value": selectedIndex
value: selectedIndex,
});
}
} else {
@@ -729,13 +722,17 @@ export class MenuGraphr implements IMenuGraphr {
public registerDirection(direction: number): void {
switch (direction) {
case Direction.Top:
return this.registerUp();
this.registerUp();
break;
case Direction.Right:
return this.registerRight();
this.registerRight();
break;
case Direction.Bottom:
return this.registerDown();
this.registerDown();
break;
case Direction.Left:
return this.registerLeft();
this.registerLeft();
break;
default:
throw new Error("Unknown direction: " + direction);
}
@@ -1090,7 +1087,6 @@ export class MenuGraphr implements IMenuGraphr {
break;
default:
this.gameStarter.physics.setLeft(thing, menu.left);
break;
}
switch (position.vertical) {
@@ -1102,7 +1098,6 @@ export class MenuGraphr implements IMenuGraphr {
break;
default:
this.gameStarter.physics.setTop(thing, menu.top);
break;
}
if (offset.top) {
@@ -1134,7 +1129,7 @@ export class MenuGraphr implements IMenuGraphr {
const textPaddingY: number = menu.textPaddingY || textProperties.paddingY;
const title: string = "Char" + this.getCharacterEquivalent(character);
const thing: IText = this.gameStarter.objectMaker.make<IText>(title, {
textPaddingY: textPaddingY
textPaddingY,
});
menu.children.push(thing);
@@ -1283,7 +1278,7 @@ export class MenuGraphr implements IMenuGraphr {
private computeMenuScrollingItems(menu: IListMenu): number {
const bottom: number = menu.bottom - (menu.textPaddingY || 0) - (menu.textYOffset || 0);
for (let i: number = 0; i < menu.gridRows; i += 1) {
for (let i = 0; i < menu.gridRows; i += 1) {
if (menu.grid[0][i].y >= bottom) {
return i;
}
@@ -1326,14 +1321,9 @@ export class MenuGraphr implements IMenuGraphr {
for (j = 0; j < optionChild.things.length; j += 1) {
this.gameStarter.physics.shiftVert(optionChild.things[j], offset);
if (
optionChild.things[j].hidden = !!(
i < menu.scrollingVisualOffset
|| i >= (menu.scrollingItems || 1) + menu.scrollingVisualOffset
) {
optionChild.things[j].hidden = true;
} else {
optionChild.things[j].hidden = false;
}
|| i >= (menu.scrollingItems || 1) + menu.scrollingVisualOffset);
}
}
}
@@ -1382,7 +1372,7 @@ export class MenuGraphr implements IMenuGraphr {
const characters: string[] = this.filterWord(dialogRaw);
const words: string[][] = [];
let word: string[] = [];
let currentlyWhitespace: boolean = false;
let currentlyWhitespace = false;
// For each character to be added...
for (const character of characters) {
@@ -1502,7 +1492,7 @@ export class MenuGraphr implements IMenuGraphr {
const characters: string[] = [];
const total: string = textRaw as string;
let component: string = "";
let component = "";
let i: number;
for (i = 0; i < total.length; i += 1) {
@@ -1642,14 +1632,10 @@ export class MenuGraphr implements IMenuGraphr {
* used in dialogs that react to box size. This may be wrong.
*/
private computeFutureWordLength(wordRaw: string[] | IMenuWordCommand, textWidth: number, textPaddingX: number): number {
let total: number = 0;
let word: string[];
if (wordRaw.constructor === Array) {
word = wordRaw as string[];
} else {
word = this.parseWordCommand(wordRaw as IMenuWordCommand);
}
let total = 0;
const word: string[] = wordRaw.constructor === Array
? wordRaw as string[]
: this.parseWordCommand(wordRaw as IMenuWordCommand);
for (const character of word) {
if (/\s/.test(character)) {
+2
View File
@@ -0,0 +1,2 @@
export * from "./IMenuGraphr";
export * from "./MenuGraphr";
-3
View File
@@ -1,3 +0,0 @@
import { mochaLoader } from "../main";
mochaLoader.it("_", (): void => { });
+2 -17
View File
@@ -1,19 +1,4 @@
{
"compilerOptions": {
"declaration": true,
"lib": ["dom", "es2015.collection", "es2015.promise", "es5"],
"module": "amd",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"target": "es5"
},
"include": [
"./**/*.ts"
]
"extends": "../tsconfig.json",
"include": ["*.ts"]
}
+9 -3
View File
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"declaration": true,
"experimentalDecorators": true,
"jsx": "react",
"lib": ["dom", "es2015.collection", "es2015.promise", "es5"],
"module": "amd",
"moduleResolution": "node",
@@ -8,12 +10,16 @@
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"pretty": true,
"strictNullChecks": true,
"target": "es5"
},
"exclude": [
"dist",
"node_modules"
],
"include": [
"./src/**/*.ts"
"./src/**/*.ts",
"./src/**/*.tsx"
]
}
+15 -52
View File
@@ -1,56 +1,19 @@
{
"extends": "tslint:all",
"extends": "./node_modules/shenanigans-manager/setup/tslint.json",
"rules": {
"array-type": [false],
"arrow-return-shorthand": [false],
"ban-types": [false],
"callable-types": [false],
"comment-format": [false],
"completed-docs": [false],
"cyclomatic-complexity": [false],
"forin": [false],
"linebreak-style": [false],
"max-file-line-count": [false],
"max-line-length": [true, 140],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"newline-before-return": [false],
"no-any": [false],
"no-bitwise": [false],
"no-console": [false],
"no-default-export": [false],
"no-inferrable-types": [false],
"no-magic-numbers": [false],
"no-redundant-jsdoc": [false],
"no-non-null-assertion": [false],
"no-object-literal-type-assertion": [false],
"no-submodule-imports": [false],
"no-require-imports": false,
"no-unbound-method": [false],
"no-unsafe-any": [false],
"no-unused-variable": [false],
"no-void-expression": [false],
"number-literal-format": [false],
"object-literal-key-quotes": [false],
"object-literal-shorthand": [false],
"object-literal-sort-keys": [false],
"only-arrow-functions": [false],
"prefer-function-over-method": [false],
"prefer-method-signature": [false],
"prefer-switch": [false],
"prefer-conditional-expression": [false],
"prefer-template": [false],
"restrict-plus-operands": [false],
"space-before-function-paren": [false],
"strict-boolean-expressions": [false],
"strict-type-predicates": [false],
"switch-final-break": [false],
"trailing-comma": [false],
"typedef": [false],
"variable-name": [false]
"completed-docs": false,
"cyclomatic-complexity": false,
"max-file-line-count": false,
"no-any": false,
"no-bitwise": false,
"no-non-null-assertion": false,
"no-unbound-method": false,
"no-unsafe-any": false,
"no-void-expression": false,
"prefer-function-over-method": false,
"prefer-template": false,
"restrict-plus-operands": false,
"strict-boolean-expressions": false,
"strict-type-predicates": false
}
}