-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,6 @@ | ||
#include "component.hpp" | ||
#define REPNIF0(var1,var2) if(count var2 > 0) then {var1 = var2} | ||
#define APPENDUNIQUE(var1,var2) var1 = var1 + var2;var1 = var1 arrayIntersect var1 | ||
|
||
|
||
private _enable = ([missionConfigFile >> "CfgGradCivs","enableCivs",0] call BIS_fnc_returnConfigEntry) == 1; | ||
if !(_enable) exitWith {}; | ||
|
||
private _islandType = [missionConfigFile >> "CfgIslands" >> worldName,"type",""] call BIS_fnc_returnConfigEntry; | ||
if (_islandType == "") exitWith {ERROR("World is not defined in cfgIslands.")}; | ||
|
||
private _civCfg = missionConfigFile >> "CfgCivilians" >> _islandType; | ||
|
||
private _clothes = [_civCfg,"clothes",[]] call BIS_fnc_returnConfigEntry; | ||
private _headgear = [_civCfg,"headgear",[]] call BIS_fnc_returnConfigEntry; | ||
private _faces = [_civCfg,"faces",[]] call BIS_fnc_returnConfigEntry; | ||
private _goggles = [_civCfg,"goggles",[]] call BIS_fnc_returnConfigEntry; | ||
private _backpacks = [_civCfg,"backpacks",[]] call BIS_fnc_returnConfigEntry; | ||
|
||
private _userEquipmentCfg = missionConfigFile >> "CfgGradCivs" >> "userEquipment"; | ||
private _userClothes = [_userEquipmentCfg,"clothes",[]] call BIS_fnc_returnConfigEntry; | ||
private _userHeadgear = [_userEquipmentCfg,"headgear",[]] call BIS_fnc_returnConfigEntry; | ||
private _userFaces = [_userEquipmentCfg,"faces",[]] call BIS_fnc_returnConfigEntry; | ||
private _userGoggles = [_userEquipmentCfg,"goggles",[]] call BIS_fnc_returnConfigEntry; | ||
private _userBackpacks = [_userEquipmentCfg,"backpacks",[]] call BIS_fnc_returnConfigEntry; | ||
|
||
|
||
private _replace = ([_userEquipmentCfg,"replace",0] call BIS_fnc_returnConfigEntry) == 1; | ||
if (_replace) then { | ||
REPNIF0(_clothes,_userClothes); | ||
REPNIF0(_headgear,_userHeadgear); | ||
REPNIF0(_faces,_userFaces); | ||
REPNIF0(_goggles,_userGoggles); | ||
REPNIF0(_backpacks,_userBackpacks); | ||
} else { | ||
APPENDUNIQUE(_clothes,_userClothes); | ||
APPENDUNIQUE(_headgear,_userHeadgear); | ||
APPENDUNIQUE(_faces,_userFaces); | ||
APPENDUNIQUE(_goggles,_userGoggles); | ||
APPENDUNIQUE(_backpacks,_userBackpacks); | ||
}; | ||
|
||
[_clothes] call grad_civs_fnc_setClothes; | ||
[_headgear] call grad_civs_fnc_setHeadgear; | ||
[_faces] call grad_civs_fnc_setFaces; | ||
[_goggles] call grad_civs_fnc_setGoggles; | ||
[_backpacks] call grad_civs_fnc_setBackpacks; | ||
|
||
[] call grad_civs_fnc_initModule; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "component.hpp" | ||
#define REPNIF0(var1,var2) if(count var2 > 0) then {var1 = var2} | ||
#define APPENDUNIQUE(var1,var2) var1 = var1 + var2;var1 = var1 arrayIntersect var1 | ||
|
||
private _enable = ([missionConfigFile >> "CfgGradCivs","enableCivs",0] call BIS_fnc_returnConfigEntry) == 1; | ||
if !(_enable) exitWith {}; | ||
|
||
private _islandType = [missionConfigFile >> "CfgIslands" >> worldName,"type",""] call BIS_fnc_returnConfigEntry; | ||
if (_islandType == "") exitWith {ERROR("World is not defined in cfgIslands.")}; | ||
|
||
private _civCfg = missionConfigFile >> "CfgCivilians" >> _islandType; | ||
|
||
private _clothes = [_civCfg,"clothes",[]] call BIS_fnc_returnConfigEntry; | ||
private _headgear = [_civCfg,"headgear",[]] call BIS_fnc_returnConfigEntry; | ||
private _faces = [_civCfg,"faces",[]] call BIS_fnc_returnConfigEntry; | ||
private _goggles = [_civCfg,"goggles",[]] call BIS_fnc_returnConfigEntry; | ||
private _backpacks = [_civCfg,"backpacks",[]] call BIS_fnc_returnConfigEntry; | ||
private _vehicles = [_civCfg,"vehicles",[]] call BIS_fnc_returnConfigEntry; | ||
|
||
private _userEquipmentCfg = missionConfigFile >> "CfgGradCivs" >> "userEquipment"; | ||
private _userClothes = [_userEquipmentCfg,"clothes",[]] call BIS_fnc_returnConfigEntry; | ||
private _userHeadgear = [_userEquipmentCfg,"headgear",[]] call BIS_fnc_returnConfigEntry; | ||
private _userFaces = [_userEquipmentCfg,"faces",[]] call BIS_fnc_returnConfigEntry; | ||
private _userGoggles = [_userEquipmentCfg,"goggles",[]] call BIS_fnc_returnConfigEntry; | ||
private _userBackpacks = [_userEquipmentCfg,"backpacks",[]] call BIS_fnc_returnConfigEntry; | ||
private _userVehicles = [_userEquipmentCfg,"vehicles",[]] call BIS_fnc_returnConfigEntry; | ||
|
||
|
||
private _replace = ([_userEquipmentCfg,"replace",0] call BIS_fnc_returnConfigEntry) == 1; | ||
if (_replace) then { | ||
REPNIF0(_clothes,_userClothes); | ||
REPNIF0(_headgear,_userHeadgear); | ||
REPNIF0(_faces,_userFaces); | ||
REPNIF0(_goggles,_userGoggles); | ||
REPNIF0(_backpacks,_userBackpacks); | ||
REPNIF0(_vehicles,_userVehicles); | ||
} else { | ||
APPENDUNIQUE(_clothes,_userClothes); | ||
APPENDUNIQUE(_headgear,_userHeadgear); | ||
APPENDUNIQUE(_faces,_userFaces); | ||
APPENDUNIQUE(_goggles,_userGoggles); | ||
APPENDUNIQUE(_backpacks,_userBackpacks); | ||
APPENDUNIQUE(_vehicles,_userVehicles); | ||
}; | ||
|
||
[_clothes] call grad_civs_fnc_setClothes; | ||
[_headgear] call grad_civs_fnc_setHeadgear; | ||
[_faces] call grad_civs_fnc_setFaces; | ||
[_goggles] call grad_civs_fnc_setGoggles; | ||
[_backpacks] call grad_civs_fnc_setBackpacks; | ||
[_vehicles] call grad_civs_fnc_setVehicles; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.