gaesup-world 0.8.13 → 0.8.15

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.
@@ -1,5 +1,5 @@
1
1
  export default function moving(prop) {
2
- var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker;
2
+ var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker, clickerOption = _a.clickerOption;
3
3
  var forward = control.forward, backward = control.backward, leftward = control.leftward, rightward = control.rightward, shift = control.shift, space = control.space;
4
4
  if (mode.controller === "gameboy" || mode.controller === "keyboard") {
5
5
  states.isMoving = forward || backward || leftward || rightward;
@@ -16,7 +16,8 @@ export default function moving(prop) {
16
16
  else if (mode.controller === "clicker") {
17
17
  states.isMoving = clicker.isOn;
18
18
  states.isNotMoving = !clicker.isOn;
19
- states.isRunning = (shift || clicker.isRun) && states.isMoving;
19
+ states.isRunning =
20
+ (shift || clicker.isRun) && states.isMoving && clickerOption.isRun;
20
21
  states.isJumping = space;
21
22
  }
22
23
  }
@@ -3,6 +3,6 @@ import { useContext } from "react";
3
3
  import { GaesupWorldContext } from "../../world/context";
4
4
  export function Clicker(_a) {
5
5
  var onMarker = _a.onMarker, runMarker = _a.runMarker;
6
- var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode;
7
- return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clicker.isRun && runMarker] })) }));
6
+ var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode, clickerOption = _b.clickerOption;
7
+ return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clickerOption.isRun && clicker.isRun && runMarker] })) }));
8
8
  }
@@ -126,6 +126,9 @@ export var gaesupWorldDefault = {
126
126
  callback: {
127
127
  moveTo: null,
128
128
  },
129
+ clickerOption: {
130
+ isRun: true,
131
+ },
129
132
  };
130
133
  export var GaesupWorldContext = createContext(null);
131
134
  export var GaesupWorldDispatchContext = createContext(null);
@@ -17,6 +17,7 @@ export declare function gaesupWorldReducer(props: Partial<gaesupWorldContextType
17
17
  animationState?: import("./type").animationStateType;
18
18
  keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
19
19
  cameraOption?: import("./type").cameraOptionType;
20
+ clickerOption?: import("./type").clickerOptionType;
20
21
  clicker?: import("./type").clickerType;
21
22
  moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
22
23
  rideable?: {
@@ -107,6 +107,9 @@ export type clickerType = {
107
107
  isOn: boolean;
108
108
  isRun: boolean;
109
109
  };
110
+ export type clickerOptionType = {
111
+ isRun: boolean;
112
+ };
110
113
  export type wheelStateType = {
111
114
  position: THREE.Vector3;
112
115
  rotation: THREE.Euler;
@@ -156,6 +159,7 @@ export type gaesupWorldContextType = {
156
159
  animationState: animationStateType;
157
160
  keyBoardMap: keyboardMapType;
158
161
  cameraOption: cameraOptionType;
162
+ clickerOption: clickerOptionType;
159
163
  clicker: clickerType;
160
164
  moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
161
165
  rideable: {
@@ -17,6 +17,7 @@ export default function initGaesupWorld(props: gaesupWorldPropsType): {
17
17
  animationState?: import("../context/type").animationStateType;
18
18
  keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
19
19
  cameraOption?: import("../context/type").cameraOptionType;
20
+ clickerOption?: import("../context/type").clickerOptionType;
20
21
  clicker?: import("../context/type").clickerType;
21
22
  moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
22
23
  rideable?: {
@@ -27,7 +27,8 @@ export default function initGaesupWorld(props) {
27
27
  minimap: gaesupWorldDefault.minimap,
28
28
  joystick: gaesupWorldDefault.joystick,
29
29
  control: gaesupWorldDefault.control,
30
- clicker: Object.assign(gaesupWorldDefault.clicker, props.clicker || {}),
30
+ clicker: gaesupWorldDefault.clicker,
31
+ clickerOption: Object.assign(gaesupWorldDefault.clickerOption, props.clickerOption || {}),
31
32
  animationState: gaesupWorldDefault.animationState,
32
33
  keyBoardMap: Object.assign(gaesupWorldDefault.keyBoardMap, props.keyBoardMap || {}),
33
34
  moveTo: null,
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
2
2
  import * as THREE from "three";
3
3
  import { keyboardMapType } from "../tools/keyBoardToolTip/type";
4
4
  import { dispatchType } from "../utils/type";
5
- import { blockType, cameraOptionType, clickerType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
5
+ import { blockType, cameraOptionType, clickerOptionType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
6
6
  export type gaesupWorldInitType = {
7
7
  value: gaesupWorldContextType;
8
8
  dispatch: dispatchType<gaesupWorldContextType>;
@@ -17,5 +17,5 @@ export type gaesupWorldPropsType = {
17
17
  cameraOption?: cameraOptionType;
18
18
  moveTo?: (position: THREE.Vector3, target: THREE.Vector3) => void;
19
19
  block?: blockType;
20
- clicker?: clickerType;
20
+ clickerOption?: clickerOptionType;
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.8.13",
3
+ "version": "0.8.15",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",