-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish create default pet config, read app configs from user config dir.
- Loading branch information
Showing
15 changed files
with
202 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,6 @@ | |
"all": false, | ||
"open": true | ||
}, | ||
"window": { | ||
"startDragging": true | ||
}, | ||
"fs": { | ||
"all": true, | ||
"scope": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export type PetState = { | ||
imageSrc: string; | ||
framesMax: number; | ||
stateHold: number; | ||
framesHold: number; | ||
image?: HTMLImageElement; | ||
}; | ||
|
||
export type States = { | ||
[key: string]: PetState | undefined; | ||
} | ||
|
||
export type CurrentPetState = { | ||
state: string; | ||
index?: number; | ||
stateHold: number; | ||
}; | ||
|
||
export interface PetParams { | ||
position: { x: number; y: number }; | ||
name: string; | ||
currentState: CurrentPetState; | ||
velocity: { x: number; y: number }; | ||
offset: { x: number; y: number }; | ||
scale?: number; | ||
framesMax?: number; | ||
framesCurrent?: number; | ||
framesElapsed?: number; | ||
framesHold?: number; | ||
states: States; | ||
walkSpeed?: number; | ||
runSpeed?: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// credit: https://github.com/lencx/ChatGPT/blob/main/src/hooks/useInit.ts | ||
import { useRef, useEffect } from 'react'; | ||
|
||
// fix: Two interface requests will be made in development mode | ||
export default function useInit(callback: () => void) { | ||
const isInit = useRef(true); | ||
useEffect(() => { | ||
if (isInit.current) { | ||
callback(); | ||
isInit.current = false; | ||
} | ||
}); | ||
} |
Oops, something went wrong.