mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: fix mouse controls in combat sim keyboard
This commit is contained in:
1 parent
07e6fdc1e0
commit
b523b1e076
2 files changed
+30
-1
No files matched your search
+26
-1
@@ -1372,7 +1372,7 @@ bool menuitemKeyboardTick(struct menuitem *item, struct menuinputs *inputs, u32
|
||||
if (dialog && g_MenuUsingMouse && !inputs->leftright && !inputs->updown) {
|
||||
const s32 dleft = dialog->x + 4;
|
||||
const s32 dright = dleft + 12 * 10;
|
||||
const s32 dtop = dialog->y + 13 + 12;
|
||||
const s32 dtop = menuitemGetTop(item, dialog) + 12;
|
||||
const s32 dbottom = dtop + 11 * 5;
|
||||
const s32 mx = inputs->mousex;
|
||||
const s32 my = inputs->mousey;
|
||||
@@ -4514,3 +4514,28 @@ Gfx *menuitemOverlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct menuitem *it
|
||||
|
||||
return gdl;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
|
||||
s32 menuitemGetTop(struct menuitem *item, struct menudialog *dialog)
|
||||
{
|
||||
struct menu *menu = &g_Menus[g_MpPlayerNum];
|
||||
s32 dtop = dialog->y + LINEHEIGHT + 1;
|
||||
|
||||
for (s32 i = 0; i < dialog->numcols; ++i) {
|
||||
const s32 colindex = i + dialog->colstart;
|
||||
|
||||
for (s32 j = 0; j < menu->cols[colindex].numrows; ++j) {
|
||||
const s32 rowindex = j + menu->cols[colindex].rowstart;
|
||||
struct menuitem *pitem = &dialog->definition->items[menu->rows[rowindex].itemindex];
|
||||
if (pitem == item) {
|
||||
return dtop;
|
||||
}
|
||||
dtop += menu->rows[rowindex].height;
|
||||
}
|
||||
}
|
||||
|
||||
return dtop;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user