mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Merge branch 'port' into port-net
This commit is contained in:
commit
f52fa8f759
4 files changed
+10
-14
No files matched your search
+7
-10
@@ -140,6 +140,7 @@ s32 g_MpPlayerNum = 0;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
s32 g_MenuMouseControl = true;
|
||||
s32 g_MenuUsingMouse = false;
|
||||
#endif
|
||||
|
||||
void menuPlaySound(s32 menusound)
|
||||
@@ -1363,7 +1364,7 @@ bool dialogChangeItemFocusWithMouse(struct menudialog *dialog, s32 mx, s32 my)
|
||||
s32 colwidth = 0;
|
||||
|
||||
// only allow mouse control of player 1 menus; ignore mouse if navigating with keyboard
|
||||
if (menu->playernum != 0 || !dialog->usingmouse) {
|
||||
if (menu->playernum != 0 || !g_MenuUsingMouse) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1502,10 +1503,6 @@ void menuOpenDialog(struct menudialogdef *dialogdef, struct menudialog *dialog,
|
||||
dialog->y = dialog->dsty;
|
||||
dialog->width = dialog->dstwidth;
|
||||
dialog->height = dialog->dstheight;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
dialog->usingmouse = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void menuPushDialog(struct menudialogdef *dialogdef)
|
||||
@@ -4509,7 +4506,7 @@ void dialogTick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickfl
|
||||
|
||||
if ((dialog->focuseditem->flags & MENUITEMFLAG_00010000) == 0) {
|
||||
#ifndef PLATFORM_N64
|
||||
if (dialog->usingmouse) {
|
||||
if (g_MenuUsingMouse) {
|
||||
dstscroll = dialog->dstscroll - inputs->mousescroll * LINEHEIGHT;
|
||||
} else
|
||||
#endif
|
||||
@@ -4681,7 +4678,7 @@ void menuProcessInput(void)
|
||||
inputs.mousex = (f32)(SCREEN_WIDTH_LO / 2) + cx;
|
||||
}
|
||||
if (dialog && inputs.mousemoved) {
|
||||
dialog->usingmouse = true;
|
||||
g_MenuUsingMouse = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4748,7 +4745,7 @@ void menuProcessInput(void)
|
||||
}
|
||||
|
||||
// don't back out on weapon back when using mouse because it's likely bound to wheel
|
||||
if (!dialog->usingmouse && (buttonsnow & BUTTON_WPNBACK)) {
|
||||
if (!g_MenuUsingMouse && (buttonsnow & BUTTON_WPNBACK)) {
|
||||
inputs.back = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -5094,10 +5091,10 @@ void menuProcessInput(void)
|
||||
#ifndef PLATFORM_N64
|
||||
// if we haven't been using the mouse but we have been keyboard scrolling disable the mouse
|
||||
if (!inputs.mousemoved && (inputs.leftright || inputs.updown || inputs.leftrightheld || inputs.updownheld)) {
|
||||
dialog->usingmouse = false;
|
||||
g_MenuUsingMouse = false;
|
||||
}
|
||||
// otherwise rotate left/right by clicking on the side of the menu
|
||||
if (dialog->usingmouse && inputs.select && !inputs.leftright && !inputs.leftrightheld) {
|
||||
if (g_MenuUsingMouse && inputs.select && !inputs.leftright && !inputs.leftrightheld) {
|
||||
if (inputs.mousey > dialog->y && inputs.mousey < dialog->y + dialog->height) {
|
||||
if (inputs.mousex < dialog->x) {
|
||||
inputs.leftright = -1;
|
||||
|
||||
+1
-1
@@ -1369,7 +1369,7 @@ bool menuitemKeyboardTick(struct menuitem *item, struct menuinputs *inputs, u32
|
||||
#ifndef PLATFORM_N64
|
||||
// handle mouse
|
||||
struct menudialog *dialog = g_Menus[g_MpPlayerNum].curdialog;
|
||||
if (dialog && dialog->usingmouse && !inputs->leftright && !inputs->updown) {
|
||||
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;
|
||||
|
||||
@@ -540,6 +540,8 @@ extern struct weathercfg g_WeatherConfig[WEATHERCFG_MAX_STAGES];
|
||||
extern const struct weathercfg g_DefaultWeatherConfig;
|
||||
extern const struct weathercfg *g_CurWeatherConfig;
|
||||
|
||||
extern s32 g_MenuUsingMouse;
|
||||
|
||||
extern f32 g_ViShakeIntensityMult;
|
||||
extern u32 g_TexFilter2D;
|
||||
extern s32 g_HudCenter;
|
||||
|
||||
@@ -3745,9 +3745,6 @@ struct menudialog {
|
||||
/*0x6c*/ u8 unk6c;
|
||||
/*0x6d*/ s8 swipedir;
|
||||
/*0x6e*/ u8 unk6e;
|
||||
#ifndef PLATFORM_N64
|
||||
/*0x6f*/ u8 usingmouse;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct menudfc {
|
||||
|
||||
Reference in new issue
Block a user