/** * @brief Handles selectboxes clicks */ void uiOptionListNode::onLeftClick (uiNode_t* node, int x, int y) { uiNode_t* option; if (UI_AbstractOption_GetCurrentValue(node) == nullptr) return; /* select the right option */ option = UI_OptionListNodeGetOptionAtPosition(node, x, y); /* update the status */ if (option) UI_AbstractOption_SetCurrentValue(node, OPTIONEXTRADATA(option).value); }
/** * @brief Handles tab clicks */ void uiTabNode::onLeftClick (uiNode_t* node, int x, int y) { uiNode_t* option; if (UI_AbstractOption_GetCurrentValue(node) == nullptr) return; option = UI_TabNodeTabAtPosition(node, x, y); if (option == nullptr) return; if (option->disabled) return; /* only execute the click stuff if the selectbox is active */ if (node->state) UI_AbstractOption_SetCurrentValue(node, OPTIONEXTRADATA(option).value); UI_PlaySound("click1"); }