@gamelearn/arcade-components 3.30.10 → 3.30.11

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.
@@ -60855,30 +60855,37 @@ function useStateMachine(l) {
60855
60855
  }
60856
60856
  }
60857
60857
  return new Promise((b) => b(!1));
60858
- }, f = async (T, y) => {
60859
- const E = getCurrentVisible(T, e);
60860
- if (cache[T] || (cache[T] = {}), !E)
60861
- return new Promise((D) => D(!1));
60862
- const g = E.userData.animator, v = n[T], b = v[y];
60863
- let R = cache[v.talking];
60864
- if (R || (await s(T), R = cache[v.talking]), !b)
60858
+ }, f = async (T, y, E) => {
60859
+ const g = getCurrentVisible(T, e);
60860
+ if (cache[T] || (cache[T] = {}), !g)
60861
+ return new Promise((O) => O(!1));
60862
+ const v = g.userData.animator, b = n[T], { isSeated: R } = g;
60863
+ let _;
60864
+ if (E)
60865
+ _ = E.url;
60866
+ else {
60867
+ let O = y;
60868
+ R && !y.includes("seated") && (O += "-seated"), _ = b[O];
60869
+ }
60870
+ let w = cache[b.talking];
60871
+ if (w || (await s(T), w = cache[b.talking]), !_)
60865
60872
  return;
60866
- let _ = cache[b];
60867
- if (!_) {
60868
- const { animations: D } = await loader.loadAsync(b);
60869
- _ = cache[b] = D[0];
60870
- }
60871
- const w = b.split("/").pop().replace(".glb", ""), C = mixWithTalkingClip(R, _);
60872
- C.name = `${w}_talking_mixed`;
60873
- const N = C.name;
60874
- if (!E.userData._active || E.userData._active !== N) {
60875
- E.userData._active = N;
60876
- const D = g.register(N, C);
60877
- return new Promise((P) => {
60878
- g.mix(N, MIX_TIME).then((O) => P(O ? D : !1));
60873
+ let C = cache[_];
60874
+ if (!C) {
60875
+ const { animations: O } = await loader.loadAsync(_);
60876
+ C = cache[_] = O[0];
60877
+ }
60878
+ const N = _.split("/").pop().replace(".glb", ""), D = mixWithTalkingClip(w, C);
60879
+ D.name = `${N}_talking_mixed`;
60880
+ const P = D.name;
60881
+ if (!g.userData._active || g.userData._active !== P) {
60882
+ g.userData._active = P;
60883
+ const O = v.register(P, D);
60884
+ return new Promise((F) => {
60885
+ v.mix(P, MIX_TIME).then((M) => F(M ? O : !1));
60879
60886
  });
60880
60887
  }
60881
- return new Promise((D) => D(!1));
60888
+ return new Promise((O) => O(!1));
60882
60889
  }, u = (T) => {
60883
60890
  const y = getCurrentVisible(T, e);
60884
60891
  if (!y)
@@ -60988,7 +60995,7 @@ function DialogComponent({
60988
60995
  var ge;
60989
60996
  if ((ge = At.current) != null && ge.node) {
60990
60997
  const Z = At.current.node.weights.sil > 0.4;
60991
- Fe.current = Z, Z && (W != null && W.uid) ? ft() : W != null && W.uid && $e(W.uid, W.emotion);
60998
+ Fe.current = Z, Z && (W != null && W.uid) ? ft() : W != null && W.uid && $e(W);
60992
60999
  }
60993
61000
  });
60994
61001
  const Ke = useMemo(() => t.reduce((ge, Z) => (Z.slots && Z.slots.filter((xe) => xe.uid).forEach((xe) => {
@@ -61079,12 +61086,9 @@ function DialogComponent({
61079
61086
  const { isSeated: Se } = xe;
61080
61087
  Y.current === Z ? (nt(Z, "neutral", null, Se), Y.current = null) : nt(Z, ge, he, Se);
61081
61088
  }
61082
- }, $e = useCallback(
61083
- (ge, Z) => {
61084
- ge && Z && V(ge, Z);
61085
- },
61086
- [V, W]
61087
- ), ft = () => {
61089
+ }, $e = useCallback(() => {
61090
+ W && V(W.uid, W.emotion, W.animation);
61091
+ }, [V, W]), ft = () => {
61088
61092
  G();
61089
61093
  }, ze = useCallback(() => {
61090
61094
  z.current = !0, Oe({ show: !1 }), xt(), J(), h || e({ type: "success" });