Skip to content

Commit

Permalink
Merge branch 'summary-page'
Browse files Browse the repository at this point in the history
  • Loading branch information
mstop4 committed Jun 22, 2024
2 parents 30e12ea + b4624ee commit a94281b
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
16 changes: 16 additions & 0 deletions pages/summary/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html>
<head lang="en">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Bunny Snek Nether Network Map</title>
<link rel="stylesheet" href="src/style.css" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
</head>
<body>
<p>Hmm..</p>
</body>
</html>
8 changes: 4 additions & 4 deletions src/components/objects/mapObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
Coordinates,
DoorData,
PathData,
PortalData,
BaseData,
RoomData,
isCuboidRoomData,
isCylindricalRoomData,
Expand Down Expand Up @@ -75,7 +75,7 @@ function vectorsToFlatPointsArray(
export function setupInstancedMapObjects(
cuboidRoomsData: RoomData[],
cylindricalRoomsData: RoomData[],
portalsData: PortalData[],
basesData: BaseData[],
doorsData: DoorData[],
) {
// Create rooms
Expand Down Expand Up @@ -106,7 +106,7 @@ export function setupInstancedMapObjects(
portalObjects = new InstancedMesh(
portalGeom,
portalMaterial,
portalsData.length,
basesData.length,
);

// Create doors
Expand Down Expand Up @@ -328,7 +328,7 @@ export function createDoor(doorData: DoorData, id: number) {
return debugDoorLabel;
}

export function createPortal(portalData: PortalData, id: number) {
export function createPortal(portalData: BaseData, id: number) {
const { label, location, hasEnderChest, hasCherryTree } = portalData;

// Create portal marker
Expand Down
16 changes: 8 additions & 8 deletions src/components/setup/mapScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import {
CylindricalRoomData,
DoorData,
PathData,
PortalData,
BaseData,
RoomData,
} from '../../data/data.types';
import { MapBounds } from './mapScene.types';
import { isCuboidRoomData, isCylindricalRoomData } from '../../data/data.types';

import featureConfig from '../../config/features.json';
import pathsJson from '../../data/paths.json';
import roomsJson from '../../data/rooms.json';
import doorsJson from '../../data/doors.json';
import portalsJson from '../../data/portals.json';
import pathsJson from '../../data/nether/paths.json';
import roomsJson from '../../data/nether/rooms.json';
import doorsJson from '../../data/nether/doors.json';
import basesJson from '../../data/bases.json';

const pathsData = pathsJson as PathData[];
const roomsData = roomsJson as RoomData[];
const doorsData = doorsJson as DoorData[];
const portalsData = portalsJson as PortalData[];
const basesData = basesJson as BaseData[];

export let mapScene: Scene;
const mapBounds: MapBounds = {
Expand Down Expand Up @@ -92,7 +92,7 @@ export function setupMapScene() {
} = setupInstancedMapObjects(
cuboidRoomsData,
cylindricalRoomsData,
portalsData,
basesData,
sortedDoorsData,
);
mapScene.add(cuboidRoomObjects);
Expand Down Expand Up @@ -166,7 +166,7 @@ export function setupMapScene() {
return true;
});

initMapObjects<PortalData>(portalsData, (object, id) => {
initMapObjects<BaseData>(basesData, (object, id) => {
const portalLabel = createPortal(object, id);
mapScene.add(portalLabel);

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/data/data.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type DoorData = {
location: Coordinates;
};

export type PortalData = {
export type BaseData = {
label: string;
location: Coordinates;
hasEnderChest: boolean;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 10 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
base: '/mc-3d-path-map/'
base: '/mc-3d-path-map/',
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
summary: resolve(__dirname, 'pages/summary/index.html'),
}
}
}
});

0 comments on commit a94281b

Please sign in to comment.