port kestrel

This commit is contained in:
commy2 2015-01-19 21:13:56 +01:00
parent 97ee63a349
commit 8c8e14b0ca
102 changed files with 508 additions and 2 deletions

View File

@ -0,0 +1 @@
z\ace\addons\kestrel

View File

@ -0,0 +1,6 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};

View File

@ -0,0 +1,53 @@
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
}
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_OpenKestrel {
displayName = "$STR_ACE_Wind_OpenKestrel";
condition = QUOTE('ACE_Kestrel' in items _player && {!GVAR(isKestrel)});
statement = QUOTE(call FUNC(openKestrel));
showDisabled = 0;
priority = 2;
icon = PATHTOF(data\4500NV1.paa);
hotkey = "K";
};
class ACE_CloseKestrel {
displayName = "$STR_ACE_Wind_CloseKestrel";
condition = QUOTE(GVAR(isKestrel));
statement = QUOTE(call FUNC(closeKestrel));
showDisabled = 0;
priority = 2;
icon = PATHTOF(data\4500NV1.paa);
hotkey = "K";
};
};
};
class Item_Base_F;
class ACE_Item_Kestrel: Item_Base_F {
author = "$STR_ACE_Common_ACETeam";
scope = 2;
scopeCurator = 2;
displayName = "$STR_ACE_Kestrel_Name";
vehicleClass = "Items";
class TransportItems {
class ACE_Kestrel {
name = "ACE_Kestrel";
count = 1;
};
};
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_Kestrel,6);
};
};
};

View File

@ -0,0 +1,20 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_Kestrel: ACE_ItemCore {
author = "$STR_ACE_Common_ACETeam";
scope = 2;
displayName = "$STR_ACE_Kestrel_Name";
descriptionShort = "$STR_ACE_Kestrel_Description";
model = PATHTOF(kestrel4500.p3d);
picture = PATHTOF(data\4500NV.paa);
icon = "iconObject_circle";
mapSize = 0.034;
class ItemInfo: InventoryItem_Base_F {
mass = 2;
};
};
};

View File

@ -0,0 +1,138 @@
class RscPicture;
class RscText;
class RscTitles {
class ACE_Kestrel {
onload = QUOTE(_this call FUNC(onLoadKestrel));
//onunload = "";
idd = -1;
movingEnable = 0;
enableDisplay = 1;
duration = 1e+011;
fadein = 0;
fadeout = 0;
enablesimulation = 1;
class controls {
class Kestrel1: RscPicture {
idc = 10;
text = PATHTOF(data\4500NV1.paa);
style = "48 + 0x800";
x = "safeZoneX - 0.25";
y = "safeZoneY + safeZoneH - 0.8";
h = "0.75";
w = "0.75";
};
class Kestrel2: Kestrel1 {
idc = 11;
text = PATHTOF(data\4500NV2.paa);
colorText[] = {0,0,0,1-(sunOrMoon*sunOrMoon+(moonIntensity/5))};
};
class HUD1: RscText {
idc = 12;
type = 0;
style = 1;
text = " 0000";
x = "safeZoneX + 0.08";
y = "safeZoneY + safeZoneH - 0.51";
h = "0.09";
w = "0.108";
shadow = 0;
font = "PuristaMedium";
sizeEx = 0.04;
colorText[] = {0.0745,0.2196,0.1216,0.7};
colorBackground[] = {0,0,0,0};
lineSpacing = 1;
};
class HUD2: HUD1 {
idc = 13;
y = "safeZoneY + safeZoneH - 0.48";
};
class HUD3: HUD1 {
idc = 14;
y = "safeZoneY + safeZoneH - 0.45";
};
class HUD4: HUD1 {
idc = 15;
y = "safeZoneY + safeZoneH - 0.418";
};
};
};
class ACE_KestrelWheel {
onload = QUOTE(_this call FUNC(onLoadKestrelWheel));
//onunload = "";
idd = -1;
movingEnable = 0;
enableDisplay = 1;
duration = 1e+011;
fadein = 0;
fadeout = 0;
enablesimulation = 1;
class controls {
class Wheel: RscPicture {
idc = 1;
type = 0;
style = "48 + 0x800";
text = PATHTOF(data\kestrel_0.paa);
x = "safeZoneX + 0.07";
y = "safeZoneY + safeZoneH - 0.76";
h = "0.15";
w = "0.15";
};
};
};
// helper class to prevent flickering. Used together with preloadTitleRsc command.
class ACE_Kestrel_Preload {
idd = -1;
movingEnable = 0;
duration = 1e+011;
fadein = 0;
fadeout = 0;
class controls {
class Preload_0: RscPicture {
text = PATHTOF(data\kestrel_0.paa);
};
class Preload_1: Preload_0 {
text = PATHTOF(data\kestrel_1.paa);
};
class Preload_2: Preload_0 {
text = PATHTOF(data\kestrel_2.paa);
};
class Preload_3: Preload_0 {
text = PATHTOF(data\kestrel_3.paa);
};
class Preload_4: Preload_0 {
text = PATHTOF(data\kestrel_4.paa);
};
class Preload_5: Preload_0 {
text = PATHTOF(data\kestrel_5.paa);
};
class Preload_6: Preload_0 {
text = PATHTOF(data\kestrel_6.paa);
};
class Preload_7: Preload_0 {
text = PATHTOF(data\kestrel_7.paa);
};
class Preload_8: Preload_0 {
text = PATHTOF(data\kestrel_8.paa);
};
class Preload_9: Preload_0 {
text = PATHTOF(data\kestrel_9.paa);
};
/*class Preload_A: Preload_0 {
text = PATHTOF(data\4500NV.paa);
};
class Preload_B: Preload_0 {
text = PATHTOF(data\4500NV1.paa);
};
class Preload_C: Preload_0 {
text = PATHTOF(data\4500NV2.paa);
};*/
};
};
};

