gaesup-world 0.0.761 → 0.0.762
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/dist/gaesup/tools/gameboy/GameBoyButton.d.ts +1 -1
- package/dist/gaesup/tools/gameboy/type.d.ts +1 -1
- package/dist/gaesup/tools/gamepad/GamePadButton.d.ts +1 -1
- package/dist/gaesup/tools/gamepad/type.d.ts +1 -1
- package/dist/gaesup/tools/joystick/index.js +2 -1
- package/dist/gaesup/tools/joystick/type.d.ts +1 -1
- package/dist/gaesup/tools/keyBoardToolTip/index.js +14 -3
- package/dist/gaesup/tools/keyBoardToolTip/type.d.ts +2 -1
- package/dist/gaesup/tools/minimap/type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,6 @@ export type gameBoyButtonType = {
|
|
|
4
4
|
tag: "up" | "down" | "left" | "right";
|
|
5
5
|
value: string;
|
|
6
6
|
icon: JSX.Element;
|
|
7
|
-
gameboyButtonStyle: VECssType
|
|
7
|
+
gameboyButtonStyle: Partial<VECssType>;
|
|
8
8
|
};
|
|
9
9
|
export default function GameBoyButton({ tag, value, icon, gameboyButtonStyle, }: gameBoyButtonType): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,5 +2,5 @@ import { VECssType } from "../type.js";
|
|
|
2
2
|
export default function GamePadButton({ value, name, gamepadButtonStyle, }: {
|
|
3
3
|
value: string;
|
|
4
4
|
name: string;
|
|
5
|
-
gamepadButtonStyle: VECssType
|
|
5
|
+
gamepadButtonStyle: Partial<VECssType>;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,5 +2,5 @@ import { VECssType } from "../type";
|
|
|
2
2
|
export type gamepadType = {
|
|
3
3
|
label?: Record<string, string>;
|
|
4
4
|
} & {
|
|
5
|
-
[key in "gamepadButtonStyle" | "gamepadGridStyle" | "gamepadInnerStyle" | "gamepadStyle"]?: VECssType
|
|
5
|
+
[key in "gamepadButtonStyle" | "gamepadGridStyle" | "gamepadInnerStyle" | "gamepadStyle"]?: Partial<VECssType>;
|
|
6
6
|
};
|
|
@@ -98,10 +98,11 @@ export function JoyStick(props) {
|
|
|
98
98
|
var normY = Math.pow((joyStickOrigin.y - Y), 2);
|
|
99
99
|
var currentRadius = Math.sqrt(normX + normY);
|
|
100
100
|
var originRadius = Math.sqrt(Math.pow((width / 2), 2) + Math.pow((height / 2), 2));
|
|
101
|
+
var newAngle = Math.atan2(Y - (bottom - height / 2), X - (left + width / 2));
|
|
101
102
|
setOrigin({
|
|
102
103
|
x: left + width / 2,
|
|
103
104
|
y: bottom - height / 2,
|
|
104
|
-
angle:
|
|
105
|
+
angle: newAngle,
|
|
105
106
|
currentRadius: currentRadius,
|
|
106
107
|
originRadius: originRadius,
|
|
107
108
|
isIn: currentRadius > originRadius / 2,
|
|
@@ -19,5 +19,5 @@ export type joyStickInnerType = {
|
|
|
19
19
|
joyStickOrigin?: joyStickOriginType;
|
|
20
20
|
};
|
|
21
21
|
export type joyStickType = {
|
|
22
|
-
[key in "joyStickBallStyle" | "joyStickStyle" | "joyBallStyle"]?: VECssType
|
|
22
|
+
[key in "joyStickBallStyle" | "joyStickStyle" | "joyBallStyle"]?: Partial<VECssType>;
|
|
23
23
|
};
|
|
@@ -18,16 +18,17 @@ import { KeyBoardAll } from "./constant";
|
|
|
18
18
|
import * as style from "./style.css";
|
|
19
19
|
export function KeyBoardToolTip(props) {
|
|
20
20
|
var worldContext = useContext(GaesupWorldContext);
|
|
21
|
-
var keyBoardMap = props.keyBoardMap, keyBoardToolTipInnerStyle = props.keyBoardToolTipInnerStyle, keyCapStyle = props.keyCapStyle;
|
|
21
|
+
var keyBoardMap = props.keyBoardMap, keyBoardToolTipInnerStyle = props.keyBoardToolTipInnerStyle, selectedKeyCapStyle = props.selectedKeyCapStyle, notSelectedkeyCapStyle = props.notSelectedkeyCapStyle, keyCapStyle = props.keyCapStyle, label = props.label;
|
|
22
22
|
var animations = worldContext.animations, mode = worldContext.mode;
|
|
23
23
|
var keyArray = Object.entries(KeyBoardAll).reduce(function (keyArray, cur) {
|
|
24
24
|
var key = cur[0], value = cur[1];
|
|
25
25
|
var gridRow = value.gridRow, gridColumn = value.gridColumn, name = value.name;
|
|
26
|
+
var labeledName = (label === null || label === void 0 ? void 0 : label[name]) || name;
|
|
26
27
|
var keyBoardItem = {
|
|
27
28
|
code: value.code || key,
|
|
28
29
|
gridRow: gridRow,
|
|
29
30
|
gridColumn: gridColumn,
|
|
30
|
-
name:
|
|
31
|
+
name: labeledName,
|
|
31
32
|
};
|
|
32
33
|
keyArray.push(keyBoardItem);
|
|
33
34
|
return keyArray;
|
|
@@ -41,12 +42,15 @@ export function KeyBoardToolTip(props) {
|
|
|
41
42
|
return (_jsx(_Fragment, { children: mode.controller === "keyboard" && (_jsx("div", { className: style.keyBoardTooInner, style: assignInlineVars(keyBoardToolTipInnerStyle), children: keyArray.map(function (item, key) {
|
|
42
43
|
var background = "rgba(0, 0, 0, 0.1)";
|
|
43
44
|
var boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
|
|
45
|
+
var isSelect = "none";
|
|
44
46
|
if (codeToActionObj[item.code]) {
|
|
45
47
|
if (animations.keyControl[codeToActionObj[item.code]]) {
|
|
48
|
+
isSelect = "select";
|
|
46
49
|
background = "".concat(vars.gradient.green);
|
|
47
50
|
boxShadow = "0 0 10px rgba(99,251,215,1)";
|
|
48
51
|
}
|
|
49
52
|
else {
|
|
53
|
+
isSelect = "notSelect";
|
|
50
54
|
background = "rgba(0, 0, 0, 0.6)";
|
|
51
55
|
boxShadow = "0 0 10px rgba(0, 0, 0, 0.6)";
|
|
52
56
|
}
|
|
@@ -56,6 +60,13 @@ export function KeyBoardToolTip(props) {
|
|
|
56
60
|
animations.keyControl[codeToActionObj[item.code]]) {
|
|
57
61
|
color = "black";
|
|
58
62
|
}
|
|
59
|
-
|
|
63
|
+
var keyStyle = keyCapStyle;
|
|
64
|
+
if (isSelect === "select") {
|
|
65
|
+
keyStyle = __assign({}, selectedKeyCapStyle);
|
|
66
|
+
}
|
|
67
|
+
else if (isSelect === "notSelect") {
|
|
68
|
+
keyStyle = __assign({}, notSelectedkeyCapStyle);
|
|
69
|
+
}
|
|
70
|
+
return (_jsx("div", { className: style.keyCap, style: assignInlineVars(__assign({ background: background, boxShadow: boxShadow, color: color, gridRow: item.gridRow, gridColumn: item.gridColumn }, keyStyle)), children: item.name }, key));
|
|
60
71
|
}) })) }));
|
|
61
72
|
}
|
|
@@ -28,7 +28,8 @@ export type keyBoardLabelType = {
|
|
|
28
28
|
export type keyBoardToolTipType = {
|
|
29
29
|
keyBoardLabel?: keyBoardLabelType;
|
|
30
30
|
keyBoardMap?: keyboardMapItemType[];
|
|
31
|
+
label?: Record<string, string>;
|
|
31
32
|
} & {
|
|
32
|
-
[key in "keyBoardToolTipInnerStyle" | "keyCapStyle"]?: VECssType
|
|
33
|
+
[key in "keyBoardToolTipInnerStyle" | "notSelectedkeyCapStyle" | "selectedKeyCapStyle" | "keyCapStyle"]?: Partial<VECssType>;
|
|
33
34
|
};
|
|
34
35
|
export type keyBoardToolTipPartialType = Partial<keyBoardToolTipType>;
|
|
@@ -11,7 +11,7 @@ export type minimapInnerType = {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export type minimapType = {
|
|
14
|
-
[key in "minimapStyle" | "outerStyle" | "innerStyle" | "textStyle" | "objectStyle" | "avatarStyle" | "directionStyle" | "scaleStyle" | "plusMinusStyle"]?: VECssType
|
|
14
|
+
[key in "minimapStyle" | "outerStyle" | "innerStyle" | "textStyle" | "objectStyle" | "avatarStyle" | "directionStyle" | "scaleStyle" | "plusMinusStyle"]?: Partial<VECssType>;
|
|
15
15
|
} & {
|
|
16
16
|
minScale?: number;
|
|
17
17
|
maxScale?: number;
|