Hi all, hope I'm posting in the right place.
Does anyone else find the default title music waaaay too loud? I had started up a new project and tried to find settings to reduce the volume of everything on startup (before the player goes to the options) but found that I'd have to manually lower the volume setting on each sound. At least, I think you have to do that. . . .Either way, I decided to try and make a plugin to do just that!
I only know the barest minimum of making plugins, so there's gonna be some bad practices here, but I felt proud enough to share anyway. I hope anyone would be willing to point out mistakes I did make or any best practices I should follow. Thanks!
Does anyone else find the default title music waaaay too loud? I had started up a new project and tried to find settings to reduce the volume of everything on startup (before the player goes to the options) but found that I'd have to manually lower the volume setting on each sound. At least, I think you have to do that. . . .Either way, I decided to try and make a plugin to do just that!
JavaScript:
(function() {
// Lower master volume initially
WebAudio.setMasterVolume(0.4);
// Create master volume configuration
Object.defineProperty(ConfigManager, 'masterVolume', {
get: function() {
return (WebAudio._masterVolume * 100).clamp(0, 100);
},
set: function(value) {
WebAudio.setMasterVolume((value / 100).clamp(0, 1));
},
configurable: true
});
// Make and apply changes to volume when selected in options
var _ConfigManager_MakeData = ConfigManager.prototype.makeData;
ConfigManager.prototype.makeData = function() {
_ConfigManager_MakeData.call(this);
var config = {};
config.masterVolume = this.masterVolume;
return config;
}
var _ConfigManager_ApplyData = ConfigManager.prototype.applyData;
ConfigManager.prototype.applyData = function(config) {
_ConfigManager_ApplyData.call(this, config);
this.masterVolume = this.readVolume(config, 'masterVolume');
}
// Add master volume option to UI
var _Window_Options_AddVolumeOptions = Window_Options.prototype.addVolumeOptions;
Window_Options.prototype.addVolumeOptions = function() {
this.addCommand('Master Volume', 'masterVolume');
_Window_Options_AddVolumeOptions.call(this);
}
})();
I only know the barest minimum of making plugins, so there's gonna be some bad practices here, but I felt proud enough to share anyway. I hope anyone would be willing to point out mistakes I did make or any best practices I should follow. Thanks!
).