gaesup-world 0.0.652 → 0.0.653
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/index.js +1 -1
- package/dist/gaesup/tools/gameboy/style.css.js +1 -0
- package/dist/gaesup/tools/gamepad/GamePadButton.js +1 -1
- package/dist/gaesup/tools/gamepad/index.js +1 -1
- package/dist/gaesup/tools/index.js +4 -5
- package/dist/gaesup/tools/joystick/index.js +1 -1
- package/dist/gaesup/tools/joystick/style.css.js +12 -10
- package/dist/gaesup/tools/keyBoardToolTip/index.js +3 -14
- package/dist/gaesup/tools/minimap/index.js +6 -4
- package/package.json +1 -1
- package/src/gaesup/tools/gameboy/index.tsx +8 -2
- package/src/gaesup/tools/gameboy/style.css.ts +1 -0
- package/src/gaesup/tools/gamepad/GamePadButton.tsx +1 -1
- package/src/gaesup/tools/gamepad/index.tsx +8 -2
- package/src/gaesup/tools/index.tsx +1 -2
- package/src/gaesup/tools/joystick/index.tsx +4 -1
- package/src/gaesup/tools/joystick/style.css.ts +12 -10
- package/src/gaesup/tools/keyBoardToolTip/index.tsx +15 -12
- package/src/gaesup/tools/minimap/index.tsx +20 -14
- package/tsconfig.json +1 -1
|
@@ -15,7 +15,7 @@ export var GameBoyDirections = [
|
|
|
15
15
|
];
|
|
16
16
|
export default function GameBoy() {
|
|
17
17
|
var _a = useContext(GaesupToolsContext).gameboy, gameboyStyle = _a.gameboyStyle, gameboyInnerStyle = _a.gameboyInnerStyle;
|
|
18
|
-
return (_jsx("div", { className: style.gameBoy,
|
|
18
|
+
return (_jsx("div", { className: style.gameBoy, children: _jsx("div", { className: style.gameBoyInner, children: GameBoyDirections.map(function (item, key) {
|
|
19
19
|
return (_jsx(GameBoyButton, { tag: item.tag, value: item.value, icon: item.icon }, key));
|
|
20
20
|
}) }) }));
|
|
21
21
|
}
|
|
@@ -21,5 +21,5 @@ export default function GamePadButton(_a) {
|
|
|
21
21
|
}), onMouseDown: function () { return onMouseDown(); }, onMouseUp: function () { return onMouseLeave(); }, onMouseLeave: function () { return onMouseLeave(); }, onContextMenu: function (e) {
|
|
22
22
|
e.preventDefault();
|
|
23
23
|
onMouseLeave();
|
|
24
|
-
}, onPointerDown: function () { return onMouseDown(); }, onPointerUp: function () { return onMouseLeave(); },
|
|
24
|
+
}, onPointerDown: function () { return onMouseDown(); }, onPointerUp: function () { return onMouseLeave(); }, children: name }));
|
|
25
25
|
}
|
|
@@ -24,7 +24,7 @@ export default function GamePad() {
|
|
|
24
24
|
.filter(function (item) {
|
|
25
25
|
return !(item.tag === "run" && mode.controller === "joystick");
|
|
26
26
|
});
|
|
27
|
-
return (_jsx("div", { className: style.gamePad,
|
|
27
|
+
return (_jsx("div", { className: style.gamePad, children: _jsx("div", { className: style.gamePadGrid, children: GamePadDirections.map(function (item, key) {
|
|
28
28
|
return (_jsx(GamePadButton, { value: item.value, name: item.name }, key));
|
|
29
29
|
}) }) }));
|
|
30
30
|
}
|
|
@@ -8,7 +8,6 @@ import GamePad from "./gamepad";
|
|
|
8
8
|
import { gamepadDefault } from "./gamepad/default";
|
|
9
9
|
import JoyStick from "./joystick";
|
|
10
10
|
import { joyStickDefault } from "./joystick/default";
|
|
11
|
-
import JumpPoint from "./jumpPoint";
|
|
12
11
|
import KeyBoardToolTip from "./keyBoardToolTip";
|
|
13
12
|
import { keyboardToolTipDefault } from "./keyBoardToolTip/default";
|
|
14
13
|
import MiniMap from "./minimap";
|
|
@@ -36,8 +35,8 @@ export function GaeSupTools(_a) {
|
|
|
36
35
|
tools.gameboy,
|
|
37
36
|
tools.gamepad,
|
|
38
37
|
]);
|
|
39
|
-
return (_jsx(GaesupToolsContext.Provider, { value: gaesupTool.value, children:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
return (_jsx(GaesupToolsContext.Provider, { value: gaesupTool.value, children: _jsx(GaesupToolsDispatchContext.Provider, { value: gaesupTool.dispatch, children: _jsxs("div", { className: style.footer, children: [_jsx("div", { className: style.footerUpper, children: (mode.controller === "joystick" ||
|
|
39
|
+
mode.controller === "gameboy") &&
|
|
40
|
+
gaesupTool.value.gamepad.on && _jsx(GamePad, {}) }), _jsxs("div", { className: style.footerLower, children: [mode.controller === "joystick" && gaesupTool.value.joystick.on && (_jsx(JoyStick, {})), mode.controller === "gameboy" && gaesupTool.value.gameboy.on && (_jsx(GameBoy, {})), mode.controller === "keyboard" &&
|
|
41
|
+
gaesupTool.value.keyboardToolTip.on && _jsx(KeyBoardToolTip, {}), gaesupTool.value.minimap.on && _jsx(MiniMap, {})] })] }) }) }));
|
|
43
42
|
}
|
|
@@ -17,7 +17,7 @@ import useJoyStick from "./default";
|
|
|
17
17
|
import * as style from "./style.css";
|
|
18
18
|
export default function JoyStick() {
|
|
19
19
|
var joyStickStyle = useContext(GaesupToolsContext).joystick.joyStickStyle;
|
|
20
|
-
return (_jsx("div", { className: style.joyStick,
|
|
20
|
+
return (_jsx("div", { className: style.joyStick, children: _jsx(JoyBall, {}) }));
|
|
21
21
|
}
|
|
22
22
|
export function JoyBall() {
|
|
23
23
|
var outerRef = useRef(null);
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { fixed, flex } from "../../../styles/recipe/index.css";
|
|
3
2
|
export var joyStick = style([
|
|
4
|
-
fixed({
|
|
5
|
-
south_east: true,
|
|
6
|
-
}),
|
|
7
|
-
flex({
|
|
8
|
-
column: "7",
|
|
9
|
-
}),
|
|
10
3
|
{
|
|
4
|
+
position: "fixed",
|
|
5
|
+
bottom: "0",
|
|
6
|
+
right: "0",
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
justifyContent: "flex-end",
|
|
10
|
+
alignItems: "flex-start",
|
|
11
|
+
textAlign: "center",
|
|
11
12
|
width: "100%",
|
|
12
13
|
},
|
|
13
14
|
]);
|
|
14
15
|
export var joyStickInner = style([
|
|
15
|
-
flex({
|
|
16
|
-
row: "center",
|
|
17
|
-
}),
|
|
18
16
|
{
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
textAlign: "center",
|
|
19
21
|
margin: "5rem",
|
|
20
22
|
padding: "1rem",
|
|
21
23
|
width: "12rem",
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
14
3
|
import { useContext } from "react";
|
|
@@ -39,7 +28,7 @@ export default function KeyBoardToolTip() {
|
|
|
39
28
|
});
|
|
40
29
|
return maps;
|
|
41
30
|
}, {});
|
|
42
|
-
return (_jsx("div", { className: style.keyBoardToolTip,
|
|
31
|
+
return (_jsx("div", { className: style.keyBoardToolTip, children: _jsx("div", { className: style.keyBoardTooInner, children: keyArray.map(function (item, key) {
|
|
43
32
|
var background = "rgba(0, 0, 0, 0.1)";
|
|
44
33
|
var boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
|
|
45
34
|
if (codeToActionObj[item.code]) {
|
|
@@ -57,12 +46,12 @@ export default function KeyBoardToolTip() {
|
|
|
57
46
|
animations.keyControl[codeToActionObj[item.code]]) {
|
|
58
47
|
color = "black";
|
|
59
48
|
}
|
|
60
|
-
return (_jsx("div", { className: style.keyCap, style:
|
|
49
|
+
return (_jsx("div", { className: style.keyCap, style: assignInlineVars({
|
|
61
50
|
background: background,
|
|
62
51
|
boxShadow: boxShadow,
|
|
63
52
|
color: color,
|
|
64
53
|
gridRow: item.gridRow,
|
|
65
54
|
gridColumn: item.gridColumn,
|
|
66
|
-
})
|
|
55
|
+
}), children: item.name }, key));
|
|
67
56
|
}) }) }));
|
|
68
57
|
}
|
|
@@ -42,16 +42,18 @@ export default function MiniMap() {
|
|
|
42
42
|
else
|
|
43
43
|
setRatio(function (prev) { return prev - 0.1; });
|
|
44
44
|
}, [setRatio, ratio]);
|
|
45
|
-
return (_jsxs("div", { className: style.minimap,
|
|
45
|
+
return (_jsxs("div", { className: style.minimap,
|
|
46
|
+
// style={assignInlineVars(minimap.minimapStyle || {})}
|
|
47
|
+
onWheel: function (e) {
|
|
46
48
|
if (e.deltaY > 0)
|
|
47
49
|
downRatio();
|
|
48
50
|
else
|
|
49
51
|
upRatio();
|
|
50
|
-
}, children: [_jsx("div", { className: style.minimapOuter
|
|
51
|
-
return (_jsx("div", { className: style.minimapObject, style:
|
|
52
|
+
}, children: [_jsx("div", { className: style.minimapOuter }), _jsxs("div", { className: style.minimapInner, children: [Object.values(minimapInner.props).map(function (obj, key) {
|
|
53
|
+
return (_jsx("div", { className: style.minimapObject, style: assignInlineVars({
|
|
52
54
|
width: "".concat(obj.size.x, "rem"),
|
|
53
55
|
height: "".concat(obj.size.z, "rem"),
|
|
54
56
|
transform: "translate(".concat(-obj.center.x + activeState.position.x * ratio, "rem, ").concat(-obj.center.z + activeState.position.z * ratio, "rem)"),
|
|
55
|
-
})
|
|
57
|
+
}), children: _jsx("div", { className: style.text, children: obj.text }) }, key));
|
|
56
58
|
}), _jsx("div", { className: style.avatar, style: minimap.avatarStyle })] })] }));
|
|
57
59
|
}
|
package/package.json
CHANGED
|
@@ -19,8 +19,14 @@ export default function GameBoy() {
|
|
|
19
19
|
gameboy: { gameboyStyle, gameboyInnerStyle },
|
|
20
20
|
} = useContext(GaesupToolsContext);
|
|
21
21
|
return (
|
|
22
|
-
<div
|
|
23
|
-
|
|
22
|
+
<div
|
|
23
|
+
className={style.gameBoy}
|
|
24
|
+
// style={gameboyStyle}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
className={style.gameBoyInner}
|
|
28
|
+
// style={gameboyInnerStyle}
|
|
29
|
+
>
|
|
24
30
|
{GameBoyDirections.map((item: gameBoyButtonType, key: number) => {
|
|
25
31
|
return (
|
|
26
32
|
<GameBoyButton
|
|
@@ -40,8 +40,14 @@ export default function GamePad() {
|
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
<div
|
|
44
|
-
|
|
43
|
+
<div
|
|
44
|
+
className={style.gamePad}
|
|
45
|
+
// style={gamepadStyle}
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
className={style.gamePadGrid}
|
|
49
|
+
// style={gamepadGridStyle}
|
|
50
|
+
>
|
|
45
51
|
{GamePadDirections.map((item: gameBoyDirectionType, key: number) => {
|
|
46
52
|
return (
|
|
47
53
|
<GamePadButton key={key} value={item.value} name={item.name} />
|
|
@@ -7,7 +7,6 @@ import GamePad from "./gamepad";
|
|
|
7
7
|
import { gamepadDefault } from "./gamepad/default";
|
|
8
8
|
import JoyStick from "./joystick";
|
|
9
9
|
import { joyStickDefault } from "./joystick/default";
|
|
10
|
-
import JumpPoint from "./jumpPoint";
|
|
11
10
|
import KeyBoardToolTip from "./keyBoardToolTip";
|
|
12
11
|
import { keyboardToolTipDefault } from "./keyBoardToolTip/default";
|
|
13
12
|
import MiniMap from "./minimap";
|
|
@@ -72,7 +71,7 @@ export function GaeSupTools({
|
|
|
72
71
|
</div>
|
|
73
72
|
</div>
|
|
74
73
|
|
|
75
|
-
<JumpPoint />
|
|
74
|
+
{/* <JumpPoint /> */}
|
|
76
75
|
</GaesupToolsDispatchContext.Provider>
|
|
77
76
|
</GaesupToolsContext.Provider>
|
|
78
77
|
);
|
|
@@ -17,7 +17,10 @@ export default function JoyStick() {
|
|
|
17
17
|
joystick: { joyStickStyle },
|
|
18
18
|
} = useContext(GaesupToolsContext);
|
|
19
19
|
return (
|
|
20
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
className={style.joyStick}
|
|
22
|
+
// style={joyStickStyle}
|
|
23
|
+
>
|
|
21
24
|
<JoyBall />
|
|
22
25
|
</div>
|
|
23
26
|
);
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { fixed, flex } from "../../../styles/recipe/index.css";
|
|
3
2
|
|
|
4
3
|
export const joyStick = style([
|
|
5
|
-
fixed({
|
|
6
|
-
south_east: true,
|
|
7
|
-
}),
|
|
8
|
-
flex({
|
|
9
|
-
column: "7",
|
|
10
|
-
}),
|
|
11
4
|
{
|
|
5
|
+
position: "fixed",
|
|
6
|
+
bottom: "0",
|
|
7
|
+
right: "0",
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
justifyContent: "flex-end",
|
|
11
|
+
alignItems: "flex-start",
|
|
12
|
+
textAlign: "center",
|
|
12
13
|
width: "100%",
|
|
13
14
|
},
|
|
14
15
|
]);
|
|
15
16
|
|
|
16
17
|
export const joyStickInner = style([
|
|
17
|
-
flex({
|
|
18
|
-
row: "center",
|
|
19
|
-
}),
|
|
20
18
|
{
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
textAlign: "center",
|
|
21
23
|
margin: "5rem",
|
|
22
24
|
padding: "1rem",
|
|
23
25
|
width: "12rem",
|
|
@@ -44,8 +44,14 @@ export default function KeyBoardToolTip() {
|
|
|
44
44
|
}, {});
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<div
|
|
48
|
-
|
|
47
|
+
<div
|
|
48
|
+
className={style.keyBoardToolTip}
|
|
49
|
+
// style={keyBoardToolTipStyle}
|
|
50
|
+
>
|
|
51
|
+
<div
|
|
52
|
+
className={style.keyBoardTooInner}
|
|
53
|
+
// style={keyBoardToolTipInnerStyle}
|
|
54
|
+
>
|
|
49
55
|
{keyArray.map((item: keyArrayItemType, key: number) => {
|
|
50
56
|
let background = "rgba(0, 0, 0, 0.1)";
|
|
51
57
|
let boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
|
|
@@ -70,16 +76,13 @@ export default function KeyBoardToolTip() {
|
|
|
70
76
|
return (
|
|
71
77
|
<div
|
|
72
78
|
className={style.keyCap}
|
|
73
|
-
style={{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}),
|
|
81
|
-
...keyCapStyle,
|
|
82
|
-
}}
|
|
79
|
+
style={assignInlineVars({
|
|
80
|
+
background,
|
|
81
|
+
boxShadow,
|
|
82
|
+
color,
|
|
83
|
+
gridRow: item.gridRow,
|
|
84
|
+
gridColumn: item.gridColumn,
|
|
85
|
+
})}
|
|
83
86
|
key={key}
|
|
84
87
|
>
|
|
85
88
|
{item.name}
|
|
@@ -41,31 +41,37 @@ export default function MiniMap() {
|
|
|
41
41
|
return (
|
|
42
42
|
<div
|
|
43
43
|
className={style.minimap}
|
|
44
|
-
style={minimap.minimapStyle || {}}
|
|
44
|
+
// style={assignInlineVars(minimap.minimapStyle || {})}
|
|
45
45
|
onWheel={(e) => {
|
|
46
46
|
if (e.deltaY > 0) downRatio();
|
|
47
47
|
else upRatio();
|
|
48
48
|
}}
|
|
49
49
|
>
|
|
50
|
-
<div
|
|
51
|
-
|
|
50
|
+
<div
|
|
51
|
+
className={style.minimapOuter}
|
|
52
|
+
// style={minimap.objectStyle || {}}
|
|
53
|
+
/>
|
|
54
|
+
<div
|
|
55
|
+
className={style.minimapInner}
|
|
56
|
+
// style={minimap.innerStyle || {}}
|
|
57
|
+
>
|
|
52
58
|
{Object.values(minimapInner.props).map((obj, key) => {
|
|
53
59
|
return (
|
|
54
60
|
<div
|
|
55
61
|
key={key}
|
|
56
62
|
className={style.minimapObject}
|
|
57
|
-
style={{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
...minimap.objectStyle,
|
|
66
|
-
}}
|
|
63
|
+
style={assignInlineVars({
|
|
64
|
+
width: `${obj.size.x}rem`,
|
|
65
|
+
height: `${obj.size.z}rem`,
|
|
66
|
+
transform: `translate(${
|
|
67
|
+
-obj.center.x + activeState.position.x * ratio
|
|
68
|
+
}rem, ${-obj.center.z + activeState.position.z * ratio}rem)`,
|
|
69
|
+
})}
|
|
67
70
|
>
|
|
68
|
-
<div
|
|
71
|
+
<div
|
|
72
|
+
className={style.text}
|
|
73
|
+
// style={minimap.textStyle}
|
|
74
|
+
>
|
|
69
75
|
{obj.text}
|
|
70
76
|
</div>
|
|
71
77
|
</div>
|
package/tsconfig.json
CHANGED