@rpgjs/vite 5.0.0-beta.12 → 5.0.0-beta.14

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @rpgjs/vite
2
2
 
3
+ ## 5.0.0-beta.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c96b31a]
8
+ - @rpgjs/server@5.0.0-beta.14
9
+
10
+ ## 5.0.0-beta.13
11
+
12
+ ### Patch Changes
13
+
14
+ - Release the next RPGJS beta with client interactions, i18n support, movement and physics improvements, Studio fixes, action battle updates, playground migration, and related runtime documentation.
15
+ - Updated dependencies
16
+ - @rpgjs/server@5.0.0-beta.13
17
+
3
18
  ## 5.0.0-beta.12
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -6809,7 +6809,7 @@ function replaceConfigImport() {
6809
6809
  };
6810
6810
  }
6811
6811
  //#endregion
6812
- //#region ../server/dist/module-BOEgtci7.js
6812
+ //#region ../server/dist/module-hfb9Mz5M.js
6813
6813
  /******************************************************************************
6814
6814
  Copyright (c) Microsoft Corporation.
6815
6815
 
@@ -8628,6 +8628,7 @@ var RpgCommonPlayer = class {
8628
8628
  this.direction = signal("down");
8629
8629
  this._speed = signal(4);
8630
8630
  this.graphics = signal([]);
8631
+ this._graphicScale = signal(null);
8631
8632
  this._canMove = signal(true);
8632
8633
  this.hitbox = signal({
8633
8634
  w: 32,
@@ -8648,6 +8649,7 @@ var RpgCommonPlayer = class {
8648
8649
  this._through = signal(false);
8649
8650
  this._throughOtherPlayer = signal(true);
8650
8651
  this._throughEvent = signal(false);
8652
+ this._pushable = signal(false);
8651
8653
  this._frequency = signal(0);
8652
8654
  this._frames = signal([]);
8653
8655
  this.componentsTop = signal(null);
@@ -8660,9 +8662,46 @@ var RpgCommonPlayer = class {
8660
8662
  this._intendedDirection = null;
8661
8663
  this._directionFixed = signal(false);
8662
8664
  this._animationFixed = signal(false);
8665
+ this._mass = signal(1);
8663
8666
  this.pendingInputs = [];
8664
8667
  }
8665
8668
  /**
8669
+ * Physical mass used by the server-side physics body.
8670
+ */
8671
+ get mass() {
8672
+ return this._mass();
8673
+ }
8674
+ /**
8675
+ * Whether this character can be physically pushed by another character.
8676
+ *
8677
+ * This is mainly intended for events. Mass controls how hard a pushable body
8678
+ * is to move; this flag controls whether gameplay allows pushing at all.
8679
+ */
8680
+ get pushable() {
8681
+ return this._pushable();
8682
+ }
8683
+ set pushable(value) {
8684
+ this._pushable.set(!!value);
8685
+ }
8686
+ get through() {
8687
+ return this._through();
8688
+ }
8689
+ set through(value) {
8690
+ this._through.set(!!value);
8691
+ }
8692
+ get throughOtherPlayer() {
8693
+ return this._throughOtherPlayer();
8694
+ }
8695
+ set throughOtherPlayer(value) {
8696
+ this._throughOtherPlayer.set(!!value);
8697
+ }
8698
+ get throughEvent() {
8699
+ return this._throughEvent();
8700
+ }
8701
+ set throughEvent(value) {
8702
+ this._throughEvent.set(!!value);
8703
+ }
8704
+ /**
8666
8705
  * Get whether direction changes are locked
8667
8706
  *
8668
8707
  * @returns True if direction is locked and cannot be changed automatically
@@ -8824,6 +8863,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8824
8863
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "direction", void 0);
8825
8864
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_speed", void 0);
8826
8865
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "graphics", void 0);
8866
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_graphicScale", void 0);
8827
8867
  __decorate([sync({ persist: false }), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_canMove", void 0);
8828
8868
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "hitbox", void 0);
8829
8869
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_gold", void 0);
@@ -8844,6 +8884,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8844
8884
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_through", void 0);
8845
8885
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_throughOtherPlayer", void 0);
8846
8886
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_throughEvent", void 0);
8887
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_pushable", void 0);
8847
8888
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_frequency", void 0);
8848
8889
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_frames", void 0);
8849
8890
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "componentsTop", void 0);
@@ -8853,6 +8894,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8853
8894
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "componentsRight", void 0);
8854
8895
  __decorate([sync({ persist: false }), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_removeTransition", void 0);
8855
8896
  __decorate([connected(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "isConnected", void 0);
8897
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_mass", void 0);
8856
8898
  (class Vector2 {
8857
8899
  /**
8858
8900
  * Creates a new Vector2
@@ -9408,6 +9450,40 @@ var Context = class {
9408
9450
  return this.values[key];
9409
9451
  }
9410
9452
  };
9453
+ var I18nServiceToken = "I18nServiceToken";
9454
+ var PendingI18nLayersKey = "__rpgjs_pending_i18n_layers__";
9455
+ function normalizeMessages(messages) {
9456
+ if (!messages) return {};
9457
+ const normalized = {};
9458
+ for (const locale in messages) {
9459
+ const catalog = messages[locale];
9460
+ if (!catalog || typeof catalog !== "object") continue;
9461
+ normalized[locale] = { ...catalog };
9462
+ }
9463
+ return normalized;
9464
+ }
9465
+ function hasMessages(messages) {
9466
+ if (!messages) return false;
9467
+ return Object.values(messages).some((catalog) => catalog && Object.keys(catalog).length > 0);
9468
+ }
9469
+ function getPendingLayers(context) {
9470
+ const values = context;
9471
+ values[PendingI18nLayersKey] ||= [];
9472
+ return values[PendingI18nLayersKey];
9473
+ }
9474
+ function registerI18nMessages(context, messages, source = "module", priority = 10) {
9475
+ if (!hasMessages(messages)) return;
9476
+ const service = inject$1(context, I18nServiceToken, { optional: true });
9477
+ if (service) {
9478
+ service.addMessages(messages, source, priority);
9479
+ return;
9480
+ }
9481
+ getPendingLayers(context).push({
9482
+ source,
9483
+ priority,
9484
+ messages: normalizeMessages(messages)
9485
+ });
9486
+ }
9411
9487
  var context = new Context();
9412
9488
  context["side"] = "server";
9413
9489
  var MAP_UPDATE_TOKEN_HEADER = "x-rpgjs-map-update-token";
@@ -9664,6 +9740,7 @@ function provideServerModules(modules) {
9664
9740
  module = moduleObj;
9665
9741
  }
9666
9742
  if ("server" in module) module = module.server;
9743
+ if (module.i18n) registerI18nMessages(context, module.i18n, "server-module", 10);
9667
9744
  if (module.player?.props) module = {
9668
9745
  ...module,
9669
9746
  playerProps: { load: (player) => {