Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Groups - Applied optimisations based HEMTT suggestions #212

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions addons/dynGroups/RscDisplayDynamicGroups.sqf
b-mayr-1984 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ switch _mode do
_editGroupName = _display displayCtrl IDC_DYNAMICGROUPS_EDITGROUPNAME;

// Add click events to list boxes
_groupsListbox ctrlAddEventHandler ["treeSelChanged", { with uiNamespace do { ['OnGroupsTreeSelChanged', _this] call DISPLAY; }; }];
_groupsListbox ctrlAddEventHandler ["TreeSelChanged", { with uiNamespace do { ['OnGroupsTreeSelChanged', _this] call DISPLAY; }; }];
_playersListbox ctrlAddEventHandler ["LBSelChanged", { with uiNamespace do { ['OnPlayersLbSelChanged', _this] call DISPLAY; }; }];
_manageListbox ctrlAddEventHandler ["LBSelChanged", { with uiNamespace do { ["OnManageLbSelChanged", _this] call DISPLAY; }; }];

Expand Down Expand Up @@ -588,8 +588,8 @@ switch _mode do
_isManageSection = _params param [2, false, [true]];

private ["_targetVar", "_targetList"];
_targetVar = if (_isManageSection) then { VAR_SELECTED_MEMBER } else { VAR_SELECTED_PLAYER };
_targetList = if (_isManageSection) then { VAR_OLD_MEMBERS_LIST } else { VAR_OLD_PLAYERS_LIST };
_targetVar = [VAR_SELECTED_PLAYER, VAR_SELECTED_MEMBER] select _isManageSection;
_targetList = [VAR_OLD_PLAYERS_LIST, VAR_OLD_MEMBERS_LIST] select _isManageSection;

// All elements currently in list
private _unitElements = [];
Expand Down Expand Up @@ -622,7 +622,7 @@ switch _mode do
_textureIcon = ["GetPlayerIcon", [_x]] call DISPLAY;
_textureRank = "a3\Ui_f\data\GUI\Cfg\Ranks\general_gs.paa";
_isGroupLeader = _x == leader group _x;
_texture = if (_isGroupLeader && ["IsGroupRegistered", [group _x]] call GROUPS) then { _textureRank } else { _textureIcon };
_texture = [_textureIcon, _textureRank] select (_isGroupLeader && ["IsGroupRegistered", [group _x]] call GROUPS);
_sameGroup = group player == group _x;
/*_isDead = !alive _x;
_isIncapacitated = alive _x && _x getVariable ["BIS_revive_incapacitated", false];*/
Expand Down Expand Up @@ -1562,7 +1562,7 @@ switch _mode do
}
forEach _groupsOfSide;

if (typeName _clampedGroupName == typeName "" && {_clampedGroupName != _oldGroupName} && {_clampedGroupName != ""} && {!_nameTaken}) then
if (_clampedGroupName isEqualType "" && {_clampedGroupName != _oldGroupName} && {_clampedGroupName != ""} && {!_nameTaken}) then
{
(group player) setGroupId [_clampedGroupName];
["SendClientMessage", ["SetName", [group player, _clampedGroupName]]] call GROUPS;
Expand All @@ -1582,7 +1582,7 @@ switch _mode do
_backgroundGroupName ctrlSetBackgroundColor _color;
_editGroupName ctrlSetTextColor [1,1,1,1];

[_backgroundGroupName, _editGroupName, if (_wasUpdated) then { _clampedGroupName } else { _oldGroupName }] spawn
[_backgroundGroupName, _editGroupName, [_oldGroupName, _clampedGroupName] select (_wasUpdated)] spawn
{
scriptName "RscDisplayDynamicGroups RscEdit animation";

Expand Down Expand Up @@ -1721,7 +1721,7 @@ switch _mode do
private "_player";
_player = _params param [0, objNull, [objNull, ""]];

if (typeName _player == typeName "") then
if (_player isEqualType "") then
{
_player = [_player] call BIS_fnc_getUnitByUid;
};
Expand Down
Loading