View File

@ -0,0 +1,13 @@
#include "script_component.hpp"
ADDON = false;
PREP(onLoadKestrel);
PREP(onLoadKestrelWheel);
PREP(openKestrel);
PREP(closeKestrel);
GVAR(isKestrel) = false;
GVAR(isKestrelWheel) = false;
ADDON = true;

18
addons/kestrel/config.cpp Normal file
View File

@ -0,0 +1,18 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {"ACE_Item_Kestrel"};
weapons[] = {"ACE_Kestrel"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common","ace_interaction"};
author[] = {"Falke","commy2","KoffeinFlummi","CAA-Picard"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "RscTitles.hpp"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
addons/kestrel/data/rad.paa Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,94 @@
/*
WHILE {AGM_isKestrel} DO {
_dSpotter = direction _player;
_windrarray = WIND;
_windrA= _windrarray select 0;
_windrB= _windrarray select 1;
_windrC= sqrt ((_windrA * _windrA) + (_windrB * _windrB));
_windrD= _windrA atan2 _windrB;
_windrR = _dSpotter - _windrD;
IF (_windrR < 0) THEN {_windrR = 360+_windrR;};
_windrBB = _windrC * sin (_windrR);
_windrAA = sqrt ((_windrC * _windrC) - (_windrBB * _windrBB));
IF (_windrR < 90) THEN {_windrAA= _windrAA - (_windrAA*2);};
IF (_windrR > 270) THEN {_windrAA= _windrAA - (_windrAA*2);};
_OrtPlayer = eyePos _player;
_Pos0 = _OrtPlayer select 0;
_Pos1 = _OrtPlayer select 1;
_Pos2 = _OrtPlayer select 2;
// im Gebaude
_Ort=0;
IF (lineIntersects [_OrtPlayer, [_Pos0,_Pos1,_Pos2 + 15]]) THEN {_Ort=_Ort+1};
/*
if (lineIntersects [_OrtPlayer, [_Pos0,_Pos1 + 15,_Pos2]]) then {_Ort=_Ort+1};
if (lineIntersects [_OrtPlayer, [_Pos0,_Pos1 - 15,_Pos2]]) then {_Ort=_Ort+1};
if (lineIntersects [_OrtPlayer, [_Pos0 + 15,_Pos1,_Pos2]]) then {_Ort=_Ort+1};
if (lineIntersects [_OrtPlayer, [_Pos0 - 15,_Pos1,_Pos2]]) then {_Ort=_Ort+1};
*/
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin windDir) * 15, (_Pos1) - (cos windDir) * 15, (_Pos2)]]) THEN {_Ort=_Ort+1};
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin (windDir-90)) * 15, (_Pos1) - (cos (windDir-90)) * 15, (_Pos2)]]) THEN {_Ort=_Ort+1};
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin (windDir+90)) * 15, (_Pos1) - (cos (windDir+90)) * 15, (_Pos2)]]) THEN {_Ort=_Ort+1};
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin (windDir+180)) * 15, (_Pos1) - (cos (windDir+180)) * 15, (_Pos2)]]) THEN {_Ort=_Ort+1};
if (_Ort>3) then {_windrAA=99.99;_windrBB=99.99};
// in Windrichtung
_Ort=0;
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin windDir) * 5, (_Pos1) - (cos windDir) * 5, (_Pos2)]]) THEN {_Ort=_Ort+1};
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin (windDir-15)) * 5, (_Pos1) - (cos (windDir-15)) * 5, (_Pos2)]]) THEN {_Ort=_Ort+1};
IF (lineIntersects [[(_Pos0) , (_Pos1), (_Pos2)], [(_Pos0) - (sin (windDir+15)) * 5, (_Pos1) - (cos (windDir+15)) * 5, (_Pos2)]]) THEN {_Ort=_Ort+1};
//IF (lineIntersects [_OrtPLAYER, [_Pos0,_Pos1,_Pos2 + 10]]) THEN {_Ort=_Ort+1};
IF (_Ort>2) THEN {_windrAA=99.99;_windrBB=99.99};
//IF (vehicle _player != _player) THEN {_windrAA=0;_windrBB=0};
IF (_player != vehicle _player) THEN {_windrAA=0;_windrBB=0};
IF (_windrAA == 99.99) then {
AGM_Kestrel_wind_Head = 0;
_windrAA= "0.00";
_windrBB= "0.00";
}ELSE{
AGM_Kestrel_wind_Head=_windrAA;
IF (_windrAA < 0) THEN {
_windrAA= FORMAT["-%1",[_windrAA*-1, 1, 2] call CBA_fnc_FORMATNumber];
}ELSE{
_windrAA= FORMAT["%1",[_windrAA, 1, 2] call CBA_fnc_FORMATNumber];
};
IF (_windrBB < 0) THEN {
_windrBB= FORMAT["-%1",[_windrBB*-1, 1, 2] call CBA_fnc_FORMATNumber];
}ELSE{
_windrBB= FORMAT["%1",[_windrBB, 1, 2] call CBA_fnc_FORMATNumber];
};
};
_ctrl2 ctrlSetText _windrAA;
_ctrl3 ctrlSetText _windrBB;
_ctrl4 ctrlSetText FORMAT["%1",round (direction _player)];
_ctrl5 ctrlSetText FORMAT["%1", (round (AGM_Wind_currentTemperature * 10)) / 10];
_ctrl6 ctrlsettextcolor [0,0,0,1-(sunOrMoon*sunOrMoon+(moonIntensity/5))];
IF (!("AGM_ItemKestrel" in items _player)) THEN {AGM_isKestrel = FALSE;};
IF (
underwater _player ||
//{_player != vehicle _player} ||
{cameraView == "GUNNER"} ||
{!alive _player}
) THEN {AGM_isKestrel = FALSE;};
IF (!AGM_isKestrel) THEN {_sleep1 = 0.01;};
SLEEP _sleep1;
};
AGM_isKestrelWheel=False;
_ctrl1 ctrlShow false;
_ctrl2 ctrlShow false;
_ctrl3 ctrlShow false;
_ctrl4 ctrlShow false;
_ctrl5 ctrlShow false;
_ctrl6 ctrlShow false;
*/

