Adding icon toggle

This commit is contained in:
SilentSpike 2015-07-24 17:23:25 +01:00
parent e413cb3d91
commit bafb261c01
2 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,7 @@ GVAR(camZoom) = 1.25;
GVAR(showComp) = true;
GVAR(showHelp) = true;
GVAR(showIcons) = true;
GVAR(showInterface) = true;
GVAR(showMap) = false;
GVAR(showTool) = true;

View File

@ -112,8 +112,10 @@ switch (toLower _mode) do {
[localize LSTRING(uiToggleUnits),"1"],
[localize LSTRING(uiToggleTools),"2"],
[localize LSTRING(uiToggleCompass),"3"],
[localize LSTRING(uiToggleIcons),"4"],
[localize LSTRING(uiToggleInterface),"Backspace"],
[localize LSTRING(freeCamControls)],
[localize LSTRING(freeCamForward),"W"],
[localize LSTRING(freeCamBackward),"S"],
[localize LSTRING(freeCamLeft),"A"],
@ -198,6 +200,9 @@ switch (toLower _mode) do {
case 4: { // 3
[_display,true] call FUNC(toggleInterface);
};
case 5: { // 4
GVAR(showIcons) = !GVAR(showIcons);
};
case 14: { // Backspace
[_display,nil,nil,true] call FUNC(toggleInterface);
};
@ -386,6 +391,8 @@ switch (toLower _mode) do {
_map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(camera),24,24,GVAR(camPan)];
};
if !(GVAR(showIcons)) exitWith {};
private ["_cachedVehicles","_unit","_color","_icon"];
_cachedVehicles = [];
{
@ -399,7 +406,7 @@ switch (toLower _mode) do {
[_unit] call FUNC(cacheUnitInfo);
};
_color = GETVAR(_unit,GVAR(uColor),[0,0,0,0]);
_color = GETVAR(_unit,GVAR(uColor),[ARR_4(0,0,0,0)]);
_icon = GETVAR(_unit,GVAR(uIcon),"");
_map drawIcon [_icon, _color, _unit, 24, 24, getDir _unit];
};