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

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,13 @@
1
1
  # @rpgjs/vite
2
2
 
3
+ ## 5.0.0-beta.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 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.
8
+ - Updated dependencies
9
+ - @rpgjs/server@5.0.0-beta.13
10
+
3
11
  ## 5.0.0-beta.12
4
12
 
5
13
  ### 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-CSIUAHY9.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,28 @@ 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
+ /**
8666
8687
  * Get whether direction changes are locked
8667
8688
  *
8668
8689
  * @returns True if direction is locked and cannot be changed automatically
@@ -8824,6 +8845,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8824
8845
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "direction", void 0);
8825
8846
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_speed", void 0);
8826
8847
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "graphics", void 0);
8848
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_graphicScale", void 0);
8827
8849
  __decorate([sync({ persist: false }), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_canMove", void 0);
8828
8850
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "hitbox", void 0);
8829
8851
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_gold", void 0);
@@ -8844,6 +8866,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8844
8866
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_through", void 0);
8845
8867
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_throughOtherPlayer", void 0);
8846
8868
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_throughEvent", void 0);
8869
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_pushable", void 0);
8847
8870
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_frequency", void 0);
8848
8871
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_frames", void 0);
8849
8872
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "componentsTop", void 0);
@@ -8853,6 +8876,7 @@ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.
8853
8876
  __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "componentsRight", void 0);
8854
8877
  __decorate([sync({ persist: false }), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_removeTransition", void 0);
8855
8878
  __decorate([connected(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "isConnected", void 0);
8879
+ __decorate([sync(), __decorateMetadata("design:type", Object)], RpgCommonPlayer.prototype, "_mass", void 0);
8856
8880
  (class Vector2 {
8857
8881
  /**
8858
8882
  * Creates a new Vector2
@@ -9408,6 +9432,40 @@ var Context = class {
9408
9432
  return this.values[key];
9409
9433
  }
9410
9434
  };
9435
+ var I18nServiceToken = "I18nServiceToken";
9436
+ var PendingI18nLayersKey = "__rpgjs_pending_i18n_layers__";
9437
+ function normalizeMessages(messages) {
9438
+ if (!messages) return {};
9439
+ const normalized = {};
9440
+ for (const locale in messages) {
9441
+ const catalog = messages[locale];
9442
+ if (!catalog || typeof catalog !== "object") continue;
9443
+ normalized[locale] = { ...catalog };
9444
+ }
9445
+ return normalized;
9446
+ }
9447
+ function hasMessages(messages) {
9448
+ if (!messages) return false;
9449
+ return Object.values(messages).some((catalog) => catalog && Object.keys(catalog).length > 0);
9450
+ }
9451
+ function getPendingLayers(context) {
9452
+ const values = context;
9453
+ values[PendingI18nLayersKey] ||= [];
9454
+ return values[PendingI18nLayersKey];
9455
+ }
9456
+ function registerI18nMessages(context, messages, source = "module", priority = 10) {
9457
+ if (!hasMessages(messages)) return;
9458
+ const service = inject$1(context, I18nServiceToken, { optional: true });
9459
+ if (service) {
9460
+ service.addMessages(messages, source, priority);
9461
+ return;
9462
+ }
9463
+ getPendingLayers(context).push({
9464
+ source,
9465
+ priority,
9466
+ messages: normalizeMessages(messages)
9467
+ });
9468
+ }
9411
9469
  var context = new Context();
9412
9470
  context["side"] = "server";
9413
9471
  var MAP_UPDATE_TOKEN_HEADER = "x-rpgjs-map-update-token";
@@ -9664,6 +9722,7 @@ function provideServerModules(modules) {
9664
9722
  module = moduleObj;
9665
9723
  }
9666
9724
  if ("server" in module) module = module.server;
9725
+ if (module.i18n) registerI18nMessages(context, module.i18n, "server-module", 10);
9667
9726
  if (module.player?.props) module = {
9668
9727
  ...module,
9669
9728
  playerProps: { load: (player) => {