Example #1
0
/**
 * @brief Handles radio button clicks
 */
void uiRadioButtonNode::onLeftClick (uiNode_t* node, int x, int y)
{
	if (node->onClick) {
		UI_ExecuteEventActions(node, node->onClick);
	}
	if (node->lua_onClick != LUA_NOREF) {
		UI_ExecuteLuaEventScript_XY(node, node->lua_onClick, x, y);
	}

	onActivate(node);
}
void uiLocatedNode::onMiddleClick (uiNode_t* node, int x, int y)
{
	if (node->onMiddleClick != nullptr) {
		UI_ExecuteEventActions(node, node->onMiddleClick);
		UI_PlaySound("click1");
	}
	else if (node->lua_onMiddleClick != LUA_NOREF) {
		UI_ExecuteLuaEventScript_XY(node, node->lua_onMiddleClick, x, y);
		UI_PlaySound("click1");
	}
}
Example #3
0
/**
 * @brief Called when the user click with the right mouse button
 */
void uiTextEntryNode::onLeftClick (uiNode_t* node, int x, int y)
{
	if (node->disabled)
		return;

	/* no cvar */
	if (!node->text)
		return;
	if (!Q_strstart(node->text, "*cvar:"))
		return;

	if (!UI_HasFocus(node)) {
		if (node->onClick) {
			UI_ExecuteEventActions(node, node->onClick);
		}
		if (node->lua_onClick != LUA_NOREF) {
			UI_ExecuteLuaEventScript_XY(node, node->lua_onClick, x, y);
		}
		UI_RequestFocus(node);
	}
}