gaesup-world 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/character.glb +0 -0
- package/dist/gaesup/camera/index.js +0 -16
- package/dist/gaesup/component/active/airplane/index.d.ts +4 -2
- package/dist/gaesup/component/active/airplane/index.js +34 -2
- package/dist/gaesup/component/active/character/index.js +6 -1
- package/dist/gaesup/component/active/vehicle/index.d.ts +3 -2
- package/dist/gaesup/component/active/vehicle/index.js +10 -3
- package/dist/gaesup/component/index.js +2 -2
- package/dist/gaesup/controller/initialize/callback/index.d.ts +6 -1
- package/dist/gaesup/controller/initialize/callback/index.js +59 -61
- package/dist/gaesup/controller/initialize/callback/type.d.ts +3 -4
- package/dist/gaesup/controller/initialize/index.js +17 -3
- package/dist/gaesup/physics/character/index.js +2 -0
- package/dist/gaesup/physics/character/stop.d.ts +2 -0
- package/dist/gaesup/physics/character/stop.js +8 -0
- package/dist/gaesup/physics/check/push.js +1 -1
- package/dist/gaesup/tools/gamePad/index.js +3 -1
- package/dist/gaesup/tools/keyBoardToolTip/index.js +29 -28
- package/dist/gaesup/world/context/type.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/grass_box.glb +0 -0
- package/package.json +1 -1
- package//341/204/206/341/205/256/341/204/214/341/205/246 3.png +0 -0
package/character.glb
ADDED
|
Binary file
|
|
@@ -29,22 +29,6 @@ export default function Camera(_a) {
|
|
|
29
29
|
var cameraRef = useRef();
|
|
30
30
|
var intersectObjectMap = useMemo(function () { return ({}); }, []);
|
|
31
31
|
var cameraProp = __assign(__assign({}, prop), { control: control, controllerContext: controllerContext, worldContext: worldContext, intersectObjectMap: intersectObjectMap });
|
|
32
|
-
// const getMeshs = (object: THREE.Object3D) => {
|
|
33
|
-
// if (object.userData && object.userData.intangible) return;
|
|
34
|
-
// if (
|
|
35
|
-
// object instanceof THREE.Mesh &&
|
|
36
|
-
// object.geometry.type !== "InstancedBufferGeometry"
|
|
37
|
-
// ) {
|
|
38
|
-
// intersectObjectMap[object.uuid] = object;
|
|
39
|
-
// }
|
|
40
|
-
// object.children.forEach((child) => {
|
|
41
|
-
// getMeshs(child);
|
|
42
|
-
// });
|
|
43
|
-
// };
|
|
44
|
-
//
|
|
45
|
-
// useEffect(() => {
|
|
46
|
-
// scene.children.forEach((child) => getMeshs(child));
|
|
47
|
-
// }, []);
|
|
48
32
|
var position = useMemo(function () { return camera.position; }, []);
|
|
49
33
|
var dir = useMemo(function () { return vec3(); }, []);
|
|
50
34
|
cameraProp.cameraRay.rayCast = new THREE.Raycaster(cameraProp.cameraRay.origin, cameraProp.cameraRay.dir, 0, -cameraOption.maxDistance);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { refsType } from "../../../controller/type";
|
|
2
|
+
import { controllerInnerType, groundRayType, refsType } from "../../../controller/type";
|
|
3
3
|
import { urlsType } from "../../../world/context/type";
|
|
4
|
-
export declare function AirplaneRef({ children, enableRiding, isRiderOn, offset, refs, urls, }: {
|
|
4
|
+
export declare function AirplaneRef({ children, props, groundRay, enableRiding, isRiderOn, offset, refs, urls, }: {
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
props: controllerInnerType;
|
|
7
|
+
groundRay: groundRayType;
|
|
6
8
|
enableRiding?: boolean;
|
|
7
9
|
isRiderOn?: boolean;
|
|
8
10
|
offset?: THREE.Vector3;
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { vec3 } from "@react-three/rapier";
|
|
3
|
+
import playActions, { subscribeActions } from "../../../animation/actions";
|
|
4
|
+
import initCallback from "../../../controller/initialize/callback";
|
|
5
|
+
import { useGltfAndSize } from "../../../hooks/useGaesupGltf";
|
|
2
6
|
import { AirplaneInnerRef } from "../../inner/airplane";
|
|
7
|
+
import { setGroundRay } from "../../inner/common/setGroundRay";
|
|
3
8
|
export function AirplaneRef(_a) {
|
|
4
|
-
var children = _a.children, enableRiding = _a.enableRiding, isRiderOn = _a.isRiderOn, offset = _a.offset, refs = _a.refs, urls = _a.urls;
|
|
5
|
-
|
|
9
|
+
var children = _a.children, props = _a.props, groundRay = _a.groundRay, enableRiding = _a.enableRiding, isRiderOn = _a.isRiderOn, offset = _a.offset, refs = _a.refs, urls = _a.urls;
|
|
10
|
+
var colliderRef = refs.colliderRef;
|
|
11
|
+
var _b = useGltfAndSize({ url: urls.vehicleUrl }), size = _b.size, gltf = _b.gltf;
|
|
12
|
+
groundRay.offset = vec3({
|
|
13
|
+
x: 0,
|
|
14
|
+
y: size.y * 5,
|
|
15
|
+
z: 0,
|
|
16
|
+
});
|
|
17
|
+
setGroundRay({
|
|
18
|
+
groundRay: groundRay,
|
|
19
|
+
length: size.y * 5,
|
|
20
|
+
colliderRef: colliderRef,
|
|
21
|
+
});
|
|
22
|
+
var animationResult = subscribeActions({
|
|
23
|
+
type: "airplane",
|
|
24
|
+
groundRay: groundRay,
|
|
25
|
+
animations: gltf.animations,
|
|
26
|
+
}).animationResult;
|
|
27
|
+
var currentAnimation = playActions({
|
|
28
|
+
type: "airplane",
|
|
29
|
+
animationResult: animationResult,
|
|
30
|
+
}).currentAnimation;
|
|
31
|
+
// callback
|
|
32
|
+
initCallback({
|
|
33
|
+
props: props,
|
|
34
|
+
animationResult: animationResult,
|
|
35
|
+
type: "airplane",
|
|
36
|
+
});
|
|
37
|
+
return (_jsx(AirplaneInnerRef, { refs: refs, urls: urls, isRiderOn: isRiderOn, enableRiding: enableRiding, offset: offset, currentAnimation: currentAnimation, children: children }));
|
|
6
38
|
}
|
|
@@ -7,7 +7,6 @@ import { CharacterInnerRef, calcCharacterColliderProps, } from "../../inner/char
|
|
|
7
7
|
import { setGroundRay } from "../../inner/common/setGroundRay";
|
|
8
8
|
export function CharacterRef(_a) {
|
|
9
9
|
var props = _a.props, refs = _a.refs, urls = _a.urls;
|
|
10
|
-
initCallback(props, "character");
|
|
11
10
|
var colliderRef = refs.colliderRef;
|
|
12
11
|
var _b = useGltfAndSize({ url: urls.characterUrl }), size = _b.size, gltf = _b.gltf;
|
|
13
12
|
var collider = calcCharacterColliderProps(size);
|
|
@@ -30,5 +29,11 @@ export function CharacterRef(_a) {
|
|
|
30
29
|
type: "character",
|
|
31
30
|
animationResult: animationResult,
|
|
32
31
|
}), animationRef = _c.animationRef, currentAnimation = _c.currentAnimation;
|
|
32
|
+
// callback
|
|
33
|
+
initCallback({
|
|
34
|
+
props: props,
|
|
35
|
+
animationResult: animationResult,
|
|
36
|
+
type: "character",
|
|
37
|
+
});
|
|
33
38
|
return (_jsx(CharacterInnerRef, { animationRef: animationRef, refs: refs, urls: urls, currentAnimation: currentAnimation, children: props.children }));
|
|
34
39
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { groundRayType, refsType } from "../../../controller/type";
|
|
2
|
+
import { controllerInnerType, groundRayType, refsType } from "../../../controller/type";
|
|
3
3
|
import { urlsType } from "../../../world/context/type";
|
|
4
|
-
export declare function VehicleRef({ children, groundRay, enableRiding, isRiderOn, offset, refs, urls, }: {
|
|
4
|
+
export declare function VehicleRef({ children, props, groundRay, enableRiding, isRiderOn, offset, refs, urls, }: {
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
props: controllerInnerType;
|
|
6
7
|
groundRay: groundRayType;
|
|
7
8
|
enableRiding?: boolean;
|
|
8
9
|
isRiderOn?: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { vec3 } from "@react-three/rapier";
|
|
3
3
|
import playActions, { subscribeActions } from "../../../animation/actions";
|
|
4
|
+
import initCallback from "../../../controller/initialize/callback";
|
|
4
5
|
import { useGltfAndSize } from "../../../hooks/useGaesupGltf";
|
|
5
6
|
import { setGroundRay } from "../../inner/common/setGroundRay";
|
|
6
7
|
import { VehicleInnerRef } from "../../inner/vehicle";
|
|
7
8
|
export function VehicleRef(_a) {
|
|
8
|
-
var children = _a.children, groundRay = _a.groundRay, enableRiding = _a.enableRiding, isRiderOn = _a.isRiderOn, offset = _a.offset, refs = _a.refs, urls = _a.urls;
|
|
9
|
+
var children = _a.children, props = _a.props, groundRay = _a.groundRay, enableRiding = _a.enableRiding, isRiderOn = _a.isRiderOn, offset = _a.offset, refs = _a.refs, urls = _a.urls;
|
|
9
10
|
var colliderRef = refs.colliderRef;
|
|
10
11
|
var _b = useGltfAndSize({ url: urls.vehicleUrl }), size = _b.size, gltf = _b.gltf;
|
|
11
12
|
groundRay.offset = vec3({
|
|
@@ -23,9 +24,15 @@ export function VehicleRef(_a) {
|
|
|
23
24
|
groundRay: groundRay,
|
|
24
25
|
animations: gltf.animations,
|
|
25
26
|
}).animationResult;
|
|
26
|
-
var
|
|
27
|
+
var currentAnimation = playActions({
|
|
27
28
|
type: "vehicle",
|
|
28
29
|
animationResult: animationResult,
|
|
29
|
-
})
|
|
30
|
+
}).currentAnimation;
|
|
31
|
+
// callback
|
|
32
|
+
initCallback({
|
|
33
|
+
props: props,
|
|
34
|
+
animationResult: animationResult,
|
|
35
|
+
type: "vehicle",
|
|
36
|
+
});
|
|
30
37
|
return (_jsx(VehicleInnerRef, { refs: refs, urls: urls, isRiderOn: isRiderOn, enableRiding: enableRiding, offset: offset, currentAnimation: currentAnimation, children: children }));
|
|
31
38
|
}
|
|
@@ -11,9 +11,9 @@ export function GaesupComponent(_a) {
|
|
|
11
11
|
var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable;
|
|
12
12
|
var enableRiding = states.enableRiding, isRiderOn = states.isRiderOn, rideableId = states.rideableId;
|
|
13
13
|
calculation(props);
|
|
14
|
-
return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), mode.type === "vehicle" && (_jsx(VehicleRef, { groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
14
|
+
return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), mode.type === "vehicle" && (_jsx(VehicleRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
15
15
|
? rideable[rideableId].offset
|
|
16
|
-
: vec3(), children: props.children })), mode.type === "airplane" && (_jsx(AirplaneRef, { refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
16
|
+
: vec3(), children: props.children })), mode.type === "airplane" && (_jsx(AirplaneRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
17
17
|
? rideable[rideableId].offset
|
|
18
18
|
: vec3(), children: props.children }))] }));
|
|
19
19
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import { Api } from "../../../animation/actions";
|
|
1
2
|
import { controllerInnerType } from "../../type";
|
|
2
|
-
export default function initCallback(props
|
|
3
|
+
export default function initCallback({ props, animationResult, type, }: {
|
|
4
|
+
props: controllerInnerType;
|
|
5
|
+
animationResult: Api<THREE.AnimationClip>;
|
|
6
|
+
type: "character" | "vehicle" | "airplane";
|
|
7
|
+
}): void;
|
|
@@ -1,62 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// }
|
|
61
|
-
// });
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { useFrame } from "@react-three/fiber";
|
|
13
|
+
import { useContext, useEffect } from "react";
|
|
14
|
+
import { useGaesupAnimation } from "../../../hooks/useGaesupAnimation";
|
|
15
|
+
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../../world/context";
|
|
16
|
+
export default function initCallback(_a) {
|
|
17
|
+
var props = _a.props, animationResult = _a.animationResult, type = _a.type;
|
|
18
|
+
var actions = animationResult.actions;
|
|
19
|
+
var animationState = useContext(GaesupWorldContext).animationState;
|
|
20
|
+
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
21
|
+
var store = useGaesupAnimation({ type: type }).store;
|
|
22
|
+
var _b = useContext(GaesupWorldContext), activeState = _b.activeState, states = _b.states, control = _b.control;
|
|
23
|
+
var subscribe = useGaesupAnimation({ type: type }).subscribe;
|
|
24
|
+
var playAnimation = function (tag, key) {
|
|
25
|
+
if (!(key in control))
|
|
26
|
+
return;
|
|
27
|
+
if (control[key]) {
|
|
28
|
+
animationState[type].current = tag;
|
|
29
|
+
var currentAnimation = store[tag];
|
|
30
|
+
if (currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.action) {
|
|
31
|
+
currentAnimation.action();
|
|
32
|
+
}
|
|
33
|
+
dispatch({
|
|
34
|
+
type: "update",
|
|
35
|
+
payload: {
|
|
36
|
+
animationState: __assign({}, animationState),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var controllerProp = __assign(__assign({}, props), { activeState: activeState, control: control, states: states, subscribe: subscribe });
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
if (props.onReady) {
|
|
44
|
+
props.onReady(controllerProp);
|
|
45
|
+
}
|
|
46
|
+
return function () {
|
|
47
|
+
if (props.onDestory) {
|
|
48
|
+
props.onDestory(controllerProp);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
useFrame(function (prop) {
|
|
53
|
+
if (props.onFrame) {
|
|
54
|
+
props.onFrame(__assign(__assign({}, controllerProp), prop));
|
|
55
|
+
}
|
|
56
|
+
if (props.onAnimate) {
|
|
57
|
+
props.onAnimate(__assign(__assign(__assign({}, controllerProp), prop), { actions: actions, animationState: animationState, playAnimation: playAnimation }));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
62
60
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { RootState } from "@react-three/fiber";
|
|
2
2
|
import { cameraRayType } from "../../../camera/type";
|
|
3
|
-
import { activeStateType, animationAtomType,
|
|
4
|
-
import { actionsType, groundRayType
|
|
3
|
+
import { activeStateType, animationAtomType, animationStateType, keyControlType, statesType } from "../../../world/context/type";
|
|
4
|
+
import { actionsType, groundRayType } from "../../type";
|
|
5
5
|
export type callbackPropType = {
|
|
6
6
|
activeState: activeStateType;
|
|
7
7
|
states: statesType;
|
|
8
|
-
slopeRay: slopeRayType;
|
|
9
8
|
groundRay: groundRayType;
|
|
10
9
|
cameraRay: cameraRayType;
|
|
11
10
|
control: keyControlType;
|
|
@@ -16,7 +15,7 @@ export type onAnimatePropType = onFramePropType & {
|
|
|
16
15
|
actions: {
|
|
17
16
|
[x: string]: THREE.AnimationAction | null;
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
animationState: animationStateType;
|
|
20
19
|
playAnimation: (tag: keyof actionsType, key: string) => void;
|
|
21
20
|
};
|
|
22
21
|
export type callbackType = {
|
|
@@ -23,12 +23,26 @@ export default function initControllerProps(_a) {
|
|
|
23
23
|
var keyControl = getKeys();
|
|
24
24
|
useEffect(function () {
|
|
25
25
|
if (context && keyControl && context.control) {
|
|
26
|
+
// 컨트롤 정하기
|
|
27
|
+
var newControl = {};
|
|
28
|
+
if (context.mode.controller === "keyboard") {
|
|
29
|
+
newControl = __assign({}, keyControl);
|
|
30
|
+
}
|
|
31
|
+
else if (context.mode.controller === "clicker") {
|
|
32
|
+
if (context.mode.isButton) {
|
|
33
|
+
newControl = __assign({}, context.control);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
newControl = __assign({}, keyControl);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
newControl = __assign({}, context.control);
|
|
41
|
+
}
|
|
26
42
|
dispatch({
|
|
27
43
|
type: "update",
|
|
28
44
|
payload: {
|
|
29
|
-
control: __assign({},
|
|
30
|
-
? keyControl
|
|
31
|
-
: context.control)),
|
|
45
|
+
control: __assign({}, newControl),
|
|
32
46
|
},
|
|
33
47
|
});
|
|
34
48
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import direction from "./direction";
|
|
2
2
|
import impulse from "./impulse";
|
|
3
3
|
import innerCalc from "./innerCalc";
|
|
4
|
+
import stop from "./stop";
|
|
4
5
|
export default function characterCalculation(calcProp) {
|
|
5
6
|
direction(calcProp);
|
|
6
7
|
impulse(calcProp);
|
|
7
8
|
innerCalc(calcProp);
|
|
9
|
+
stop(calcProp);
|
|
8
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default function push(prop) {
|
|
2
|
-
var _a = prop.worldContext, states = _a.states,
|
|
2
|
+
var _a = prop.worldContext, states = _a.states, control = _a.control;
|
|
3
3
|
Object.keys(control).forEach(function (key) {
|
|
4
4
|
states.isPush[key] = control[key];
|
|
5
5
|
});
|
|
@@ -26,7 +26,9 @@ export function GamePad(props) {
|
|
|
26
26
|
.filter(function (item) {
|
|
27
27
|
return !(item.tag === "run" && mode.controller === "joystick");
|
|
28
28
|
});
|
|
29
|
-
return (_jsx(_Fragment, { children: (mode.controller === "joystick" ||
|
|
29
|
+
return (_jsx(_Fragment, { children: (mode.controller === "joystick" ||
|
|
30
|
+
mode.controller === "gameboy" ||
|
|
31
|
+
mode.controller === "clicker") && (_jsx("div", { className: "gamePad", style: gamePadStyle, children: GamePadDirections.map(function (item, key) {
|
|
30
32
|
return (_jsx(GamePadButton, { value: item.value, name: item.name, gamePadButtonStyle: gamePadButtonStyle }, key));
|
|
31
33
|
}) })) }));
|
|
32
34
|
}
|
|
@@ -37,34 +37,35 @@ export function KeyBoardToolTip(props) {
|
|
|
37
37
|
});
|
|
38
38
|
return maps;
|
|
39
39
|
}, {});
|
|
40
|
-
return (_jsx(_Fragment, { children: mode.controller === "keyboard"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
return (_jsx(_Fragment, { children: mode.controller === "keyboard" ||
|
|
41
|
+
(mode.controller === "clicker" && !mode.isButton && (_jsx("div", { className: "keyBoardToolInner", style: keyBoardToolTipInnerStyle, children: keyArray.map(function (item, key) {
|
|
42
|
+
var background = "rgba(0, 0, 0, 0.1)";
|
|
43
|
+
var boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
|
|
44
|
+
var isSelect = "none";
|
|
45
|
+
if (codeToActionObj[item.code]) {
|
|
46
|
+
if (control[codeToActionObj[item.code]]) {
|
|
47
|
+
isSelect = "select";
|
|
48
|
+
background = "linear-gradient( 68.4deg, rgba(99,251,215,1) -0.4%, rgba(5,222,250,1) 100.2% )";
|
|
49
|
+
boxShadow = "0 0 10px rgba(99,251,215,1)";
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
isSelect = "notSelect";
|
|
53
|
+
background = "rgba(0, 0, 0, 0.6)";
|
|
54
|
+
boxShadow = "0 0 10px rgba(0, 0, 0, 0.6)";
|
|
55
|
+
}
|
|
49
56
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
var color = "white";
|
|
58
|
+
if (codeToActionObj[item.code] &&
|
|
59
|
+
control[codeToActionObj[item.code]]) {
|
|
60
|
+
color = "black";
|
|
54
61
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
else if (isSelect === "notSelect") {
|
|
66
|
-
keyStyle = __assign({}, notSelectedkeyCapStyle);
|
|
67
|
-
}
|
|
68
|
-
return (_jsx("div", { className: "keyCap", style: __assign({ background: background, boxShadow: boxShadow, color: color, gridRow: item.gridRow, gridColumn: item.gridColumn }, keyStyle), children: item.name }, key));
|
|
69
|
-
}) })) }));
|
|
62
|
+
var keyStyle = keyCapStyle;
|
|
63
|
+
if (isSelect === "select") {
|
|
64
|
+
keyStyle = __assign({}, selectedKeyCapStyle);
|
|
65
|
+
}
|
|
66
|
+
else if (isSelect === "notSelect") {
|
|
67
|
+
keyStyle = __assign({}, notSelectedkeyCapStyle);
|
|
68
|
+
}
|
|
69
|
+
return (_jsx("div", { className: "keyCap", style: __assign({ background: background, boxShadow: boxShadow, color: color, gridRow: item.gridRow, gridColumn: item.gridColumn }, keyStyle), children: item.name }, key));
|
|
70
|
+
}) }))) }));
|
|
70
71
|
}
|
|
@@ -82,6 +82,7 @@ export type modeType = {
|
|
|
82
82
|
type?: "character" | "vehicle" | "airplane";
|
|
83
83
|
controller?: "gameboy" | "keyboard" | "joystick" | "clicker";
|
|
84
84
|
control?: "normal" | "orbit";
|
|
85
|
+
isButton?: boolean;
|
|
85
86
|
};
|
|
86
87
|
export type activeStateType = {
|
|
87
88
|
position: THREE.Vector3;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
|
14
14
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
15
15
|
export { Rideable } from "./gaesup/tools/rideable";
|
|
16
16
|
export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
17
|
+
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
17
18
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
18
19
|
export { GaesupWorld } from "./gaesup/world";
|
|
19
20
|
export { useFocus } from "./gaesup/hooks/useFocus";
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
|
14
14
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
15
15
|
export { Rideable } from "./gaesup/tools/rideable";
|
|
16
16
|
export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
17
|
+
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
17
18
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
18
19
|
export { GaesupWorld } from "./gaesup/world";
|
|
19
20
|
export { useFocus } from "./gaesup/hooks/useFocus";
|
package/grass_box.glb
ADDED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|