Cargo - Add load time coefficient setting (#6618)

* Add loadTimeCoefficient setting

* Call settingChanged function

* Normalize load coefficient
This commit is contained in:
mharis001
2018-10-12 23:37:05 -04:00
committed by PabstMirror
parent 9972f5374f
commit c95877d823
4 changed files with 27 additions and 14 deletions

View File

@ -39,7 +39,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
private _size = [_object] call FUNC(getSizeItem); private _size = [_object] call FUNC(getSizeItem);
[ [
5 * _size, GVAR(loadTimeCoefficient) * 5 * _size,
[_object, _vehicle], [_object, _vehicle],
{ {
[objNull, _this select 0 select 0, true] call EFUNC(common,claim); [objNull, _this select 0 select 0, true] call EFUNC(common,claim);
@ -54,7 +54,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
} else { } else {
private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"); private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
[[LSTRING(LoadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured); [[LSTRING(LoadingFailed), _displayName], 3] call EFUNC(common,displayTextStructured);
}; };
_return _return

View File

@ -70,7 +70,7 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
private _size = [_item] call FUNC(getSizeItem); private _size = [_item] call FUNC(getSizeItem);
[ [
5 * _size, GVAR(loadTimeCoefficient) * 5 * _size,
[_item, GVAR(interactionVehicle), ACE_player], [_item, GVAR(interactionVehicle), ACE_player],
{["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent}, {["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent},
{}, {},
@ -82,5 +82,5 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
[[LSTRING(UnloadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured); [[LSTRING(UnloadingFailed), _displayName], 3] call EFUNC(common,displayTextStructured);
}; };

View File

@ -1,19 +1,26 @@
// CBA Settings [ADDON: ace_cargo]:
[ [
QGVAR(enable), "CHECKBOX", QGVAR(enable), "CHECKBOX",
[LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)], [LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(openMenu)], [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)],
true, // default value true,
true, // isGlobal true,
{[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init; ] call CBA_settings_fnc_init;
[
QGVAR(loadTimeCoefficient), "SLIDER",
[LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)],
[LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)],
[0, 3, 1, 1],
true,
{[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;
[ [
QGVAR(paradropTimeCoefficent), "SLIDER", QGVAR(paradropTimeCoefficent), "SLIDER",
[LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)], [LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)],
[localize ELSTRING(OptionsMenu,CategoryLogistics), localize LSTRING(openMenu)], [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)],
[0,10,2.5,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] [0, 10, 2.5, 1],
true, // isGlobal true,
{[QGVAR(paradropTimeCoefficent), _this] call EFUNC(common,cbaSettings_settingChanged)} {[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init; ] call CBA_settings_fnc_init;

View File

@ -291,7 +291,7 @@
<Chinesesimp>此架飞机并无保持水平飞行</Chinesesimp> <Chinesesimp>此架飞机并无保持水平飞行</Chinesesimp>
</Key> </Key>
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent"> <Key ID="STR_ACE_Cargo_paradropTimeCoefficent">
<English>Paradrop Time Coffecient</English> <English>Paradrop Time Coefficient</English>
<German>Türlast Zeitfaktor</German> <German>Türlast Zeitfaktor</German>
<Japanese>空中投下までの時間係数</Japanese> <Japanese>空中投下までの時間係数</Japanese>
<Italian>Coefficente Tempo Lancio Paracadute</Italian> <Italian>Coefficente Tempo Lancio Paracadute</Italian>
@ -312,5 +312,11 @@
<Polish>Modyfikator wskazujący jak dużo czasu potrzeba by zrzucić przedmiot na spadochronie.</Polish> <Polish>Modyfikator wskazujący jak dużo czasu potrzeba by zrzucić przedmiot na spadochronie.</Polish>
<Korean>화물을 공중 투하 하는데 얼마나 걸리는 시간 설정</Korean> <Korean>화물을 공중 투하 하는데 얼마나 걸리는 시간 설정</Korean>
</Key> </Key>
<Key ID="STR_ACE_Cargo_loadTimeCoefficient">
<English>Load Time Coefficient</English>
</Key>
<Key ID="STR_ACE_Cargo_loadTimeCoefficient_description">
<English>Modifies how long it takes to load/unload items.\nTime, in seconds, is 5 times the size of the item multiplied by this value.</English>
</Key>
</Package> </Package>
</Project> </Project>