Fix group tags scaling glitch

My mistake from b148293
This commit is contained in:
ebayShopper
2017-03-09 13:10:29 -05:00
parent 50b71a08b7
commit f22460491a
2 changed files with 41 additions and 35 deletions

View File

@@ -2,5 +2,6 @@
[FIXED] Kamaz refuel trucks no longer allow automatic refueling. #1855 @coresync2k @dreamforceinc [FIXED] Kamaz refuel trucks no longer allow automatic refueling. #1855 @coresync2k @dreamforceinc
[FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions. [FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions.
[FIXED] Glitch where group icons scaled very large momentarily while moving off screen.
[INFO] See Documents\CHANGE LOG 1.0.6.txt for the full list of 1.0.5.1 --> 1.0.6 changes. [INFO] See Documents\CHANGE LOG 1.0.6.txt for the full list of 1.0.5.1 --> 1.0.6 changes.

View File

@@ -1,47 +1,52 @@
#define DRAW_TAGS (!visibleMap && count units group player > 1) //Use && cameraView != "GROUP" if tactical view is allowed (blocked by default)
private ["_display","_distance","_group","_icon","_index","_pos","_scale","_screen","_text"]; private ["_display","_distance","_group","_icon","_index","_pos","_scale","_screen","_text"];
disableSerialization; disableSerialization;
while {true} do { _refresh = {
_group = player call dayz_filterGroup; _group = player call dayz_filterGroup;
if (!visibleMap && count _group > 1) then { //Use (&& cameraView != "GROUP") if tactical view is allowed (blocked by default) _display = uiNamespace getVariable "DZ_GroupTags";
80000 cutRsc ["DZ_GroupTags","PLAIN"]; _index = 0;
{
_display = uiNamespace getVariable "DZ_GroupTags"; _pos = [_x] call FNC_GetPos;
_index = 0; _distance = _pos distance player;
{ _icon = _display displayCtrl (100 + _index);
_pos = [_x] call FNC_GetPos; if (_distance > 1 && _distance < 2500 && vehicle _x != vehicle player) then {
_distance = _pos distance player; _pos set [2,(_pos select 2) + 1.5];
_icon = _display displayCtrl (100 + _index); _screen = worldToScreen _pos;
if (_distance > 1 && _distance < 2500 && vehicle _x != vehicle player) then { _text = composeText [image "\ca\ui\data\igui_side_unknown_ca.paa"," ",if (dayz_groupNameTags) then {name _x} else {""}];
_pos set [2,(_pos select 2) + 1.5]; if (count _screen > 1) then {
_screen = worldToScreen _pos; _scale = if (_distance < 200) then {.3} else {1 min ((1 - (_distance - 3) / 15) max .3)};
_text = composeText [image "\ca\ui\data\igui_side_unknown_ca.paa"," ",if (dayz_groupNameTags) then {name _x} else {""}]; _icon ctrlSetStructuredText _text;
if (count _screen > 1) then { _icon ctrlSetPosition [(_screen select 0),(_screen select 1),.99,.65];
_scale = if (_distance < 200) then {.3} else {1 min ((1 - (_distance - 3) / 15) max .3)}; _icon ctrlSetScale _scale;
_icon ctrlSetStructuredText _text; _icon ctrlSetFade ((1 - _scale) / 2);
_icon ctrlSetPosition [(_screen select 0),(_screen select 1),.99,.65]; _icon ctrlCommit 0;
_icon ctrlSetScale _scale; _icon ctrlShow true;
_icon ctrlSetFade ((1 - _scale) / 2);
_icon ctrlCommit 0;
_icon ctrlShow true;
} else {
_icon ctrlShow false;
};
} else { } else {
_icon ctrlShow false; _icon ctrlShow false;
}; };
_index = _index + 1; } else {
} count _group; _icon ctrlShow false;
if (dayz_oldGroupCount > count _group) then {
_display displayCtrl (100 + _index) ctrlShow false;
}; };
_index = _index + 1;
} count _group;
dayz_oldGroupCount = count _group; if (dayz_oldGroupCount > count _group) then {
} else { _display displayCtrl (100 + _index) ctrlShow false;
80000 cutText ["","PLAIN"];
}; };
uiSleep 0.01; dayz_oldGroupCount = count _group;
};
while {true} do {
waitUntil {uiSleep 1; DRAW_TAGS};
80000 cutRsc ["DZ_GroupTags","PLAIN"];
while {DRAW_TAGS} do {
call _refresh; //Must be called to finish in current frame
uiSleep 0.01;
};
80000 cutText ["","PLAIN"];
}; };