Skip to content

Commit

Permalink
Cache config and add string in stringtable
Browse files Browse the repository at this point in the history
- add cache the config vehicles
- add need string in stringtable
- need german translation for STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_FILTER #400
  • Loading branch information
Vdauphin committed Jun 23, 2018
1 parent 6bca237 commit 00a0042
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Params {
class btc_p_arsenal_Restrict { // Restricted arsenal (See /define_mod.sqf):
title = __EVAL(format [" %1", localize "STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR"]);
values[]={0,1,2,3};
texts[] = {$STR_DISABLED,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_FULL,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_REMOVEONLY,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_REMOVEONLY}; //texts[]={"Off","Full","Remove only (works only with ACE3-Arsenal)"};
texts[] = {$STR_DISABLED,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_FULL,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_REMOVEONLY,$STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_FILTER}; //texts[]={"Off","Full","Remove only (works only with ACE3-Arsenal)","Filter on player role (works only with ACE3-Arsenal)"};
default = 3;
};
class btc_p_garage { // Activate garage for admin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ private _allowedWeapons = [];
_allowedWeapons append ([_weapons, _x] call btc_fnc_arsenal_ammoUsage);
} forEach _itemType_ammo_usageAllowed;

private _cfgVehicles = configFile >> "CfgVehicles";
private _enemyWeapons = [];
{
_enemyWeapons append getArray (configFile >> "CfgVehicles" >> _x >> "weapons");
_enemyWeapons append getArray (_cfgVehicles >> _x >> "weapons");
} forEach _type_units;
_allowedWeapons = _allowedWeapons - _enemyWeapons;

Expand Down
5 changes: 3 additions & 2 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/init_player.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ call compile preprocessFileLineNumbers "core\doc.sqf";

[player] call btc_fnc_eh_player;

private _arsenal_trait = player call btc_fnc_arsenal_trait;
if (btc_p_arsenal_Restrict isEqualTo 3) then {
[player call btc_fnc_arsenal_trait] call btc_fnc_arsenal_weaponsFilter;
[_arsenal_trait] call btc_fnc_arsenal_weaponsFilter;
};
call btc_fnc_int_add_actions;
call btc_fnc_int_shortcuts;
Expand All @@ -18,7 +19,7 @@ call compile preprocessFileLineNumbers "core\doc.sqf";
};

if (btc_p_loadout) then {
player setUnitLoadout ([(player call btc_fnc_arsenal_trait) select 0] call btc_fnc_arsenal_loadout);
player setUnitLoadout ([_arsenal_trait select 0] call btc_fnc_arsenal_loadout);
} else {
removeAllWeapons player;
};
Expand Down
3 changes: 3 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@
<Original>Remove only (works only with ACE3-Arsenal)</Original>
<German>Nur entfernen (funktioniert nur beim ACE3-Arsenal)</German>
</Key>
<Key ID="STR_BTC_HAM_PARAM_ARSENAL_ARSENALRESTR_FILTER">
<Original>Filter on player role (works only with ACE3-Arsenal)</Original>
</Key>
<Key ID="STR_BTC_HAM_PARAM_ARSENAL_GARAGEADMIN">
<Original>Activate garage for admin:</Original>
<German>Virtuelle Garage für den Admin:</German>
Expand Down

0 comments on commit 00a0042

Please sign in to comment.