Did I ever commit this?

master
Auri 2020-11-01 14:19:01 -08:00
parent 9561e5a489
commit 9f899ec8ef
208 changed files with 94 additions and 60 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
client/@types/jquery.d.ts vendored Normal file → Executable file
View File

0
client/@types/libs.d.ts vendored Normal file → Executable file
View File

0
client/@types/p2.d.ts vendored Normal file → Executable file
View File

0
client/@types/phaser.comments.d.ts vendored Normal file → Executable file
View File

0
client/@types/phaser.d.ts vendored Normal file → Executable file
View File

0
client/@types/pixi.comments.d.ts vendored Normal file → Executable file
View File

0
client/@types/pixi.d.ts vendored Normal file → Executable file
View File

6
client/Data/LoadedAssets.ts Normal file → Executable file
View File

@ -7,6 +7,10 @@ interface LoadedAsset {
name: string;
identifier: string;
key: string; //Set by LoadScene
path: string;
size: Vec2;
size: number;
tileSize: Vec2;
spriteSize?: Vec2;
}

0
client/InitScene.ts Normal file → Executable file
View File

20
client/LoadScene.ts Normal file → Executable file
View File

@ -2,6 +2,8 @@ class LoadScene extends Phaser.Scene {
loaderOutline: Phaser.GameObjects.Sprite | null = null;
loaderFilled: Phaser.GameObjects.Sprite | null = null;
assets: LoadedAsset[] = [];
constructor() {
super({key: "LoadScene"});
}
@ -42,15 +44,23 @@ class LoadScene extends Phaser.Scene {
this.load.image("shader_light_mask", "/public/res/shader/light_mask.png");
let assets = JSON.parse(this.cache.text.get("assets"));
for (let asset of assets) {
if (asset.tileSize) this.load.spritesheet(asset.identifier, asset.path, {frameWidth: asset.tileSize.x, frameHeight: asset.tileSize.y});
else this.load.image(asset.identifier, asset.path);
this.assets = JSON.parse(this.cache.text.get("assets"));
for (let asset of this.assets) {
let key =
(asset.type == AssetType.WALL ? "wall_" :
asset.type == AssetType.GROUND ? "ground_" :
asset.type == AssetType.OVERLAY ? "overlay_" :
asset.type == AssetType.TOKEN ? "token_" : "ERR_")
+ asset.identifier;
asset.key = key;
if (asset.tileSize) this.load.spritesheet(key, asset.path, {frameWidth: asset.tileSize.x, frameHeight: asset.tileSize.y});
else this.load.image(key, asset.path);
}
}
create(): void {
this.game.scene.start('MapScene', JSON.parse(this.cache.text.get("assets")));
this.game.scene.start('MapScene', this.assets);
this.cache.text.remove("assets");
this.game.scene.stop('LoadScene');
this.game.scene.swapPosition('MapScene', 'LoadScene');

0
client/MapScene/FogOfWar.ts Normal file → Executable file
View File

0
client/MapScene/History/HistoryElement.ts Normal file → Executable file
View File

0
client/MapScene/History/HistoryManager.ts Normal file → Executable file
View File

0
client/MapScene/Interface/AssetUploader.ts Normal file → Executable file
View File

0
client/MapScene/Interface/Chat.ts Normal file → Executable file
View File

0
client/MapScene/Interface/Chatbox.ts Normal file → Executable file
View File

0
client/MapScene/Interface/Components/UIComponent.ts Normal file → Executable file
View File

0
client/MapScene/Interface/Components/UIContainer.ts Normal file → Executable file
View File

View File

View File

View File

0
client/MapScene/Interface/Components/UISidebar.ts Normal file → Executable file
View File

View File

0
client/MapScene/Interface/Components/UITileSelector.ts Normal file → Executable file
View File

6
client/MapScene/Interface/Components/UITileSidebar.ts Normal file → Executable file
View File

@ -15,7 +15,7 @@ class UITileSidebar extends UISidebar {
this.sprites.push(add_wall);
for (let tileset of assets.filter((a) => a.type == AssetType.WALL))
this.addWall(tileset.identifier);
this.addWall(tileset.key);
let add_ground = new Phaser.GameObjects.Sprite(this.scene, 9 + x * 21 * 3, 9 + y * 21 * 3, "ui_sidebar_browse");
add_ground.setName("add_ground");
@ -25,7 +25,7 @@ class UITileSidebar extends UISidebar {
this.sprites.push(add_ground);
for (let tileset of assets.filter((a) => a.type == AssetType.GROUND))
this.addGround(tileset.identifier);
this.addGround(tileset.key);
let add_overlay = new Phaser.GameObjects.Sprite(this.scene, 9 + x * 21 * 3, 9 + 9 * 21 * 3, "ui_sidebar_browse");
add_overlay.setName("add_overlay");
@ -35,7 +35,7 @@ class UITileSidebar extends UISidebar {
this.sprites.push(add_overlay);
for (let tileset of assets.filter((a) => a.type == AssetType.OVERLAY))
this.addOverlay(tileset.identifier);
this.addOverlay(tileset.key);
for (let i = 0; i < 12; i++) {
if (i % 4 != 0) this.backgrounds[i].setFrame(0);

0
client/MapScene/Interface/Components/UITokenProps.ts Normal file → Executable file
View File

View File

0
client/MapScene/Interface/Components/UITokenSidebar.ts Normal file → Executable file
View File

4
client/MapScene/Interface/Modes/ArchitectMode.ts Normal file → Executable file
View File

@ -60,11 +60,11 @@ class ArchitectMode {
}
// Push history to HistoryManager
if (this.scene.i.mouseLeftDown() && !this.pointerDown) {
if (this.scene.i.mouseDown() && !this.pointerDown) {
this.pointerDown = true;
this.pointerPrimaryDown = this.scene.i.mouseLeftDown();
}
else if (!this.scene.i.mouseLeftDown() && this.pointerDown) {
else if (!this.scene.i.mouseDown() && this.pointerDown) {
if (this.manipulated.length != 0) {
for (let tile of this.manipulated) {
this.scene.lighting.tileUpdatedAt(tile.pos.x, tile.pos.y);

0
client/MapScene/Interface/Modes/TokenMode.ts Normal file → Executable file
View File

0
client/MapScene/Interface/TextInput.ts Normal file → Executable file
View File

2
client/MapScene/Interface/UIView.ts Normal file → Executable file
View File

@ -31,7 +31,7 @@ class UIView {
this.tokenSidebar = new UITokenSidebar(this.scene, -205, 0);
this.o.add(this.tokenSidebar);
for (let token of assets.filter((a) => a.type == AssetType.TOKEN))
this.tokenSidebar.addToken(token.identifier);
this.tokenSidebar.addToken(token.key);
this.tileSidebar = new UITileSidebar(this.scene, 0, 0, assets);
this.o.add(this.tileSidebar);

0
client/MapScene/Lighting/LightChunk.ts Normal file → Executable file
View File

0
client/MapScene/Lighting/LightSource.ts Normal file → Executable file
View File

0
client/MapScene/Lighting/Lighting.ts Normal file → Executable file
View File

0
client/MapScene/Map/MapChunk.ts Normal file → Executable file
View File

0
client/MapScene/Map/MapData.ts Normal file → Executable file
View File

0
client/MapScene/Map/SmartTiler.ts Normal file → Executable file
View File

6
client/MapScene/Map/TilesetManager.ts Normal file → Executable file
View File

@ -15,9 +15,9 @@ class TilesetManager {
}
init(assets: LoadedAsset[]) {
for (let tileset of assets.filter(a => a.type == AssetType.WALL )) this.addTileset(tileset.identifier, Layer.wall);
for (let tileset of assets.filter(a => a.type == AssetType.GROUND )) this.addTileset(tileset.identifier, Layer.floor);
for (let tileset of assets.filter(a => a.type == AssetType.OVERLAY)) this.addTileset(tileset.identifier, Layer.overlay);
for (let tileset of assets.filter(a => a.type == AssetType.WALL )) this.addTileset(tileset.key, Layer.wall);
for (let tileset of assets.filter(a => a.type == AssetType.GROUND )) this.addTileset(tileset.key, Layer.floor);
for (let tileset of assets.filter(a => a.type == AssetType.OVERLAY)) this.addTileset(tileset.key, Layer.overlay);
}
private addTileset(key: string, layer: Layer): void {

0
client/MapScene/MapScene.ts Normal file → Executable file
View File

0
client/MapScene/Token.ts Normal file → Executable file
View File

0
client/MapScene/WorldView.ts Normal file → Executable file
View File

0
client/Shaders/BrightenPipeline.ts Normal file → Executable file
View File

0
client/Shaders/OutlinePipeline.ts Normal file → Executable file
View File

0
client/Util/InputManager.ts Normal file → Executable file
View File

0
client/Util/Util.ts Normal file → Executable file
View File

0
client/Util/Vector.ts Normal file → Executable file
View File

0
client/index.ts Normal file → Executable file
View File

0
client/nodemon.json Normal file → Executable file
View File

0
client/tsconfig.json Normal file → Executable file
View File

0
package-lock.json generated Normal file → Executable file
View File

0
package.json Normal file → Executable file
View File

39
public/editor/core.js Normal file → Executable file
View File

@ -101,6 +101,7 @@ var LoadScene = /** @class */ (function (_super) {
var _this = _super.call(this, { key: "LoadScene" }) || this;
_this.loaderOutline = null;
_this.loaderFilled = null;
_this.assets = [];
return _this;
}
LoadScene.prototype.setup = function () {
@ -132,26 +133,32 @@ var LoadScene = /** @class */ (function (_super) {
this.load.image("ui_sidebar_browse", "/public/res/ui/sidebar_browse.png");
this.load.spritesheet("ui_button_sidebar_toggle", "/public/res/ui/button_sidebar_toggle.png", { frameWidth: 30, frameHeight: 18 });
this.load.image("shader_light_mask", "/public/res/shader/light_mask.png");
var assets = JSON.parse(this.cache.text.get("assets"));
this.assets = JSON.parse(this.cache.text.get("assets"));
try {
for (var assets_1 = __values(assets), assets_1_1 = assets_1.next(); !assets_1_1.done; assets_1_1 = assets_1.next()) {
var asset = assets_1_1.value;
for (var _b = __values(this.assets), _c = _b.next(); !_c.done; _c = _b.next()) {
var asset = _c.value;
var key = (asset.type == AssetType.WALL ? "wall_" :
asset.type == AssetType.GROUND ? "ground_" :
asset.type == AssetType.OVERLAY ? "overlay_" :
asset.type == AssetType.TOKEN ? "token_" : "ERR_")
+ asset.identifier;
asset.key = key;
if (asset.tileSize)
this.load.spritesheet(asset.identifier, asset.path, { frameWidth: asset.tileSize.x, frameHeight: asset.tileSize.y });
this.load.spritesheet(key, asset.path, { frameWidth: asset.tileSize.x, frameHeight: asset.tileSize.y });
else
this.load.image(asset.identifier, asset.path);
this.load.image(key, asset.path);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (assets_1_1 && !assets_1_1.done && (_a = assets_1.return)) _a.call(assets_1);
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
};
LoadScene.prototype.create = function () {
this.game.scene.start('MapScene', JSON.parse(this.cache.text.get("assets")));
this.game.scene.start('MapScene', this.assets);
this.cache.text.remove("assets");
this.game.scene.stop('LoadScene');
this.game.scene.swapPosition('MapScene', 'LoadScene');
@ -1059,7 +1066,7 @@ var UIView = /** @class */ (function () {
try {
for (var _b = __values(assets.filter(function (a) { return a.type == AssetType.TOKEN; })), _c = _b.next(); !_c.done; _c = _b.next()) {
var token = _c.value;
this.tokenSidebar.addToken(token.identifier);
this.tokenSidebar.addToken(token.key);
}
}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
@ -1587,7 +1594,7 @@ var UITileSidebar = /** @class */ (function (_super) {
try {
for (var _d = __values(assets.filter(function (a) { return a.type == AssetType.WALL; })), _e = _d.next(); !_e.done; _e = _d.next()) {
var tileset = _e.value;
_this.addWall(tileset.identifier);
_this.addWall(tileset.key);
}
}
catch (e_12_1) { e_12 = { error: e_12_1 }; }
@ -1606,7 +1613,7 @@ var UITileSidebar = /** @class */ (function (_super) {
try {
for (var _f = __values(assets.filter(function (a) { return a.type == AssetType.GROUND; })), _g = _f.next(); !_g.done; _g = _f.next()) {
var tileset = _g.value;
_this.addGround(tileset.identifier);
_this.addGround(tileset.key);
}
}
catch (e_13_1) { e_13 = { error: e_13_1 }; }
@ -1625,7 +1632,7 @@ var UITileSidebar = /** @class */ (function (_super) {
try {
for (var _h = __values(assets.filter(function (a) { return a.type == AssetType.OVERLAY; })), _j = _h.next(); !_j.done; _j = _h.next()) {
var tileset = _j.value;
_this.addOverlay(tileset.identifier);
_this.addOverlay(tileset.key);
}
}
catch (e_14_1) { e_14 = { error: e_14_1 }; }
@ -1893,11 +1900,11 @@ var ArchitectMode = /** @class */ (function () {
this.placeMode = "brush";
}
// Push history to HistoryManager
if (this.scene.i.mouseLeftDown() && !this.pointerDown) {
if (this.scene.i.mouseDown() && !this.pointerDown) {
this.pointerDown = true;
this.pointerPrimaryDown = this.scene.i.mouseLeftDown();
}
else if (!this.scene.i.mouseLeftDown() && this.pointerDown) {
else if (!this.scene.i.mouseDown() && this.pointerDown) {
if (this.manipulated.length != 0) {
try {
for (var _b = __values(this.manipulated), _c = _b.next(); !_c.done; _c = _b.next()) {
@ -3410,7 +3417,7 @@ var TilesetManager = /** @class */ (function () {
try {
for (var _d = __values(assets.filter(function (a) { return a.type == AssetType.WALL; })), _e = _d.next(); !_e.done; _e = _d.next()) {
var tileset = _e.value;
this.addTileset(tileset.identifier, 1 /* wall */);
this.addTileset(tileset.key, 1 /* wall */);
}
}
catch (e_29_1) { e_29 = { error: e_29_1 }; }
@ -3423,7 +3430,7 @@ var TilesetManager = /** @class */ (function () {
try {
for (var _f = __values(assets.filter(function (a) { return a.type == AssetType.GROUND; })), _g = _f.next(); !_g.done; _g = _f.next()) {
var tileset = _g.value;
this.addTileset(tileset.identifier, 0 /* floor */);
this.addTileset(tileset.key, 0 /* floor */);
}
}
catch (e_30_1) { e_30 = { error: e_30_1 }; }
@ -3436,7 +3443,7 @@ var TilesetManager = /** @class */ (function () {
try {
for (var _h = __values(assets.filter(function (a) { return a.type == AssetType.OVERLAY; })), _j = _h.next(); !_j.done; _j = _h.next()) {
var tileset = _j.value;
this.addTileset(tileset.identifier, 2 /* overlay */);
this.addTileset(tileset.key, 2 /* overlay */);
}
}
catch (e_31_1) { e_31 = { error: e_31_1 }; }

0
public/editor/socket.js Normal file → Executable file
View File

0
public/lib/phaser.min.js vendored Normal file → Executable file
View File

0
public/res/aesymatt.ttf Normal file → Executable file
View File

0
public/res/cursor.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 191 B

0
public/res/dice.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

0
public/res/favicon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
public/res/grid_tile.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 163 B

0
public/res/loader/kobold_loader_unfilled.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 984 B

After

Width:  |  Height:  |  Size: 984 B

0
public/res/loader/loader_filled.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
public/res/loader/loader_patching.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

0
public/res/loader/loader_unfilled.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 986 B

After

Width:  |  Height:  |  Size: 986 B

0
public/res/loader/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
public/res/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 319 KiB

After

Width:  |  Height:  |  Size: 319 KiB

0
public/res/shader/light_mask.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
public/res/shader/outline.glsl Normal file → Executable file
View File

0
public/res/tileset/0.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

0
public/res/tileset/0.xcf Normal file → Executable file
View File

0
public/res/tileset/floor_grass.attrib Normal file → Executable file
View File

0
public/res/tileset/ground_cave.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

0
public/res/tileset/ground_cave.xcf Normal file → Executable file
View File

0
public/res/tileset/ground_grass.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

0
public/res/tileset/ground_grass.xcf Normal file → Executable file
View File

0
public/res/tileset/ground_wood.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

0
public/res/tileset/ground_wood.xcf Normal file → Executable file
View File

0
public/res/tileset/overlay_hole.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
public/res/tileset/overlay_hole.xcf Normal file → Executable file
View File

0
public/res/tileset/overlay_water.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
public/res/tileset/overlay_water.xcf Normal file → Executable file
View File

0
public/res/tileset/wall_dungeon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

0
public/res/tileset/wall_dungeon.xcf Normal file → Executable file
View File

0
public/res/tileset/wall_shadow.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

0
public/res/tileset/wall_shadow.xcf Normal file → Executable file
View File

0
public/res/tileset/wall_wood.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

0
public/res/tileset/wall_wood.xcf Normal file → Executable file
View File

0
public/res/token/armor_1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
public/res/token/baby_amethyst_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 854 B

After

Width:  |  Height:  |  Size: 854 B

0
public/res/token/baby_black_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 856 B

After

Width:  |  Height:  |  Size: 856 B

0
public/res/token/baby_blue_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 872 B

After

Width:  |  Height:  |  Size: 872 B

0
public/res/token/baby_gold_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 872 B

After

Width:  |  Height:  |  Size: 872 B

0
public/res/token/baby_green_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 875 B

0
public/res/token/baby_red_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 875 B

0
public/res/token/baby_tin_dragon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 810 B

0
public/res/token/blue_slime.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

0
public/res/token/bones.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 396 B

0
public/res/token/cadin_1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
public/res/token/cadin_2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show More