Jump to content
bendy303

Teamswitch text popup - change???

Recommended Posts

Hi, I have created a revive mod, and I would like to change the teamswitch popup text when you press "U".

I just want to make the text red for units that are incapacitated, so you can choose which units to teamswitch into...

how can I affect this popup? is it a display number?

cheers

Ben

 

Share this post


Link to post
Share on other sites

Hello, already solved in forum:

 

 

Click on my reply.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/19/2024 at 11:27 PM, pierremgi said:

Hello, already solved in forum:

 

 

Click on my reply.

this is great, thanks Pierre.

I also wouldnt mind just being able to see which units are down in the teamswitch popup - because sometmes you have no choice but to switch into an incapacitated unit. So its choice...

any way to change the font colour in the popup?

cheers Pierre

Share this post


Link to post
Share on other sites
52 minutes ago, bendy303 said:

any way to change the font colour in the popup?

 

fnc_teamSwitch = {
  disableSerialization;
  params ["_type","_ctrlDispl"];
  private _idc = ctrlIDC (_ctrlDispl select 0);
  private _selectedIndex = _ctrlDispl param [1];
  _displ = findDisplay 632;
  _ctrl101 = _displ displayCtrl 101;
  _cnt = (lbsize 101) -1;
  for "_i" from 0 to _cnt do {
    _selectedUnit = switchableUnits param [_i,objNull];
    _unit = vehicle _selectedUnit;
    if (lifeState _unit == "incapacitated") then {
      lbSetText [_idc,_i,"unconscious unit"];
      lbSetTooltip [_idc, _i, "unconscious unit"];
      lbSetColor [_idc, _i,[1,0.3,0.3,1]];    // CHANGE COLOR HERE (R,G,B,A)
    };
  };
  if (_type == 1) then {true};
  if (lifeState (vehicle (switchableUnits param [_selectedIndex,objNull])) == "incapacitated") then {
    (_displ displayCtrl 1) ctrlShow false
  } else {
    (_displ displayCtrl 1) ctrlShow true
  }
};

[] spawn {
  while {true} do {
    waituntil {sleep 0.2; !isnull findDisplay 632};
    (findDisplay 632 displayCtrl 101) ctrlAddEventHandler ["LBSelChanged",
      "[0,_this] call fnc_teamSwitch"
    ];
    (findDisplay 632 displayCtrl 101) ctrlsetEventHandler ["LBDblClick",
      "[1,_this] call fnc_teamSwitch"
    ];
    waitUntil {sleep 0.2; isNull findDisplay 632};
  };
};

 

  • Like 2

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

 


fnc_teamSwitch = {
  disableSerialization;
  params ["_type","_ctrlDispl"];
  private _idc = ctrlIDC (_ctrlDispl select 0);
  private _selectedIndex = _ctrlDispl param [1];
  _displ = findDisplay 632;
  _ctrl101 = _displ displayCtrl 101;
  _cnt = (lbsize 101) -1;
  for "_i" from 0 to _cnt do {
    _selectedUnit = switchableUnits param [_i,objNull];
    _unit = vehicle _selectedUnit;
    if (lifeState _unit == "incapacitated") then {
      lbSetText [_idc,_i,"unconscious unit"];
      lbSetTooltip [_idc, _i, "unconscious unit"];
      lbSetColor [_idc, _i,[1,0.3,0.3,1]];    // CHANGE COLOR HERE (R,G,B,A)
    };
  };
  if (_type == 1) then {true};
  if (lifeState (vehicle (switchableUnits param [_selectedIndex,objNull])) == "incapacitated") then {
    (_displ displayCtrl 1) ctrlShow false
  } else {
    (_displ displayCtrl 1) ctrlShow true
  }
};

[] spawn {
  while {true} do {
    waituntil {sleep 0.2; !isnull findDisplay 632};
    (findDisplay 632 displayCtrl 101) ctrlAddEventHandler ["LBSelChanged",
      "[0,_this] call fnc_teamSwitch"
    ];
    (findDisplay 632 displayCtrl 101) ctrlsetEventHandler ["LBDblClick",
      "[1,_this] call fnc_teamSwitch"
    ];
    waitUntil {sleep 0.2; isNull findDisplay 632};
  };
};

 



 

Pierre thanks a million!!! that works!!!!!!!!!!!!!!!!!!! BRILLIANT

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×