Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A3C_GREN_VISUAL = {
- params ["_muzzle","_mode"];
- //player commandchat str [_mode];
- //-- label parent button
- private _col = if (count A3C_AI_GREN_ARRAY == 0) then {[1,1,1,0.3]} else{[1,1,1,0.6]};
- (findDisplay 7999 displayCtrl 9015) ctrlSetText "A3C_CORE\ui\pictures\icon_menu_grenade.paa";
- (findDisplay 7999 displayCtrl 9015) ctrlSetTextColor _col;
- (findDisplay 7999 displayCtrl 9016) ctrlSetToolTip "AI Grenades";
- //-- sort grenades by usability
- A3C_AI_GREN_ARRAY =
- [
- A3C_AI_GREN_ARRAY,
- [],
- {
- _ammo = getText (configfile >> "CfgMagazines" >> _x >> "ammo");
- _number = 0;
- _explo = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive");
- if (_explo == 1) then {
- _hit = getNumber (configfile >> "CfgAmmo" >> _ammo >> "hit");
- _number = 1000 * _hit;
- } else {
- _number = getNumber (configfile >> "CfgAmmo" >> _ammo >> "aiAmmoUsageFlags");
- };
- _number
- },
- "DESCEND"
- ] call BIS_fnc_sortBy;
- if (A3C_RADIALMODE == "GRENADE" && {BV_GREN == 1}) then {
- //-- reset outer ring buttons
- for "_i" from 10008 to 10039 do {
- (findDisplay 7999 displayCtrl _i) ctrlShow false;
- if (_i % 2 == 0) then {
- (findDisplay 7999 displayCtrl _i) ctrlSetText "";
- } else {
- (findDisplay 7999 displayCtrl _i) ctrlSetTooltip "";
- };
- };
- _outerRingBackGroundIDs = ["PlaceHolder","Left","bottom","Right","Top"];
- //-- outer ring backgrounds
- for "_i" from 8001 to 8004 do {
- _ind = _i - 8000;
- if ( _ind <= ((ceil ((count A3C_AI_GREN_ARRAY) / 4) ) min 3) ) then {
- (findDisplay 7999 displayCtrl _i) ctrlShow true; //-- outer circle backgroud shown
- (findDisplay 7999 displayCtrl _i) ctrlSetText (format ["A3C_CORE\ui\pictures\BG_Radial_OuterRing_%1.paa",_outerRingBackGroundIDs select _ind]);
- } else {
- (findDisplay 7999 displayCtrl _i) ctrlShow false; //-- outer circle backgroud hidden
- };
- };
- if (count A3C_AI_GREN_ARRAY == 0) exitWith {};
- //-- label buttons-images and fncs
- {
- _btnID = (10039 - (_foreachIndex * 2));
- _imgID = ((10039 - (_foreachIndex * 2)) - 1);
- _buttonitem = 16 - _foreachIndex;
- //systemchat str _btnID;
- _btnClicker = findDisplay 7999 displayCtrl _btnID;
- _btnImage = findDisplay 7999 displayCtrl _imgID;
- {_x ctrlShow true} foreach [_btnImage,_btnClicker];
- _btnImage ctrlSetText (gettext (configfile >> "CfgMagazines" >> _x >> "picture"));
- _btnClicker ctrlSetToolTip (gettext (configfile >> "CfgMagazines" >> _x >> "displayNameShort"));
- call compile format
- [
- "
- A3C_OUTER_RING_BTN_fnc_%1 =
- [
- [],
- {
- A3C_GREN_MUZZLE = '%2';
- [] spawn A3C_RadialMenu_GREN;
- systemchat '%2'
- }
- ];
- ",
- _buttonitem,
- _x
- ];
- } foreach A3C_AI_GREN_ARRAY;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement