Gamer125 / fofix

Automatically exported from code.google.com/p/fofix
0 stars 0 forks source link

practice mode does not allow to select sections #1167

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
in SVN r2038, the practice mode does not allow to select a song section to
start with.

See the following patch to fix the issue:

===================================================================
--- src/SongChoosingScene.py    (revision 2038)
+++ src/SongChoosingScene.py    (working copy)
@@ -1015,6 +1028,34 @@
     #render the foreground stuff last
     self.engine.theme.setlist.renderForeground(self)

+  def selectPracticeSection(self):
+    # FB: bugfix r2038: missing selection of practice sections in practice
mode
+    #     code here mostly taken from SongChoosingScene.py of release 3.121
+    info = Song.loadSongInfo(self.engine, self.songName, library =
self.libraryName)
+    info.getSections()
+    sectionLabels = [sLabel for sLabel,sPos in info.sections]
+
+    # TODO: clear screen here
+    startLabel = Dialogs.chooseItem(self.engine, sectionLabels, "%s \n %s"
% (Dialogs.removeSongOrderPrefixFromName(info.name), _("Start Section:")))
+
+    if startLabel:
+      Log.debug("Practice start section selected: " + startLabel)
+      #self.player.practiceSection = startLabel
+    else:
+      startLabel = "Gig"
+    
+    #find start position in array:
+    try:
+      tempStart = [sPos for sLabel,sPos in info.sections if sLabel ==
startLabel]
+      if tempStart == []:
+        self.playerList[0].startPos = 0.0
+      else:
+        self.playerList[0].startPos = tempStart[0]
+      Log.debug("Practice start position retrieved: " +
str(self.playerList[0].startPos))
+    except:
+      Log.error("Cannot retrieve start position!")
+      self.playerList[0].startPos = 0.0
+  
   def render(self, visibility, topMost):
     if self.gameStarted:
       return

Original issue reported on code.google.com by felix.uwe.bertram@gmail.com on 31 Mar 2010 at 2:26

GoogleCodeExporter commented 9 years ago
Bumping priority and adding Review label.

Original comment by fuzio...@gmail.com on 1 Sep 2010 at 1:27