forked from Ports/perfect_dark
Merge pull request #729 from ZenithMDC/mousewheel-scrollable-menus
Add mousewheel scrolling to scrollable menus
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -4614,6 +4614,9 @@ void dialogTick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickfl
|
|||||||
s32 adjustment = (s32)(inputs->yaxis * g_Vars.diffframe60freal / 20) - (s32)(inputs->updownheld * g_Vars.diffframe60freal);
|
s32 adjustment = (s32)(inputs->yaxis * g_Vars.diffframe60freal / 20) - (s32)(inputs->updownheld * g_Vars.diffframe60freal);
|
||||||
#else
|
#else
|
||||||
s32 adjustment = inputs->yaxis * g_Vars.diffframe60 / 20 - inputs->updownheld * g_Vars.diffframe60;
|
s32 adjustment = inputs->yaxis * g_Vars.diffframe60 / 20 - inputs->updownheld * g_Vars.diffframe60;
|
||||||
|
#endif
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
adjustment -= inputs->mousescroll * (LINEHEIGHT + 1);
|
||||||
#endif
|
#endif
|
||||||
dialog->dstscroll += adjustment;
|
dialog->dstscroll += adjustment;
|
||||||
|
|
||||||
|
|||||||
@@ -3228,6 +3228,9 @@ bool menuitemScrollableTick(struct menuitem *item, struct menudialog *dialog, st
|
|||||||
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
||||||
#else
|
#else
|
||||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||||
|
#endif
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
intval += inputs->mousescroll * (LINEHEIGHT - 2) * 3;
|
||||||
#endif
|
#endif
|
||||||
data->scrollable.scrolloffset += intval;
|
data->scrollable.scrolloffset += intval;
|
||||||
|
|
||||||
@@ -3751,6 +3754,9 @@ bool menuitemRankingTick(struct menuinputs *inputs, u32 tickflags, union menuite
|
|||||||
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
||||||
#else
|
#else
|
||||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||||
|
#endif
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
intval += inputs->mousescroll * (LINEHEIGHT - 1);
|
||||||
#endif
|
#endif
|
||||||
data->ranking.scrolloffset += intval;
|
data->ranking.scrolloffset += intval;
|
||||||
|
|
||||||
@@ -4046,6 +4052,9 @@ bool menuitemPlayerStatsTick(struct menuitem *item, struct menudialog *dialog, s
|
|||||||
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
intval = intval + (s32)(((f32)inputs->updownheld + (f32)inputs->updownheld) * g_Vars.diffframe60freal);
|
||||||
#else
|
#else
|
||||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||||
|
#endif
|
||||||
|
#ifndef PLATFORM_N64
|
||||||
|
intval += inputs->mousescroll * (LINEHEIGHT - 1);
|
||||||
#endif
|
#endif
|
||||||
data->dropdown.scrolloffset += intval;
|
data->dropdown.scrolloffset += intval;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user