Skip to content

Commit

Permalink
feat(map): add advanced shadows to system maps
Browse files Browse the repository at this point in the history
also organized system maps utils
  • Loading branch information
MichaelMakesGames committed Oct 31, 2024
1 parent f91ab82 commit a052aa4
Show file tree
Hide file tree
Showing 15 changed files with 818 additions and 493 deletions.
62 changes: 61 additions & 1 deletion package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"utility-types": "^3.11.0",
"vite": "^5.2.8"
"vite": "^5.2.8",
"vite-plugin-static-copy": "^2.0.0"
},
"dependencies": {
"@electron-toolkit/preload": "^3.0.1",
Expand All @@ -93,6 +94,7 @@
"fast-glob": "^3.3.2",
"font-list": "^1.5.1",
"intl-messageformat": "^10.5.11",
"pathkit-wasm": "^1.0.0",
"pixi.js": "^8.1.0",
"platform-paths": "^1.2.2",
"polylabel": "^1.1.0",
Expand Down
43 changes: 43 additions & 0 deletions src/customTypings/pathkit-wasm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// only the types used are implemented
// see https://skia.org/docs/user/modules/pathkit/#api for more
declare module 'pathkit-wasm/bin/pathkit' {
function PathKitInit(): Promise<PathKit>;

export interface PathKit {
NewPath(): SkPath;
FromSVGString(str: string): SkPath;
MakeFromOp(path1: SkPath, path2: SkPath, op: PathOp): SkPath;
PathOp: {
UNION: PathOp;
DIFFERENCE: PathOp;
INTERSECT: PathOp;
XOR: PathOp;
REVERSE_DIFFERENCE: PathOp;
};
}

enum PathOp {
UNION,
DIFFERENCE,
INTERSECT,
XOR,
REVERSE_DIFFERENCE,
}

export interface SkPath {
arc(
x: number,
y: number,
radius: number,
startAngle: number,
endAngle: number,
ccw = false,
): SkPath;
op(path: SkPath, op: PathOp): SkPath;
toSVGString(): string;
delete(): void;
equals(path: SkPath): boolean;
}

export default PathKitInit;
}
2 changes: 1 addition & 1 deletion src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self' https://*.github.com https://discord.gg ipc://*"
content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self' https://*.github.com https://discord.gg ipc://*"
/>
</head>

Expand Down
4 changes: 4 additions & 0 deletions src/renderer/src/intl/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ export default {
systemMapPlanetScale: 'Planet Scale',
systemMapMoonScale: 'Moon Scale',
systemMapPlanetRingColor: 'Planet Ring Color',
systemMapPlanetShadowSelf: 'Planets/Moons Cast Shadows on Self',
systemMapPlanetShadowPlanetarySystem: 'Planets/Moons Cast Shadows on Each Other',
systemMapPlanetShadowRings: 'Planets/Moons Cast Shadows on Rings',
systemMapPlanetShadowOverlap: 'Planet/Moons Shadow Overlap',
systemMapLabelPlanetsFont: 'Planet Name Font',
systemMapLabelPlanetsFontSize: 'Planet Name Font Size',
systemMapLabelPlanetsPosition: 'Planet Name Position',
Expand Down
Loading

0 comments on commit a052aa4

Please sign in to comment.