← Go back

lnbSetTooltip for Arma 3


Posted on May 10, 2018 at 12:11 (GMT +00:00) by Colin

Creating dialogs for Arma 3 can be a serious pain in the a** and even worse when something does not work or is missing. A good example is ListNBox, adding tooltips to a multi column listbox means you need to add some additional maths to calculate column offset due to there not being any lnbSetTooltip, and instead you need to use lbSetTooltip.

Anyway to save anyone a headache, you can add this function in, using the following function:


//
// API missing function lnbSetTooltip for usage with ListNBox
// Author: Colin J.D. Stewart.
// usage: [ctrl, index, colcount, "text"] call lnbSetTooltip;
//
lnbSetTooltip = {
    params["_ctrl", "_index", "_cols", "_text"];
    
    _ctrl lbSetTooltip [_index + ((_cols-1)*_index), _text];    
};


Params:
_ctrl = the ListNBox control
_index = the index of the row via addRow
_cols = how many columns your listnBox has declared.
_text = the obvious, the text you want for the tooltip

[_row, 5, 3, "My tooltip"] call lnbSetTooltip;



I will occasionally post missing api functions, so keep checking back.
/Scripting/Programming/Game Modding