Refuel - Add separate names for jerry can interactions (#9625)

Fix for #8115
This commit is contained in:
johnb432 2023-11-10 23:59:15 +01:00 committed by GitHub
parent 0ae00248c5
commit 0330532cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 10 deletions

View File

@ -72,7 +72,7 @@ private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL);
_args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_endPosTestOffset", [0,0,0], [[]], 3]];
_unit setVariable [QGVAR(nozzle), nil, true];
_unit setVariable [QGVAR(isRefueling), false];
private _source = _nozzle getVariable QGVAR(source);
detach _nozzle;
@ -128,14 +128,14 @@ private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL);
if ([_unit, _nozzle, false] call FUNC(canTurnOn)) then {
[_unit, _nozzle, false] call FUNC(turnOn);
} else {
[localize LSTRING(CouldNotTurnOn)] call EFUNC(common,displayText);
[localize LSTRING(CouldNotTurnOn)] call EFUNC(common,displayTextStructured);
};
};
case (!_canReceive && _isContainer): {
if ([_unit, _nozzle, true] call FUNC(canTurnOn)) then {
[_unit, _nozzle, true] call FUNC(turnOn);
} else {
[localize LSTRING(CouldNotTurnOn)] call EFUNC(common,displayText);
[localize LSTRING(CouldNotTurnOn)] call EFUNC(common,displayTextStructured);
};
};
default {
@ -144,7 +144,7 @@ private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL);
};
},
"",
localize LSTRING(ConnectAction),
localize ([LSTRING(ConnectAction), LSTRING(ConnectFuelCanisterAction)] select (_nozzle getVariable [QGVAR(jerryCan), false])),
{true},
[INTERACT_EXCEPTIONS]
] call EFUNC(common,progressBar);

View File

@ -45,7 +45,7 @@ private _action = [QGVAR(Refuel),
// Add pickup
_action = [QGVAR(PickUpNozzle),
localize LSTRING(TakeNozzle),
localize LSTRING(TakeFuelCanister),
QPATHTOF(ui\icon_refuel_interact.paa),
{[_player, _target] call FUNC(takeNozzle)},
{[_player, _target] call FUNC(canTakeNozzle)},
@ -105,7 +105,7 @@ _action = [QGVAR(TurnOff),
// Add disconnect
_action = [QGVAR(Disconnect),
localize LSTRING(Disconnect),
localize LSTRING(DisconnectFuelCanister),
QPATHTOF(ui\icon_refuel_interact.paa),
{[_player, _target] call FUNC(disconnect)},
{[_player, _target] call FUNC(canDisconnect)},

View File

@ -96,7 +96,7 @@ TRACE_2("start",_unit,_nozzle);
getCursorObjectParams params ["_cursorObject", "", "_distance"];
if (!isNull _cursorObject && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE}) then {
if ([_cursorObject] call FUNC(canConnectNozzle)) then {
_hintLMB = localize LSTRING(Connect);
_hintLMB = localize ([LSTRING(Connect), LSTRING(ConnectFuelCanister)] select (_nozzle getVariable [QGVAR(jerryCan), false]));
};
if ([_unit, _cursorObject] call FUNC(canReturnNozzle)) then {
_hintRMB = localize LSTRING(Return);

View File

@ -77,11 +77,11 @@ params [
[_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set);
_source setVariable [QGVAR(isConnected), true, true];
_source setVariable [QGVAR(ownedNozzle), _nozzle, true];
// Prevent moving the fuel source while the hose is out
_source setVariable [QGVAR(canCarryLast), _source getVariable [QEGVAR(dragging,canCarry), false], true];
_source setVariable [QGVAR(canDragLast), _source getVariable [QEGVAR(dragging,canDrag), false], true];
_source setVariable [QEGVAR(dragging,canCarry), false, true];
_source setVariable [QEGVAR(dragging,canDrag), false, true];
};
@ -100,7 +100,7 @@ params [
[_unit, _nozzle] call FUNC(startNozzleInHandsPFH);
},
{},
localize LSTRING(TakeNozzleAction),
localize ([LSTRING(TakeNozzleAction), LSTRING(TakeFuelCanisterAction)] select (_object getVariable [QGVAR(jerryCan), false])),
{true},
[INTERACT_EXCEPTIONS_REFUELING]
] call EFUNC(common,progressBar);

View File

@ -492,6 +492,21 @@
<Chinese>已加入%1公升</Chinese>
<Turkish>%1 litre dolduruldu</Turkish>
</Key>
<Key ID="STR_ACE_Refuel_TakeFuelCanister">
<English>Pick up fuel canister</English>
</Key>
<Key ID="STR_ACE_Refuel_TakeFuelCanisterAction">
<English>Picking fuel canister up...</English>
</Key>
<Key ID="STR_ACE_Refuel_ConnectFuelCanister">
<English>Connect fuel canister</English>
</Key>
<Key ID="STR_ACE_Refuel_ConnectFuelCanisterAction">
<English>Connecting fuel canister...</English>
</Key>
<Key ID="STR_ACE_Refuel_DisconnectFuelCanister">
<English>Disconnect fuel canister</English>
</Key>
<Key ID="STR_ACE_Refuel_RefuelSettings_hoseLength_DisplayName">
<English>Refuel hose length</English>
<German>Betankung Schlauchlänge</German>