Skip to content

Commit

Permalink
dont update notefield if it isnt visible and update wifetwirl logic
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Nov 22, 2018
1 parent 0bcf406 commit d793ad6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ local t =
if getTabIndex() == 0 then
if heyiwasusingthat and GAMESTATE:GetCurrentSong() and noteField then -- these can prolly be wrapped better too -mina
mcbootlarder:visible(true)
mcbootlarder:GetChild("NoteField"):visible(true)
MESSAGEMAN:Broadcast("ChartPreviewOn")
heyiwasusingthat = false
end
Expand All @@ -44,13 +45,21 @@ local t =
else
if GAMESTATE:GetCurrentSong() and noteField and mcbootlarder:GetVisible() then
mcbootlarder:visible(false)
mcbootlarder:GetChild("NoteField"):visible(false)
MESSAGEMAN:Broadcast("ChartPreviewOff")
heyiwasusingthat = true
end
self:queuecommand("Off")
update = false
end
end,
MilkyTartsCommand=function(self) -- when entering pack screenselectmusic explicitly turns visibilty on notefield off -mina
if noteField and mcbootlarder:GetVisible() then
mcbootlarder:visible(false)
MESSAGEMAN:Broadcast("ChartPreviewOff")
heyiwasusingthat = true
end
end,
TabChangedMessageCommand = function(self)
self:queuecommand("MintyFresh")
end,
Expand Down Expand Up @@ -623,13 +632,6 @@ t[#t + 1] = LoadFont("Common Normal") .. {
self:halign(0)
self:settext("Toggle Preview")
end,
RefreshChartInfoMessageCommand = function(self)
if song then
self:visible(true)
else
self:visible(false)
end
end,
MouseLeftClickMessageCommand = function(self)
if isOver(self) and (song or noteField) then
toggleNoteField()
Expand Down
2 changes: 2 additions & 0 deletions src/NoteField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ NoteField::InitColumnRenderers()
void
NoteField::Update(float fDeltaTime)
{
if (!this->GetVisible())
return;
if (m_bFirstUpdate) {
m_pCurDisplay->m_ReceptorArrowRow.PlayCommand("On");
}
Expand Down
9 changes: 6 additions & 3 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,9 +1453,12 @@ ScreenSelectMusic::AfterMusicChange()
GAMESTATE->m_pCurSong.Set(pSong);
if (pSong != nullptr)
GAMESTATE->m_pPreferredSong = pSong;
else
GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr); // set steps to null when moving out of packs
// so that currentstepsp1 gets broadcast when moving into packs -mina
else {
GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr);
if (m_pPreviewNoteField)
m_pPreviewNoteField->SetVisible(false);
}

GAMESTATE->SetPaused(false); // hacky can see this being problematic
// if we forget about it -mina

Expand Down

0 comments on commit d793ad6

Please sign in to comment.