Moved killNormal into IGameStartr

This commit is contained in:
Josh Goldberg
2015-07-07 08:47:34 -07:00
parent 6c9777de78
commit 7c49cbb9d6
2 changed files with 3 additions and 10 deletions
+1 -5
View File
@@ -6,6 +6,7 @@ declare module MenuGraphr {
ObjectMaker: ObjectMakr.IObjectMakr;
TimeHandler: TimeHandlr.ITimeHandlr;
addThing(thing: IThing | string | any[], left?: number, top?: number): IThing;
killNormal(thing: IThing): void;
setHeight(thing: IThing, height: number);
setWidth(thing: IThing, width: number);
}
@@ -188,13 +189,8 @@ declare module MenuGraphr {
paddingY: number;
}
export interface IKillFunction {
(thing: IThing): void;
}
export interface IMenuGraphrSettings {
GameStarter: IGameStartr;
killNormal: IKillFunction;
schemas?: {
[i: string]: IMenuSchema;
};
+2 -5
View File
@@ -48,14 +48,11 @@ module MenuGraphr {
[i: string]: boolean
};
private killNormal: IKillFunction;
/**
*
*/
constructor(settings: IMenuGraphrSettings) {
this.GameStarter = settings.GameStarter;
this.killNormal = settings.killNormal;
this.schemas = settings.schemas || {};
this.aliases = settings.aliases || {};
@@ -256,7 +253,7 @@ module MenuGraphr {
delete this.menus[child.name];
}
this.killNormal(child);
this.GameStarter.killNormal(child);
this.deleteMenuChildren(name);
if (child.onMenuDelete) {
@@ -1200,7 +1197,7 @@ module MenuGraphr {
this.GameStarter.shiftVert(character, -this.GameStarter.unitsize);
if (character.top < menu.top + (menu.textYOffset - 1) * this.GameStarter.unitsize) {
this.killNormal(character);
this.GameStarter.killNormal(character);
return true;
}