View File

@ -0,0 +1,8 @@
// by commy2
#include "script_component.hpp"
GVAR(isKestrel) = false;
GVAR(isKestrelWheel) = false;
(["ACE_KestrelWheel"] call BIS_fnc_rscLayer) cutText ["", "PLAIN", 0, false];
(["ACE_Kestrel"] call BIS_fnc_rscLayer) cutText ["", "PLAIN", 0, false];

View File

@ -0,0 +1,30 @@
// by Falke, commy2
#include "script_component.hpp"
GVAR(windHead) = 0;
[{
private ["_dlgKestrel", "_ctrlKestrel1", "_ctrlKestrel2", "_ctrlHUD1", "_ctrlHUD2", "_ctrlHUD3", "_ctrlHUD4"];
disableSerialization;
_dlgKestrel = _this select 0;
_ctrlKestrel1 = _dlgKestrel displayCtrl 10;
_ctrlKestrel2 = _dlgKestrel displayCtrl 11;
_ctrlHUD1 = _dlgKestrel displayCtrl 12;
_ctrlHUD2 = _dlgKestrel displayCtrl 13;
_ctrlHUD3 = _dlgKestrel displayCtrl 14;
_ctrlHUD4 = _dlgKestrel displayCtrl 15;
private ["_wheelState", "_wheelStateAdd"];
systemChat str diag_frameno;
if (!GVAR(isKestrel) || {!("ACE_Kestrel" in items ACE_player)}) exitWith {
call FUNC(closeKestrel);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0.01, _this select 0] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,40 @@
// by Falke, commy2
#include "script_component.hpp"
GVAR(windHead) = 0;
GVAR(wheelState) = 1;
[{
private ["_display", "_control"];
disableSerialization;
_display = _this select 0;
_control = _display displayCtrl 1;
private ["_wheelState", "_wheelStateAdd"];
_wheelState = GVAR(wheelState);
_wheelStateAdd = ((round GVAR(windHead) * 2) min 5) max -5;
_wheelState = _wheelState + _wheelStateAdd;
if (_wheelState < 0) then {_wheelState = _wheelState + 9};
if (_wheelState > 9) then {_wheelState = _wheelState - 9};
GVAR(wheelState) = _wheelState;
if (preloadTitleRsc ["ACE_Kestrel_Preload", "PLAIN"]) then {
private "_brightness";
_brightness = call EFUNC(common,ambientBrightness);
_control ctrlSetText format [QUOTE(PATHTOF(data\kestrel_%1.paa)), _rad1];
_control ctrlSetTextColor [_brightness, _brightness, _brightness, 1];
};
if (!GVAR(isKestrelWheel)) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0.01, _this select 0] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,8 @@
// by commy2
#include "script_component.hpp"
GVAR(isKestrel) = true;
GVAR(isKestrelWheel) = true;
(["ACE_KestrelWheel"] call BIS_fnc_rscLayer) cutRsc ["ACE_KestrelWheel", "PLAIN", 0, false];
(["ACE_Kestrel"] call BIS_fnc_rscLayer) cutRsc ["ACE_Kestrel", "PLAIN", 0, false];

View File

@ -0,0 +1 @@
#include "\z\ace\addons\kestrel\script_component.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
#define COMPONENT kestrel
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_KESTREL
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_KESTREL
#define DEBUG_SETTINGS DEBUG_ENABLED_KESTREL
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-11 -->
<Project name="ACE">
<Package name="Wind">
<Key ID="STR_ACE_Wind_ApproximateTemp">
<English>Approximate Temperature</English>
<German>Ungefähre Temperatur</German>
<Spanish>Temperatura aproximada</Spanish>
<French>Estimer la température</French>
<Polish>Przybliżona temperatura</Polish>
<Czech>Odhadovaná teplota</Czech>
<Hungarian>Hőmérséklet nagyábol</Hungarian>
<Russian>Примерная температура </Russian>
</Key>
<Key ID="STR_ACE_Kestrel_Name">
<English>Kestrel 4500NV</English>
<German>Kestrel 4500NV</German>
<Spanish>Kestrel 4500NV</Spanish>
<French>Kestrel 4500NV</French>
<Polish>Kestrel 4500NV</Polish>
<Czech>Kestrel 4500NV</Czech>
<Italian>Kestrel 4500NV</Italian>
<Hungarian>Kestrel 4500NV</Hungarian>
<Portuguese>Kestrel 4500NV</Portuguese>
<Russian>Kestrel 4500NV</Russian>
</Key>
<Key ID="STR_ACE_Kestrel_Description">
<English>Applied Ballistics Meter</English>
<German>Applied Ballistics Meter</German>
<Spanish>Anemómetro balístico</Spanish>
<French>Applied Ballistics Meter</French>
<Polish>Urządzenie do monitorowania pogody</Polish>
<Czech>Zařízení pro měření vítru</Czech>
<Italian>Monitoraggio Balistico Attivo</Italian>
<Hungarian>Applied Ballistics Meter</Hungarian>
<Portuguese>Medidor Balístico Ativo</Portuguese>
<Russian>метеостанция</Russian>
</Key>
<Key ID="STR_ACE_Wind_OpenKestrel">
<English>Open Kestrel</English>
<German>Kestrel öffnen</German>
<Spanish>Abrir Kestrel</Spanish>
<French>Ouvrir Kestrel</French>
<Polish>Otwórz Kestrel</Polish>
<Czech>Otevřít Kestrel</Czech>
<Portuguese>Abrir Kestrel</Portuguese>
<Italian>Apri Kestrel</Italian>
<Hungarian>Kestrel bekapcsolása</Hungarian>
<Russian>Открыть Kestrel</Russian>
</Key>
<Key ID="STR_ACE_Wind_CloseKestrel">
<English>Close Kestrel</English>
<German>Kestrel schließen</German>
<Spanish>Cerrar Kestrel</Spanish>
<French>Fermer Kestrel</French>
<Polish>Zamknij Kestrel</Polish>
<Czech>Zavřít Kestrel</Czech>
<Portuguese>Fechar Kestrel</Portuguese>
<Italian>Chiudi Kestrel</Italian>
<Hungarian>Kestrel kikapcsolása</Hungarian>
<Russian>Закрыть Kestrel</Russian>
</Key>
</Package>
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More