[pyddr-devel] Added level sorting to songselect.py

Frank Foeth foeth01 at orange.nl
Mon Jan 22 04:39:53 EST 2007


Hello Pavel,

> > Don't worry about that --- make whatever changes are needed to get
this
> > right, and then use 'svn diff' to make the patch.

Please find attached a new patch generated with  svn diff  this time. I
hope your nasty test set does not throw up more surprises. If it does I
hope to hear from you soon.

> > I've tried the patch out as it is. Unfortunately, it appears to die if
> > the folder being viewed contains nonstandard difficulty level names
> > (which show up in some unofficial steps), so I haven't been able to test
> > it. I've attached the file with the traceback.
> Yep, it should. I'll ban anything nonstandard to the end of the 
> displayed list.

This seems to be ok now. Hopefully your test set agrees. 

> > Please correct me if I am misunderstanding the problem, but what about
> > ending up in the folder of the level of the difficulty selected at the
> > time the mode was changed?

I bound it to the first player's selection. Keeping track of the last
selected value is a pain:
- it requires an extra variable
- if you walk through a list of songs, the chosen difficulties may
change if the same value is not available in a new song, so I have to
choose a player to bind it to in this common case anyway.

I do have one testing problem though, I don't have a two player setup.
If there is a trick in the program to simulate this from keyboard, I'd
like to know. And I don't have space for a two mat set-up anyway.

I sorted out two more bugs.
1. the one I mailed to the list: badly defined folder index on returning
from a subfolder after changing the sort mode while in a subfolder (see
also my email from yesterday, jan 21 - Bug in songselect).
2. in the index folders the number of songs were not updated when
choosing the next sort mode. 

1. required quite some hacking. Bottom line: 
In the old system only the last used folder index in the last used index
folder was stored, this was then used to reset the cursor to the right
folder index. This breaks down after resorting while in a subfolder. 
I threw out most of this and replaced it with:
- a reconstruction of the wanted subfolder name from the current
selected song, just before returning. 
- getting the appropriate index for this folder name.
(There are still FIXME comments in some places commenting out the old
lines, please remove after a new version of songselect has been proved
stable.)

2. Was easy, just added ui.SORT to the list that forces a new preview.

I hope the new version is stable,

Yours,
Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svn-diff-level-sorting.patch
Type: text/x-patch
Size: 10521 bytes
Desc: not available
URL: <http://icculus.org/pipermail/pyddr-devel/attachments/20070122/c1731755/attachment.bin>


More information about the pyddr-devel mailing list