@shimotsuki/core 2.0.36 → 2.0.37

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/index.d.ts CHANGED
@@ -1024,10 +1024,12 @@ declare class Manager {
1024
1024
  get store(): CoreStore;
1025
1025
  get gui_bundle_name(): string;
1026
1026
  get audio_local_store_key(): string;
1027
+ get default_audio_effect(): string;
1027
1028
  /**GUI资源配置 */
1028
- setConfig: ({ gui_bundleName, audio_local_store_key }?: {
1029
+ setConfig: ({ default_audio_effect, gui_bundleName, audio_local_store_key }?: {
1029
1030
  gui_bundleName?: string;
1030
1031
  audio_local_store_key?: string;
1032
+ default_audio_effect?: string;
1031
1033
  }) => this;
1032
1034
  /**启动 */
1033
1035
  boot(): Promise<void>;
package/dist/index.js CHANGED
@@ -2764,8 +2764,9 @@ const AudioEffect = (effect, callBackFun) => {
2764
2764
  return (_target, _propertyKey, descriptor) => {
2765
2765
  let oldFun = descriptor.value;
2766
2766
  descriptor.value = function (...args) {
2767
- if (effect) {
2768
- cat.audio.playEffect(effect);
2767
+ const _effect = effect ?? cat.default_audio_effect;
2768
+ if (_effect) {
2769
+ cat.audio.playEffect(_effect);
2769
2770
  }
2770
2771
  else {
2771
2772
  console.warn(`请添加音效路径参数`);
@@ -2860,13 +2861,17 @@ class Manager {
2860
2861
  /**音效本地存储key */
2861
2862
  #audio_local_store_key = '';
2862
2863
  get audio_local_store_key() { return this.#audio_local_store_key; }
2864
+ /**默认音效路径 */
2865
+ #default_audio_effect = '';
2866
+ get default_audio_effect() { return this.#default_audio_effect; }
2863
2867
  /**GUI资源配置 */
2864
- setConfig = ({ gui_bundleName = 'resources', audio_local_store_key = 'game_audio' } = {}) => {
2868
+ setConfig = ({ default_audio_effect = '', gui_bundleName = 'resources', audio_local_store_key = 'game_audio' } = {}) => {
2865
2869
  if (this.#initialized) {
2866
2870
  throw new Error('[CAT] 已初始化,无法修改配置');
2867
2871
  }
2868
2872
  this.#gui_bundle_name = gui_bundleName;
2869
2873
  this.#audio_local_store_key = audio_local_store_key;
2874
+ this.#default_audio_effect = default_audio_effect;
2870
2875
  return this;
2871
2876
  };
2872
2877
  /**启动 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shimotsuki/core",
3
- "version": "2.0.36",
3
+ "version": "2.0.37",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",