wip, fbcb2_assets, init, util
This commit is contained in:
166
framework/fbcb2_assets/functions/fn_getVehicleData.sqf
Normal file
166
framework/fbcb2_assets/functions/fn_getVehicleData.sqf
Normal file
@@ -0,0 +1,166 @@
|
||||
params ["_vic"];
|
||||
|
||||
private _title = [];
|
||||
private _image = [];
|
||||
private _info = [];
|
||||
private _capacity = [];
|
||||
|
||||
// Excluded 2024-02-01
|
||||
// private _weapons = [];
|
||||
// private _pylonWeapons = [];
|
||||
// private _inventory = [];
|
||||
|
||||
|
||||
private _vicConfig = configOf _vic;
|
||||
private _class = configName _vicConfig;
|
||||
private _objType = (_vic call BIS_fnc_objectType) select 1;
|
||||
private _dispName = getText(_vicConfig >> 'displayName');
|
||||
|
||||
// "debug_console" callExtension (format["VehicleName = %1", _dispName] + "#0110");
|
||||
|
||||
private _cat = getText(_vicConfig >> 'category');
|
||||
private _fac = getText(_vicConfig >> 'faction');
|
||||
private _side = [getNumber(_vicConfig >> 'side')] call BIS_fnc_sideName;
|
||||
private _canFloat = (_vicConfig >> "canFloat") call BIS_fnc_getCfgDataBool;
|
||||
|
||||
private _totalSeats = [_class, true] call BIS_fnc_crewCount; // Number of total seats: crew + non-FFV cargo/passengers + FFV cargo/passengers
|
||||
private _crewSeats = [_class, false] call BIS_fnc_crewCount; // Number of crew seats only
|
||||
private _driverSeats = fullcrew [_vic, "driver", true];
|
||||
private _gunnerSeats = fullCrew [_vic, "gunner", true];
|
||||
private _commanderSeats = fullCrew [_vic, "commander", true];
|
||||
// _cargoSeats = fullCrew [_vic, "cargo", true];
|
||||
private _cargoSeats = _totalSeats - _crewSeats; // Number of total cargo/passenger seats: non-FFV + FFV
|
||||
private _turretSeatsRaw = fullCrew [_vic, "turret", true];
|
||||
private _turretSeats = _turretSeatsRaw select {(_x # 4) isEqualTo false};
|
||||
private _ffvSeats = _turretSeatsRaw select {(_x # 4) isEqualTo true};
|
||||
|
||||
private _pylons = getAllPylonsInfo _vic;
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// WRITE TITLE
|
||||
///////////////////////////////////////////////
|
||||
_title pushBack format["<font size='24' shadow='1' color='#e1701a' face='PuristaBold'>%1</font>", _dispName];
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// WRITE IMAGE
|
||||
///////////////////////////////////////////////
|
||||
// Editor preview image
|
||||
_image pushBack format["<img width='200' image='%1'/>", getText(_vicConfig >> 'editorPreview')];
|
||||
_image pushBack linebreak;
|
||||
// Thumbnail image
|
||||
// _image pushBack format["<img width='128' height='64' image='%1'/>", getText(_vicConfig >> 'picture')];
|
||||
// _image pushBack linebreak;
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// WRITE INFO
|
||||
///////////////////////////////////////////////
|
||||
_info pushBack format["<font size='14' color='#e1701a' face='PuristaBold'>INFO</font>"];
|
||||
_info pushBack format["<font face='PuristaMedium'> Classname: %1", _class];
|
||||
_info pushBack format[" Side: %1", _side];
|
||||
_info pushBack format[" Category: %1", _objType];
|
||||
_info pushBack format[" Faction: %1", _fac];
|
||||
_info pushBack format[" Can Float: %1", _canFloat];
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// WRITE CAPACITY
|
||||
///////////////////////////////////////////////
|
||||
_capacity pushBack format["<font size='14' color='#e1701a' face='PuristaBold'>CAPACITY: %1</font>", _totalSeats];
|
||||
_capacity pushBack format["<font face='PuristaMedium'> Driver Seats: %1", count _driverSeats];
|
||||
_capacity pushBack format[" Gunner Seats: %1", count _gunnerSeats];
|
||||
_capacity pushBack format[" Commander Seats: %1", count _commanderSeats];
|
||||
_capacity pushBack format[" Turret Seats: %1", count _turretSeats];
|
||||
_capacity pushBack format[" Cargo Seats: %1", _cargoSeats];
|
||||
_capacity pushBack format[" FFV Seats: %1</font>", count _ffvSeats];
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// GATHER WEAPONS AVAILABLE TO SEATS AND TURRETS
|
||||
// EXCLUDED 2024-02-01
|
||||
///////////////////////////////////////////////
|
||||
// _weapons pushBack format["<font size='14' color='#e1701a' face='PuristaBold'>WEAPONS</font>"];
|
||||
// // DRIVER
|
||||
// [_driverSeats apply {_x # 3}, "DRIVER/PILOT", _weapons] call milsim_fbcb2_assets_fnc_getWeaponry;
|
||||
|
||||
// //GUNNER
|
||||
// [_gunnerSeats apply {_x # 3}, "GUNNER/COPILOT", _weapons] call milsim_fbcb2_assets_fnc_getWeaponry;
|
||||
|
||||
// // COMMANDER
|
||||
// // "debug_console" callExtension ("COMMANDER" + "#1100");
|
||||
// [_commanderSeats apply {_x # 3}, "COMMANDER", _weapons] call milsim_fbcb2_assets_fnc_getWeaponry;
|
||||
|
||||
// // TURRETS
|
||||
// [_turretSeats apply {_x # 3}, "TURRET", _weapons] call milsim_fbcb2_assets_fnc_getWeaponry;
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// GATHER PYLON WEAPONS WITH AMMO
|
||||
// EXCLUDED 2024-02-01
|
||||
///////////////////////////////////////////////
|
||||
|
||||
// _pilotWeps = [];
|
||||
// _otherWeps = [];
|
||||
|
||||
// _parsePylonWeapons = {
|
||||
// params ["_input"];
|
||||
// _input params ["_index", "_name", "_turretPath", "_magazine","_ammoCount","_id"];
|
||||
// // "debug_console" callExtension (str _turretPath + "~0000");
|
||||
|
||||
// _magName = getText(configFile >> "CfgMagazines" >> _magazine >> "displayName");
|
||||
// if (_magName isEqualTo "") exitWith {};
|
||||
|
||||
// if (_turretPath isEqualTo [-1]) then {
|
||||
// _pilotWeps pushBack format[
|
||||
// " <font color='#87ffbb' face='PuristaSemiBold'>%1</font> <font face='PuristaMedium'><font color='#c2c2c2'>|</font> <font color='#4de4ff'>%2</font> <font color='#c2c2c2'>rounds</font></font>",
|
||||
// _magName,
|
||||
// _ammoCount
|
||||
// ];
|
||||
// } else {
|
||||
// _otherWeps pushBack format[
|
||||
// " <font color='#87ffbb' face='PuristaSemiBold'>%1</font> <font face='PuristaMedium'><font color='#c2c2c2'>|</font> <font color='#4de4ff'>%2</font> <font color='#c2c2c2'>rounds</font></font>",
|
||||
// _magName,
|
||||
// _ammoCount
|
||||
// ];
|
||||
// };
|
||||
// };
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// WRITE PYLON WEAPONS
|
||||
///////////////////////////////////////////////
|
||||
|
||||
// if (count _pylons > 0) then {
|
||||
// _pylonWeapons pushBack format["<font size='14' color='#e1701a' face='PuristaBold'>PYLON WEAPONS</font>"];
|
||||
// {
|
||||
// [_x] call _parsePylonWeapons;
|
||||
// } forEach _pylons;
|
||||
// _pylonWeapons pushBack format[" <font color='#f6dcbf' face='PuristaSemiBold'>PILOT</font>"];
|
||||
// {
|
||||
// _pylonWeapons pushBack _x;
|
||||
// } forEach _pilotWeps;
|
||||
// _pylonWeapons pushBack format[" <font color='#f6dcbf' face='PuristaSemiBold'>GUNNER</font>"];
|
||||
// {
|
||||
// _pylonWeapons pushBack _x;
|
||||
// } forEach _otherWeps;
|
||||
// };
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// GATHER INVENTORY
|
||||
// EXCLUDED 2024-02-01
|
||||
///////////////////////////////////////////////
|
||||
// _invLines = [_vic] call milsim_fbcb2_assets_fnc_getInventory;
|
||||
// if (count _invLines > 0) then {
|
||||
// _inventory pushBack format["<font size='14' color='#e1701a' face='PuristaBold'>INVENTORY</font>"];
|
||||
// _inventory append _invLines;
|
||||
// };
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// CLOSE AND RETURN
|
||||
///////////////////////////////////////////////
|
||||
|
||||
[_vicConfig, _dispName, [
|
||||
_title joinString "<br/>",
|
||||
_image joinString "<br/>",
|
||||
_info joinString "<br/>",
|
||||
_capacity joinString "<br/>"
|
||||
// _weapons joinString "<br/>",
|
||||
// _pylonWeapons joinString "<br/>",
|
||||
// _inventory joinString "<br/>"
|
||||
]];
|
||||
Reference in New Issue
Block a user