Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-01k committed Jun 18, 2024
1 parent f4af859 commit 6a59a13
Show file tree
Hide file tree
Showing 12 changed files with 523 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bun.lockb
.DS_Store
*.pem

.env
# debug
npm-debug.log*
yarn-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion components/gamedev/TaskControls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as THREE from 'three';
import { GlobalContext, GlobalContextProvider } from './GlobalContext.jsx'


const TaskControls = ({ stateEnv, setStateEnv }) => {
const TaskControls = () => {
const { state, dispatch } = useContext(GlobalContext);
const { objectMaster } = state;

Expand Down
1 change: 1 addition & 0 deletions components/gamedev/pivotControls/SphereScale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const SphereScale: React.FC<{ direction: THREE.Vector3; axis: 0 | 1 | 2 }
onDrag,
onDragEnd,
userData,
// @ts-ignore
object
} = React.useContext(context)

Expand Down
2 changes: 1 addition & 1 deletion components/gamedev/pivotControls/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type PivotContext = {
export const context = React.createContext<PivotContext>(null!)

const isRef = (object: any): object is React.MutableRefObject<THREE.Object3D> => object && object.current
export const resolveObject = (
export const resolveObject : any = (
object?: THREE.Object3D | React.MutableRefObject<THREE.Object3D>,
fallback?: THREE.Object3D | React.MutableRefObject<THREE.Object3D>
) => (isRef(object) ? object.current : object ? object : fallback ? resolveObject(fallback) : undefined)
67 changes: 0 additions & 67 deletions components/gamedev/saved.jsx

This file was deleted.

222 changes: 222 additions & 0 deletions contracts/DchainGame.json

Large diffs are not rendered by default.

131 changes: 131 additions & 0 deletions contracts/DchainGameFactory.json

Large diffs are not rendered by default.

150 changes: 150 additions & 0 deletions contracts/GamePlayerStatus.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions contracts/contractaddr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"DchainGameFactory": ""
}

3 changes: 3 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
eslint: {
ignoreDuringBuilds: true,
},
};

export default nextConfig;
12 changes: 6 additions & 6 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import Swal from "sweetalert2";
import axios from "axios";
import Image from 'next/image';
import { ethers } from "ethers";
import GameFactory from "../contracts/GameFactory.json";
import ContractAddress from "../contracts/contract-address.json";
import DchainGameFactory from "../contracts/DchainGameFactory.json";
import ContractAddress from "../contracts/contractaddr.json";

import objJSON from "../components/gamedev/objectMaster.json";
import UploadModel from "../components/UploadModel";
Expand Down Expand Up @@ -87,7 +87,7 @@ function Scene() {
const { objectMaster, currentObjectIdentifer, assetMaster } = state;

// Load Object Master
const LoadObjectMaster = (file) => {
const LoadObjectMaster = (file : any) => {
file.map((object) => {
if (object.type === "object") {
const AddAction = {
Expand Down Expand Up @@ -193,7 +193,7 @@ function Scene() {
};

// Function to handle file upload
const handleFileUpload = (event) => {
const handleFileUpload = (event : any) => {
const file = event.target.files[0];
const reader = new FileReader();

Expand Down Expand Up @@ -238,8 +238,8 @@ function Scene() {
});

const factoryContract_ = new ethers.Contract(
ContractAddress.GameFactory,
GameFactory.abi,
ContractAddress.DchainGameFactory,
DchainGameFactory.abi,
signer
);
setFactoryContract(factoryContract_);
Expand Down
3 changes: 3 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ button {
cursor: pointer;
transition: border-color 0.25s;
}

button:hover {
border-color: #646cff;
}

button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
Expand All @@ -134,6 +136,7 @@ a {
color: #646cff;
text-decoration: inherit;
}

a:hover {
color: #535bf2;
}

0 comments on commit 6a59a13

Please sign in to comment.