Open Saborknight opened 5 years ago
Fast and easy way to add stuff to arsenal is to draw controls using Arsenal display. Code below may be be plugged into some loop (e.g. eachFrame) or handler may be attached
if ( isNull ( uinamespace getvariable "RSCDisplayArsenal") ) exitWith {}; // No arseanl display
private _display = uinamespace getvariable "RSCDisplayArsenal";
// Adds new button control to arsenal UI
private _ctrl = _display ctrlCreate ["RscButton", -1];
_ctrl ctrlSetText "MY BUTTON";
_ctrl ctrlSetPosition [0.375,1,0.25,0.05];
_ctrl ctrlCommit 0;
_ctrl ctrlAddEventHandler ["ButtonClick", {
params ["_control"];
/* Do stuff, call some functions to move selected headgear to belt */
}];
@10Dozen Thanks a lot for the code. I'll probably take the code from my other Mod BackpackOnChest :)
Similar to BackpackOnChest, have a button that allows the user to sling the helmet and then select another headgear.