untitled-pixi-live2d-engine 1.3.0 → 1.3.1

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/cubism.js CHANGED
@@ -2762,7 +2762,7 @@ var __async = (__this, __arguments, generator) => {
2762
2762
  preserveExpressionOnMotion: true,
2763
2763
  cubism: CubismFrameworkConfig
2764
2764
  };
2765
- const VERSION = "1.3.0";
2765
+ const VERSION = "1.3.1";
2766
2766
  const logger = {
2767
2767
  log(tag, ...messages) {
2768
2768
  if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
@@ -6014,13 +6014,18 @@ var __async = (__this, __arguments, generator) => {
6014
6014
  * group: The motion group,
6015
6015
  * index: Index in the motion group,
6016
6016
  * priority: The priority to be applied. (0: No priority, 1: IDLE, 2:NORMAL, 3:FORCE) (default: 2)
6017
+ * ignoreParamIds: The ids to be ignored,
6018
+ * loop: Whether the motion should loop.
6017
6019
  * @return Promise that resolves with a list, indicates the motion is successfully started, with false otherwise.
6018
6020
  */
6019
6021
  parallelMotion(motionList) {
6020
6022
  return __async(this, null, function* () {
6021
6023
  this.internalModel.extendParallelMotionManager(motionList.length);
6022
6024
  const result = motionList.map(
6023
- (m, idx) => this.internalModel.parallelMotionManager[idx].startMotion(m.group, m.index, m.priority)
6025
+ (m, idx) => this.internalModel.parallelMotionManager[idx].startMotion(m.group, m.index, m.priority, {
6026
+ ignoreParamIds: m.ignoreParamIds,
6027
+ loop: m.loop
6028
+ })
6024
6029
  );
6025
6030
  const flags = [];
6026
6031
  for (const r of result) {
@@ -9022,11 +9027,13 @@ var __async = (__this, __arguments, generator) => {
9022
9027
  * @param index - Index in the motion group.
9023
9028
  * @param priority - The priority to be applied. default: 2 (NORMAL)
9024
9029
  * @param ignoreParamIds - The ids to be ignored.
9030
+ * @param loop - Whether the motion should loop. Overrides Cubism 3/4/5 motion JSON loop metadata when specified.
9025
9031
  * @return Promise that resolves with true if the motion is successfully started, with false otherwise.
9026
9032
  */
9027
9033
  startMotion(_0, _1) {
9028
- return __async(this, arguments, function* (group, index, priority = MotionPriority.NORMAL, ignoreParamIds = []) {
9034
+ return __async(this, arguments, function* (group, index, priority = MotionPriority.NORMAL, options = {}) {
9029
9035
  var _a;
9036
+ const { ignoreParamIds = [], loop } = Array.isArray(options) ? { ignoreParamIds: options, loop: void 0 } : options;
9030
9037
  if (!this.state.reserve(group, index, priority)) {
9031
9038
  return false;
9032
9039
  }
@@ -9041,7 +9048,7 @@ var __async = (__this, __arguments, generator) => {
9041
9048
  logger.log(this.tag, "Start motion:", this.getMotionName(definition));
9042
9049
  this.emit("motionStart", group, index, void 0);
9043
9050
  this.playing = true;
9044
- this._startMotion(motion, void 0, ignoreParamIds);
9051
+ this._startMotion(motion, void 0, ignoreParamIds, loop);
9045
9052
  return true;
9046
9053
  });
9047
9054
  }
@@ -9049,10 +9056,11 @@ var __async = (__this, __arguments, generator) => {
9049
9056
  * Starts a random Motion as given priority.
9050
9057
  * @param group - The motion group.
9051
9058
  * @param priority - The priority to be applied. (default: 1 `IDLE`)
9059
+ * @param loop - Whether the motion should loop. Overrides Cubism 3/4/5 motion JSON loop metadata when specified.
9052
9060
  * @return Promise that resolves with true if the motion is successfully started, with false otherwise.
9053
9061
  */
9054
- startRandomMotion(group, priority) {
9055
- return __async(this, null, function* () {
9062
+ startRandomMotion(_0, _1) {
9063
+ return __async(this, arguments, function* (group, priority, { loop = void 0 } = {}) {
9056
9064
  var _a;
9057
9065
  const groupDefs = this.manager.definitions[group];
9058
9066
  if (groupDefs == null ? void 0 : groupDefs.length) {
@@ -9065,7 +9073,7 @@ var __async = (__this, __arguments, generator) => {
9065
9073
  }
9066
9074
  if (availableIndices.length) {
9067
9075
  const index = availableIndices[Math.floor(Math.random() * availableIndices.length)];
9068
- return this.startMotion(group, index, priority);
9076
+ return this.startMotion(group, index, priority, { loop });
9069
9077
  }
9070
9078
  }
9071
9079
  return false;