Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Change View Sound

Content

Warnings

  1. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0

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.0 1.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL 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 1610873213

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.0
- Initial release.

Equipment

This expansion declares no equipment. This may be related to warnings.

Ships

This expansion declares no ships. This may be related to warnings.

Models

This expansion declares no models. This may be related to warnings.

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.$playSound = function() {
	var mySound = new SoundSource;
    mySound.sound = "[@click]";
	mySound.loop = false;
	mySound.volume = 0.5;
	mySound.play();
}