Skip to content

Commit

Permalink
We now hide the area sectors if the browser is not ie.
Browse files Browse the repository at this point in the history
- Other browsers cannot handle the performance.
- Also minfied the endgate lib
  • Loading branch information
NTaylorMullen committed Oct 11, 2013
1 parent 7109147 commit 015f91f
Show file tree
Hide file tree
Showing 7 changed files with 8,930 additions and 8,889 deletions.
26 changes: 23 additions & 3 deletions ShootR/ShootR/Client/Space/AreaRenderer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ShootR/ShootR/Client/Space/AreaRenderer.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions ShootR/ShootR/Client/Space/AreaRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ module ShootR {
keyboard.OnCommandPress(AreaRenderer.KEYBOARD_MAPPING, () => {
this._active = !this._active;

for (var i = 0; i < this._areas.length; i++) {
this._areas[i].Visible = this._active;
}
this.UpdateVisible();
});

// IE is the only browser that can handle the performance, therefore this check sees if we're NOT an ie
if (!(!!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/)))) {

This comment has been minimized.

Copy link
@davidfowl

davidfowl Oct 11, 2013

Collaborator

Think you could make this more confusing?

this.Hide();
}
}

public OnMapResize(newSize: eg.Size2d): void {
Expand All @@ -45,6 +48,16 @@ module ShootR {
return letter + sectorNumber.toString();
}

public Show(): void {
this._active = true;
this.UpdateVisible();
}

public Hide(): void {
this._active = false;
this.UpdateVisible();
}

private BuildSectors(): void {
var gridCount: number = this._mapSize.Width / this._areaSize.Width,
locationOffset: number = this._areaSize.HalfWidth,
Expand All @@ -69,6 +82,14 @@ module ShootR {
this._scene.Add(area);
}
}

this.UpdateVisible();
}

private UpdateVisible(): void {
for (var i = 0; i < this._areas.length; i++) {
this._areas[i].Visible = this._active;
}
}
}

Expand Down
Loading

0 comments on commit 015f91f

Please sign in to comment.