Skip to content
Draft

format #1067

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
301 changes: 202 additions & 99 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [

"libs/common",
"libs/config",
"libs/format",
"libs/lzo",
"libs/p3d",
"libs/paa",
Expand Down
1 change: 1 addition & 0 deletions bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bench = false
hemtt-common = { path = "../libs/common" }

hemtt-config = { path = "../libs/config", features = ["serde"] }
hemtt-format = { path = "../libs/format" }
hemtt-p3d = { path = "../libs/p3d" }
hemtt-paa = { path = "../libs/paa", features = ["generate"] }
hemtt-pbo = { path = "../libs/pbo" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
params [
["_class", "", [""]]
];
params [["_class", "", [""]]];

if (_class == "") exitWith {};

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
};
if (isNil "ps_cam") then { ps_cam = "camera" camCreate [0, 0, 0]; };

ps_cam cameraEffect ["INTERNAL", "BACK"];
ps_cam camSetTarget objNull;
Expand Down
27 changes: 12 additions & 15 deletions bin/dist/profile/autotest/ps_items.VR/functions/fnc_firearm.sqf
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
params [
["_class", "", [""]],
["_pistol", false, [false]]
];
params [["_class", "", [""]], ["_pistol", false, [false]]];

if (_class == "") exitWith {};

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
};
if (isNil "ps_cam") then { ps_cam = "camera" camCreate [0, 0, 0]; };

private _pos = getPos item_position;

private _holder = createVehicle ["groundweaponholder",_pos,[],0,"none"];
private _holder = createVehicle ["groundweaponholder", _pos, [], 0, "none"];
_holder setPos _pos;
_holder addWeaponCargo [_class,1];
_holder setVectorDirAndUp [[0,0,1],[1,0,0]];

private _fov = if (_pistol) then {0.3} else {0.7};
private _campos = [_pos,0.5,90] call bis_fnc_relpos;
_campos set [2,_pos#2 + 0.5];
_holder addWeaponCargo [_class, 1];
_holder setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];

