ACE3/addons/huntir/functions/fnc_huntirCompass.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

90 lines
2.5 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: Norrin, Rocko, Ruthberg
*
* HuntIR monitor compass
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ACE_huntir_fnc_huntirCompass
*
* Public: No
*/
disableSerialization;
#define __DSP (uiNamespace getVariable QGVAR(cam_rose))
#define __CHAR_N (__DSP displayCtrl 64432)
#define __CHAR_E (__DSP displayCtrl 64433)
#define __CHAR_S (__DSP displayCtrl 64434)
#define __CHAR_W (__DSP displayCtrl 64435)
#define __OFFSET_X 0.003
#define __OFFSET_Y 0.003
#define __WIDTH 0.1
#define __HEIGHT 0.1
#define __RADIUS 0.05
#define __CENTER_X 0.70
#define __CENTER_Y 0.65
private _fnc_correctIt = {
params ["_pos", "_dir"];
if (_dir >= 270 || {_dir <= 90}) then {
_pos set [1, (_pos select 1) + __OFFSET_Y]
};
if (_dir >= 0 && {_dir <= 180}) then {
_pos set [0, (_pos select 0) - __OFFSET_X]
};
if (_dir >= 90 && {_dir <= 270}) then {
_pos set [1, (_pos select 1) - __OFFSET_Y]
};
if (_dir >= 180 && {_dir <= 360}) then {
_pos set [0, (_pos select 0) + __OFFSET_X]
};
_pos
};
HUNTIR_CAM_ROSE_LAYER_ID cutRsc [QGVAR(cam_rose), "PLAIN"];
[{
params ["_args", "_idPFH"];
_args params ["_fnc_correctIt"];
if (GVAR(stop)) exitWith {
HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"];
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _dir = getDir GVAR(cam); // direction player;
private _x1 = __CENTER_X - (__RADIUS * sin(_dir));
private _y1 = __CENTER_Y - (__RADIUS * cos(_dir));
private _pos = [[_x1, _y1], _dir] call _fnc_correctIt;
__CHAR_N ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT];
__CHAR_N ctrlCommit 0;
_x1 = __CENTER_X - (__RADIUS * sin(_dir + 90));
_y1 = __CENTER_Y - (__RADIUS * cos(_dir + 90));
_pos = [[_x1, _y1], _dir] call _fnc_correctIt;
__CHAR_W ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT];
__CHAR_W ctrlCommit 0;
_x1 = __CENTER_X - (__RADIUS * sin(_dir + 180));
_y1 = __CENTER_Y - (__RADIUS * cos(_dir + 180));
_pos = [[_x1, _y1], _dir] call _fnc_correctIt;
__CHAR_S ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT];
__CHAR_S ctrlCommit 0;
_x1 = __CENTER_X - (__RADIUS * sin(_dir + 270));
_y1 = __CENTER_Y - (__RADIUS * cos(_dir + 270));
_pos = [[_x1, _y1], _dir] call _fnc_correctIt;
__CHAR_E ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT];
__CHAR_E ctrlCommit 0;
}, 0.01, [_fnc_correctIt]] call CBA_fnc_addPerFrameHandler;