Add full 3DEN support

This commit is contained in:
Josuan Albin
2017-11-03 15:46:59 +01:00
parent a1b921e3d4
commit 59d47ee1cf
9 changed files with 91 additions and 2 deletions

View File

@ -33,6 +33,7 @@ PREP(onSelChangedLeft);
PREP(onSelChangedLoadouts);
PREP(onSelChangedRight);
PREP(onSelChangedRightListnBox);
PREP(open3DEN);
PREP(openBox);
PREP(removeBox);
PREP(removeVirtualItems);

View File

@ -2,7 +2,6 @@
#include "defines.hpp"
GVAR(EH_ID) = 0;
GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium"];
GVAR(lastSearchTextLeft) = "";
GVAR(lastSearchTextRight) = "";

View File

@ -7,6 +7,8 @@ PREP_RECOMPILE_START;
PREP_RECOMPILE_END;
// Arsenal
GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium"];
[QGVAR(camInverted), "CHECKBOX", "Invert camera controls", "ACE3 Arsenal", false] call CBA_Settings_fnc_init; // TBL
[QGVAR(canUseCurrentMagTab), "CHECKBOX", "Can use currentMag tab", "ACE3 Arsenal", false] call CBA_Settings_fnc_init; // TBL
[QGVAR(enableModIcons), "CHECKBOX", "Enable mod logos", "ACE3 Arsenal", true] call CBA_Settings_fnc_init; // TBL

View File

@ -25,7 +25,6 @@ if (_cachedItemInfo isEqualTo []) then {//Not in cache. So get info and put into
};
};
if (_dlcName != "") then {
_cachedItemInfo set [2, (modParams [_dlcName,["logo"]]) param [0,""]];//mod picture
_modID = GVAR(modList) find _dlcName;

View File

@ -9,7 +9,27 @@ camDestroy GVAR(camera);
GVAR(center) switchCamera GVAR(cameraView);
deleteVehicle GVAR(cameraHelper);
if (is3DEN) then {
GVAR(centerOrigin) setUnitLoadout (getUnitLoadout GVAR(center));
GVAR(centerOrigin) setFace GVAR(currentFace);
GVAR(centerOrigin) setSpeaker GVAR(currentVoice);
deleteVehicle GVAR(sphere);
deleteVehicle GVAR(light);
deleteVehicle GVAR(center);
GVAR(centerOrigin) = nil;
GVAR(sphere) = nil;
GVAR(light) = nil;
get3DENCamera cameraEffect ["internal","back"];
["ShowInterface",true] call bis_fnc_3DENInterface;
GVAR(visionMode) call bis_fnc_3DENVisionMode;
};
if (isMultiplayer) then {
[QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(center) + "_face"] call CBA_fnc_globalEventJIP;
[QGVAR(center) + "_face", GVAR(center)] call CBA_fnc_removeGlobalEventJIP;

View File

@ -254,6 +254,43 @@ showHUD false;
private _mouseAreaCtrl = _display displayCtrl IDC_mouseArea;
ctrlSetFocus _mouseAreaCtrl;
// 3DEN support, lifted from BIS_fnc_arsenal
if (is3DEN) then {
GVAR(centerOrigin) = GVAR(center);
private _centerPos = position GVAR(centerOrigin);
_centerPos set [2,500];
GVAR(sphere) = createVehicle ["Sphere_3DEN", _centerPos, [], 0, "none"];
GVAR(sphere) setPosAtl _centerPos;
GVAR(sphere) setDir 0;
GVAR(sphere) setObjectTexture [0,"#(argb,8,8,3)color(0.93,1.0,0.98,0.028,co)"];
GVAR(sphere) setObjectTexture [1,"#(argb,8,8,3)color(0.93,1.0,0.98,0.01,co)"];
GVAR(center) = createAgent [typeOf GVAR(centerOrigin), position GVAR(centerOrigin), [], 0, "none"];
GVAR(center) setPosAtl getPosAtl GVAR(sphere);
GVAR(center) setDir 0;
GVAR(center) switchMove animationState GVAR(centerOrigin);
GVAR(center) switchAction "playerstand";
GVAR(center) enableSimulation false;
GVAR(center) setUnitLoadout (getUnitLoadout GVAR(centerOrigin));
GVAR(center) setFace GVAR(currentFace);
GVAR(center) setSpeaker GVAR(currentVoice);
//--- Create light for night editing (code based on BIS_fnc_3DENFlashlight)
private _intensity = 20;
GVAR(light) = "#lightpoint" createVehicle _centerPos;
GVAR(light) setLightBrightness _intensity;
GVAR(light) setLightAmbient [1,1,1];
GVAR(light) setLightColor [0,0,0];
GVAR(light) lightAttachObject [GVAR(sphere), [0, 0, -_intensity * 7]];
//--- Use the same vision mode as in Eden
GVAR(visionMode)= -2 call bis_fnc_3DENVisionMode;
["ShowInterface",false] spawn bis_fnc_3DENInterface;
if (get3denactionstate "togglemap" > 0) then {do3DENAction "togglemap";};
};
//--------------- Init camera
GVAR(cameraPosition) = [5,0,0,[0,0,0.85]];

View File

@ -0,0 +1,4 @@
#include "script_component.hpp"
private _entity = (uinamespace getvariable ["bis_fnc_3DENEntityMenu_data",[]]) param [1, objnull];
[_entity, _entity, true] call FUNC(openBox);

View File

@ -12,4 +12,21 @@ GVAR(camera) setVectorDirAndUp [vectorDir GVAR(cameraHelper), vectorUp GVAR(came
if ((getPosAsl GVAR(camera) select 2) < (getPosAsl GVAR(center) select 2)) then {
private _disCoef = ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(center) select 2)) / ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(camera) select 2) + 0.001);
GVAR(camera) setPos (GVAR(cameraHelper) modelToWorldVisual [0, -_distance * _disCoef, 0]);
};
if (is3DEN) then {
for "_x" from -5 to 5 step 1 do {
drawLine3D [
GVAR(sphere) modelToWorld [_x, -5, 0],
GVAR(sphere) modelToWorld [_x, +5, 0],
[0.03, 0.03, 0.03, 1]
];
};
for "_y" from -5 to 5 step 1 do {
drawLine3D [
GVAR(sphere) modelToWorld [-5, _y, 0],
GVAR(sphere) modelToWorld [+5, _y, 0],
[0.03, 0.03, 0.03, 1]
];
};
};

View File

@ -266,3 +266,13 @@ class ctrlMapEmpty;
class ctrlMapMain;
class ctrlListNBox;
class ctrlCheckboxToolbar;
class Display3DEN {
class ContextMenu :ctrlMenu {
class Items {
class Arsenal {
action= QUOTE(call FUNC(open3DEN));
};
};
};
};