private _fov = if (_pistol) then {
0.3
} else { 0.7 };
private _campos = [_pos, 0.5, 90] call bis_fnc_relpos;
_campos set [2, _pos#2 + 0.5];
ps_cam camSetPos _campos;
ps_cam camSetFov _fov;
ps_cam camSetTarget [_pos#0,_pos#1,_pos#2 + 0.57];
ps_cam camSetTarget [_pos#0, _pos#1, _pos#2 + 0.57];
ps_cam camCommit 0;

sleep 0.5;
Expand Down
18 changes: 7 additions & 11 deletions bin/dist/profile/autotest/ps_items.VR/functions/fnc_headgear.sqf
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
params [
["_class", "", [""]]
];
params [["_class", "", [""]]];

if (_class == "") exitWith {};

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
};
if (isNil "ps_cam") then { ps_cam = "camera" camCreate [0, 0, 0]; };

private _pos = getPos item_position;

private _holder = createVehicle ["groundweaponholder",_pos,[],0,"none"];
private _holder = createVehicle ["groundweaponholder", _pos, [], 0, "none"];
_holder setPos _pos;
_holder addWeaponCargo [_class,1];
_holder setVectorDirAndUp [[0,0,1],[0,-1,0]];
_holder addWeaponCargo [_class, 1];
_holder setVectorDirAndUp [[0, 0, 1], [0, -1, 0]];

private _campos = [_pos, 2.5, 20] call bis_fnc_relpos;
_campos set [2,_pos#2 + 2.5];
_campos set [2, _pos#2 + 2.5];
ps_cam cameraEffect ["INTERNAL", "BACK"];
ps_cam camSetPos _campos;
ps_cam camSetFov 0.1;
ps_cam camSetTarget [_pos#0,_pos#1 + 0.425,_pos#2 + 1.3];
ps_cam camSetTarget [_pos#0, _pos#1 + 0.425, _pos#2 + 1.3];
ps_cam camCommit 0;

sleep 0.5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
params [
["_uniform", "", [""]]
];
params [["_uniform", "", [""]]];

if (_uniform == "") exitWith {};

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
};
if (isNil "ps_cam") then { ps_cam = "camera" camCreate [0, 0, 0]; };

ps_cam cameraEffect ["INTERNAL", "BACK"];
ps_cam camSetTarget objNull;
Expand Down
30 changes: 13 additions & 17 deletions bin/dist/profile/autotest/ps_items.VR/functions/fnc_vest.sqf
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
params [
["_class", "", [""]]
];
params [["_class", "", [""]]];

if (_class == "") exitWith {};

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
};
if (isNil "ps_cam") then { ps_cam = "camera" camCreate [0, 0, 0]; };

private _pos = getPos item_position;

private _holder = createVehicle ["groundweaponholder",_pos,[],0,"none"];
_holder setPos _pos;
_holder addWeaponCargo [_class, 1];
_holder setvectordirandup [[0.00173726,0.000167279,0.999998],[-0.995395,-0.0958456,0.00177588]];

private _campos = [_pos, 2, 90] call bis_fnc_relpos;
_campos set [2,_pos#2 + 1.2];
ps_cam cameraEffect ["INTERNAL", "BACK"];
ps_cam camSetPos _campos;
ps_cam camSetFov 0.4;
ps_cam camSetTarget [_pos#0,_pos#1 -0.2,_pos#2 + 0.9];
private _holder = createVehicle ["groundweaponholder", _pos, [], 0, "none"];
_holder setPos _pos;
_holder addWeaponCargo [_class, 1];
_holder setvectordirandup [[0.00173726, 0.000167279, 0.999998], [-0.995395, -0.0958456, 0.00177588]];

private _campos = [_pos, 2, 90] call bis_fnc_relpos;
_campos set [2, _pos#2 + 1.2];
ps_cam cameraEffect ["INTERNAL", "BACK"];
ps_cam camSetPos _campos;
ps_cam camSetFov 0.4;
ps_cam camSetTarget [_pos#0, _pos#1 - 0.2, _pos#2 + 0.9];
ps_cam camCommit 0;

sleep 0.5;
Expand Down
18 changes: 8 additions & 10 deletions bin/dist/profile/autotest/ps_items.VR/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ addMissionEventHandler ["ExtensionCallback", {
diag_log format ["%1: %2", _name, _function];
if (_name isEqualTo "hemtt_ps_items" || _name isEqualTo "hemtt_ps") then {
switch (_function) do {
case "weapon_add": {
case "weapon_add" : {
diag_log format ["Weapon: %1", _data];
if !(isClass (configFile >> "CfgWeapons" >> _data)) exitWith {
"hemtt_comm" callExtension ["photoshoot:items:weapon_unsupported", [_data]];
Expand Down Expand Up @@ -53,17 +53,17 @@ addMissionEventHandler ["ExtensionCallback", {
// "hemtt_comm" callExtension ["log", ["debug", format ["NVG: %1", _data]]];
// [_data] spawn ps_fnc_nvg;
// };
case 605: {
case 605 : {
// Headgear
"hemtt_comm" callExtension ["log", ["debug", format ["Headgear: %1", _data]]];
[_data] spawn ps_fnc_headgear;
};
case 701: {
case 701 : {
// Vest
"hemtt_comm" callExtension ["log", ["debug", format ["Vest: %1", _data]]];
[_data] spawn ps_fnc_vest;
};
case 801: {
case 801 : {
// Uniform
"hemtt_comm" callExtension ["log", ["debug", format ["Uniform: %1", _data]]];
[_data] spawn ps_fnc_uniform;
Expand All @@ -74,11 +74,11 @@ addMissionEventHandler ["ExtensionCallback", {
};
};
};
case "vehicle_add": {
case "vehicle_add" : {
private _type = getText (configFile >> "CfgVehicles" >> _data >> "vehicleClass");
"hemtt_comm" callExtension ["log", ["debug", format ["Type: %1", _type]]];
switch (_type) do {
case "Backpacks": {
case "Backpacks" : {
"hemtt_comm" callExtension ["log", ["debug", format ["Backpack: %1", _data]]];
[_data] spawn ps_fnc_backpack;
};
Expand All @@ -87,9 +87,7 @@ addMissionEventHandler ["ExtensionCallback", {
};
};
};
case "done": {
endMission "END1";
};
case "done" : { endMission "END1"; };
default {
diag_log format ["Unknown: %1", _function];
"hemtt_comm" callExtension ["log", ["error", format ["Unknown: %1", _function]]];
Expand All @@ -107,7 +105,7 @@ showCinemaBorder false;
diag_log format ["response: %1", "hemtt_comm" callExtension ["photoshoot:items:ready", []]];

if (isNil "ps_cam") then {
ps_cam = "camera" camCreate [0,0,0];
ps_cam = "camera" camCreate [0, 0, 0];
showCinemaBorder false;
};
};
Loading
Loading