Skip to content

Commit

Permalink
Merge pull request #98 from Feodor0090/mods-touch
Browse files Browse the repository at this point in the history
Add touch support for mods select
  • Loading branch information
Feodor0090 authored Nov 2, 2022
2 parents 1d64404 + c5e000e commit 903e816
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/nmania/ui/ng/ModsSelectScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ public void OnKey(IDisplay d, int k) {
}

public void OnTouch(IDisplay d, int s, int x, int y, int dx, int dy, int w, int h) {
if (s != 1)
return;

int dir = x * 3 / w;
dir--;
if (y < fontH * 2) {
selected = 0;
mods.SetDA(dir);
} else if (y < fontH * 4) {
selected = 1;
mods.SetFA(dir);
} else if (y < fontH * 5) {
selected = 2;
Settings.defaultMods = mods.GetMask();
Settings.Save();
}
}

}

0 comments on commit 903e816

Please sign in to comment.