mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
Add wrap-around key movement to menu system
This commit is contained in:
parent
cb49e59c86
commit
8798b99394
@ -147,7 +147,13 @@ public:
|
||||
|
||||
void move(int movement)
|
||||
{
|
||||
activeEntry = std::min<const int>(entries.size()-1, std::max<const int>(0, activeEntry + movement));
|
||||
activeEntry += movement;
|
||||
if (activeEntry >= int(entries.size())) {
|
||||
activeEntry = 0;
|
||||
}
|
||||
else if (activeEntry < 0) {
|
||||
activeEntry = entries.size() - 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user