Fix mouse clicking around interface if IFACE_BAR_MODE is enabled (#12)
See #3
This commit is contained in:
parent
c634499a87
commit
03b5771e8f
|
@ -831,6 +831,22 @@ void gameMouseRefresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool gameMouseClickOnInterfaceBar()
|
||||||
|
{
|
||||||
|
Rect interfaceBarWindowRect;
|
||||||
|
windowGetRect(gInterfaceBarWindow, &interfaceBarWindowRect);
|
||||||
|
|
||||||
|
int interfaceBarWindowRectLeft = 0;
|
||||||
|
int interfaceBarWindowRectRight = _scr_size.right;
|
||||||
|
|
||||||
|
if (gInterfaceBarMode) {
|
||||||
|
interfaceBarWindowRectLeft = interfaceBarWindowRect.left;
|
||||||
|
interfaceBarWindowRectRight = interfaceBarWindowRect.right;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _mouse_click_in(interfaceBarWindowRectLeft, interfaceBarWindowRect.top, interfaceBarWindowRectRight, interfaceBarWindowRect.bottom);
|
||||||
|
}
|
||||||
|
|
||||||
// 0x44BFA8
|
// 0x44BFA8
|
||||||
void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
|
void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
|
||||||
{
|
{
|
||||||
|
@ -852,8 +868,7 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: allow clicking to the left and right of the INTERFACE_BAR if gInterfaceBarMode is enabled
|
if (gameMouseClickOnInterfaceBar()) {
|
||||||
if (!_mouse_click_in(0, 0, _scr_size.right - _scr_size.left, _scr_size.bottom - _scr_size.top - INTERFACE_BAR_HEIGHT)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,5 +186,6 @@ int _gmouse_3d_move_to(int x, int y, int elevation, Rect* a4);
|
||||||
int gameMouseHandleScrolling(int x, int y, int cursor);
|
int gameMouseHandleScrolling(int x, int y, int cursor);
|
||||||
void _gmouse_remove_item_outline(Object* object);
|
void _gmouse_remove_item_outline(Object* object);
|
||||||
int objectIsDoor(Object* object);
|
int objectIsDoor(Object* object);
|
||||||
|
bool gameMouseClickOnInterfaceBar();
|
||||||
|
|
||||||
#endif /* GAME_MOUSE_H */
|
#endif /* GAME_MOUSE_H */
|
||||||
|
|
Loading…
Reference in New Issue