mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-25 11:36:26 -05:00
animation is played and last frame is completedFrame
This commit is contained in:
parent
08e590f3e4
commit
856138daca
@ -374,6 +374,8 @@ func (s *QuestLog) makeQuestIconForAct(act, n int) (*d2ui.Sprite, error) {
|
||||
case d2enum.QuestStatusCompleted:
|
||||
err = icon.SetCurrentFrame(completedFrame)
|
||||
case d2enum.QuestStatusCompleting:
|
||||
// animation will be played after quest-log panel is opened (see s.playQuestAnimation)
|
||||
err = icon.SetCurrentFrame(0)
|
||||
case d2enum.QuestStatusNotStarted:
|
||||
err = icon.SetCurrentFrame(notStartedFrame)
|
||||
default:
|
||||
@ -398,7 +400,6 @@ func (s *QuestLog) playQuestAnimations() {
|
||||
i.SetPlayLength(3)
|
||||
i.PlayForward()
|
||||
i.SetPlayLoop(false)
|
||||
s.questStatus[questID] = d2enum.QuestStatusCompleted
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -521,9 +522,15 @@ func (s *QuestLog) Advance(elapsed float64) {
|
||||
return
|
||||
}
|
||||
|
||||
for _, i := range s.quests[s.selectedTab].icons {
|
||||
if err := i.Advance(elapsed); err != nil {
|
||||
s.Error(err.Error())
|
||||
for j, i := range s.quests[s.selectedTab].icons {
|
||||
questID := s.cordsToQuestID(s.selectedTab+1, j)
|
||||
if s.questStatus[questID] == d2enum.QuestStatusCompleting {
|
||||
if err := i.Advance(elapsed); err != nil {
|
||||
s.Error(err.Error())
|
||||
}
|
||||
if i.GetCurrentFrame() == completedFrame {
|
||||
s.questStatus[questID] = d2enum.QuestStatusCompleted
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user