Skip to content

Commit

Permalink
Add config for Chernarus scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
3Mydlo3 committed Mar 6, 2024
1 parent a5dc56c commit 6000646
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 23 deletions.
1 change: 1 addition & 0 deletions addons/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PREP(getNearestLocationName);
PREP(getNearestLocationWithAvailableName);
PREP(getRandomEmptyPosition);
PREP(getRandomPos);
PREP(getTextFromConfig);
PREP(isHouseNearby);
PREP(isRoadNearby);
PREP(playMusicServer);
Expand Down
29 changes: 29 additions & 0 deletions addons/common/functions/fnc_getTextFromConfig.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "script_component.hpp"
/*
* Author: 3Mydlo3
* Function loads config for killers stuff.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/

params ["_property", "_defaultConfig", "_missionConfig"];

private _result = getText (_missionConfig >> _property);

if (_result isEqualTo "") then {
_result = getText (_defaultConfig >> _property);
TRACE_3("Loaded property %1 from %2. Retrieved value: %3",_property,str _defaultConfig,_result);
} else {
TRACE_3("Loaded property %1 from %2. Retrieved value: %3",_property,str _missionConfig,_result);
};

_result
2 changes: 2 additions & 0 deletions addons/killers/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ if (!EGVAR(common,enabled)) exitWith {};
GVAR(killersRespawnMarker) = "";
GVAR(stashes) = [];

call FUNC(initConfig);

ADDON = true;
12 changes: 1 addition & 11 deletions addons/killers/functions/fnc_initConfig.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,4 @@
private _killersConfig = (configFile >> "CfgSerialKillers" >> "Killers");
private _missionKillersConfig = (missionConfigFile >> "CfgSerialKillers" >> "Killers");

private _fnc_getTextProperty = {
params ["_property"];

if (isClass (_missionKillersConfig >> _property)) exitWith {
getText (_missionKillersConfig >> _property)
};

getText (_killersConfig >> _property)
};

GVAR(flagClassName) = "FlagClassName" call _fnc_getTextProperty;
GVAR(flagClassName) = ["FlagClassName", _killersConfig, _missionKillersConfig] call EFUNC(common,getTextFromConfig);
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CfgSerialKillers
{
class Killers
{
FlagClassName = "FlagCarrierINS";
};

class Police
{
FlagClassName = "FlagCarrierCDF";
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ respawnDelay = 20;
respawnOnStart = -1;
respawnTemplatesWest[] = {"MenuPosition", "Counter"};
respawnTemplatesEast[] = {"Base", "Counter"};

#include "CfgSerialKillers.hpp"
2 changes: 1 addition & 1 deletion addons/police/CfgSerialKillers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class CfgSerialKillers
{
class Police
{
FlagClassName = "Flag_US_F";
FlagClassName = "Flag_Gendarmerie_F";
};
};
12 changes: 1 addition & 11 deletions addons/police/functions/fnc_initConfig.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,4 @@
private _policeConfig = (configFile >> "CfgSerialKillers" >> "Police");
private _missionPoliceConfig = (missionConfigFile >> "CfgSerialKillers" >> "Police");

private _fnc_getTextProperty = {
params ["_property"];

if (isClass (_missionPoliceConfig >> _property)) exitWith {
getText (_missionPoliceConfig >> _property)
};

getText (_policeConfig >> _property)
};

GVAR(flagClassName) = "FlagClassName" call _fnc_getTextProperty;
GVAR(flagClassName) = ["FlagClassName", _policeConfig, _missionPoliceConfig] call EFUNC(common,getTextFromConfig);

0 comments on commit 6000646

Please sign in to comment.