@rpgjs/client 5.0.0-beta.2 → 5.0.0-beta.20
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/CHANGELOG.md +123 -0
- package/dist/Game/AnimationManager.d.ts +2 -1
- package/dist/Game/AnimationManager.js +21 -9
- package/dist/Game/AnimationManager.js.map +1 -1
- package/dist/Game/AnimationManager.spec.d.ts +1 -0
- package/dist/Game/ClientVisuals.d.ts +61 -0
- package/dist/Game/ClientVisuals.js +96 -0
- package/dist/Game/ClientVisuals.js.map +1 -0
- package/dist/Game/ClientVisuals.spec.d.ts +1 -0
- package/dist/Game/Event.js.map +1 -1
- package/dist/Game/EventComponentResolver.d.ts +16 -0
- package/dist/Game/EventComponentResolver.js +52 -0
- package/dist/Game/EventComponentResolver.js.map +1 -0
- package/dist/Game/EventComponentResolver.spec.d.ts +1 -0
- package/dist/Game/Map.d.ts +9 -1
- package/dist/Game/Map.js +83 -5
- package/dist/Game/Map.js.map +1 -1
- package/dist/Game/Object.d.ts +49 -15
- package/dist/Game/Object.js +101 -42
- package/dist/Game/Object.js.map +1 -1
- package/dist/Game/Object.spec.d.ts +1 -0
- package/dist/Game/Player.js.map +1 -1
- package/dist/Game/ProjectileManager.d.ts +98 -0
- package/dist/Game/ProjectileManager.js +196 -0
- package/dist/Game/ProjectileManager.js.map +1 -0
- package/dist/Game/ProjectileManager.spec.d.ts +1 -0
- package/dist/Gui/Gui.d.ts +20 -6
- package/dist/Gui/Gui.js +96 -54
- package/dist/Gui/Gui.js.map +1 -1
- package/dist/Gui/Gui.spec.d.ts +1 -0
- package/dist/Gui/NotificationManager.js.map +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/RpgClient.d.ts +194 -15
- package/dist/RpgClientEngine.d.ts +176 -11
- package/dist/RpgClientEngine.js +669 -68
- package/dist/RpgClientEngine.js.map +1 -1
- package/dist/Sound.js.map +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorateMetadata.js +1 -1
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/animations/animation.ce.js +6 -5
- package/dist/components/animations/animation.ce.js.map +1 -1
- package/dist/components/animations/fx.ce.js +60 -0
- package/dist/components/animations/fx.ce.js.map +1 -0
- package/dist/components/animations/hit.ce.js +24 -28
- package/dist/components/animations/hit.ce.js.map +1 -1
- package/dist/components/animations/index.d.ts +1 -0
- package/dist/components/animations/index.js +6 -4
- package/dist/components/animations/index.js.map +1 -1
- package/dist/components/character.ce.js +606 -248
- package/dist/components/character.ce.js.map +1 -1
- package/dist/components/dynamics/bar.ce.js +99 -0
- package/dist/components/dynamics/bar.ce.js.map +1 -0
- package/dist/components/dynamics/image.ce.js +26 -0
- package/dist/components/dynamics/image.ce.js.map +1 -0
- package/dist/components/dynamics/parse-value.d.ts +3 -0
- package/dist/components/dynamics/parse-value.js +54 -35
- package/dist/components/dynamics/parse-value.js.map +1 -1
- package/dist/components/dynamics/parse-value.spec.d.ts +1 -0
- package/dist/components/dynamics/shape-utils.d.ts +16 -0
- package/dist/components/dynamics/shape-utils.js +73 -0
- package/dist/components/dynamics/shape-utils.js.map +1 -0
- package/dist/components/dynamics/shape-utils.spec.d.ts +1 -0
- package/dist/components/dynamics/shape.ce.js +86 -0
- package/dist/components/dynamics/shape.ce.js.map +1 -0
- package/dist/components/dynamics/text.ce.js +36 -56
- package/dist/components/dynamics/text.ce.js.map +1 -1
- package/dist/components/gui/box.ce.js +9 -9
- package/dist/components/gui/box.ce.js.map +1 -1
- package/dist/components/gui/dialogbox/index.ce.js +75 -65
- package/dist/components/gui/dialogbox/index.ce.js.map +1 -1
- package/dist/components/gui/gameover.ce.js +47 -68
- package/dist/components/gui/gameover.ce.js.map +1 -1
- package/dist/components/gui/hud/hud.ce.js +23 -31
- package/dist/components/gui/hud/hud.ce.js.map +1 -1
- package/dist/components/gui/menu/equip-menu.ce.js +121 -172
- package/dist/components/gui/menu/equip-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/exit-menu.ce.js +15 -10
- package/dist/components/gui/menu/exit-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/items-menu.ce.js +62 -77
- package/dist/components/gui/menu/items-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/main-menu.ce.js +89 -104
- package/dist/components/gui/menu/main-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/options-menu.ce.js +12 -8
- package/dist/components/gui/menu/options-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/skills-menu.ce.js +17 -19
- package/dist/components/gui/menu/skills-menu.ce.js.map +1 -1
- package/dist/components/gui/mobile/index.js +2 -2
- package/dist/components/gui/mobile/index.js.map +1 -1
- package/dist/components/gui/mobile/mobile.ce.js +7 -5
- package/dist/components/gui/mobile/mobile.ce.js.map +1 -1
- package/dist/components/gui/notification/notification.ce.js +28 -26
- package/dist/components/gui/notification/notification.ce.js.map +1 -1
- package/dist/components/gui/save-load.ce.js +81 -256
- package/dist/components/gui/save-load.ce.js.map +1 -1
- package/dist/components/gui/shop/shop.ce.js +107 -142
- package/dist/components/gui/shop/shop.ce.js.map +1 -1
- package/dist/components/gui/title-screen.ce.js +50 -73
- package/dist/components/gui/title-screen.ce.js.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/interaction-components.ce.js +22 -0
- package/dist/components/interaction-components.ce.js.map +1 -0
- package/dist/components/player-components-utils.d.ts +67 -0
- package/dist/components/player-components-utils.js +162 -0
- package/dist/components/player-components-utils.js.map +1 -0
- package/dist/components/player-components-utils.spec.d.ts +1 -0
- package/dist/components/player-components.ce.js +191 -0
- package/dist/components/player-components.ce.js.map +1 -0
- package/dist/components/prebuilt/hp-bar.ce.js +45 -45
- package/dist/components/prebuilt/hp-bar.ce.js.map +1 -1
- package/dist/components/prebuilt/light-halo.ce.js +39 -60
- package/dist/components/prebuilt/light-halo.ce.js.map +1 -1
- package/dist/components/scenes/canvas.ce.js +205 -27
- package/dist/components/scenes/canvas.ce.js.map +1 -1
- package/dist/components/scenes/draw-map.ce.js +39 -39
- package/dist/components/scenes/draw-map.ce.js.map +1 -1
- package/dist/components/scenes/event-layer.ce.js +51 -10
- package/dist/components/scenes/event-layer.ce.js.map +1 -1
- package/dist/core/inject.js +1 -1
- package/dist/core/inject.js.map +1 -1
- package/dist/core/setup.js +1 -1
- package/dist/core/setup.js.map +1 -1
- package/dist/decorators/spritesheet.d.ts +1 -0
- package/dist/decorators/spritesheet.js +11 -0
- package/dist/decorators/spritesheet.js.map +1 -0
- package/dist/i18n.d.ts +55 -0
- package/dist/i18n.js +60 -0
- package/dist/i18n.js.map +1 -0
- package/dist/i18n.spec.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +29 -21
- package/dist/module.js +45 -4
- package/dist/module.js.map +1 -1
- package/dist/node_modules/.pnpm/{@signe_di@2.9.0 → @signe_di@3.1.0}/node_modules/@signe/di/dist/index.js +7 -117
- package/dist/node_modules/.pnpm/@signe_di@3.1.0/node_modules/@signe/di/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js +239 -0
- package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/chunk-EUXUH3YW.js +13 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/chunk-EUXUH3YW.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js +698 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/client/index.js +43 -0
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/client/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@signe_sync@2.9.0 → @signe_sync@3.1.0_react@19.2.7}/node_modules/@signe/sync/dist/index.js +57 -141
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js → partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/index.js} +30 -17
- package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js → partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/ws.js} +65 -34
- package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/ws.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +13 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +106 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +13 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +121 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +110 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +99 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +82 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/.pnpm/{zod@3.24.2/node_modules/zod/lib/index.js → zod@3.25.76/node_modules/zod/v3/types.js} +74 -611
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
- package/dist/presets/animation.js.map +1 -1
- package/dist/presets/faceset.js.map +1 -1
- package/dist/presets/icon.js.map +1 -1
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/lpc.js.map +1 -1
- package/dist/presets/rmspritesheet.js.map +1 -1
- package/dist/services/AbstractSocket.d.ts +2 -0
- package/dist/services/AbstractSocket.js.map +1 -1
- package/dist/services/actionInput.d.ts +14 -0
- package/dist/services/actionInput.js +59 -0
- package/dist/services/actionInput.js.map +1 -0
- package/dist/services/actionInput.spec.d.ts +1 -0
- package/dist/services/interactions.d.ts +159 -0
- package/dist/services/interactions.js +460 -0
- package/dist/services/interactions.js.map +1 -0
- package/dist/services/interactions.spec.d.ts +1 -0
- package/dist/services/keyboardControls.d.ts +1 -0
- package/dist/services/keyboardControls.js +1 -0
- package/dist/services/keyboardControls.js.map +1 -1
- package/dist/services/loadMap.d.ts +9 -0
- package/dist/services/loadMap.js +1 -1
- package/dist/services/loadMap.js.map +1 -1
- package/dist/services/mmorpg-connection.d.ts +5 -0
- package/dist/services/mmorpg-connection.js +50 -0
- package/dist/services/mmorpg-connection.js.map +1 -0
- package/dist/services/mmorpg-connection.spec.d.ts +1 -0
- package/dist/services/mmorpg.d.ts +11 -4
- package/dist/services/mmorpg.js +57 -33
- package/dist/services/mmorpg.js.map +1 -1
- package/dist/services/pointerContext.d.ts +11 -0
- package/dist/services/pointerContext.js +48 -0
- package/dist/services/pointerContext.js.map +1 -0
- package/dist/services/pointerContext.spec.d.ts +1 -0
- package/dist/services/save.js.map +1 -1
- package/dist/services/save.spec.d.ts +1 -0
- package/dist/services/standalone-message.d.ts +1 -0
- package/dist/services/standalone-message.js +9 -0
- package/dist/services/standalone-message.js.map +1 -0
- package/dist/services/standalone.d.ts +4 -1
- package/dist/services/standalone.js +36 -16
- package/dist/services/standalone.js.map +1 -1
- package/dist/services/standalone.spec.d.ts +1 -0
- package/dist/utils/getEntityProp.js +4 -3
- package/dist/utils/getEntityProp.js.map +1 -1
- package/dist/utils/getEntityProp.spec.d.ts +1 -0
- package/dist/utils/mapId.d.ts +1 -0
- package/dist/utils/mapId.js +6 -0
- package/dist/utils/mapId.js.map +1 -0
- package/dist/utils/readPropValue.d.ts +2 -0
- package/dist/utils/readPropValue.js +13 -0
- package/dist/utils/readPropValue.js.map +1 -0
- package/package.json +13 -13
- package/src/Game/AnimationManager.spec.ts +30 -0
- package/src/Game/AnimationManager.ts +26 -10
- package/src/Game/ClientVisuals.spec.ts +56 -0
- package/src/Game/ClientVisuals.ts +184 -0
- package/src/Game/EventComponentResolver.spec.ts +84 -0
- package/src/Game/EventComponentResolver.ts +74 -0
- package/src/Game/Map.ts +134 -2
- package/src/Game/Object.spec.ts +59 -0
- package/src/Game/Object.ts +181 -77
- package/src/Game/ProjectileManager.spec.ts +449 -0
- package/src/Game/ProjectileManager.ts +346 -0
- package/src/Gui/Gui.spec.ts +340 -0
- package/src/Gui/Gui.ts +129 -57
- package/src/Resource.ts +1 -2
- package/src/RpgClient.ts +220 -17
- package/src/RpgClientEngine.ts +959 -116
- package/src/components/animations/fx.ce +101 -0
- package/src/components/animations/index.ts +4 -2
- package/src/components/character.ce +681 -45
- package/src/components/dynamics/bar.ce +88 -0
- package/src/components/dynamics/image.ce +21 -0
- package/src/components/dynamics/parse-value.spec.ts +83 -0
- package/src/components/dynamics/parse-value.ts +111 -37
- package/src/components/dynamics/shape-utils.spec.ts +46 -0
- package/src/components/dynamics/shape-utils.ts +61 -0
- package/src/components/dynamics/shape.ce +90 -0
- package/src/components/dynamics/text.ce +35 -149
- package/src/components/gui/dialogbox/index.ce +52 -21
- package/src/components/gui/gameover.ce +6 -4
- package/src/components/gui/menu/equip-menu.ce +11 -9
- package/src/components/gui/menu/exit-menu.ce +6 -4
- package/src/components/gui/menu/items-menu.ce +11 -9
- package/src/components/gui/menu/main-menu.ce +14 -12
- package/src/components/gui/menu/options-menu.ce +4 -3
- package/src/components/gui/menu/skills-menu.ce +2 -1
- package/src/components/gui/notification/notification.ce +7 -1
- package/src/components/gui/save-load.ce +13 -11
- package/src/components/gui/shop/shop.ce +20 -18
- package/src/components/gui/title-screen.ce +6 -4
- package/src/components/index.ts +2 -1
- package/src/components/interaction-components.ce +23 -0
- package/src/components/player-components-utils.spec.ts +109 -0
- package/src/components/player-components-utils.ts +205 -0
- package/src/components/player-components.ce +222 -0
- package/src/components/prebuilt/hp-bar.ce +4 -3
- package/src/components/prebuilt/light-halo.ce +2 -2
- package/src/components/scenes/canvas.ce +219 -15
- package/src/components/scenes/draw-map.ce +34 -22
- package/src/components/scenes/event-layer.ce +55 -4
- package/src/core/setup.ts +2 -2
- package/src/decorators/spritesheet.ts +8 -0
- package/src/i18n.spec.ts +39 -0
- package/src/i18n.ts +59 -0
- package/src/index.ts +7 -0
- package/src/module.ts +61 -11
- package/src/services/AbstractSocket.ts +3 -0
- package/src/services/actionInput.spec.ts +155 -0
- package/src/services/actionInput.ts +120 -0
- package/src/services/interactions.spec.ts +175 -0
- package/src/services/interactions.ts +722 -0
- package/src/services/keyboardControls.ts +2 -1
- package/src/services/loadMap.ts +5 -1
- package/src/services/mmorpg-connection.spec.ts +99 -0
- package/src/services/mmorpg-connection.ts +69 -0
- package/src/services/mmorpg.ts +70 -36
- package/src/services/pointerContext.spec.ts +36 -0
- package/src/services/pointerContext.ts +84 -0
- package/src/services/save.spec.ts +127 -0
- package/src/services/standalone-message.ts +7 -0
- package/src/services/standalone.spec.ts +54 -0
- package/src/services/standalone.ts +44 -12
- package/src/utils/getEntityProp.spec.ts +96 -0
- package/src/utils/getEntityProp.ts +4 -3
- package/src/utils/mapId.ts +2 -0
- package/src/utils/readPropValue.ts +16 -0
- package/dist/node_modules/.pnpm/@signe_di@2.9.0/node_modules/@signe/di/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js +0 -457
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js +0 -463
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js +0 -2191
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js +0 -10
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js +0 -91
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js +0 -14
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/index.js +0 -2
- package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-menu.ce.js","names":[],"sources":["../../../../src/components/gui/menu/skills-menu.ce"],"sourcesContent":["<DOMContainer width=\"100%\" height=\"100%\">\n <div class=\"rpg-ui-menu-panel rpg-ui-panel\">\n <div class=\"rpg-ui-menu-panel-header\">
|
|
1
|
+
{"version":3,"file":"skills-menu.ce.js","names":[],"sources":["../../../../src/components/gui/menu/skills-menu.ce"],"sourcesContent":["<DOMContainer width=\"100%\" height=\"100%\">\n <div class=\"rpg-ui-menu-panel rpg-ui-panel\">\n <div class=\"rpg-ui-menu-panel-header\">{t(\"rpg.menu.skills\")}</div>\n <div class=\"rpg-ui-menu-panel-body rpg-ui-menu-panel-body-stacked\">\n <div class=\"rpg-ui-menu-panel-details rpg-ui-panel\">\n @if (currentSkill) {\n <div class=\"rpg-ui-menu-panel-hero\">\n <div class=\"rpg-ui-menu-panel-hero-icon\">✨</div>\n <div>\n <div class=\"rpg-ui-menu-panel-details-title\">{currentSkill()?.name}</div>\n <div class=\"rpg-ui-menu-panel-details-desc\">{currentSkill()?.description || \"\"}</div>\n </div>\n </div>\n }\n </div>\n <div class=\"rpg-ui-menu-panel-list rpg-ui-menu rpg-ui-menu-panel-list-full\">\n <Navigation tabindex={selectedSkill} controls={controls}>\n @for ((skill,index) of skills) {\n <div\n class=\"rpg-ui-menu-item rpg-ui-menu-row\"\n data-selected={selectedSkill() === index ? \"true\" : \"false\"}\n tabindex={index}\n click={selectSkill(index)}\n >\n <span>{skill.name}</span>\n <span class=\"rpg-ui-menu-row-end\">SP {skill.spCost ?? 0}</span>\n </div>\n }\n </Navigation>\n </div>\n </div>\n </div>\n</DOMContainer>\n\n<script>\n import { signal, computed, createTabindexNavigator } from \"canvasengine\";\n import { inject } from \"../../../core/inject\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n\n const engine = inject(RpgClientEngine);\n const { t } = engine.i18n();\n const keyboardControls = engine.globalConfig.keyboardControls;\n\n const selectedSkill = signal(0);\n const { data, onBack } = defineProps();\n const skills = computed(() => data().skills);\n\n const nav = createTabindexNavigator(selectedSkill, { count: () => skills().length }, \"wrap\");\n const currentSkill = computed(() => skills()[selectedSkill()]);\n\n function selectSkill(index) {\n return function() {\n selectedSkill.set(index);\n }\n }\n\n const controls = signal({\n up: {\n repeat: true,\n bind: keyboardControls.up,\n throttle: 150,\n keyDown() {\n nav.next(-1);\n }\n },\n down: {\n repeat: true,\n bind: keyboardControls.down,\n throttle: 150,\n keyDown() {\n nav.next(1);\n }\n },\n escape: {\n bind: keyboardControls.escape,\n keyDown() {\n if (onBack) onBack();\n }\n },\n gamepad: {\n enabled: true\n }\n });\n</script>\n"],"mappings":";;;;AAUM,SAAS,UAAU,SAAQ;CACV,SAAM,OAAA;CACrB,MAAM,cAAW,eAAA,OAAA;CACT,eAAA,OAAA;CACR,MAAM,SAAG,OAAA,eAAA;CACjB,MAAM,EAAE,MAAK,OAAI,KAAO;CACxB,MAAM,mBAAW,OAAW,aAAU;CACtC,MAAM,gBAAe,OAAM,CAAA;CAC3B,MAAM,EAAE,MAAM,WAAW,YAAA;CACzB,MAAM,SAAS,eAAa,KAAO,EAAA,MAAO;CAC1C,MAAM,MAAM,wBAAqB,eAAU,EAAA,aAAoB,OAAS,EAAA,OAAS,GAAA,MAAM;CACvF,MAAM,eAAe,eAAe,OAAO,EAAA,cAAA,EAAA;CAC3C,SAAS,YAAY,OAAO;EACxB,OAAO,WAAY;GACf,cAAc,IAAI,KAAG;EACzB;CACJ;CACA,MAAM,WAAW,OAAG;EAChB,IAAI;GACA,QAAM;GACN,MAAK,iBAAA;GACP,UAAG;GACP,UAAY;;GAEP;EACH;EACA,MAAM;GACN,QAAS;;GAET,UAAc;GACd,UAAc;IACR,IAAA,KAAA,CAAA;;EAEN;EACA,QAAQ;GACR,MAAM,iBAAqB;;IAErB,IAAM,QACN,OAAa;;EAEnB;EACA,SAAI,EACA,SAAI,KACR;CACJ,CAAC;CAEG,OAAA,EAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAe;AACb;AAEA,IAAM,iBAAM"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject } from "../../../core/inject.js";
|
|
2
2
|
import { RpgClientEngine } from "../../../RpgClientEngine.js";
|
|
3
|
-
import
|
|
3
|
+
import __ce_component from "./mobile.ce.js";
|
|
4
4
|
import { signal } from "canvasengine";
|
|
5
5
|
//#region src/components/gui/mobile/index.ts
|
|
6
6
|
function isMobile() {
|
|
@@ -8,7 +8,7 @@ function isMobile() {
|
|
|
8
8
|
}
|
|
9
9
|
var withMobile = () => ({ gui: [{
|
|
10
10
|
id: "mobile-gui",
|
|
11
|
-
component,
|
|
11
|
+
component: __ce_component,
|
|
12
12
|
autoDisplay: true,
|
|
13
13
|
dependencies: () => {
|
|
14
14
|
const engine = inject(RpgClientEngine);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/gui/mobile/index.ts"],"sourcesContent":["import { inject } from \"../../../core/inject\";\nimport { RpgClientEngine } from \"../../../RpgClientEngine\";\nimport MobileGui from \"./mobile.ce\";\nimport { signal } from \"canvasengine\";\n\nfunction isMobile() {\n return /Android|iPhone|iPad|iPod|Windows Phone|webOS|BlackBerry/i.test(navigator.userAgent);\n }\n\nexport const withMobile = () => (\n {\n gui: [\n {\n id: 'mobile-gui',\n component: MobileGui,\n autoDisplay: true,\n dependencies: () => {\n const engine = inject(RpgClientEngine);\n return [signal(isMobile() ||undefined), engine.controlsReady]\n }\n }\n ]\n }\n)"],"mappings":";;;;;AAKA,SAAS,WAAW;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/gui/mobile/index.ts"],"sourcesContent":["import { inject } from \"../../../core/inject\";\nimport { RpgClientEngine } from \"../../../RpgClientEngine\";\nimport MobileGui from \"./mobile.ce\";\nimport { signal } from \"canvasengine\";\n\nfunction isMobile() {\n return /Android|iPhone|iPad|iPod|Windows Phone|webOS|BlackBerry/i.test(navigator.userAgent);\n }\n\nexport const withMobile = () => (\n {\n gui: [\n {\n id: 'mobile-gui',\n component: MobileGui,\n autoDisplay: true,\n dependencies: () => {\n const engine = inject(RpgClientEngine);\n return [signal(isMobile() ||undefined), engine.controlsReady]\n }\n }\n ]\n }\n)"],"mappings":";;;;;AAKA,SAAS,WAAW;CAChB,OAAO,2DAA2D,KAAK,UAAU,SAAS;AAC5F;AAEF,IAAa,oBACT,EACI,KAAK,CACD;CACI,IAAI;CACJ,WAAW;CACX,aAAa;CACb,oBAAoB;EAChB,MAAM,SAAS,OAAO,eAAe;EACrC,OAAO,CAAC,OAAO,SAAS,KAAI,KAAA,CAAS,GAAG,OAAO,aAAa;CAChE;AACJ,CACJ,EACJ"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { inject } from "../../../core/inject.js";
|
|
2
|
-
import { Button, Container, Joystick, h, mount, signal, useDefineProps, useProps } from "canvasengine";
|
|
2
|
+
import { Button, Container, Joystick, h, mount, signal, useDefineEmits, useDefineProps, useProps } from "canvasengine";
|
|
3
3
|
//#region src/components/gui/mobile/mobile.ce
|
|
4
4
|
function component($$props) {
|
|
5
5
|
useProps($$props);
|
|
6
6
|
useDefineProps($$props);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
useDefineEmits($$props);
|
|
8
|
+
const controlsInstance = signal(null);
|
|
9
|
+
mount((element) => {
|
|
10
|
+
const control = inject("KeyboardControls");
|
|
10
11
|
controlsInstance.set(control);
|
|
11
12
|
});
|
|
12
13
|
return h(Container, {
|
|
@@ -72,7 +73,8 @@ function component($$props) {
|
|
|
72
73
|
innerColor: "#3498db"
|
|
73
74
|
})))]);
|
|
74
75
|
}
|
|
76
|
+
var __ce_component = component;
|
|
75
77
|
//#endregion
|
|
76
|
-
export {
|
|
78
|
+
export { __ce_component as default };
|
|
77
79
|
|
|
78
80
|
//# sourceMappingURL=mobile.ce.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile.ce.js","names":[],"sources":["../../../../src/components/gui/mobile/mobile.ce"],"sourcesContent":["<Container justifyContent=\"space-between\" alignItems=\"flex-end\" width=\"100%\" height=\"100%\">\n <!-- Gamepad buttons A and B (left side) -->\n <Container justifyContent=\"flex-start\" alignItems=\"flex-end\" gap={20}>\n <Container display=\"flex\" direction=\"column\" gap={20} margin={50}>\n <!-- Button B (top) -->\n \n <!-- Button A (bottom) -->\n <Button \n text=\"A\"\n shape=\"circle\"\n width={70}\n height={70}\n controls={controlsInstance}\n controlName=\"action\"\n style={{\n backgroundColor: {\n normal: \"#2ecc71\",\n hover: \"#27ae60\",\n pressed: \"#229954\",\n disabled: \"#7f8c8d\"\n },\n text: {\n fontSize: 24,\n fontFamily: \"Arial Bold\",\n color: \"#ffffff\"\n }\n }}\n />\n\n <Button \n text=\"B\"\n shape=\"circle\"\n width={70}\n height={70}\n controls={controlsInstance}\n controlName=\"back\"\n style={{\n backgroundColor: {\n normal: \"#e74c3c\",\n hover: \"#c0392b\",\n pressed: \"#a93226\",\n disabled: \"#7f8c8d\"\n },\n text: {\n fontSize: 24,\n fontFamily: \"Arial Bold\",\n color: \"#ffffff\"\n }\n }}\n />\n\n </Container>\n </Container>\n \n <Container margin={100} alignItems=\"flex-end\">\n <Container>\n <Joystick \n controls={controlsInstance}\n outerColor=\"#34495e\"\n innerColor=\"#3498db\"\n />\n </Container>\n </Container>\n</Container>\n\n<script>\n import { signal, mount } from 'canvasengine'\n import { Button } from 'canvasengine'\n import { inject } from '../../../core/inject'\n import { RpgClientEngine } from '../../../RpgClientEngine'\n import { Direction } from '@rpgjs/common'\n\n\n const controlsInstance = signal(null)\n\n mount((element) => {\n const control = inject('KeyboardControls')\n controlsInstance.set(control)\n })\n</script>"],"mappings":";;;AASM,
|
|
1
|
+
{"version":3,"file":"mobile.ce.js","names":[],"sources":["../../../../src/components/gui/mobile/mobile.ce"],"sourcesContent":["<Container justifyContent=\"space-between\" alignItems=\"flex-end\" width=\"100%\" height=\"100%\">\n <!-- Gamepad buttons A and B (left side) -->\n <Container justifyContent=\"flex-start\" alignItems=\"flex-end\" gap={20}>\n <Container display=\"flex\" direction=\"column\" gap={20} margin={50}>\n <!-- Button B (top) -->\n \n <!-- Button A (bottom) -->\n <Button \n text=\"A\"\n shape=\"circle\"\n width={70}\n height={70}\n controls={controlsInstance}\n controlName=\"action\"\n style={{\n backgroundColor: {\n normal: \"#2ecc71\",\n hover: \"#27ae60\",\n pressed: \"#229954\",\n disabled: \"#7f8c8d\"\n },\n text: {\n fontSize: 24,\n fontFamily: \"Arial Bold\",\n color: \"#ffffff\"\n }\n }}\n />\n\n <Button \n text=\"B\"\n shape=\"circle\"\n width={70}\n height={70}\n controls={controlsInstance}\n controlName=\"back\"\n style={{\n backgroundColor: {\n normal: \"#e74c3c\",\n hover: \"#c0392b\",\n pressed: \"#a93226\",\n disabled: \"#7f8c8d\"\n },\n text: {\n fontSize: 24,\n fontFamily: \"Arial Bold\",\n color: \"#ffffff\"\n }\n }}\n />\n\n </Container>\n </Container>\n \n <Container margin={100} alignItems=\"flex-end\">\n <Container>\n <Joystick \n controls={controlsInstance}\n outerColor=\"#34495e\"\n innerColor=\"#3498db\"\n />\n </Container>\n </Container>\n</Container>\n\n<script>\n import { signal, mount } from 'canvasengine'\n import { Button } from 'canvasengine'\n import { inject } from '../../../core/inject'\n import { RpgClientEngine } from '../../../RpgClientEngine'\n import { Direction } from '@rpgjs/common'\n\n\n const controlsInstance = signal(null)\n\n mount((element) => {\n const control = inject('KeyboardControls')\n controlsInstance.set(control)\n })\n</script>"],"mappings":";;;AASM,SAAS,UAAQ,SAAM;CACN,SAAE,OAAA;CACC,eAAA,OAAA;CACA,eAAgB,OAAA;CAClC,MAAM,mBAAe,OAAM,IAAA;CACnC,OAAO,YAAS;EACZ,MAAM,UAAU,OAAA,kBAAiB;EACjC,iBAAiB,IAAG,OAAQ;CAChC,CAAC;CAEO,OADY,EAAE,WAAW;EAAE,gBAAO;EAAA,YAAA;EAAA,OAAA;EAAA,QAAA;CAAA,GAAA,CAAA,EAAA,WAAA;EAAA,gBAAA;EAAA,YAAA;EAAA,KAAA;CAAA,GAAA,EAAA,WAAA;EAAA,SAAA;EAAA,WAAA;EAAA,KAAA;EAAA,QAAA;CAAA,GAAA,CAAA,EAAA,QAAA;EAAA,MAAA;EAAA,OAAA;EAAA,OAAA;EAAA,QAAA;EAAA,UAAA;EAAA,aAAA;EAAA,OAAA;GAAA,iBAAA;IAAA,QAAA;IAAA,OAAA;IAAA,SAAA;IAAA,UAAA;GAAA;GAAA,MAAA;IAAA,UAAA;IAAA,YAAA;IAAA,OAAA;GAAA;EAAA;CAAA,CAAA,GAAA,EAAA,QAAA;EAAA,MAAA;EAAA,OAAA;EAAA,OAAA;EAAA,QAAA;EAAA,UAAA;EAAA,aAAA;EAAA,OAAA;GAAA,iBAAA;IAAA,QAAA;IAAA,OAAA;IAAA,SAAA;IAAA,UAAA;GAAA;GAAA,MAAA;IAAA,UAAA;IAAA,YAAA;IAAA,OAAA;GAAA;EAAA;CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,WAAA;EAAA,QAAA;EAAA,YAAA;CAAA,GAAA,EAAA,WAAA,MAAA,EAAA,UAAA;EAAA,UAAA;EAAA,YAAA;EAAA,YAAA;CAAA,CAAA,CAAA,CAAA,CAAA,CACvB;AACb;AAEA,IAAM,iBAAY"}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { inject } from "../../../core/inject.js";
|
|
2
2
|
import { RpgClientEngine } from "../../../RpgClientEngine.js";
|
|
3
|
-
import { DOMContainer, DOMElement, DOMSprite, computed, cond, effect, h, loop, useDefineProps, useProps } from "canvasengine";
|
|
3
|
+
import { DOMContainer, DOMElement, DOMSprite, computed, cond, effect, h, loop, useDefineEmits, useDefineProps, useProps } from "canvasengine";
|
|
4
4
|
//#region src/components/gui/notification/notification.ce
|
|
5
|
-
if (typeof document !== "undefined"
|
|
6
|
-
|
|
7
|
-
styleElement
|
|
5
|
+
if (typeof document !== "undefined") {
|
|
6
|
+
let styleElement = document.getElementById("ce-style--home-runner-work-RPG-JS-RPG-JS-packages-client-src-components-gui-notification-notification-ce");
|
|
7
|
+
if (!styleElement) {
|
|
8
|
+
styleElement = document.createElement("style");
|
|
9
|
+
styleElement.id = "ce-style--home-runner-work-RPG-JS-RPG-JS-packages-client-src-components-gui-notification-notification-ce";
|
|
10
|
+
document.head.appendChild(styleElement);
|
|
11
|
+
}
|
|
8
12
|
styleElement.textContent = ".notification {\n pointer-events: none !important;\n }";
|
|
9
|
-
document.head.appendChild(styleElement);
|
|
10
13
|
}
|
|
11
14
|
function component($$props) {
|
|
12
15
|
useProps($$props);
|
|
13
16
|
useDefineProps($$props);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
useDefineEmits($$props);
|
|
18
|
+
const engine = inject(RpgClientEngine);
|
|
19
|
+
const notifications = computed(() => engine.notificationManager.stack());
|
|
20
|
+
const iconSheet = (iconId) => ({
|
|
21
|
+
definition: engine.getSpriteSheet(iconId),
|
|
22
|
+
playing: "default"
|
|
17
23
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
effect(function() {
|
|
25
|
-
var list = notifications();
|
|
26
|
-
var rowHeight = 68;
|
|
27
|
-
list.forEach(function(notif, index) {
|
|
24
|
+
effect(() => {
|
|
25
|
+
const list = notifications();
|
|
26
|
+
const rowHeight = 68;
|
|
27
|
+
list.forEach((notif, index) => {
|
|
28
28
|
notif.layoutY.set(index * rowHeight);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
};
|
|
31
|
+
const notificationStyle = (notif) => ({
|
|
32
|
+
opacity: notif.opacity(),
|
|
33
|
+
transform: `translateY(${notif.layoutY() + notif.offset()}px)`
|
|
34
|
+
});
|
|
37
35
|
return h(DOMContainer, {
|
|
38
36
|
width: "100%",
|
|
39
37
|
height: "100%",
|
|
40
38
|
zIndex: 100,
|
|
41
|
-
attrs: {
|
|
39
|
+
attrs: {
|
|
40
|
+
class: "notification",
|
|
41
|
+
style: "pointer-events: none !important;"
|
|
42
|
+
}
|
|
42
43
|
}, h(DOMElement, {
|
|
43
44
|
element: "div",
|
|
44
45
|
attrs: { class: "rpg-ui-notifications" }
|
|
@@ -58,7 +59,8 @@ function component($$props) {
|
|
|
58
59
|
textContent: notif.message
|
|
59
60
|
})]))));
|
|
60
61
|
}
|
|
62
|
+
var __ce_component = component;
|
|
61
63
|
//#endregion
|
|
62
|
-
export {
|
|
64
|
+
export { __ce_component as default };
|
|
63
65
|
|
|
64
66
|
//# sourceMappingURL=notification.ce.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.ce.js","names":[],"sources":["../../../../src/components/gui/notification/notification.ce"],"sourcesContent":["<DOMContainer
|
|
1
|
+
{"version":3,"file":"notification.ce.js","names":[],"sources":["../../../../src/components/gui/notification/notification.ce"],"sourcesContent":["<DOMContainer\n width=\"100%\"\n height=\"100%\"\n zIndex={100}\n class=\"notification\"\n style=\"pointer-events: none !important;\"\n>\n <div class=\"rpg-ui-notifications\">\n @for ((notif,index) of notifications) {\n <div\n class=\"rpg-ui-notification\"\n data-type={notif.type || \"info\"}\n style={notificationStyle(notif)}\n >\n @if (notif.icon) {\n <div class=\"rpg-ui-notification-icon\">\n <DOMSprite sheet={iconSheet(notif.icon)} />\n </div>\n }\n <div class=\"rpg-ui-notification-message\">{notif.message}</div>\n </div>\n }\n </div>\n</DOMContainer>\n\n<style>\n .notification {\n pointer-events: none !important;\n }\n</style>\n\n<script>\n import { effect, computed } from \"canvasengine\";\n import { inject } from \"../../../core/inject\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n\n const engine = inject(RpgClientEngine);\n const notifications = computed(() => engine.notificationManager.stack());\n\n const iconSheet = (iconId) => ({\n definition: engine.getSpriteSheet(iconId),\n playing: \"default\"\n });\n\n effect(() => {\n const list = notifications();\n const rowHeight = 68;\n list.forEach((notif, index) => {\n notif.layoutY.set(index * rowHeight);\n });\n });\n\n const notificationStyle = (notif) => ({\n opacity: notif.opacity(),\n transform: `translateY(${notif.layoutY() + notif.offset()}px)`\n });\n</script>\n"],"mappings":";;;;AAUA,IAAI,OAAO,aAAY,aAAO;CAC5B,IAAI,eAAe,SAAM,eAAe,0GAAK;CAC7C,IAAI,CAAC,cAAc;EACjB,eAAQ,SAAA,cAAA,OAAA;EACR,aAAa,KAAI;EACjB,SAAS,KAAK,YAAY,YAAS;CACrC;CACA,aAAa,cAAU;AACzB;AAEM,SAAQ,UAAG,SAAA;CACT,SAAA,OAAA;CACC,eAAA,OAAA;CACK,eAAA,OAAA;;CAEd,MAAM,gBAAA,eAAA,OAAA,oBAAA,MAAA,CAAA;CACN,MAAK,aAAa,YAAA;EACd,YAAY,OAAO,eAAO,MAAS;EACnC,SAAA;CACJ;;EAEC,MAAM,OAAA,cAAA;EACH,MAAM,YAAW;EACjB,KAAA,SAAS,OAAS,UAAa;GAC/B,MAAS,QAAA,IAAA,QAAkB,SAAY;;CAE3C,CAAC;CACD,MAAI,qBAAsB,WAAY;;EAElC,WAAM,cAAmB,MAAM,QAAA,IAAA,MAAA,OAAA,EAAA;CACnC;CAEM,OADY,EAAA,cAAO;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,OAAA;GAAA,OAAA;GAAA,OAAA;EAAA;CAAA,GAAA,EAAA,YAAA;EAAA,SAAA;EAAA,OAAA,EAAA,OAAA,uBAAA;CAAA,GAAA,KAAA,gBAAA,OAAA,UAAA,EAAA,YAAA;EAAA,SAAA;EAAA,OAAA;GAAA,OAAA;GAAA,aAAA,eAAA,MAAA,QAAA,MAAA;GAAA,OAAA,eAAA,kBAAA,KAAA,CAAA;EAAA;CAAA,GAAA,CAAA,KAAA,MAAA,YAAA,EAAA,YAAA;EAAA,SAAA;EAAA,OAAA,EAAA,OAAA,2BAAA;CAAA,GAAA,EAAA,WAAA,EAAA,OAAA,eAAA,UAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,GAAA,EAAA,YAAA;EAAA,SAAA;EAAA,OAAA,EAAA,OAAA,8BAAA;EAAA,aAAA,MAAA;CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACnB;;AAGA,IAAE,iBAAa"}
|
|
@@ -1,281 +1,105 @@
|
|
|
1
1
|
import { inject } from "../../core/inject.js";
|
|
2
|
+
import { getKeyboardControlBind } from "../../services/actionInput.js";
|
|
2
3
|
import { SaveClientService } from "../../services/save.js";
|
|
3
4
|
import { RpgGui } from "../../Gui/Gui.js";
|
|
4
5
|
import { RpgClientEngine } from "../../RpgClientEngine.js";
|
|
5
|
-
import { DOMContainer, DOMElement, Navigation, computed, cond, createTabindexNavigator, h, loop, mount, signal, useDefineProps, useProps } from "canvasengine";
|
|
6
|
+
import { DOMContainer, DOMElement, Navigation, computed, cond, createTabindexNavigator, h, loop, mount, signal, useDefineEmits, useDefineProps, useProps } from "canvasengine";
|
|
6
7
|
import { PrebuiltGui } from "@rpgjs/common";
|
|
7
8
|
//#region src/components/gui/save-load.ce
|
|
8
9
|
function component($$props) {
|
|
9
10
|
useProps($$props);
|
|
10
11
|
const defineProps = useDefineProps($$props);
|
|
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
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
var __generator = this && this.__generator || function(thisArg, body) {
|
|
39
|
-
var _ = {
|
|
40
|
-
label: 0,
|
|
41
|
-
sent: function() {
|
|
42
|
-
if (t[0] & 1) throw t[1];
|
|
43
|
-
return t[1];
|
|
44
|
-
},
|
|
45
|
-
trys: [],
|
|
46
|
-
ops: []
|
|
47
|
-
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
48
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
49
|
-
return this;
|
|
50
|
-
}), g;
|
|
51
|
-
function verb(n) {
|
|
52
|
-
return function(v) {
|
|
53
|
-
return step([n, v]);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function step(op) {
|
|
57
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
59
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
61
|
-
switch (op[0]) {
|
|
62
|
-
case 0:
|
|
63
|
-
case 1:
|
|
64
|
-
t = op;
|
|
65
|
-
break;
|
|
66
|
-
case 4:
|
|
67
|
-
_.label++;
|
|
68
|
-
return {
|
|
69
|
-
value: op[1],
|
|
70
|
-
done: false
|
|
71
|
-
};
|
|
72
|
-
case 5:
|
|
73
|
-
_.label++;
|
|
74
|
-
y = op[1];
|
|
75
|
-
op = [0];
|
|
76
|
-
continue;
|
|
77
|
-
case 7:
|
|
78
|
-
op = _.ops.pop();
|
|
79
|
-
_.trys.pop();
|
|
80
|
-
continue;
|
|
81
|
-
default:
|
|
82
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
83
|
-
_ = 0;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
87
|
-
_.label = op[1];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
91
|
-
_.label = t[1];
|
|
92
|
-
t = op;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (t && _.label < t[2]) {
|
|
96
|
-
_.label = t[2];
|
|
97
|
-
_.ops.push(op);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (t[2]) _.ops.pop();
|
|
101
|
-
_.trys.pop();
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
op = body.call(thisArg, _);
|
|
105
|
-
} catch (e) {
|
|
106
|
-
op = [6, e];
|
|
107
|
-
y = 0;
|
|
108
|
-
} finally {
|
|
109
|
-
f = t = 0;
|
|
110
|
-
}
|
|
111
|
-
if (op[0] & 5) throw op[1];
|
|
112
|
-
return {
|
|
113
|
-
value: op[0] ? op[1] : void 0,
|
|
114
|
-
done: true
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
var __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
119
|
-
if (pack || arguments.length === 2) {
|
|
120
|
-
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
|
|
121
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
122
|
-
ar[i] = from[i];
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
126
|
-
};
|
|
127
|
-
var engine = inject(RpgClientEngine);
|
|
128
|
-
var saveClient = inject(SaveClientService);
|
|
129
|
-
var gui = inject(RpgGui);
|
|
130
|
-
var keyboardControls = engine.globalConfig.keyboardControls;
|
|
131
|
-
var selectedSlot = signal(0);
|
|
132
|
-
var DEFAULT_SLOTS = 4;
|
|
133
|
-
var defaultSlots = function() {
|
|
134
|
-
return Array.from({ length: DEFAULT_SLOTS }, function() {
|
|
135
|
-
return null;
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
var localSlots = signal(defaultSlots());
|
|
139
|
-
var _a = defineProps(), data = _a.data, onFinish = _a.onFinish;
|
|
140
|
-
var title = computed(function() {
|
|
141
|
-
return data().mode === "save" ? "Save Game" : "Load Game";
|
|
142
|
-
});
|
|
143
|
-
var subtitle = computed(function() {
|
|
144
|
-
return data().mode === "save" ? "Choose a slot to overwrite or create." : "Select a slot to load your progress.";
|
|
145
|
-
});
|
|
146
|
-
var slotsValue = computed(function() {
|
|
147
|
-
return localSlots();
|
|
148
|
-
});
|
|
149
|
-
var displaySlots = computed(function() {
|
|
150
|
-
var _a;
|
|
151
|
-
var slots = slotsValue();
|
|
152
|
-
var items = slots.map(function(slot, index) {
|
|
153
|
-
return {
|
|
154
|
-
kind: "slot",
|
|
155
|
-
slot,
|
|
156
|
-
slotIndex: index,
|
|
157
|
-
label: "Slot ".concat(index + 1),
|
|
158
|
-
readonly: false
|
|
159
|
-
};
|
|
160
|
-
});
|
|
12
|
+
useDefineEmits($$props);
|
|
13
|
+
const engine = inject(RpgClientEngine);
|
|
14
|
+
const { t } = engine.i18n();
|
|
15
|
+
const saveClient = inject(SaveClientService);
|
|
16
|
+
const gui = inject(RpgGui);
|
|
17
|
+
const keyboardControls = engine.globalConfig.keyboardControls;
|
|
18
|
+
const selectedSlot = signal(0);
|
|
19
|
+
const DEFAULT_SLOTS = 4;
|
|
20
|
+
const defaultSlots = () => Array.from({ length: DEFAULT_SLOTS }, () => null);
|
|
21
|
+
const localSlots = signal(defaultSlots());
|
|
22
|
+
const { data, onFinish } = defineProps();
|
|
23
|
+
const title = computed(() => data().mode === "save" ? t("rpg.save.title") : t("rpg.load.title"));
|
|
24
|
+
const subtitle = computed(() => data().mode === "save" ? t("rpg.save.subtitle") : t("rpg.load.subtitle"));
|
|
25
|
+
const slotsValue = computed(() => localSlots());
|
|
26
|
+
const displaySlots = computed(() => {
|
|
27
|
+
const slots = slotsValue();
|
|
28
|
+
const items = slots.map((slot, index) => ({
|
|
29
|
+
kind: "slot",
|
|
30
|
+
slot,
|
|
31
|
+
slotIndex: index,
|
|
32
|
+
label: t("rpg.save.slot", { index: index + 1 }),
|
|
33
|
+
readonly: false
|
|
34
|
+
}));
|
|
161
35
|
if (!data().showAutoSlot) return items;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return
|
|
36
|
+
const index = typeof data().autoSlotIndex === "number" ? data().autoSlotIndex : 0;
|
|
37
|
+
const autoSlot = slots[index] ?? null;
|
|
38
|
+
const readonly = data().mode === "save";
|
|
39
|
+
return [{
|
|
166
40
|
kind: "auto",
|
|
167
41
|
slot: autoSlot,
|
|
168
42
|
slotIndex: index,
|
|
169
|
-
label: data().autoSlotLabel || "
|
|
43
|
+
label: data().autoSlotLabel || t("rpg.save.auto"),
|
|
170
44
|
readonly
|
|
171
|
-
}
|
|
45
|
+
}, ...items];
|
|
172
46
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
} }, "wrap");
|
|
176
|
-
var canSelect = function(item) {
|
|
47
|
+
const nav = createTabindexNavigator(selectedSlot, { count: () => displaySlots().length }, "wrap");
|
|
48
|
+
const canSelect = (item) => {
|
|
177
49
|
if (item.readonly) return false;
|
|
178
50
|
if (data().mode === "load" && !item.slot) return false;
|
|
179
51
|
return true;
|
|
180
52
|
};
|
|
181
|
-
|
|
53
|
+
const normalizeSlotValue = (value) => {
|
|
182
54
|
if (!value) return null;
|
|
183
55
|
if (typeof value === "string") try {
|
|
184
56
|
return JSON.parse(value);
|
|
185
|
-
} catch
|
|
57
|
+
} catch {
|
|
186
58
|
return null;
|
|
187
59
|
}
|
|
188
60
|
return value;
|
|
189
61
|
};
|
|
190
|
-
|
|
62
|
+
const normalizeSlots = (list) => {
|
|
191
63
|
if (Array.isArray(list)) {
|
|
192
|
-
|
|
193
|
-
return Array.from({ length
|
|
194
|
-
return normalizeSlotValue(list[index]);
|
|
195
|
-
});
|
|
64
|
+
const length = Math.max(list.length, DEFAULT_SLOTS);
|
|
65
|
+
return Array.from({ length }, (_, index) => normalizeSlotValue(list[index]));
|
|
196
66
|
}
|
|
197
67
|
if (!list || typeof list !== "object") return defaultSlots();
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
});
|
|
206
|
-
var maxIndex = indices.length ? Math.max.apply(Math, indices) : -1;
|
|
207
|
-
var length = Math.max(maxIndex + 1, DEFAULT_SLOTS);
|
|
208
|
-
var slots = Array.from({ length }, function() {
|
|
209
|
-
return null;
|
|
210
|
-
});
|
|
211
|
-
keys.forEach(function(key) {
|
|
212
|
-
var index = Number(key);
|
|
68
|
+
const keys = Object.keys(list).filter((key) => /^\d+$/.test(key));
|
|
69
|
+
const indices = keys.map((key) => Number(key)).filter((index) => index >= 0);
|
|
70
|
+
const maxIndex = indices.length ? Math.max(...indices) : -1;
|
|
71
|
+
const length = Math.max(maxIndex + 1, DEFAULT_SLOTS);
|
|
72
|
+
const slots = Array.from({ length }, () => null);
|
|
73
|
+
keys.forEach((key) => {
|
|
74
|
+
const index = Number(key);
|
|
213
75
|
if (index < 0 || index >= length) return;
|
|
214
76
|
slots[index] = normalizeSlotValue(list[key]);
|
|
215
77
|
});
|
|
216
78
|
return slots;
|
|
217
79
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
0,
|
|
226
|
-
2,
|
|
227
|
-
,
|
|
228
|
-
3
|
|
229
|
-
]);
|
|
230
|
-
return [4, saveClient.listSlots()];
|
|
231
|
-
case 1:
|
|
232
|
-
list = _a.sent();
|
|
233
|
-
localSlots.set(normalizeSlots(list));
|
|
234
|
-
return [3, 3];
|
|
235
|
-
case 2:
|
|
236
|
-
_a.sent();
|
|
237
|
-
localSlots.set(defaultSlots());
|
|
238
|
-
return [3, 3];
|
|
239
|
-
case 3: return [2];
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
80
|
+
const refreshSlots = async () => {
|
|
81
|
+
try {
|
|
82
|
+
const list = await saveClient.listSlots();
|
|
83
|
+
localSlots.set(normalizeSlots(list));
|
|
84
|
+
} catch (err) {
|
|
85
|
+
localSlots.set(defaultSlots());
|
|
86
|
+
}
|
|
243
87
|
};
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return [4, refreshSlots()];
|
|
260
|
-
case 2:
|
|
261
|
-
_a.sent();
|
|
262
|
-
_a.label = 3;
|
|
263
|
-
case 3:
|
|
264
|
-
if (!(action === "load")) return [3, 5];
|
|
265
|
-
return [4, saveClient.loadSlot(item.slotIndex)];
|
|
266
|
-
case 4:
|
|
267
|
-
_a.sent();
|
|
268
|
-
_a.label = 5;
|
|
269
|
-
case 5:
|
|
270
|
-
setTimeout(function() {
|
|
271
|
-
if (onFinish) onFinish();
|
|
272
|
-
gui.hide(PrebuiltGui.Save);
|
|
273
|
-
gui.hide(PrebuiltGui.TitleScreen);
|
|
274
|
-
}, 50);
|
|
275
|
-
return [2];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
});
|
|
88
|
+
const triggerSelect = async (displayIndex) => {
|
|
89
|
+
const item = displaySlots()[displayIndex];
|
|
90
|
+
if (!item) return;
|
|
91
|
+
if (!canSelect(item)) return;
|
|
92
|
+
const action = data().mode === "save" ? "save" : "load";
|
|
93
|
+
if (action === "save") {
|
|
94
|
+
await saveClient.saveSlot(item.slotIndex);
|
|
95
|
+
await refreshSlots();
|
|
96
|
+
}
|
|
97
|
+
if (action === "load") await saveClient.loadSlot(item.slotIndex);
|
|
98
|
+
setTimeout(() => {
|
|
99
|
+
if (onFinish) onFinish();
|
|
100
|
+
gui.hide(PrebuiltGui.Save);
|
|
101
|
+
gui.hide(PrebuiltGui.TitleScreen);
|
|
102
|
+
}, 50);
|
|
279
103
|
};
|
|
280
104
|
function selectSlot(index) {
|
|
281
105
|
return function() {
|
|
@@ -283,12 +107,12 @@ function component($$props) {
|
|
|
283
107
|
triggerSelect(index);
|
|
284
108
|
};
|
|
285
109
|
}
|
|
286
|
-
|
|
110
|
+
const controls = signal({
|
|
287
111
|
up: {
|
|
288
112
|
repeat: true,
|
|
289
113
|
bind: keyboardControls.up,
|
|
290
114
|
throttle: 150,
|
|
291
|
-
keyDown
|
|
115
|
+
keyDown() {
|
|
292
116
|
nav.next(-1);
|
|
293
117
|
}
|
|
294
118
|
},
|
|
@@ -296,26 +120,26 @@ function component($$props) {
|
|
|
296
120
|
repeat: true,
|
|
297
121
|
bind: keyboardControls.down,
|
|
298
122
|
throttle: 150,
|
|
299
|
-
keyDown
|
|
123
|
+
keyDown() {
|
|
300
124
|
nav.next(1);
|
|
301
125
|
}
|
|
302
126
|
},
|
|
303
127
|
action: {
|
|
304
|
-
bind: keyboardControls.action,
|
|
305
|
-
keyDown
|
|
128
|
+
bind: getKeyboardControlBind(keyboardControls.action),
|
|
129
|
+
keyDown() {
|
|
306
130
|
triggerSelect(selectedSlot());
|
|
307
131
|
}
|
|
308
132
|
},
|
|
309
133
|
escape: {
|
|
310
134
|
bind: keyboardControls.escape,
|
|
311
|
-
keyDown
|
|
135
|
+
keyDown() {
|
|
312
136
|
if (onFinish) onFinish();
|
|
313
137
|
gui.hide(PrebuiltGui.Save);
|
|
314
138
|
}
|
|
315
139
|
},
|
|
316
140
|
gamepad: { enabled: true }
|
|
317
141
|
});
|
|
318
|
-
mount(
|
|
142
|
+
mount((element) => {
|
|
319
143
|
refreshSlots();
|
|
320
144
|
});
|
|
321
145
|
return h(DOMContainer, {
|
|
@@ -360,30 +184,31 @@ function component($$props) {
|
|
|
360
184
|
h(DOMElement, {
|
|
361
185
|
element: "div",
|
|
362
186
|
attrs: { class: "rpg-ui-save-load-slot-line" },
|
|
363
|
-
textContent: "
|
|
187
|
+
textContent: t("rpg.save.level") + ": " + item.slot.level
|
|
364
188
|
}),
|
|
365
189
|
h(DOMElement, {
|
|
366
190
|
element: "div",
|
|
367
191
|
attrs: { class: "rpg-ui-save-load-slot-line" },
|
|
368
|
-
textContent: "
|
|
192
|
+
textContent: t("rpg.save.exp") + ": " + item.slot.exp
|
|
369
193
|
}),
|
|
370
194
|
h(DOMElement, {
|
|
371
195
|
element: "div",
|
|
372
196
|
attrs: { class: "rpg-ui-save-load-slot-line" },
|
|
373
|
-
textContent: "
|
|
197
|
+
textContent: t("rpg.save.map") + ": " + item.slot.map
|
|
374
198
|
}),
|
|
375
199
|
h(DOMElement, {
|
|
376
200
|
element: "div",
|
|
377
201
|
attrs: { class: "rpg-ui-save-load-slot-line" },
|
|
378
|
-
textContent: "
|
|
202
|
+
textContent: t("rpg.save.date") + ": " + item.slot.date
|
|
379
203
|
})
|
|
380
204
|
]), () => h(DOMElement, {
|
|
381
205
|
element: "div",
|
|
382
206
|
attrs: { class: "rpg-ui-save-load-slot-empty" },
|
|
383
|
-
textContent:
|
|
207
|
+
textContent: computed(() => t("rpg.save.empty-slot"))
|
|
384
208
|
}))]))))]));
|
|
385
209
|
}
|
|
210
|
+
var __ce_component = component;
|
|
386
211
|
//#endregion
|
|
387
|
-
export {
|
|
212
|
+
export { __ce_component as default };
|
|
388
213
|
|
|
389
214
|
//# sourceMappingURL=save-load.ce.js.map
|