hide height / velocity while parachuting, freefallig in expert mode, fix 692

This commit is contained in:
commy2 2015-04-17 11:02:01 +02:00
parent 54daa02aa4
commit 20565e8b02
3 changed files with 43 additions and 2 deletions

View File

@ -40,5 +40,4 @@ GVAR(PFH) = false;
}] call EFUNC(common,addEventHandler);
// don't show speed and height when in expert mode
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler);

View File

@ -18,6 +18,7 @@
ADDON = false;
PREP(doLanding);
PREP(handleInfoDisplayChanged);
PREP(hideAltimeter);
PREP(onEachFrame);
PREP(showAltimeter);

View File

@ -0,0 +1,41 @@
/*
* Author: commy2
* Hides the height and velocity display while freefalling or parachuting on higher difficulties.
*
* Arguments:
* Stuff from infoDisplayChanged eventhandler.
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_dialog", "_type"];
_dialog = _this select 0;
_type = _this select 1;
// don't do anything in noob mode
if (cadetMode) exitWith {};
switch (_type) do {
case ("Parachute"): {
{
(_dialog displayCtrl _x) ctrlShow false;
} forEach [121, 122, 1004, 1005, 1006, 1014];
};
case ("Soldier"): {
{
private "_control";
_control = (_dialog displayCtrl _x);
// these reset ctrlShow every frame by the engine. Set height/width to 0 as work around.
_control ctrlSetPosition [0,0,0,0];
_control ctrlCommit 0;
} forEach [380, 382];
};
};
nil // switch might return true if no case was found. Just to make sure the return value matches