Back to Index Page generated: Jul 27, 2025, 4:28:31 AM

Expansion Change View Sound

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Plays a sound whenever the view direction is changed during flight. Plays a sound whenever the view direction is changed during flight.
Identifier oolite.oxp.phkb.ChangeViewSound oolite.oxp.phkb.ChangeViewSound
Title Change View Sound Change View Sound
Category Miscellaneous Miscellaneous
Author phkb phkb
Version 1.1 1.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Change_View_Sound n/a
Download URL https://wiki.alioth.net/img_auth.php/0/05/ChangeViewSound.oxz n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1753589749

Documentation

Also read http://wiki.alioth.net/index.php/Change%20View%20Sound

readme.txt

Change View Sound
by Nick Rogers

Overview
========
The aim of this OXP is to add an audible notification that the view has been changed. By default, change the view to forward, aft, port or starboard occurs silently. In most cases this is fine, as the player will normally have been the one to trigger the change, so there would appear, on the surface at least, to be no need for any sound to play as well. However, is this age of live streaming and YouTube recordings, changing the view without some sort of sound can leave an audience wondering what happened on the screen. By including a small sound, those watching can be alerted to the fact that the player has just done something.

License
=======
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/

Version History
===============
1.1
- Added click when the space compass target changes, the selected MFD slot changes, or an MFD key changes.
- Increased the volume a touch.

1.0
- Initial release.

Equipment

This expansion declares no equipment.

Ships

This expansion declares no ships.

Models

This expansion declares no models.

Scripts

Path
Config/script.js
"use strict";
this.name        = "ChangeViewSound";
this.author      = "phkb";
this.copyright   = "2018 phkb";
this.description = "Plays a sound whenever the view direction is changed during flight";
this.licence     = "CC BY-NC-SA 4.0";

//--------------------------------------------------------------------------------------------------------------
this.viewDirectionChanged = function(viewString) {
	var p = player.ship;
    if (p.alertCondition !== 0) this.$playSound();
}

//-------------------------------------------------------------------------------------------------------------
this.compassTargetChanged = this.selectedMFDChanged = this.mfdKeyChanged = function() {
	this.$playSound();
}

//-------------------------------------------------------------------------------------------------------------
this.$playSound = function() {
	var mySound = new SoundSource;
    mySound.sound = "[@click]";
	mySound.loop = false;
	mySound.volume = 0.6;
	mySound.play();
}