support for +/- keys to edit ratings.

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1362 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2011-10-28 02:57:24 +00:00
parent dbd0751b8d
commit 4af1ca5d0f
11 changed files with 125 additions and 14 deletions

View File

@ -209,6 +209,39 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
break;
case PROJECTM_K_t:
break;
case PROJECTM_K_EQUALS:
case PROJECTM_K_PLUS:
unsigned int index;
if (selectedPresetIndex(index)) {
const int oldRating = getPresetRating(index, HARD_CUT_RATING_TYPE);
if (oldRating >= 6)
break;
const int rating = oldRating + 1;
changePresetRating(index, rating, HARD_CUT_RATING_TYPE);
}
break;
case PROJECTM_K_MINUS:
if (selectedPresetIndex(index)) {
const int oldRating = getPresetRating(index, HARD_CUT_RATING_TYPE);
if (oldRating <= 1)
break;
const int rating = oldRating - 1;
changePresetRating(index, rating, HARD_CUT_RATING_TYPE);
}
break;
default:
break;
}