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

Add the new MusicRate selector to Edit/Practice mode #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kubik369
Copy link
Contributor

@kubik369 kubik369 commented Sep 9, 2022

Hi,

I have added the new MusicRate selector that is default in Play mode to the Edit/Practice menu. I have been able to limit it to applying this only in the ScreenEditOptions, so I am fairly certain it should not break anything else.

Thanks for taking a look :)

The newer one supports a range in 0.01 step increments while the
old one only allowed coarse steps, e.g. 0.25, 0.5, 0.75, 0.8, ...

Signed-off-by: Jakub Šimo <[email protected]>
@moruzerinho6 moruzerinho6 added the enhancement New feature or request label Sep 9, 2022
@kubik369
Copy link
Contributor Author

I have just noticed that the original PR did not work on the second playback of the song. I have written it in the comment above the code, so I will just paste it here:

-- The rate change needs to be set in ModsLevel_Song for it to work in Edit/Practice modes.
-- It needs to be set in ModsLevel_Stage too, otherwise the rate gets reset when playing
-- the song a second time. If it is set only in ModsLevel_Stage, it gets applied only
-- on the second playback of the song and the first one gets weirdly modified going in the
-- opposite direction, e.g. set a song to 0.50x and you get the arrows going double the speed.
local isInEditOptions = SCREENMAN:GetTopScreen() and SCREENMAN:GetTopScreen():GetName() == "ScreenEditOptions"
if isInEditOptions then
  GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):MusicRate( self.Values[choice] )
  GAMESTATE:GetSongOptionsObject("ModsLevel_Song"):PitchRate( self.Values[choice] )
  GAMESTATE:GetSongOptionsObject("ModsLevel_Stage"):MusicRate( self.Values[choice] )
  GAMESTATE:GetSongOptionsObject("ModsLevel_Stage"):PitchRate( self.Values[choice] )
end

I have pushed the commit which should remedy this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants