ACE3/addons/scopes/functions/fnc_onDrawShortdot.sqf

26 lines
587 B
Plaintext
Raw Normal View History

2015-04-02 20:40:21 +00:00
// by commy2
#include "script_component.hpp"
2015-04-02 22:03:08 +00:00
private "_control";
_control = uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull];
2015-04-02 20:40:21 +00:00
2015-04-02 22:03:08 +00:00
if (cameraView != "GUNNER" || {currentWeapon ACE_player != primaryWeapon ACE_player}) exitWith {
2015-04-02 20:40:21 +00:00
_control ctrlShow false;
};
private ["_size", "_sizeX", "_sizeY"];
2015-04-02 22:03:08 +00:00
_size = call EFUNC(common,getZoom);
2015-04-02 20:40:21 +00:00
_sizeX = _size/4;
_sizeY = _sizeX*safezoneW/safezoneH;
_control ctrlSetPosition [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
_control ctrlCommit 0;
_control ctrlShow true;