mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
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);
|
||||
#else
|
||||
s32 adjustment = inputs->yaxis * g_Vars.diffframe60 / 20 - inputs->updownheld * g_Vars.diffframe60;
|
||||
#endif
|
||||
#ifndef PLATFORM_N64
|
||||
adjustment -= inputs->mousescroll * (LINEHEIGHT + 1);
|
||||
#endif
|
||||
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);
|
||||
#else
|
||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||
#endif
|
||||
#ifndef PLATFORM_N64
|
||||
intval += inputs->mousescroll * (LINEHEIGHT - 2) * 3;
|
||||
#endif
|
||||
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);
|
||||
#else
|
||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||
#endif
|
||||
#ifndef PLATFORM_N64
|
||||
intval += inputs->mousescroll * (LINEHEIGHT - 1);
|
||||
#endif
|
||||
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);
|
||||
#else
|
||||
intval += inputs->updownheld * 2 * g_Vars.diffframe60;
|
||||
#endif
|
||||
#ifndef PLATFORM_N64
|
||||
intval += inputs->mousescroll * (LINEHEIGHT - 1);
|
||||
#endif
|
||||
data->dropdown.scrolloffset += intval;
|
||||
|
||||
|
||||
Reference in new issue
Block a user