mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
Merge branch 'port' into port-debugger
This commit is contained in:
commit
04a6f64a95
2 files changed
+29
-1
No files matched your search
+1
-1
@@ -4747,7 +4747,7 @@ void menuProcessInput(void)
|
||||
}
|
||||
|
||||
// don't back out on weapon back when using mouse because it's likely bound to wheel
|
||||
if (!g_MenuUsingMouse && (buttonsnow & BUTTON_WPNBACK)) {
|
||||
if (!g_MenuMouseControl && (buttonsnow & BUTTON_WPNBACK)) {
|
||||
inputs.back = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2454,6 +2454,34 @@ bool menuitemSliderTick(struct menuitem *item, struct menudialog *dialog, struct
|
||||
f32 f14;
|
||||
|
||||
if ((tickflags & MENUTICKFLAG_ITEMISFOCUSED)) {
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_MenuUsingMouse && inputs->select) {
|
||||
// handle mouse
|
||||
struct menudialog *dialog = g_Menus[g_MpPlayerNum].curdialog;
|
||||
if (dialog) {
|
||||
const s32 left = dialog->x + dialog->width - 82;
|
||||
const s32 right = dialog->x + dialog->width - 7;
|
||||
const s32 size = right - left;
|
||||
const s32 delta = inputs->mousex - left;
|
||||
if (delta >= -8 && delta <= size + 8) {
|
||||
index = (delta / (f32)size) * item->param3;
|
||||
if (index < 0) {
|
||||
index = 0;
|
||||
}
|
||||
if (index > item->param3) {
|
||||
index = item->param3;
|
||||
}
|
||||
if (item->handler) {
|
||||
item->handler(MENUOP_GET, item, &handlerdata);
|
||||
handlerdata.slider.value = index;
|
||||
item->handler(MENUOP_SET, item, &handlerdata);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (tickflags & MENUTICKFLAG_DIALOGISDIMMED) {
|
||||
if (item->handler) {
|
||||
item->handler(MENUOP_GETSLIDER, item, &handlerdata);
|
||||
|
||||
Reference in new issue
Block a user