Skip to content

Commit ce6ca19

Browse files
committed
Prettier lint
1 parent 030de30 commit ce6ca19

15 files changed

+96
-270
lines changed

src/blueprints/blu_building.ts

+2-27
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,8 @@ import {Models} from "../models_map.js";
88
import {Blueprint, create_line} from "./blu_common.js";
99

1010
export let main_palette = [
11-
0.6,
12-
0.4,
13-
0,
14-
0.4,
15-
0.2,
16-
0,
17-
0.14,
18-
0,
19-
0,
20-
0.2,
21-
0.8,
22-
1,
23-
1,
24-
1,
25-
0,
26-
1,
27-
0.8,
28-
0.4,
29-
0.6,
30-
0.4,
31-
0,
32-
0.2,
33-
0.2,
34-
0.2,
35-
0.53,
36-
0.53,
37-
0.53,
11+
0.6, 0.4, 0, 0.4, 0.2, 0, 0.14, 0, 0, 0.2, 0.8, 1, 1, 1, 0, 1, 0.8, 0.4, 0.6, 0.4, 0, 0.2, 0.2,
12+
0.2, 0.53, 0.53, 0.53,
3813
];
3914

4015
let additional_colors = [

src/blueprints/blu_character.ts

+22-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,28 @@ import {Blueprint, Color} from "./blu_common.js";
1010
import {create_gun} from "./blu_gun.js";
1111
import {get_hat_blueprint} from "./blu_hat.js";
1212

13-
let shirt_colors: Array<Color> = [[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]];
14-
let skin_colors: Array<Color> = [[1, 0.8, 0.6], [0.6, 0.4, 0]];
15-
let hair_colors: Array<Color> = [[1, 1, 0], [0, 0, 0], [0.6, 0.4, 0], [0.4, 0, 0]];
16-
let pants_colors: Array<Color> = [[0, 0, 0], [0.53, 0, 0], [0.6, 0.4, 0.2], [0.33, 0.33, 0.33]];
13+
let shirt_colors: Array<Color> = [
14+
[1, 0, 0],
15+
[0, 1, 0],
16+
[0, 0, 1],
17+
[1, 1, 1],
18+
];
19+
let skin_colors: Array<Color> = [
20+
[1, 0.8, 0.6],
21+
[0.6, 0.4, 0],
22+
];
23+
let hair_colors: Array<Color> = [
24+
[1, 1, 0],
25+
[0, 0, 0],
26+
[0.6, 0.4, 0],
27+
[0.4, 0, 0],
28+
];
29+
let pants_colors: Array<Color> = [
30+
[0, 0, 0],
31+
[0.53, 0, 0],
32+
[0.6, 0.4, 0.2],
33+
[0.33, 0.33, 0.33],
34+
];
1735

1836
export function get_character_blueprint(game: Game): Blueprint {
1937
// Create the hat first so that the hat itself can be reproduced with SeedBounty.

src/blueprints/blu_hat.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ import {palette} from "../palette.js";
66
import {Blueprint, Color, create_line} from "./blu_common.js";
77

88
// colors 2 & 5
9-
let hat_colors: Array<Color> = [[0.2, 0.2, 0.2], [0.9, 0.9, 0.9], [0.53, 0, 0], [1, 0, 0]];
10-
let extra_colors: Array<Color> = [[0, 0, 0], [1, 1, 1], [1, 1, 0], [0.9, 0, 0]];
9+
let hat_colors: Array<Color> = [
10+
[0.2, 0.2, 0.2],
11+
[0.9, 0.9, 0.9],
12+
[0.53, 0, 0],
13+
[1, 0, 0],
14+
];
15+
let extra_colors: Array<Color> = [
16+
[0, 0, 0],
17+
[1, 1, 1],
18+
[1, 1, 0],
19+
[0.9, 0, 0],
20+
];
1121

1222
export function get_hat_blueprint(game: Game): Blueprint {
1323
let hat_palette = palette.slice();

src/components/com_animate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function animate(clips: {[Anim.Idle]: AnimationClip; [k: number]: Animati
2727
// keyframes' timestamps after each alternation. We want to
2828
// modify copies of the timestamps defined in the clip. It's OK
2929
// to copy other keyframe properties by reference.
30-
Keyframes: Keyframes.map(keyframe => <AnimationKeyframe>{...keyframe}),
30+
Keyframes: Keyframes.map((keyframe) => <AnimationKeyframe>{...keyframe}),
3131
Flags,
3232
Duration,
3333
Time: 0,

src/components/com_light.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type Light = [
1010
/** Blue */
1111
number,
1212
/** Intensity */
13-
number
13+
number,
1414
];
1515

1616
/**

src/components/com_transform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function* components_of_type<T>(
5555
component: Get
5656
): IterableIterator<T> {
5757
if (game.World[transform.EntityId] & (1 << component)) {
58-
yield (game[component][transform.EntityId] as unknown) as T;
58+
yield game[component][transform.EntityId] as unknown as T;
5959
}
6060
for (let child of transform.Children) {
6161
yield* components_of_type<T>(game, child, component);

src/game.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ export class Game implements ComponentData, GameState {
141141
this.GL = this.Canvas3.getContext("webgl2")!;
142142
this.Context = this.Canvas2.getContext("2d")!;
143143

144-
this.UI.addEventListener("contextmenu", evt => evt.preventDefault());
145-
this.UI.addEventListener("mousedown", evt => {
144+
this.UI.addEventListener("contextmenu", (evt) => evt.preventDefault());
145+
this.UI.addEventListener("mousedown", (evt) => {
146146
this.Input[`d${evt.button}`] = 1;
147147
});
148-
this.UI.addEventListener("mousemove", evt => {
148+
this.UI.addEventListener("mousemove", (evt) => {
149149
this.Input.mx = evt.offsetX;
150150
this.Input.my = evt.offsetY;
151151
});

src/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { dispatch } from "./actions.js";
2-
import { Game } from "./game.js";
3-
import { load } from "./model.js";
4-
import { world_intro } from "./worlds/wor_town.js";
1+
import {dispatch} from "./actions.js";
2+
import {Game} from "./game.js";
3+
import {load} from "./model.js";
4+
import {world_intro} from "./worlds/wor_town.js";
55

66
let game = new Game();
77
// @ts-ignore
88
window.$ = (...args) => dispatch(game, ...args);
99
// @ts-ignore
1010
window.game = game;
1111

12-
load(`${OUTDIR}/models.tfu`).then(models => {
12+
load(`${OUTDIR}/models.tfu`).then((models) => {
1313
game.Models = models;
1414
world_intro(game);
1515
game.Start();

src/math/quat.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ export function from_axis(out: Quat, axis: Vec3, angle: number) {
7474
return out;
7575
}
7676

77-
export const rotation_to = (function() {
77+
export const rotation_to = (function () {
7878
let tmpvec3: Vec3 = [];
7979
let xUnitVec3 = [1, 0, 0];
8080
let yUnitVec3 = [0, 1, 0];
8181

82-
return function(out: Quat, a: Vec3, b: Vec3) {
82+
return function (out: Quat, a: Vec3, b: Vec3) {
8383
let d = dot(a, b);
8484
if (d < -0.999999) {
8585
cross(tmpvec3, xUnitVec3, a);

src/model.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export type Model = Float32Array;
22

33
export function load(path: string): Promise<Array<Model>> {
44
return fetch(path)
5-
.then(response => response.arrayBuffer())
6-
.then(buffer => {
5+
.then((response) => response.arrayBuffer())
6+
.then((buffer) => {
77
let buffer_array = new Uint16Array(buffer);
88
let model_data: Array<Model> = [];
99
let i = 0;

src/palette.ts

+3-39
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
11
export let palette = [
2-
1.0,
3-
1.0,
4-
1.0,
5-
1.0,
6-
1.0,
7-
1.0,
8-
1.0,
9-
1.0,
10-
0.8,
11-
1.0,
12-
1.0,
13-
0.6,
14-
1.0,
15-
1.0,
16-
0.4,
17-
1.0,
18-
1.0,
19-
0.2,
20-
1.0,
21-
1.0,
22-
0.0,
23-
0.0,
24-
0.8,
25-
0.0,
26-
0.47,
27-
0.47,
28-
0.47,
29-
0.53,
30-
0.0,
31-
0.0,
32-
0.4,
33-
0.2,
34-
0.0,
35-
0.0,
36-
1.0,
37-
1.0,
38-
0.93,
39-
0.0,
40-
0.0,
2+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.8, 1.0, 1.0, 0.6, 1.0, 1.0, 0.4, 1.0, 1.0, 0.2, 1.0,
3+
1.0, 0.0, 0.0, 0.8, 0.0, 0.47, 0.47, 0.47, 0.53, 0.0, 0.0, 0.4, 0.2, 0.0, 0.0, 1.0, 1.0, 0.93,
4+
0.0, 0.0,
415
];

0 commit comments

Comments
 (0)