Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Music volume slider asset #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samrocketman
Copy link

Adds the volume slider svg that works as a base for the volume slider png

samrocketman pushed a commit to samrocketman/endless-sky that referenced this pull request Mar 3, 2023
* This PR is a revival of endless-sky#7538.
* Authorship from prior code review is preserved.

Feature Summary
---------------

Adds the possibility to add playlists to the game that are only played in certain locations and if certain conditions are met.

Example:

```ruby
track "test2"
        volume 0.1 #add 0.1 to volume
	idle "music/mainscreen" #idle track, played during normal gameplay
	combat "music/mainscreen" #combat track, played during combat
	landing "music/mainscreen" #landing track, played while landed

track "test1"
	idle "music/haispace"
	combat "music/haispace"
	landing "music/haispace"

playlist "test"
        to play #conditions for playing this playlist
                has "Hai Intro: done"
	location #locationfilter for where to play this
		not government "Hai"
	priority 1 #the priority, higher priority playlist will be chosen over lower priority playlists
	weight 10 #the weight of a playlist inside of its priority layer, higher weight means more probable to be chosen
	tracks "linear"
		"test1" 20
		"test2" 20
```

Detailed Explanation
--------------------

`track NAME` holds the following child keys.

* `NAME` the name of the track
* `volume` (default 0): a value that should be chosen between -1 and 1 that gets added to the current volume of the music. (use this with small values, otherwise users who want dim music will be annoyed.)
* Three categories of music associated with this track. The tracks will be played when the player is in their state. If one is not given, nothing will be played in that state.
  * `idle`
  * `combat`
  * `landing`

`playlist NAME` holds the following child keys.

* `NAME` the name of the playlist.
* `to play` conditions that determine if this playlist can be played.
* A `location` filter for where this playlist will be played.
* A `priority`, higher priorities will always play over lower priorities.
* A `weight`, playlists with higher weight are more likely to be played inside the same priority.
* `tracks`
  * A progression style: `linear`, `random`, or `pick` (pick means that one track will be picked and repeated until the playlist is switched)
  * Various tracks with weights to them, weights only matter for pick or random progression style.

This would play either track one or track two when you are not in Hai government zone.

Testing Done
------------

TBD

Important
---------

* Asset pull request: endless-sky/endless-sky-assets#127

Checklist
---------

- [ ] Update with upstream master including CMake.
- [ ] Do some testing.

Co-authored-by: Hurleveur <[email protected]>
Co-authored-by: tibetiroka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants