Skip to content

Commit

Permalink
feat: new residence model
Browse files Browse the repository at this point in the history
  • Loading branch information
Cygnusfear committed Oct 16, 2023
1 parent 3970b8b commit 3319b58
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
Binary file modified packages/client/public/models/facilities.glb
Binary file not shown.
10 changes: 7 additions & 3 deletions packages/client/src/components/ui/colorWheel.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { useState } from "react";
import Wheel from "@uiw/react-color-wheel";
import { ColorResult, hsvaToHex } from "@uiw/color-convert";
import { ColorResult, hexToHsva } from "@uiw/color-convert";
import { useStore } from "@/game/store";
import { getRandom } from "@/lib/utils";
import { palette } from "@/game/utils/palette";

const randomColor = getRandom(palette.buildingSecondary);

function ColorWheel() {
const [hsva, setHsva] = useState({ h: 214, s: 43, v: 90, a: 1 });
const [hex, setHex] = useState(hsvaToHex({ h: 214, s: 43, v: 90, a: 1 }));
const [hsva, setHsva] = useState(hexToHsva(randomColor));
const [hex, setHex] = useState(randomColor);
const {
input: {
cursor: { setCursor },
Expand Down
15 changes: 15 additions & 0 deletions packages/client/src/game/data/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ const EntityData = {
variants: ModelData.scaffold,
tags: [],
},
miner: {
entityTypeId: 105,
name: "Crystal Miner",
blurb: "Needs to be placed next to a Crystal",
description: "",
image: "scaffold.webp",
costs: [
["gravity", 1],
["power", 2],
["LAPU", 350],
],
produces: [],
variants: ModelData.miner,
tags: [],
},
} as { [key: string]: FacilityDataType },
resources: {
crystalFloat: {
Expand Down
14 changes: 14 additions & 0 deletions packages/client/src/game/data/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const ModelData: ModelDataGroupType = {
materials: [],
colors: ["secondary", "primary"],
},
{
name: "Residence00",
nodes: ["CubaMid005", "CubaTop003", "CubaPole003"],
materials: [],
colors: ["secondary", "primary", "primary"],
},
{
name: "Residence02",
nodes: ["CubaMid000", "CubaTop001", "CubaBottom000"],
Expand Down Expand Up @@ -75,6 +81,14 @@ const ModelData: ModelDataGroupType = {
colors: ["secondary", "primary"],
},
],
miner: [
{
name: "Miner000",
nodes: ["Miner000", "Miner001"],
materials: [],
colors: ["secondary", "primary"],
},
],
scaffold: [
{
name: "Scaffold000",
Expand Down

0 comments on commit 3319b58

Please sign in to comment.