ScratchAddons icon indicating copy to clipboard operation
ScratchAddons copied to clipboard

New addon: remove "pop" sound from new sprites

Open WorldLanguages opened this issue 3 years ago • 6 comments

feature request: automatically remove "pop" sound when creating a new sprite with paint option

Related to "customizable default project" (it has an empty project preset), but it would also affect newly created sprites.

WorldLanguages avatar Jun 25 '22 19:06 WorldLanguages

I would totally use this, I really hope you implement it.

BroJac5246 avatar Jun 25 '22 23:06 BroJac5246

+1 from recent feedback

WorldLanguages avatar Oct 26 '22 02:10 WorldLanguages

Related closed issue: #6597

We could also add the option to remove the my variable variable even if the user doesn't know about "customizable default project"

WorldLanguages avatar Aug 26 '23 15:08 WorldLanguages

We could also add the option to remove the my variable variable even if the user doesn't know about "customizable default project"

+1 from comment https://github.com/ScratchAddons/ScratchAddons/discussions/6635#discussioncomment-6956092

WorldLanguages avatar Sep 10 '23 01:09 WorldLanguages

+1 from feedback

WorldLanguages avatar Aug 04 '24 15:08 WorldLanguages

heres some basic code to do this:

  vm = scratchAddons.eventTargets.tab[0].traps.vm;
  const _addSprite = vm.addSprite;
  vm.addSprite = function (data) {
    const json = JSON.parse(data);
    // this removes all default sounds. there could be a setting to only remove the pop sound.
    json.sounds = [];
    return _addSprite.call(this, JSON.stringify(json));
  };

  const _loadProject = vm.loadProject;
  vm.loadProject = function (data) {
    if (typeof data === "string") {
      const json = JSON.parse(data);
      for (const target of json.targets) {
        // this removes all default sounds. there could be a setting to only remove the pop sound.
        target.sounds = [];
      }

      return _loadProject.call(this, JSON.stringify(json));
    }
    return _loadProject.call(this, data);
  };

would probably need to test with remixing, creating copies, uploading sprites/projects, etc.

TheColaber avatar Aug 04 '24 17:08 TheColaber

+1 from feedback

WorldLanguages avatar Dec 24 '24 15:12 WorldLanguages