Esempio n. 1
0
/**
 * @brief Turn button is hit
 */
static void CL_TurnDown_f (void)
{
	if (IN_GetMouseSpace() == MS_UI)
		return;
	if (IN_GetMouseSpace() == MS_WORLD)
		CL_ActorTurnMouse();
}
Esempio n. 2
0
/**
 * @brief Set the focus to the next action node
 * @note Action nodes are nodes with click defined
 * @sa Key_Event
 * @sa UI_FocusExecuteActionNode
 */
static bool UI_FocusNextActionNode (void)
{
#if 0	/**< @todo need a cleanup */
	static int i = UI_MAX_WINDOWSTACK + 1;	/* to cycle between all windows */

	if (IN_GetMouseSpace() != MS_UI)
		return false;

	if (UI_GetMouseCapture())
		return false;

	if (i >= ui_global.windowStackPos)
		i = UI_GetLastFullScreenWindow();

	assert(i >= 0);

	if (focusNode) {
		uiNode_t* node = UI_GetNextActionNode(focusNode);
		if (node)
			return UI_FocusSetNode(node);
	}

	while (i < ui_global.windowStackPos) {
		uiNode_t* window;
		window = ui_global.windowStack[i++];
		if (UI_FocusSetNode(UI_GetNextActionNode(window->firstChild)))
			return true;
	}
	i = UI_GetLastFullScreenWindow();

	/* no node to focus */
	UI_RemoveFocus();
#endif
	return false;
}
Esempio n. 3
0
static void CL_ActionUp_f (void)
{
	IN_KeyUp(&in_pantilt);
	if (IN_GetMouseSpace() == MS_UI)
		return;
	if (in_pantilt.msec < 250)
		CL_ActorActionMouse();
	IN_SetMouseSpace(MS_NULL);
}
Esempio n. 4
0
/**
 * @brief Execute the current focused action node
 * @note Action nodes are nodes with click defined
 * @sa Key_Event
 * @sa UI_FocusNextActionNode
 */
static bool UI_FocusExecuteActionNode (void)
{
#if 0	/**< @todo need a cleanup */
	if (IN_GetMouseSpace() != MS_UI)
		return false;

	if (UI_GetMouseCapture())
		return false;

	if (focusNode) {
		if (focusNode->onClick) {
			UI_ExecuteEventActions(focusNode, focusNode->onClick);
		}
		UI_ExecuteEventActions(focusNode, focusNode->onMouseLeave);
		focusNode = nullptr;
		return true;
	}
#endif
	return false;
}
Esempio n. 5
0
/**
 * @brief Draws the 3D-cursor in battlemode and the icons/info next to it.
 */
static void SCR_DrawCursor (void)
{
	if (scr_showcursor->integer == 0)
		return;

	if (!scr_cursor->integer)
		return;

	if (scr_cursor->modified) {
		scr_cursor->modified = qfalse;
		SCR_TouchPics();
	}

	if (!cursorImage[0])
		return;

	if (!UI_DNDIsDragging()) {
		const char *pic;
		image_t *image;

		if (cls.team != cl.actTeam && CL_BattlescapeRunning())
			pic = "pics/cursors/wait";
		else
			pic = cursorImage;

		image = R_FindImage(pic, it_pic);
		if (image)
			R_DrawImage(mousePosX - image->width / 2, mousePosY - image->height / 2, image);

		if (IN_GetMouseSpace() == MS_WORLD && CL_BattlescapeRunning()) {
			HUD_UpdateCursor();
		}
	} else {
		UI_DrawCursor();
	}
}
Esempio n. 6
0
/**
 * @brief Left mouse button is freed in menu
 */
static void CL_LeftClickUp_f (void)
{
	if (IN_GetMouseSpace() == MS_UI) {
		UI_MouseUp(mousePosX, mousePosY, K_MOUSE1);
	}
}
Esempio n. 7
0
/**
 * @brief Middle mouse button is hit in menu
 */
static void CL_MiddleClickDown_f (void)
{
	if (IN_GetMouseSpace() == MS_UI) {
		UI_MouseDown(mousePosX, mousePosY, K_MOUSE3);
	}
}
Esempio n. 8
0
static void CL_TurnUp_f (void)
{
	if (IN_GetMouseSpace() == MS_UI)
		return;
	IN_SetMouseSpace(MS_NULL);
}
Esempio n. 9
0
/**
 * @brief Left mouse click
 */
static void CL_SelectDown_f (void)
{
	if (IN_GetMouseSpace() != MS_WORLD)
		return;
	CL_ActorSelectMouse();
}
Esempio n. 10
0
static void IN_PanTiltDown_f (void)
{
	if (IN_GetMouseSpace() != MS_WORLD)
		return;
	IN_KeyDown(&in_pantilt);
}