diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index 88336dab..7cc5a5a6 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -23,7 +23,7 @@ jobs: - name: Setup HEMTT uses: arma-actions/hemtt@v1 - name: Run HEMTT build - run: hemtt build + run: chmod +x hemtt/hemtt && hemtt/hemtt build - name: Rename build folder run: mv .hemttout/build .hemttout/@misery - name: Upload Artifact diff --git a/README.md b/README.md index 39f56af4..fa48d381 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

- Requires the latest versions of CBA A3 and ACE3.
+ Requires the latest versions of CBA A3,ACE3 and AE3.
Visit us on Discord

@@ -55,7 +55,7 @@ We trust that this mod will serve as a valuable tool in realizing your vision fo ## Getting started -Misery requires Arma 3 and the latest version of CBA A3 and ACE3. +Misery requires Arma 3 and the latest version of CBA A3,ACE3 and AE3. ## Contributing to Misery diff --git a/addons/audio/XEH_postInit.sqf b/addons/audio/XEH_postInit.sqf index 737a7058..f9a223e4 100644 --- a/addons/audio/XEH_postInit.sqf +++ b/addons/audio/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" // CBA Events -[QGVAR(say3D), {(_this select 0) say3D (_this select 1)}] call CBA_fnc_addEventHandler; +[QGVAR(say3D), {(_this select 0) say3D [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; // TODO. /* diff --git a/addons/audio/functions/fnc_ambientSoundScape.sqf b/addons/audio/functions/fnc_ambientSoundScape.sqf index 32c98681..d198e252 100644 --- a/addons/audio/functions/fnc_ambientSoundScape.sqf +++ b/addons/audio/functions/fnc_ambientSoundScape.sqf @@ -28,7 +28,7 @@ private _soundDummy = createVehicle ["Land_HelipadEmpty_F", _dummyPosition, [], private _sound = selectRandom GVAR(ambientSoundScapeExtras); -[QGVAR(say3D), [_soundDummy, _sound]] call CBA_fnc_globalEvent; +[QGVAR(say3D), [_soundDummy, _sound, 100]] call CBA_fnc_globalEvent; // Loop sound [{ diff --git a/addons/audio/sounds/generator/dieselRunning.ogg b/addons/audio/sounds/generator/dieselRunning.ogg index 318df921..962d0f0a 100644 Binary files a/addons/audio/sounds/generator/dieselRunning.ogg and b/addons/audio/sounds/generator/dieselRunning.ogg differ diff --git a/addons/audio/sounds/generator/petrolRunning.ogg b/addons/audio/sounds/generator/petrolRunning.ogg index fca65c7f..6d860566 100644 Binary files a/addons/audio/sounds/generator/petrolRunning.ogg and b/addons/audio/sounds/generator/petrolRunning.ogg differ diff --git a/addons/common/functions/fnc_itemDecrement.sqf b/addons/common/functions/fnc_itemDecrement.sqf index 655c154a..6242ef24 100644 --- a/addons/common/functions/fnc_itemDecrement.sqf +++ b/addons/common/functions/fnc_itemDecrement.sqf @@ -8,7 +8,7 @@ * 1: Replacement Item (default: "") * * Return Value: - * None + * 0: Decremented * * Example: * [] call misery_common_fnc_itemDecrement @@ -25,10 +25,12 @@ if (_itemContainer isNotEqualTo -1) then { if (_containerCount > 1) then { player removeMagazine _item; [player, _item, _containerCount - 1, true] call CBA_fnc_addMagazine; + true } else { player removeMagazine _item; if (_replacementItem isNotEqualTo "") then { [player, _replacementItem, true] call CBA_fnc_addItem; }; + false }; }; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 18db7532..1dcab615 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -737,6 +737,22 @@ 系统提示 + RPT日志 Sistem Sohbeti + RPT Günlükleri + + Take %1 + Vzít %1 + Prendre %1 + Tomar %1 / Cojer %1 + Prendi %1 + Weź %1 + Pegar %1 + Взять %1 + %1 nehmen + %1 줍기 + %1 を取る + 拿取 %1 + 拿取 %1 + %1 Al + You cannot afford this! Tohle si nemůžete dovolit! diff --git a/addons/common/ui/menus.hpp b/addons/common/ui/menus.hpp index 7c7fac6a..ca2b576f 100644 --- a/addons/common/ui/menus.hpp +++ b/addons/common/ui/menus.hpp @@ -11,9 +11,6 @@ #include "\z\misery\addons\fire\ui\fireCrafting.hpp" #include "\z\misery\addons\fishing\ui\fishing.hpp" #include "\z\misery\addons\forge\ui\forge.hpp" -#include "\z\misery\addons\fuel\ui\refill_fuelCan.hpp" -#include "\z\misery\addons\fuel\ui\refuelVehicle.hpp" -#include "\z\misery\addons\generator\ui\generator.hpp" #include "\z\misery\addons\hydrology\ui\hydrology.hpp" #include "\z\misery\addons\maintenance\ui\maintenance.hpp" #include "\z\misery\addons\persistence\ui\grad_persistence.hpp" diff --git a/addons/fuel/XEH_PREP.hpp b/addons/fuel/XEH_PREP.hpp index 1e468ad0..31928f64 100644 --- a/addons/fuel/XEH_PREP.hpp +++ b/addons/fuel/XEH_PREP.hpp @@ -1,6 +1,6 @@ -PREP(audioLogic); -PREP(fuelCanListed); -PREP(icon); -PREP(process); +PREP(initFuelPumps); +PREP(initRefuelRestrictions); PREP(processFuelCan); -PREP(pumpAudio); +PREP(processTerrainPumps); +PREP(turnOffPump); +PREP(turnOnPump); diff --git a/addons/fuel/XEH_postInit.sqf b/addons/fuel/XEH_postInit.sqf index 666e33f6..74f28be5 100644 --- a/addons/fuel/XEH_postInit.sqf +++ b/addons/fuel/XEH_postInit.sqf @@ -1,57 +1,42 @@ #include "script_component.hpp" -if (!isNil QACEGVAR(refuel,enabled) && ACEGVAR(refuel,enabled)) exitWith {}; +if (isServer) then { + call FUNC(initFuelPumps); + call FUNC(processTerrainPumps); +}; + +call FUNC(initRefuelRestrictions); private _allFuelStations = [MACRO_FUELSTATIONS_LAND] + [MACRO_FUELSTATIONS_AIR]; -private _fuelPumpAction = [ - QGVAR(fuel_pump_menu), - localize LSTRING(Action), - QPATHTOEF(markers,data\fuel_ca.paa), - {}, - {true}, - {}, - ["_target", "_player"], - [0, 0, 0], - 3 -] call ACEFUNC(interact_menu,createAction); +private _refillPumpAction = [ + QGVAR(refuel_fuelCan_pump_menu), + localize LSTRING(RefillFuelCanAtPump), + "z\ace\addons\refuel\ui\icon_refuel_interact.paa", + { + params ["_target", "_player"]; -{ - [_x, 0, [QUOTE(ACE_MainActions)], _fuelPumpAction] call ACEFUNC(interact_menu,addActionToClass); -} forEach _allFuelStations; + private _allCans = [MACRO_FUEL_CANS] + [MACRO_FUEL_CANS_EMPTY]; + private _matchedIndex = _allCans findIf { [[_x]] call EFUNC(common,hasItem) }; -private _refuelPumpAction = [ - QGVAR(refuel_pump_menu), - localize LSTRING(RefuelAtPump), - QPATHTOEF(markers,data\fuel_ca.paa), - { - createDialog QCLASS(refuelVehicle_ui) + [_player, _matchedIndex] call FUNC(processFuelCan); }, - {true}, - {}, - ["_target", "_player"], - [0, 0, 0], - 3 -] call ACEFUNC(interact_menu,createAction); + { + params ["_target", "_player"]; -{ - [_x, 0, [QUOTE(ACE_MainActions), QGVAR(fuel_pump_menu)], _refuelPumpAction] call ACEFUNC(interact_menu,addActionToClass); -} forEach _allFuelStations; + private _isHoldingNozzle = _player getVariable [QACEGVAR(refuel,nozzle), objNull]; -private _refillPumpAction = [ - QGVAR(refuel_fuelCan_pump_menu), - localize LSTRING(RefillFuelCanAtPump), - QPATHTOEF(markers,data\fuel_ca.paa), - { - createDialog QCLASS(refuelfuelCan_ui) + if (isNull _isHoldingNozzle) exitWith { false }; + + private _allCans = [MACRO_FUEL_CANS] + [MACRO_FUEL_CANS_EMPTY]; + private _matchedIndex = _allCans findIf { [[_x]] call EFUNC(common,hasItem) }; + + _matchedIndex isNotEqualTo -1 }, - {true}, {}, ["_target", "_player"], [0, 0, 0], 3 ] call ACEFUNC(interact_menu,createAction); -{ - [_x, 0, [QUOTE(ACE_MainActions), QGVAR(fuel_pump_menu)], _refillPumpAction] call ACEFUNC(interact_menu,addActionToClass); -} forEach _allFuelStations; +[player, 1, [QUOTE(ACE_SelfActions)], _refillPumpAction] call ACEFUNC(interact_menu,addActionToObject); diff --git a/addons/fuel/config.cpp b/addons/fuel/config.cpp index 3e1293bc..92889932 100644 --- a/addons/fuel/config.cpp +++ b/addons/fuel/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {QCLASS(common)}; + requiredAddons[] = {QCLASS(common), QCLASSACE(refuel)}; authors[] = {"TenuredCLOUD"}; VERSION_CONFIG; }; @@ -14,4 +14,3 @@ class CfgPatches { #include "CfgEventHandlers.hpp" - diff --git a/addons/fuel/functions/fnc_audioLogic.sqf b/addons/fuel/functions/fnc_audioLogic.sqf deleted file mode 100644 index 359bb0ac..00000000 --- a/addons/fuel/functions/fnc_audioLogic.sqf +++ /dev/null @@ -1,34 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: TenuredCLOUD - * Terminates audio loop when no longer allowed - * - * Arguments: - * 0: Source - * 1: Handle - * - * Return Value: - * None - * - * Example: - * [] call misery_fuel_fnc_audioLogic -*/ - -params ["_audioSource", "_logicHandle"]; - -[{ - params ["_args", "_handle"]; - _args params ["_audioSource", "_logicHandle"]; - - if (!GVAR(pumpingFuel) || !alive player) exitWith { - if !(isNull _audioSource) then { - deleteVehicle _audioSource; - if (!isNil "_logicHandle") then { - _logicHandle call CBA_fnc_removePerFrameHandler; - }; - call FUNC(pumpAudio); - }; - _handle call CBA_fnc_removePerFrameHandler; - }; -}, 1, [_audioSource, _logicHandle]] call CBA_fnc_addPerFrameHandler; - diff --git a/addons/fuel/functions/fnc_fuelCanListed.sqf b/addons/fuel/functions/fnc_fuelCanListed.sqf deleted file mode 100644 index ff59fe2f..00000000 --- a/addons/fuel/functions/fnc_fuelCanListed.sqf +++ /dev/null @@ -1,38 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: TenuredCLOUD - * Fuel can filling list processor - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_fuel_fnc_fuelCanListed - * -*/ - -[{!isNull findDisplay 733836}, { - private _list = findDisplay 733836 displayCtrl 1500; - - lbClear _list; - - if ([[MACRO_FUELSTATIONS_LAND], 2.5] call EFUNC(common,nearCraftingStation)) exitWith { - { - private _outputItem = _x; - [_outputItem] call EFUNC(common,getItemData) params ["_displayName"]; - - private _index = _list lbAdd _displayName; - _list lbSetData [_index, _outputItem]; - } forEach [QCLASS(petrol), QCLASS(diesel)]; - }; - - if ([[MACRO_FUELSTATIONS_AIR], 5] call EFUNC(common,nearCraftingStation)) exitWith { - [QCLASS(jetFuel)] call EFUNC(common,getItemData) params ["_displayName"]; - - private _index = _list lbAdd _displayName; - _list lbSetData [_index, QCLASS(jetFuel)]; - }; -}, []] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/fuel/functions/fnc_icon.sqf b/addons/fuel/functions/fnc_icon.sqf deleted file mode 100644 index 8787db77..00000000 --- a/addons/fuel/functions/fnc_icon.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: TenuredCLOUD - * Refuel icon updater - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_fuel_fnc_icon; - * - * Public: No -*/ - -[{!isNull findDisplay 733835}, { - [{ - params ["_args", "_handle"]; - - if (isNull findDisplay 733835 || (!alive player)) exitWith { - [_handle] call CBA_fnc_removePerFrameHandler; - }; - - [player] call EFUNC(common,nearVehicle) params ["", "_vehicle"]; - [_vehicle] call EFUNC(common,getObjectData) params ["_displayName", "_picture"]; - - private _dialog = findDisplay 733835; - private _iconCtrl = _dialog displayCtrl 1201; - private _nameCtrl = _dialog displayCtrl 1200; - - _iconCtrl ctrlSetText _picture; - _nameCtrl ctrlSetText _displayName; - }, 1, []] call CBA_fnc_addPerFrameHandler; -}, []] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/fuel/functions/fnc_initFuelPumps.sqf b/addons/fuel/functions/fnc_initFuelPumps.sqf new file mode 100644 index 00000000..ac4471c4 --- /dev/null +++ b/addons/fuel/functions/fnc_initFuelPumps.sqf @@ -0,0 +1,84 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Initializes fuel pumps that can be placed / dynamically spawned + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_fuel_fnc_initFuelPumps; + * + * Public: No +*/ + +{ + [_x, "Init", { + params ["_pumpSource"]; + + private _supportedFuels = [0, 1]; + + _pumpSource setVariable [QGVAR(fuelTypeSupported), _supportedFuels, true]; + + // Default to no fuel available to terminate nozzle pumping + [_pumpSource, 0] call ACEFUNC(refuel,makeSource); + + [ + _pumpSource, + "", + 0, + {}, + { + [_this select 0] call FUNC(turnOnPump); + }, + {true}, + { + [_this select 0] call FUNC(turnOffPump); + }, + {true} + ] call AE3FUNC(power,initDevice); + + [_pumpSource, nil, false] call AE3FUNC(power,initPowerInterface); + + // Set fuel pumps at 1.2kW for operation + [_pumpSource, 0.000333, 0] call AE3FUNC(power,initConsumer); + + }, true, [], true] call CBA_fnc_addClassEventHandler; +} forEach [MACRO_FUELSTATIONS_LAND]; + +{ + [_x, "Init", { + params ["_pumpSource"]; + + private _supportedFuels = [2]; + + _pumpSource setVariable [QGVAR(fuelTypeSupported), _supportedFuels, true]; + + // Default to no fuel available to terminate nozzle pumping + [_pumpSource, 0] call ACEFUNC(refuel,makeSource); + + [ + _pumpSource, + "", + 0, + {}, + { + [_this select 0] call FUNC(turnOnPump); + }, + {true}, + { + [_this select 0] call FUNC(turnOffPump); + }, + {true} + ] call AE3FUNC(power,initDevice); + + [_pumpSource, nil, false] call AE3FUNC(power,initPowerInterface); + + // Set fuel pumps at 1.2kW for operation + [_pumpSource, 0.000333, 0] call AE3FUNC(power,initConsumer); + + }, true, [], true] call CBA_fnc_addClassEventHandler; +} forEach [MACRO_FUELSTATIONS_AIR]; diff --git a/addons/fuel/functions/fnc_initRefuelRestrictions.sqf b/addons/fuel/functions/fnc_initRefuelRestrictions.sqf new file mode 100644 index 00000000..9758e492 --- /dev/null +++ b/addons/fuel/functions/fnc_initRefuelRestrictions.sqf @@ -0,0 +1,64 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Listener that intercepts ACE refuel events to enforce fuel types + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_fuel_fnc_refuelRestrictions; + */ + +[QCLASSACE(refuel_started), { + params ["_source", "_target", "_nozzle", "_unit"]; + + private _pumpAllowedFuels = _source getVariable [QGVAR(fuelTypeSupported), []]; + + // If target is a generator & source isn't jetfuel allow refilling + if (_target in EGVAR(power,generators) && 0 in _pumpAllowedFuels || 1 in _pumpAllowedFuels) exitWith {}; + + if (_pumpAllowedFuels isNotEqualTo []) then { + + private _found = false; + private _vehicleFuelIndex = -1; + + { + if ((_x select 0) isEqualTo typeOf _target) then { + _found = true; + _vehicleFuelIndex = _x select 1; + }; + } forEach EGVAR(common,vehicleData); + + if (!_found) exitWith { + // short delay to make sure nozzle sound is terminated + [{ + params ["_unit", "_nozzle"]; + [_unit, _nozzle] call ACEFUNC(refuel,turnOff); + }, [_unit, _nozzle], 0.2] call CBA_fnc_waitAndExecute; + }; + + if !(_vehicleFuelIndex in _pumpAllowedFuels) then { + + // short delay to make sure nozzle sound is terminated + [{ + params ["_unit", "_nozzle"]; + [_unit, _nozzle] call ACEFUNC(refuel,turnOff); + }, [_unit, _nozzle], 0.2] call CBA_fnc_waitAndExecute; + + private _reqString = ""; + + switch (_vehicleFuelIndex) do { + case 0: { _reqString = localize LSTRING(Diesel) }; + case 1: { _reqString = localize LSTRING(Petrol) }; + case 2: { _reqString = localize LSTRING(JetFuel) }; + }; + + private _msg = format [localize LSTRING(PumpSupports), _pumpAllowedFuels joinString " + ", _reqString]; + [[_msg, 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; + }; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/fuel/functions/fnc_process.sqf b/addons/fuel/functions/fnc_process.sqf deleted file mode 100644 index 1215fe1a..00000000 --- a/addons/fuel/functions/fnc_process.sqf +++ /dev/null @@ -1,141 +0,0 @@ -#include "..\script_component.hpp" -#include "\a3\ui_f\hpp\defineDIKCodes.inc" -/* - * Author: TenuredCLOUD - * Process refueling vehicle with fuel pump - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_fuel_fnc_process - * -*/ - -private _dialog = findDisplay 733835; - -[player] call EFUNC(common,nearVehicle) params ["", "_vehicle"]; - -private _nearLandFuel = [[MACRO_FUELSTATIONS_LAND], 2.5] call EFUNC(common,nearCraftingStation); -private _nearAirFuel = [[MACRO_FUELSTATIONS_AIR], 10] call EFUNC(common,nearCraftingStation); - -if (isNil "_vehicle") exitWith { ctrlSetText [1001, localize LSTRING(NoVehicle)]; }; - -if (_vehicle isKindOf "Air" && _nearLandFuel) exitWith { ctrlSetText [1001, localize LSTRING(WrongStation)]; }; - -if (_vehicle isKindOf "Land" && _nearAirFuel) exitWith { ctrlSetText [1001, localize LSTRING(WrongStation)]; }; - -private _found = false; -private _totalLiters = 0; - -{ - if ((_x select 0) isEqualTo typeOf _vehicle) then { - _array = _x; - _found = true; - _totalLiters = _x select 2; - }; -} forEach EGVAR(common,vehicleData); - -if !(_found) exitWith {}; - -player setVariable [QGVAR(usingPump), true]; - -// Initial button disabler -[733835, [1600, 1601], false] call EFUNC(common,displayShowControls); - -private _pumpInterrupt = (findDisplay 733835) displayAddEventHandler ["KeyDown", { - params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"]; - if (_key isEqualTo DIK_ESCAPE) then { - player setVariable [QGVAR(usingPump),false]; - [QEGVAR(common,tileText), format [localize LSTRING(RefuelingInterrupted)]] call CBA_fnc_localEvent; - }; -}]; - -if (fuel _vehicle >= 1) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733835) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - _vehicle setFuel 1; - ctrlSetText [1001, format [localize LSTRING(TankFull), [_vehicle] call EFUNC(common,getObjectData) select 0]]; - [733835, [1600, 1601], true] call EFUNC(common,displayShowControls); -}; - -GVAR(pumpingFuel) = true; -playSound QEGVAR(audio,sound_gasPumpStart); -call FUNC(pumpAudio); - -private _text = localize LSTRING(Refueling); -private _tanklvl = localize LSTRING(TankLevel); -private _displayedText = ""; - -[{ - params ["_args", "_handle"]; - _args params ["_vehicle", "_pumpInterrupt", "_totalLiters", "_text", "_tanklvl", "_displayedText"]; - - private _fuelToAdd = 1 / _totalLiters; - - [player, 25] call EFUNC(generator,nearGenerator) params ["", "_generator"]; - - GVAR(usingGenerator) = false; - GVAR(usingBattery) = false; - - if (!isNil "_generator" && _generator getVariable [QEGVAR(generator,isRunning), false]) then { - GVAR(usingGenerator) = true; - }; - - if ([[QCLASS(autoBattery), QCLASS(autoBattery_Heavy)]] call EFUNC(common,hasItem)) then { - GVAR(usingBattery) = true; - }; - - if ((player getVariable QGVAR(usingPump)) isEqualTo false) exitWith { - (findDisplay 733835) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - [733835, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; - }; - - if (fuel _vehicle >= 1) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733835) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - _vehicle setFuel 1; - ctrlSetText [1001, format [localize LSTRING(TankFull), [_vehicle] call EFUNC(common,getObjectData) select 0]]; - [733835, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; - }; - - if (!GVAR(usingGenerator) && !GVAR(usingBattery)) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733835) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - ctrlSetText [1001, localize LSTRING(NoPowerSource)]; - [733835, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; - }; - - if (GVAR(usingGenerator)) then { - // No power needed since generator is powering fuel pump - _vehicle setFuel ((fuel _vehicle) + _fuelToAdd); - }; - - if (!GVAR(usingGenerator) && GVAR(usingBattery)) then { - _vehicle setFuel ((fuel _vehicle) + _fuelToAdd); - // Decrement the battery's life randomly (if being used): - if ([30] call EFUNC(common,rollChance)) then { - if ([[QCLASS(autoBattery)]] call EFUNC(common,hasItem)) then { - [QCLASS(autoBattery)] call EFUNC(common,itemDecrement); - } else { - if ([[QCLASS(autoBattery_Heavy)]] call EFUNC(common,hasItem)) then { - [QCLASS(autoBattery_Heavy)] call EFUNC(common,itemDecrement); - }; - }; - }; - }; - - ctrlSetText [1001, format ["%1%2%3%2%4%2%5", _text, endl, [_vehicle] call EFUNC(common,getObjectData) select 0, _tanklvl, (fuel _vehicle) * 100]]; -}, 0.5, [_vehicle, _pumpInterrupt, _totalLiters, _text, _tanklvl, _displayedText]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fuel/functions/fnc_processFuelCan.sqf b/addons/fuel/functions/fnc_processFuelCan.sqf index 861bcc50..14b5e487 100644 --- a/addons/fuel/functions/fnc_processFuelCan.sqf +++ b/addons/fuel/functions/fnc_processFuelCan.sqf @@ -1,5 +1,4 @@ #include "..\script_component.hpp" -#include "\a3\ui_f\hpp\defineDIKCodes.inc" /* * Author: TenuredCLOUD * Process filling fuel cans from fuel pump @@ -15,119 +14,128 @@ * */ -private _dialog = findDisplay 733836; +params ["_unit", "_matchedIndex"]; -private _selectedFuelCan = lbData [1500, (lbCurSel 1500)]; +if (_matchedIndex isEqualTo -1) exitWith {}; -if (_selectedFuelCan isEqualTo "") exitWith { ctrlSetText [1001, localize LSTRING(NoFuelCan)] }; +private _allCans = [MACRO_FUEL_CANS] + [MACRO_FUEL_CANS_EMPTY]; +private _foundCanClass = _allCans select _matchedIndex; -player setVariable [QGVAR(usingPump), true]; +private _isEmptyCan = _foundCanClass in [MACRO_FUEL_CANS_EMPTY]; -// Initial button disabler -[733836, [1600, 1601], false] call EFUNC(common,displayShowControls); +private _fuelTypeIndex = -1; -private _pumpInterrupt = (findDisplay 733836) displayAddEventHandler ["KeyDown", { - params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"]; - if (_key isEqualTo DIK_ESCAPE) then { - player setVariable [QGVAR(usingPump), false]; - [QEGVAR(common,tileText), format [localize LSTRING(FillingInterrupted)]] call CBA_fnc_localEvent; - }; -}]; +switch (true) do { + case (_foundCanClass isEqualTo QCLASS(diesel) || _foundCanClass isEqualTo QCLASS(dieselEmpty)): { _fuelTypeIndex = 0 }; + case (_foundCanClass isEqualTo QCLASS(petrol) || _foundCanClass isEqualTo QCLASS(petrolEmpty)): { _fuelTypeIndex = 1 }; + case (_foundCanClass isEqualTo QCLASS(jetFuel) || _foundCanClass isEqualTo QCLASS(jetFuelEmpty)): { _fuelTypeIndex = 2 }; +}; + +private _fillableCan = [MACRO_FUEL_CANS] select _fuelTypeIndex; + +private _nozzle = _unit getVariable [QACEGVAR(refuel,nozzle), objNull]; + +private _targetPump = if (!isNull _nozzle) then { _nozzle getVariable [QACEGVAR(refuel,source), objNull] } else { objNull }; + +if (isNull _targetPump) exitWith { + [[localize LSTRING(FuelPumpUnresponsive), 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; +}; + +private _powerState = [_targetPump] call AE3FUNC(power,getPowerState); + +private _dummyPosition = getPosATL _nozzle; +private _soundDummy = createVehicle ["Land_HelipadEmpty_F", _dummyPosition, [], 0, "CAN_COLLIDE"]; +private _soundDummy_1 = createVehicle ["Land_HelipadEmpty_F", _dummyPosition, [], 0, "CAN_COLLIDE"]; + +if (_powerState isEqualTo "Off") exitWith { + [[localize LSTRING(NoPowerSource), 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; + [QEGVAR(audio,say3D), [_soundDummy, QACEGVAR(refuel,nozzle_stop), 50]] call CBA_fnc_globalEvent; + [{ + params ["_soundDummy", "_soundDummy_1"]; + deleteVehicle _soundDummy; + deleteVehicle _soundDummy_1; + }, [_soundDummy, _soundDummy_1], 0.5] call CBA_fnc_waitAndExecute; +}; + +private _fuelStrings = [localize LSTRING(Diesel), localize LSTRING(Petrol), localize LSTRING(JetFuel)]; + +private _canFuelTypeString = _fuelStrings select _fuelTypeIndex; -private _preCheckIndex = [MACRO_FUEL_CANS] find _selectedFuelCan; -private _preCheckCanNoFuel = [MACRO_FUEL_CANS_EMPTY] select _preCheckIndex; +private _pumpAllowedFuels = _targetPump getVariable [QGVAR(fuelTypeSupported), []]; -if (!([[_preCheckCanNoFuel]] call EFUNC(common,hasItem)) && !([[_selectedFuelCan]] call EFUNC(common,hasItem))) exitWith { - ctrlSetText [1001, localize LSTRING(NoFuelCanToFill)]; - [733836, [1600, 1601], true] call EFUNC(common,displayShowControls); - player setVariable [QGVAR(usingPump), false]; - (findDisplay 733836) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; +if !(_fuelTypeIndex in _pumpAllowedFuels) exitWith { + private _msg = format [localize LSTRING(PumpDoesNotDispense), _canFuelTypeString]; + [[_msg, 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; + [QEGVAR(audio,say3D), [_soundDummy, QACEGVAR(refuel,nozzle_stop), 50]] call CBA_fnc_globalEvent; + [{ + params ["_soundDummy", "_soundDummy_1"]; + { + deleteVehicle _x; + } forEach [_soundDummy, _soundDummy_1]; + }, [_soundDummy, _soundDummy_1], 0.5] call CBA_fnc_waitAndExecute; }; -GVAR(pumpingFuel) = true; -playSound QEGVAR(audio,sound_gasPumpStart); -call FUNC(pumpAudio); +[QEGVAR(audio,say3D), [_soundDummy, QACEGVAR(refuel,nozzle_start), 50]] call CBA_fnc_globalEvent; + +if (_isEmptyCan) then { + [_unit, _foundCanClass] call CBA_fnc_removeItem; + [_unit, _fillableCan, 1, true] call CBA_fnc_addMagazine; +}; + +private _lastPos = getPosATL _unit; + +private _totalSteps = 20 / (ACEGVAR(refuel,rate) min 20); +private _currentStep = 0; [{ params ["_args", "_handle"]; - _args params ["_selectedFuelCan", "_pumpInterrupt", "_preCheckCanNoFuel"]; + _args params ["_nozzle", "_targetPump", "_lastPos", "_totalSteps", "_currentStep", "_unit", "_fillableCan", "_soundDummy", "_soundDummy_1", "_canFuelTypeString"]; - [player, 25] call EFUNC(generator,nearGenerator) params ["", "_generator"]; + private _currentPos = getPosATL _unit; - GVAR(usingGenerator) = false; - GVAR(usingBattery) = false; + [[localize LSTRING(Refueling), 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; - if (!isNil "_generator" && _generator getVariable [QEGVAR(generator,isRunning), false]) then { - GVAR(usingGenerator) = true; - }; - - if ([[QCLASS(autoBattery), QCLASS(autoBattery_Heavy)]] call EFUNC(common,hasItem)) then { - GVAR(usingBattery) = true; - }; + if ((_currentPos distance _lastPos) > 0.01 || isNull _nozzle || isNull _targetPump || !alive _unit) exitWith { + [[localize LSTRING(RefuelingInterrupted), 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; + deleteVehicle _soundDummy; + [QEGVAR(audio,say3D), [_soundDummy_1, QACEGVAR(refuel,nozzle_stop), 50]] call CBA_fnc_globalEvent; + [{ + deleteVehicle _this; + }, [_soundDummy_1], 0.5] call CBA_fnc_waitAndExecute; - if ((player getVariable QGVAR(usingPump)) isEqualTo false) exitWith { - (findDisplay 733836) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - [733836, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); _handle call CBA_fnc_removePerFrameHandler; }; - if (!GVAR(usingGenerator) && !GVAR(usingBattery)) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733836) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - ctrlSetText [1001, localize LSTRING(NoPowerSource)]; - [733836, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; + private _incremented = false; + private _rate = ACEGVAR(refuel,rate); + + for "_i" from 1 to _rate do { + [_fillableCan] call EFUNC(common,itemIncrement) params [["_success", false]]; + if (_success) then { _incremented = true; }; }; - ctrlSetText [1001, localize LSTRING(PumpingFuel)]; + if !(_incremented) exitWith { + private _msg = format [localize LSTRING(CanIsFull), _canFuelTypeString]; + [[_msg, 1, [1, 1, 1, 1]], [], true] call CBA_fnc_notify; + deleteVehicle _soundDummy; + [QEGVAR(audio,say3D), [_soundDummy_1, QACEGVAR(refuel,nozzle_stop), 50]] call CBA_fnc_globalEvent; + [{ + deleteVehicle _this; + }, [_soundDummy_1], 0.5] call CBA_fnc_waitAndExecute; - // Add matching magazine type of fuel can to player if they have empty variant - if !([[_selectedFuelCan]] call EFUNC(common,hasItem)) then { - // Remove empty can and swap with magazine (fill-able variant) - [player, _preCheckCanNoFuel] call CBA_fnc_removeItem; - [player, _selectedFuelCan, 1, true] call CBA_fnc_addMagazine; + _handle call CBA_fnc_removePerFrameHandler; }; - if (GVAR(usingGenerator)) then { - // No power needed since generator is powering fuel pump - [_selectedFuelCan] call EFUNC(common,itemIncrement) params ["_incremented"]; - - if !(_incremented) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733836) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - ctrlSetText [1001, localize LSTRING(StopPumpingFuel)]; - [733836, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; - }; - }; + _currentStep = _currentStep + 1; + _args set [4, _currentStep]; + + if (_currentStep >= _totalSteps) exitWith { + deleteVehicle _soundDummy; + [QEGVAR(audio,say3D), [_soundDummy_1, QACEGVAR(refuel,nozzle_stop), 50]] call CBA_fnc_globalEvent; + [{ + deleteVehicle _this; + }, [_soundDummy_1], 0.5] call CBA_fnc_waitAndExecute; - if (!GVAR(usingGenerator) && GVAR(usingBattery)) then { - [_selectedFuelCan] call EFUNC(common,itemIncrement) params ["_incremented"]; - - if !(_incremented) exitWith { - player setVariable [QGVAR(usingPump), nil]; - (findDisplay 733836) displayRemoveEventHandler ["KeyDown", _pumpInterrupt]; - ctrlSetText [1001, localize LSTRING(StopPumpingFuel)]; - [733836, [1600, 1601], true] call EFUNC(common,displayShowControls); - GVAR(pumpingFuel) = false; - playSound QEGVAR(audio,sound_gasPumpStop); - _handle call CBA_fnc_removePerFrameHandler; - }; - // Decrement the battery's life randomly (if being used): - if ([30] call EFUNC(common,rollChance)) then { - if ([[QCLASS(autoBattery)]] call EFUNC(common,hasItem)) then { - [QCLASS(autoBattery)] call EFUNC(common,itemDecrement); - } else { - if ([[QCLASS(autoBattery_Heavy)]] call EFUNC(common,hasItem)) then { - [QCLASS(autoBattery_Heavy)] call EFUNC(common,itemDecrement); - }; - }; - }; + _handle call CBA_fnc_removePerFrameHandler; }; -}, 0.5, [_selectedFuelCan, _pumpInterrupt, _preCheckCanNoFuel]] call CBA_fnc_addPerFrameHandler; +}, 0.5, [_nozzle, _targetPump, _lastPos, _totalSteps, _currentStep, _unit, _fillableCan, _soundDummy, _soundDummy_1, _canFuelTypeString]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fuel/functions/fnc_processTerrainPumps.sqf b/addons/fuel/functions/fnc_processTerrainPumps.sqf new file mode 100644 index 00000000..93844ac4 --- /dev/null +++ b/addons/fuel/functions/fnc_processTerrainPumps.sqf @@ -0,0 +1,50 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Terrain fuel pump initializer / replacer to prep for ACE refuel & AE3 power + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_fuel_fnc_processTerrainPumps +*/ + +if (!isServer) exitWith {}; + +private _terrainObjects = call EFUNC(blackout,nearObjects); + +private _landPumps = [MACRO_FUELSTATIONS_LAND]; +private _airPumps = [MACRO_FUELSTATIONS_AIR]; +private _allPumpClasses = _landPumps + _airPumps; + +private _replacementPumps = []; + +{ + private _object = _x; + private _pumpClass = typeOf _object; + + if (_pumpClass in _allPumpClasses) then { + + _object hideObjectGlobal true; + + private _position = getPosATL _object; + private _direction = getDir _object; + private _vectorUp = vectorUp _object; + + private _pumpSource = createVehicle [_pumpClass, _position, [], 0, "CAN_COLLIDE"]; + _pumpSource setDir _direction; + _pumpSource setVectorUp _vectorUp; + + _replacementPumps pushBack _pumpSource; + }; +} forEach _terrainObjects; + +if (isClass (missionConfigFile >> "CfgGradPersistence")) then { + { + [_x] call GRADFUNC(persistence,blacklistObjects); + } forEach _replacementPumps; +}; diff --git a/addons/fuel/functions/fnc_pumpAudio.sqf b/addons/fuel/functions/fnc_pumpAudio.sqf deleted file mode 100644 index ac889b4c..00000000 --- a/addons/fuel/functions/fnc_pumpAudio.sqf +++ /dev/null @@ -1,27 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: TenuredCLOUD - * Processes fuel pump audio - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_fuel_fnc_pumpAudio -*/ - -[{GVAR(pumpingFuel)}, -{ - [{ - params ["_args", "_handle"]; - - private _audioSource = objNull; - - _audioSource = playSound QEGVAR(audio,sound_gasPumpRunning); - - [_audioSource, _handle] call FUNC(audioLogic); - }, 24, []] call CBA_fnc_addPerFrameHandler; -}, []] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/fuel/functions/fnc_turnOffPump.sqf b/addons/fuel/functions/fnc_turnOffPump.sqf new file mode 100644 index 00000000..8f28a4e1 --- /dev/null +++ b/addons/fuel/functions/fnc_turnOffPump.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Pump turn off logic + * Handles power logic & ACE refuel API hook + * + * Arguments: + * 0: Source + * + * Return Value: + * None + * + * Example: + * [] call misery_fuel_fnc_turnOffPump +*/ + +params ["_source"]; + +[_source, 0] call ACEFUNC(refuel,makeSource); + +true diff --git a/addons/fuel/functions/fnc_turnOnPump.sqf b/addons/fuel/functions/fnc_turnOnPump.sqf new file mode 100644 index 00000000..c164eba4 --- /dev/null +++ b/addons/fuel/functions/fnc_turnOnPump.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Pump turn on logic + * Handles power logic & ACE refuel API hook + * + * Arguments: + * 0: Source + * + * Return Value: + * None + * + * Example: + * [] call misery_fuel_fnc_turnOnPump +*/ + +params ["_source"]; + +[{ + params ["_source"]; + + [_source, -10] call ACEFUNC(refuel,makeSource); +}, [_source], 1] call CBA_fnc_waitAndExecute; + +true diff --git a/addons/fuel/stringtable.xml b/addons/fuel/stringtable.xml index b0148c88..fa2cb3c1 100644 --- a/addons/fuel/stringtable.xml +++ b/addons/fuel/stringtable.xml @@ -1,69 +1,69 @@ - - Use fuel pump - Použít palivové čerpadlo - Utiliser la pompe à carburant - Usar bomba de combustible - Usa pompa di carburante - Użyj dystrybutora paliwa - Usar bomba de combustível - Использовать топливный насос - Kraftstoffpumpe benutzen - 연료 펌프 사용 - 燃料ポンプを使用する - 使用燃料幫浦 - 使用燃料泵 - Yakıt pompasını kullan + + %1 can is full... + Kanystr (%1) je plný... + Le bidon de %1 est plein... + El bidón de %1 está lleno... + La tanica di %1 è piena... + Kanalizator (%1) jest pełny... + O galão de %1 está cheio... + Канистра (%1) полна... + %1-Kanister ist voll... + %1 캔이 가득 찼습니다... + %1 缶は満タンです... + %1 罐已滿... + %1 罐已满... + %1 bidonu dolu... - - Filling interrupted... - Naplnění přerušeno... - Remplissage interrompu... - Llenado interrumpido... - Riempiemento interrotto... - Wypełnienie przerwane... - Preenchimento interrompido... - Заполнение прервано... - Auffüllen unterbrochen... - 채우기 중단됨... - 充填が中断されました... - 填充被中断了... - 填充被中断了... - Doldurma işlemi kesildi... + + Diesel + Nafta + Diesel + Diésel + Diesel + Diesel / Olej napędowy + Diesel + Дизель + Diesel + 디젤 + 軽油 / ディーゼル + 柴油 + 柴油 + Dizel - - No selected fuel can to fill... - Žádný vybraný nádrž na naplnění... - Aucune citerne de carburant sélectionnée à remplir... - Ninguna tinaco seleccionado para llenar... - Nessuna serbatoio selezionato da rifornire... - Brak wybranego zbiornika paliwa do wypełnienia... - Nenhum tinaco selecionado para encher... - Нет выбранного бака для заправки... - Keine ausgewählte Tankkanister zum Auffüllen... - 채울 연료 탱크가 없습니다... - 補給するタンクが選択されていません... - 没有选择的油箱来填充... - 没有选择的油箱来填充... - Doldurmak için seçilmiş bir yakıt bantı yok... + + This fuel pump is unresponsive... + Toto palivové čerpadlo nereaguje... + Cette pompe à carburant ne répond pas... + Esta bomba de combustible no responde... + Questa pompa di carburante non risponde... + Ta pompa paliwowa nie reaguje... + Esta bomba de combustível não está respondendo... + Этот топливный насос не реагирует... + Diese Kraftstoffpumpe reagiert nicht... + 이 연료 펌프가 반응하지 않습니다... + この燃料ポンプは反応しません... + 此燃料幫浦無回應... + 此燃料泵无回应... + Bu yakıt pompası yanıt vermiyor... - - You have no fuel can to fill... - Nemáte žádný nádrž na naplnění... - Vous n'avez aucune citerne de carburant à remplir... - No tienes ningún tinaco para llenar... - Non hai nessun serbatoio da rifornire... - Nie masz zbiornika paliwa do wypełnienia... - Você não tem nenhum tinaco para encher... - У вас нет бака для заправки... - Sie haben keinen Tankkanister zum Auffüllen... - 채울 연료 탱크가 없습니다... - 補給するタンクがありません... - 没有油箱可以填充... - 没有油箱可以填充... - Doldurmak için hiçbir yakıt bantı yok... + + JetFuel + Letecké palivo + Kérosène / Carburant d'aviation + Combustible de aviación / Queroseno + Cherosene / Carburante avio + Paliwo lotnicze + Combustível de Aviação + Авиационное топливо + Kerosin / Flugkraftstoff + 항공유 + 航空燃料 + 航空煤油 / 航空燃料 + 航空煤油 / 航空燃料 + Jet Yakıtı You have no power source to operate this fuel pump... @@ -81,37 +81,53 @@ 你没有能源来操作这个加油泵... Bu yakıt pompasını çalıştırmak için bir enerji kaynağı yoktur... - - No vehicle to refuel... - Žádné vozidlo k naplňování... - Aucun véhicule à recharger... - Ningún vehículo para repostar... - Nessun veicolo da rifornire... - Brak pojazdu do zatankowania... - Nenhum veículo para encher... - Нет транспортного средства для заправки... - Kein Fahrzeug zum Benzinieren... - 주유할 차량이 없습니다... - 給油する車がありません... - 没有车辆可供加油... - 没有车辆可供加油... - Yakıt doldurmak için araç yok... + + Petrol + Benzín + Essence + Gasolina + Benzina + Benzyna + Gasolina + Бензин + Benzin + 가솔린 / 휘발유 + ガソリン + 汽油 + 汽油 + Benzin - - Pumping fuel... - Napálení paliva... - Pompage de carburant... - Bombear combustible... - Pompaggio di carburante... - Nasycanie paliwem... - Bomba de combustível... - Заправка... - Benzinieren... - 연료 펌핑 중... - 燃料ポンプ中... - 加油中... - 加油中... - Yakıt pompalıyor... + + Pump does not dispense %1... + Čerpadlo nevydává %1... + La pompe ne distribue pas de %1... + La bomba no dispensa %1... + La pompa non eroga %1... + Pompa nie wydaje %1... + A bomba não fornece %1... + Насос не выдает %1... + Pumpe gibt kein %1 aus... + 펌프에서 %1(이)가 나오지 않습니다... + ポンプから %1 は出ません... + 幫浦未分配 %1... + 泵未分配 %1... + Pompa %1 dağıtmıyor... + + + Pump supports: %1 Vehicle requires: %2 + Čerpadlo podporuje: %1 Vozidlo vyžaduje: %2 + La pompe fournit : %1 Le véhicule nécessite : %2 + La bomba admite: %1 El vehículo requiere: %2 + La pompa eroga: %1 Il veicolo richiede: %2 + Pompa obsługuje: %1 Pojazd wymaga: %2 + A bomba suporta: %1 O veículo requer: %2 + Насос поддерживает: %1 Транспорту требуется: %2 + Pumpe unterstützt: %1 Fahrzeug benötigt: %2 + 펌프 지원: %1 차량 요구: %2 + ポンプの対応: %1 車両の要求: %2 + 幫浦支援: %1 車輛需要: %2 + 泵支持: %1 车辆需要: %2 + Pompa desteği: %1 Araç gereksinimi: %2 Refill fuel can at pump @@ -129,22 +145,6 @@ 在加油泵处填充油箱 Nasosda yakıt bantını doldur - - Refuel at pump - Naplňte na pompe - Réglez au distributeur - Repostar en la bomba - Riforniti alla pompa - Zatankujcie u bomby - Reabasteça na bomba - Заправиться у насоса - Benzinieren an der Tankstelle - 주유소에서 주유하기 - 給油所で給油する - 在加油泵处加油 - 在加油泵处加油 - Nasosda yakıt al - Refueling... Naplňování... @@ -177,69 +177,5 @@ 加油被中断了... Yakıt doldurma işlemi kesildi... - - You stop pumping fuel... - Ukončíte napálení paliva... - Vous arrêtez le pompage de carburant... - Detienes la bomba de combustible... - Interrompi il pompaggio di carburante... - Zatrzymaj nasycanie paliwem... - Você para a bomba de combustível... - Вы прекращаете заправку... - Sie stoppen das Benzinieren... - 연료 펌핑을 중단합니다... - 燃料ポンプを停止します... - 你停止加油... - 你停止加油... - Yakıt pompalamayı durduruyorsunuz... - - - %1 fuel tank is full... - Tank %1 je plný... - Tank %1 est plein... - El tanque de combustible %1 está lleno... - Tanque di carburante %1 è pieno... - Tank paliwna %1 jest pełny... - O tanque de combustível %1 está cheio... - Бак %1 полон... - Tank %1 ist voll... - %1 연료 탱크가 가득 찼습니다... - 燃料タンク %1 が満タンです... - 燃料箱 %1 已满... - 燃料箱 %1 已满... - %1 yakıt bantı dolu... - - - Tank level: - Úroveň nádrže: - Niveau du réservoir : - Nivel del tanque : - Livello del serbatoio : - Poziom zbiornika paliwa : - Nível do tanque : - Уровень топлива: - Tankstand: - 연료 수준: - タンクレベル: - 油箱水平: - 油箱水平: - Tank düzeyi: - - - Wrong fuel station for this vehicle... - Nesprávná pumpa pro toto vozidlo... - Mauvaise pompe pour ce véhicule... - Pozo incorrecto para este vehículo... - Pompa errata per questo veicolo... - Nieprawidłowa stacja benzynowania dla tego pojazdu... - Bomba errada para este veículo... - Неправильная станция для данного автомобиля... - Falsche Tankstelle für dieses Fahrzeug... - 이 차량에 맞는 주유소가 아닙니다... - この車に適した給油所ではありません... - 这个车辆的加油站不对... - 这个车辆的加油站不对... - Bu aracı için doğru bir yakıt istasyonu bulunmamaktadır... - diff --git a/addons/fuel/ui/refill_fuelCan.hpp b/addons/fuel/ui/refill_fuelCan.hpp deleted file mode 100644 index e0d95647..00000000 --- a/addons/fuel/ui/refill_fuelCan.hpp +++ /dev/null @@ -1,84 +0,0 @@ -class CLASS(refuelfuelCan_ui) { - idd = 733836; - onLoad = QUOTE([733836] call EFUNC(common,menuBlurEffect); [] call EFUNC(fuel,fuelCanListed)); - - class ControlsBackground { - class CLASS(refuelVehicle_background): CLASS(RscText) { - idc = -1; - x = 2.5 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 35 * GUI_GRID_W; - h = 18 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.7}; - }; - class CLASS(refuelVehicle_prompt): RscText { - idc = -1; - text = "Refill fuel can from pump"; //--- ToDo: Localize; - x = 3.5 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 22 * GUI_GRID_W; - h = 2.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_fuel_icon): RscPicture { - idc = -1; - text = QPATHTOEF(markers,data\fuel_ca.paa); - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 3.5 * GUI_GRID_H + GUI_GRID_Y; - w = 5.5 * GUI_GRID_W; - h = 3.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - }; - class Controls { - class CLASS(refuelVehicle_noteBox): RscText { - idc = 1001; - x = 3.5 * GUI_GRID_W + GUI_GRID_X; - y = 13.5 * GUI_GRID_H + GUI_GRID_Y; - w = 33 * GUI_GRID_W; - h = 3.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_refuel): RscButton { - idc = 1600; - colorFocused[] = {0.5,0.5,0.5,0.7}; - onButtonClick = QUOTE(call EFUNC(fuel,processFuelCan)); - text = "Refill"; //--- ToDo: Localize; - x = 25.5 * GUI_GRID_W + GUI_GRID_X; - y = 8.5 * GUI_GRID_H + GUI_GRID_Y; - w = 7.5 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - colorBackground[] = {0.2,0.2,0.2,0.7}; - colorActive[] = {0.5,0.5,0.5,0.7}; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_exit): RscButton { - idc = 1601; - colorFocused[] = {0.5,0.5,0.5,0.7}; - onButtonClick = QUOTE(closeDialog 2); - text = ECSTRING(common,Exit); - x = 25.5 * GUI_GRID_W + GUI_GRID_X; - y = 11 * GUI_GRID_H + GUI_GRID_Y; - w = 7.5 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - colorBackground[] = {0.2,0.2,0.2,0.7}; - colorActive[] = {0.5,0.5,0.5,0.7}; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(Listed_fuelCan): RscListBox { - idc = 1500; - x = 4 * GUI_GRID_W + GUI_GRID_X; - y = 3.5 * GUI_GRID_H + GUI_GRID_Y; - w = 12 * GUI_GRID_W; - h = 7 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - }; -}; - diff --git a/addons/fuel/ui/refuelVehicle.hpp b/addons/fuel/ui/refuelVehicle.hpp deleted file mode 100644 index b9e0a1a2..00000000 --- a/addons/fuel/ui/refuelVehicle.hpp +++ /dev/null @@ -1,90 +0,0 @@ -class CLASS(refuelVehicle_ui) { - idd = 733835; - onLoad = QUOTE([733835] call EFUNC(common,menuBlurEffect); [] call EFUNC(fuel,icon)); - - class ControlsBackground { - class CLASS(refuelVehicle_background): CLASS(RscText) { - idc = -1; - x = 2.5 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 35 * GUI_GRID_W; - h = 18 * GUI_GRID_H; - colorBackground[] = {0,0,0,0.7}; - }; - class CLASS(refuelVehicle_vehicleName): RscText { - idc = 1200; - text = ""; //--- ToDo: Localize; - x = 3 * GUI_GRID_W + GUI_GRID_X; - y = 8 * GUI_GRID_H + GUI_GRID_Y; - w = 21 * GUI_GRID_W; - h = 2.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_icon): RscPicture { - idc = 1201; - text = ""; - x = 6.5 * GUI_GRID_W + GUI_GRID_X; - y = 4 * GUI_GRID_H + GUI_GRID_Y; - w = 5.5 * GUI_GRID_W; - h = 3.5 * GUI_GRID_H; - }; - class CLASS(refuelVehicle_prompt): RscText { - idc = -1; - text = "Refuel from pump"; //--- ToDo: Localize; - x = 3.5 * GUI_GRID_W + GUI_GRID_X; - y = 0 * GUI_GRID_H + GUI_GRID_Y; - w = 22 * GUI_GRID_W; - h = 2.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_fuel_icon): RscPicture { - idc = -1; - text = QPATHTOEF(markers,data\fuel_ca.paa); - x = 26.5 * GUI_GRID_W + GUI_GRID_X; - y = 3.5 * GUI_GRID_H + GUI_GRID_Y; - w = 5.5 * GUI_GRID_W; - h = 3.5 * GUI_GRID_H; - }; - }; - class Controls { - class CLASS(refuelVehicle_noteBox): RscText { - idc = 1001; - x = 3.5 * GUI_GRID_W + GUI_GRID_X; - y = 13.5 * GUI_GRID_H + GUI_GRID_Y; - w = 33 * GUI_GRID_W; - h = 3.5 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_refuel): RscButton { - idc = 1600; - colorFocused[] = {0.5,0.5,0.5,0.7}; - onButtonClick = QUOTE(call EFUNC(fuel,process)); - text = "Refuel"; //--- ToDo: Localize; - x = 25.5 * GUI_GRID_W + GUI_GRID_X; - y = 8.5 * GUI_GRID_H + GUI_GRID_Y; - w = 7.5 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - colorBackground[] = {0.2,0.2,0.2,0.7}; - colorActive[] = {0.5,0.5,0.5,0.7}; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(refuelVehicle_exit): RscButton { - idc = 1601; - colorFocused[] = {0.5,0.5,0.5,0.7}; - onButtonClick = QUOTE(closeDialog 2); - text = ECSTRING(common,Exit); - x = 25.5 * GUI_GRID_W + GUI_GRID_X; - y = 11 * GUI_GRID_H + GUI_GRID_Y; - w = 7.5 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - colorBackground[] = {0.2,0.2,0.2,0.7}; - colorActive[] = {0.5,0.5,0.5,0.7}; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - }; -}; diff --git a/addons/generator/$PBOPREFIX$ b/addons/generator/$PBOPREFIX$ deleted file mode 100644 index a9b5fb46..00000000 --- a/addons/generator/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\misery\addons\generator diff --git a/addons/generator/XEH_PREP.hpp b/addons/generator/XEH_PREP.hpp deleted file mode 100644 index 459935de..00000000 --- a/addons/generator/XEH_PREP.hpp +++ /dev/null @@ -1,10 +0,0 @@ -PREP(fuel); -PREP(icon); -PREP(nearGenerator); -PREP(powerButton); -PREP(powerNearby); -PREP(processAction); -PREP(refresh); -PREP(refuel); -PREP(runLoop); -PREP(trackPos); diff --git a/addons/generator/XEH_postInit.sqf b/addons/generator/XEH_postInit.sqf deleted file mode 100644 index fc734a29..00000000 --- a/addons/generator/XEH_postInit.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" - -private _generatorAction = [ - QGVAR(generator_menu), - localize LSTRING(Action), - QPATHTOEF(icons,data\cable_ca.paa), - { - params ["_target", "_player"]; - createDialog QCLASS(generator_ui); - }, - { - [player] call FUNC(nearGenerator) select 0; - }, - {}, - ["_target", "_player"], - [0, 0, 0], - 3 -] call ACEFUNC(interact_menu,createAction); - -{ - [_x, 0, [QUOTE(ACE_MainActions)], _generatorAction] call ACEFUNC(interact_menu,addActionToClass); -} forEach GVAR(generators); diff --git a/addons/generator/XEH_preInit.sqf b/addons/generator/XEH_preInit.sqf deleted file mode 100644 index 5cf784ec..00000000 --- a/addons/generator/XEH_preInit.sqf +++ /dev/null @@ -1,12 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -#include "XEH_PREP.hpp" - -GVAR(generators) = [ - "Land_Portable_generator_F", - "Land_PowerGenerator_F" -]; - -ADDON = true; diff --git a/addons/generator/functions/fnc_fuel.sqf b/addons/generator/functions/fnc_fuel.sqf deleted file mode 100644 index 75daff0d..00000000 --- a/addons/generator/functions/fnc_fuel.sqf +++ /dev/null @@ -1,44 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Fuel drain loop - * - * Arguments: - * 0: Generator - * 1: Type - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_fuel - * -*/ - -params ["_generator", "_generatorType"]; - -private _fuelDelay = nil; - - switch (_generatorType) do { - case "Land_Portable_generator_F": { - _fuelDelay = 60; - }; - case "Land_PowerGenerator_F": { - _fuelDelay = 120; - }; - }; - -[{ - params ["_args", "_handle"]; - _args params ["_generator"]; - - private _runState = _generator getVariable [QGVAR(isRunning), false]; - private _fuelLevel = _generator getVariable [QGVAR(fuelLevel), 1]; - - if (!_runState || _fuelLevel <= 0) exitWith { - _handle call CBA_fnc_removePerFrameHandler; - }; - - _generator setVariable [QGVAR(fuelLevel), _fuelLevel - 0.01, true]; - -}, _fuelDelay, [_generator]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/generator/functions/fnc_icon.sqf b/addons/generator/functions/fnc_icon.sqf deleted file mode 100644 index 89f39c2d..00000000 --- a/addons/generator/functions/fnc_icon.sqf +++ /dev/null @@ -1,30 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator icon updater - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_icon - * -*/ - -[player] call FUNC(nearGenerator) params ["", "", "_generatorType"]; - -disableSerialization; - -[{!isNull findDisplay 573849}, { - params ["_generatorType"]; - - private _dialog = findDisplay 573849; - private _iconName = _dialog displayCtrl 1000; - - [_generatorType] call EFUNC(common,getObjectData) params ["_objectDisplayName"]; - _iconName ctrlSetText _objectDisplayName; - -}, _generatorType] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/generator/functions/fnc_nearGenerator.sqf b/addons/generator/functions/fnc_nearGenerator.sqf deleted file mode 100644 index d56a4493..00000000 --- a/addons/generator/functions/fnc_nearGenerator.sqf +++ /dev/null @@ -1,25 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Checks for nearby generator objects - * - * Arguments: - * 0: Object - * - * Return Value: - * 0: Nearby Generator - * 1: Nearest Generator - * 2: Type of Generator - * - * Example: - * [] call misery_generator_fnc_nearGenerator - * -*/ - -params ["_object", ["_distance", 2]]; - -if (!isNull objectParent player) exitWith {}; - -private _nearObjects = nearestObjects [_object, ["Land_Portable_generator_F", "Land_PowerGenerator_F"], _distance]; - -[_nearObjects isNotEqualTo [], _nearObjects select 0, typeOf (_nearObjects select 0)] diff --git a/addons/generator/functions/fnc_powerButton.sqf b/addons/generator/functions/fnc_powerButton.sqf deleted file mode 100644 index 3abea1b4..00000000 --- a/addons/generator/functions/fnc_powerButton.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Power button - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_powerButton - * -*/ - -[player] call FUNC(nearGenerator) params ["", "_generator", "_generatorType"]; - -[{!isNull findDisplay 573849}, { - params ["_generator", "_generatorType"]; - - _powerButton = findDisplay 573849 displayCtrl 1600; - - if ((ctrlText 1600) isEqualTo (localize LSTRING(Start))) exitWith { - if (insideBuilding player isEqualTo 1) exitWith { - [QEGVAR(common,tileText), localize LSTRING(Inside)] call CBA_fnc_localEvent; - }; - - [_generator, _generatorType] call FUNC(processAction); - }; - - if ((ctrlText 1600) isEqualTo (localize LSTRING(Stop))) exitWith { - _generator setVariable [QGVAR(shuttingDown), true, true]; - }; -}, [_generator, _generatorType]] call CBA_fnc_waitUntilAndExecute; - - diff --git a/addons/generator/functions/fnc_powerNearby.sqf b/addons/generator/functions/fnc_powerNearby.sqf deleted file mode 100644 index e3c6a8a0..00000000 --- a/addons/generator/functions/fnc_powerNearby.sqf +++ /dev/null @@ -1,75 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Power nearby loop - * - * Arguments: - * 0: Generator - * 1: Type - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_powerNearby - * -*/ - -params ["_generator", "_generatorType"]; - -[{ - params ["_args", "_handle"]; - _args params ["_generator", "_generatorType"]; - - private _runState = _generator getVariable [QGVAR(isRunning), false]; - - private _radius = nil; - - switch (_generatorType) do { - case "Land_Portable_generator_F": { - _radius = 25; - }; - case "Land_PowerGenerator_F": { - _radius = 150; - }; - }; - - private _lights = nearestObjects [getPosATL _generator, ["HOUSE","STATIC","BUILDING"], _radius, false]; - private _lightsTerrain = nearestTerrainObjects [getPosATL _generator, ["BUILDING","HOUSE"], _radius, false]; - - if (_runState) then { - { - private _object = _x; - private _hitpoints = getAllHitPointsDamage _object select 0; - - _x switchLight "ON"; - - if (!isNil "_hitpoints") then { - { - private _lower = toLower _x; - if ("light" in _lower) then { - _object setHitPointDamage [_x, 0]; - }; - } forEach _hitpoints; - }; - } forEach _lights + _lightsTerrain; - }; - - if (!_runState) exitWith { - { - private _object = _x; - private _hitpoints = getAllHitPointsDamage _object select 0; - - _x switchLight "OFF"; - - if (!isNil "_hitpoints") then { - { - private _lower = toLower _x; - if ("light" in _lower) then { - _object setHitPointDamage [_x, 0]; - }; - } forEach _hitpoints; - }; - } forEach _lights + _lightsTerrain; - }; -}, 1, [_generator, _generatorType]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/generator/functions/fnc_processAction.sqf b/addons/generator/functions/fnc_processAction.sqf deleted file mode 100644 index 3ae8b646..00000000 --- a/addons/generator/functions/fnc_processAction.sqf +++ /dev/null @@ -1,57 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Running Audio loop - * - * Arguments: - * 0: Generator - * 1: Type - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_processAction - * -*/ - -params ["_generator", "_generatorType"]; - -if (_generator getVariable [QGVAR(fuelLevel), 1] <= 0) exitWith { - [QEGVAR(common,tileText), localize LSTRING(NoFuel)] call CBA_fnc_localEvent; -}; - -private _soundStart = nil; -private _startupDelay = nil; - -switch (_generatorType) do { - case "Land_Portable_generator_F": { - _soundStart = QCLASS(audio_sound_petrolStart); - _startupDelay = 1; - }; - case "Land_PowerGenerator_F": { - _soundStart = QCLASS(audio_sound_dieselStart); - _startupDelay = 2; - }; -}; - -_generator setVariable [QGVAR(isRunning), true, true]; - -private _soundDummy = "Land_HelipadEmpty_F" createVehicle (getPosATL _generator); -_generator setVariable [QCLASS(generatorSound), true, true]; - -[_soundDummy, [_soundStart, 500]] remoteExec ["say3D", 0, _soundDummy]; - -[{!(_generator getVariable [QCLASS(generatorSound), false])},{ - deleteVehicle _this; -}, _soundDummy] call CBA_fnc_waitUntilAndExecute; - -[{ - params ["_generator", "_generatorType"]; - - [[_generator, _generatorType], FUNC(fuel)] remoteExec ["call", [0, -2] select isDedicated, true]; - [[_generator, _generatorType], FUNC(powerNearby)] remoteExec ["call", [0, -2] select isDedicated, true]; - [[_generator, _generatorType], FUNC(runLoop)] remoteExec ["call", [0, -2] select isDedicated, true]; - [[_generator], FUNC(trackPos)] remoteExec ["call", [0, -2] select isDedicated, true]; -}, [_generator, _generatorType], _startupDelay] call CBA_fnc_waitAndExecute; - diff --git a/addons/generator/functions/fnc_refresh.sqf b/addons/generator/functions/fnc_refresh.sqf deleted file mode 100644 index d7215347..00000000 --- a/addons/generator/functions/fnc_refresh.sqf +++ /dev/null @@ -1,95 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator UI populator - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_refresh - * -*/ - -[player] call FUNC(nearGenerator) params ["", "_generator", "_generatorType"]; - -[{!isNull findDisplay 573849}, { - params ["_args"]; - _args params ["_generator", "_generatorType"]; - - private _radius = nil; - - switch (_generatorType) do { - case "Land_PowerGenerator_F": { - _radius = 150; - }; - case "Land_Portable_generator_F": { - _radius = 25; - }; - }; - - [{ - params ["_args", "_handle"]; - _args params ["_generator", "_generatorType"]; - - if (isNull findDisplay 573849) exitWith { - _handle call CBA_fnc_removePerFrameHandler; - }; - - private _dialog = findDisplay 573849; - - private _iconName = _dialog displayCtrl 1000; - - private _fuelProgressBar = findDisplay 573849 displayCtrl 1004; - - private _powerButton = findDisplay 573849 displayCtrl 1600; - - private _refuelButton = findDisplay 573849 displayCtrl 1601; - - [_generatorType] call EFUNC(common,getObjectData) params ["_objectDisplayName"]; - - if (_objectDisplayName isEqualTo "") exitWith {}; - - private _fuelLevel = _generator getVariable [QGVAR(fuelLevel), 1]; - - _fuelProgressBar progressSetPosition _fuelLevel; - - private _runState = _generator getVariable [QGVAR(isRunning), false]; - private _shutDownState = _generator getVariable [QGVAR(shuttingDown), false]; - private _powerState = ""; - private _powerButtonText = ""; - private _showPowerButton = false; - private _showRefuelButton = false; - - switch (true) do { - case (!_runState && !_shutDownState): { - _powerState = localize LSTRING(OFF); - _powerButtonText = localize LSTRING(Start); - _showPowerButton = true; - _showRefuelButton = true; - }; - case (_runState && !_shutDownState): { - _powerState = localize LSTRING(RUNNING); - _powerButtonText = localize LSTRING(Stop); - _showPowerButton = true; - _showRefuelButton = false; - }; - case (_runState && _shutDownState): { - _powerState = localize LSTRING(SHUTTINGDOWN); - _showPowerButton = false; - _showRefuelButton = false; - }; - }; - - ctrlSetText [1600, _powerButtonText]; - _refuelButton ctrlEnable _showRefuelButton; - _powerButton ctrlEnable _showPowerButton; - - private _displayedState = format [localize LSTRING(PowerState), _powerState]; - ctrlSetText [1001, _displayedState]; - - }, 0, [_generator, _generatorType]] call CBA_fnc_addPerFrameHandler; -}, [_generator, _generatorType]] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/generator/functions/fnc_refuel.sqf b/addons/generator/functions/fnc_refuel.sqf deleted file mode 100644 index 08bbea8e..00000000 --- a/addons/generator/functions/fnc_refuel.sqf +++ /dev/null @@ -1,77 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: TenuredCLOUD - * Generator Refuel Action - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_refuel - * -*/ - -[player] call FUNC(nearGenerator) params ["", "_generator", "_generatorType"]; - -[{!isNull findDisplay 573849}, { - params ["_generator", "_generatorType"]; - - private _fuelLevel = _generator getVariable [QGVAR(fuelLevel), 1]; - - if (_fuelLevel >= 1) exitWith { - [QEGVAR(common,tileText), localize LSTRING(FullTank)] call CBA_fnc_localEvent; - }; - - private _fuelCan = ""; - private _requiredFuelType = ""; - - switch (_generatorType) do { - case "Land_PowerGenerator_F": { - _fuelCan = QCLASS(diesel); - _requiredFuelType = localize LSTRING(Diesel); - }; - case "Land_Portable_generator_F": { - _fuelCan = QCLASS(petrol); - _requiredFuelType = localize LSTRING(Petrol); - }; - }; - - if !([[_fuelCan]] call EFUNC(common,hasItem)) exitWith { - [QEGVAR(common,tileText), format [localize LSTRING(NeedsJerrycan), _requiredFuelType]] call CBA_fnc_localEvent; - }; - - [{ - params ["_args", "_handle"]; - _args params ["_fuelCan", "_requiredFuelType", "_fuelLevel", "_generator", "_generatorType"]; - - private _currentFuel = _generator getVariable [QGVAR(fuelLevel), 1]; - - if (isNull findDisplay 573849) exitWith { - _handle call CBA_fnc_removePerFrameHandler; - }; - - if !([[_fuelCan]] call EFUNC(common,hasItem)) exitWith { - [QEGVAR(common,tileText), format [localize LSTRING(NeedsJerrycan), _requiredFuelType]] call CBA_fnc_localEvent; - _handle call CBA_fnc_removePerFrameHandler; - }; - - if (_fuelLevel >= 1) exitWith { - [QEGVAR(common,tileText), localize LSTRING(FullTank)] call CBA_fnc_localEvent; - _handle call CBA_fnc_removePerFrameHandler; - }; - - // Land_PowerGenerator_F simulated at 80L tank, Land_Portable_generator_F simulated at 40L tank - private _fueltoAdd = [0.025, 0.0125] select (_generatorType isEqualTo "Land_PowerGenerator_F"); - - _generator setVariable [QGVAR(fuelLevel), _currentFuel + _fueltoAdd, true]; - - private _emptyCan = [QCLASS(petrolEmpty), QCLASS(dieselEmpty)] select (_requiredFuelType isEqualTo (localize LSTRING(Diesel))); - - [_fuelCan, _emptyCan] call EFUNC(common,itemDecrement); - - }, 1, [_fuelCan, _requiredFuelType, _fuelLevel, _generator, _generatorType]] call CBA_fnc_addPerFrameHandler; -}, [_generator, _generatorType]] call CBA_fnc_waitUntilAndExecute; - diff --git a/addons/generator/functions/fnc_runLoop.sqf b/addons/generator/functions/fnc_runLoop.sqf deleted file mode 100644 index 167fb4b2..00000000 --- a/addons/generator/functions/fnc_runLoop.sqf +++ /dev/null @@ -1,103 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Running Audio loop - * - * Arguments: - * 0: Generator - * 1: Type - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_runLoop - * -*/ - -params ["_generator", "_generatorType"]; - -[{ - params ["_args", "_handle"]; - _args params ["_generator", "_generatorType"]; - - private _fuelLevel = _generator getVariable [QGVAR(fuelLevel), 1]; - private _runState = _generator getVariable [QGVAR(isRunning), false]; - private _shutDown = _generator getVariable [QGVAR(shuttingDown), false]; - - private _soundRunning = nil; - private _runningDelay = nil; - - switch (_generatorType) do { - case "Land_Portable_generator_F": { - _soundRunning = QCLASS(audio_sound_petrolRunning); - _runningDelay = 11.5; - }; - case "Land_PowerGenerator_F": { - _soundRunning = QCLASS(audio_sound_dieselRunning); - _runningDelay = 11.5; - }; - }; - - private _soundDummyRunning = "Land_HelipadEmpty_F" createVehicle (getPosATL _generator); - _generator setVariable [QCLASS(generatorSound), true, true]; - - [_soundDummyRunning, [_soundRunning, 500]] remoteExec ["say3D", 0, _soundDummyRunning]; - - [{!(_generator getVariable [QCLASS(generatorSound), false])},{ - deleteVehicle _this; - }, _soundDummyRunning] call CBA_fnc_waitUntilAndExecute; - - if (_shutDown) exitWith { - deleteVehicle _soundDummyRunning; - - private _soundShutdown = nil; - - switch (_generatorType) do { - case "Land_Portable_generator_F": { - _soundShutdown = QCLASS(audio_sound_petrolStop); - }; - case "Land_PowerGenerator_F": { - _soundShutdown = QCLASS(audio_sound_dieselStop); - }; - }; - - private _soundDummy = "Land_HelipadEmpty_F" createVehicle (position _generator); - _generator setVariable [QGVAR(shutDownAudio), true, true]; - [_soundDummy, [_soundShutdown, 500]] remoteExec ["say3D", 0, _soundDummy]; - [{!(_generator getVariable [QGVAR(shutDownAudio), false])},{ - deleteVehicle _this; - }, _soundDummy] call CBA_fnc_waitUntilAndExecute; - _generator setVariable [QGVAR(isRunning), false, true]; - _generator setVariable [QGVAR(shuttingDown), false, true]; - _handle call CBA_fnc_removePerFrameHandler; - }; - - if (_fuelLevel <= 0) exitWith { - deleteVehicle _soundDummyRunning; - _generator setVariable [QGVAR(shuttingDown), true, true]; - - private _soundStop = nil; - - switch (_generatorType) do { - case "Land_Portable_generator_F": { - _soundStop = QCLASS(audio_sound_petrolStop); - }; - case "Land_PowerGenerator_F": { - _soundStop = QCLASS(audio_sound_dieselStop); - }; - }; - - private _soundDummy = "Land_HelipadEmpty_F" createVehicle (position _generator); - - _generator setVariable [QGVAR(shutDownAudio), true, true]; - [_soundDummy, [_soundStop, 500]] remoteExec ["say3D", 0, _soundDummy]; - - [{!(_generator getVariable [QGVAR(shutDownAudio), false])},{ - deleteVehicle _this; - }, _soundDummy] call CBA_fnc_waitUntilAndExecute; - _generator setVariable [QGVAR(isRunning), false, true]; - _generator setVariable [QGVAR(shuttingDown), false, true]; - _handle call CBA_fnc_removePerFrameHandler; - }; -}, 11.5, [_generator, _generatorType]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/generator/functions/fnc_trackPos.sqf b/addons/generator/functions/fnc_trackPos.sqf deleted file mode 100644 index af484393..00000000 --- a/addons/generator/functions/fnc_trackPos.sqf +++ /dev/null @@ -1,38 +0,0 @@ -#include "..\script_component.hpp" - /* - * Author: TenuredCLOUD - * Generator Position Tracking - * - * Arguments: - * 0: Generator - * - * Return Value: - * None - * - * Example: - * [] call misery_generator_fnc_trackPos - * -*/ - -params ["_generator"]; - -private _lastPos = getPosATL _generator; - -[{ - params ["_args", "_handle"]; - _args params ["_generator", "_lastPos"]; - - _currentPos = getPosATL _generator; - - //Check if generator is "Moving" (Base item framework of somekind? if so kill running gen) - if (_currentPos distance _lastPos > 0.01) exitWith { - _generator setVariable [QGVAR(isRunning), false, true]; - _handle call CBA_fnc_removePerFrameHandler; - }; - - //Check if generator no longer exists - if (isNull _generator) exitWith { - _generator setVariable [QGVAR(isRunning), false, true]; - _handle call CBA_fnc_removePerFrameHandler; - }; -}, 0.5, [_generator, _lastPos]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/generator/stringtable.xml b/addons/generator/stringtable.xml deleted file mode 100644 index 42d067a1..00000000 --- a/addons/generator/stringtable.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Use Generator - Použít generátor - Utiliser le générateur - Usar generador - Usa generatore - Użyj generatora - Usar gerador - Использовать генератор - Generator benutzen - 발전기 사용 - 発電機を使用する - 使用發電機 - 使用发电机 - Jeneratörü kullan - - - Diesel - Nafta - Diesel - Diésel - Diesel - Diesel - Diesel - Дизель - Diesel - 디젤 - ディーゼル - 柴油 - 柴油 - Dizel - - - Fuel: - Palivo: - Carburant : - Combustible: - Carburante: - Paliwo: - Combustível: - Топливо: - Kraftstoff: - 연료: - 燃料: - 燃料: - 燃料: - Yakıt: - - - This generator has a full tank... - Tento generátor má plnou nádrž... - Ce générateur a le réservoir plein... - Este generador tiene el tanque lleno... - Questo generatore ha il serbatoio pieno... - Ten generator ma pełny bak... - Este gerador tem o depósito cheio... - У этого генератора полный бак... - Dieser Generator hat einen vollen Tank... - 이 발전기의 연료 탱크가 가득 찼습니다... - この発電機は満タンです... - 這台發電機的油箱已滿... - 这台发电机的油箱已满... - Bu jeneratörün deposu dolu... - - - You cannot start a generator while inside... - Nemůžete spustit generátor uvnitř budovy... - Vous ne pouvez pas démarrer un générateur à l'intérieur... - No puedes arrancar un generador estando adentro... - Non puoi avviare un generatore all'interno... - Nie możesz uruchomić generatora wewnątrz budynku... - Não pode ligar um gerador dentro de um edifício... - Нельзя запускать генератор внутри помещения... - Du kannst einen Generator nicht im Innenbereich starten... - 실내에서는 발전기를 가동할 수 없습니다... - 屋内で発電機を始動することはできません... - 您不能在室內啟動發電機... - 您不能在室内启动发电机... - İçerideyken jeneratörü çalıştıramazsınız... - - - You need a %1 jerrycan to refuel this generator... - K doplnění paliva do tohoto generátoru potřebujete kanystr s %1... - Vous avez besoin d'un jerrycan de %1 pour ravitailler ce générateur... - Necesitas un bidón de %1 para reabastecer este generador... - Hai bisogno di una tanica di %1 per rifornire questo generatore... - Potrzebujesz kanistra z %1, aby zatankować ten generator... - Precisa de um jerrican de %1 para reabastecer este gerador... - Вам нужна канистра с %1, чтобы заправить этот генератор... - Du benötigst einen %1-Kanister, um diesen Generator aufzutanken... - 이 발전기를 재충전하려면 %1 제리캔이 필요합니다... - この発電機に給油するには%1のジェリカンが必要です... - 您需要一個 %1 油桶來為這台發電機加油... - 您需要一个 %1 油桶来为这台发电机加油... - Bu jeneratöre yakıt ikmali yapmak için %1 bidona ihtiyacınız var... - - - This generator has no fuel... - Tento generátor nemá žádné palivo... - Ce générateur n'a pas de carburant... - Este generador no tiene combustible... - Questo generatore non ha carburante... - Ten generator nie ma paliwa... - Este gerador não tem combustível... - В этом генераторе нет топлива... - Dieser Generator hat keinen Kraftstoff... - 이 발전기에는 연료가 없습니다... - この発電機には燃料がありません... - 這台發電機沒有燃料... - 这台发电机没有燃料... - Bu jeneratörde yakıt yok... - - - OFF - VYPNUTO - ARRÊT - APAGADO - SPENTO - WYŁĄCZONY - DESLIGADO - ВЫКЛ - AUS - 꺼짐 - オフ - 關閉 - 关闭 - KAPALI - - - Petrol - Benzín - Essence - Gasolina - Benzina - Benzyna - Gasolina - Бензин - Benzin - 휘발유 - ガソリン - 汽油 - 汽油 - Benzin - - - Power State: %1 - Stav napájení: %1 - État de l'alimentation : %1 - Estado de energía: %1 - Stato alimentazione: %1 - Stan zasilania: %1 - Estado da energia: %1 - Состояние питания: %1 - Stromstatus: %1 - 전원 상태: %1 - 電源状態: %1 - 電源狀態: %1 - 电源状态: %1 - Güç Durumu: %1 - - - RUNNING - BĚŽÍ - EN MARCHE - EN MARCHA - IN FUNZIONE - URUCHOMIONY - EM FUNCIONAMENTO - РАБОТАЕТ - LÄUFT - 가동 중 - 運転中 - 運行中 - 运行中 - ÇALIŞIYOR - - - Refuel - Doplnit palivo - Ravitailler - Reabastecer - Rifornisci - Zatankuj - Reabastecer - Заправить - Auftanken - 연료 보충 - 給油 - 加油 - 加油 - Yakıt ikmali yap - - - SHUTTING DOWN - VYPÍNÁNÍ - ARRÊT EN COURS - APAGÁNDOSE - SPEGNIMENTO - WYŁĄCZANIE - A DESLIGAR - ВЫКЛЮЧЕНИЕ - WIRD AUSGESCHALTET - 종료 중 - 停止中 - 正在關閉 - 正在关闭 - KAPANIYOR - - - Start - Spustit - Démarrer - Arrancar - Avvia - Uruchom - Ligar - Запустить - Starten - 시작 - 始動 - 啟動 - 启动 - Başlat - - - Stop - Zastavit - Arrêter - Detener - Fermá - Zatrzymaj - Parar - Остановить - Stoppen - 정지 - 停止 - 停止 - 停止 - Durdur - - - diff --git a/addons/generator/ui/generator.hpp b/addons/generator/ui/generator.hpp deleted file mode 100644 index 8975debf..00000000 --- a/addons/generator/ui/generator.hpp +++ /dev/null @@ -1,95 +0,0 @@ -class CLASS(generator_ui) { - idd = 573849; - onLoad = QUOTE([573849] call EFUNC(common,menuBlurEffect); [] call EFUNC(generator,refresh); [] call EFUNC(generator,icon)); - - class ControlsBackground { - class CLASS(generator_background): CLASS(RscText) { - idc = 1800; - x = 0 * GUI_GRID_W + GUI_GRID_X; - y = 4.5 * GUI_GRID_H + GUI_GRID_Y; - w = 40 * GUI_GRID_W; - h = 16.5 * GUI_GRID_H; - colorBackground[] = {0, 0, 0, 0.7}; - }; - class CLASS(generator_prompt): RscText { - idc = 1000; - x = 0.5 * GUI_GRID_W + GUI_GRID_X; - y = 4.5 * GUI_GRID_H + GUI_GRID_Y; - w = 20.5 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(generator_fuellvl): RscText { - idc = 1003; - text = ECSTRING(generator,FuelLabel); //--- ToDo: Localize; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 10 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(generator_fuelProgressBar): CLASS(RscProgress) { - idc = 1004; - x = 3.84 * GUI_GRID_W + GUI_GRID_X; - y = 10.83 * GUI_GRID_H + GUI_GRID_Y; - w = 8 * GUI_GRID_W; - h = 0.5 * GUI_GRID_H; - }; - class CLASS(generator_powerState): RscText { - idc = 1001; - text = "'On / Off'"; //--- ToDo: Localize; - x = 1 * GUI_GRID_W + GUI_GRID_X; - y = 8 * GUI_GRID_H + GUI_GRID_Y; - w = 9.5 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - }; - - class Controls { - class CLASS(generator_startStop_button): RscButton { - idc = 1600; - x = 1.5 * GUI_GRID_W + GUI_GRID_X; - y = 14.5 * GUI_GRID_H + GUI_GRID_Y; - w = 8 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - colorBackground[] = {0.2, 0.2, 0.2, 0.7}; - colorFocused[] = {0.5, 0.5, 0.5, 0.7}; - colorActive[] = {0.5, 0.5, 0.5, 0.7}; - onButtonClick = QUOTE([] call EFUNC(generator,powerButton)); - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(generator_refuel_button): RscButton { - idc = 1601; - text = ECSTRING(generator,Refuel); //--- ToDo: Localize; - x = 1.5 * GUI_GRID_W + GUI_GRID_X; - y = 17.5 * GUI_GRID_H + GUI_GRID_Y; - w = 8 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - colorBackground[] = {0.2, 0.2, 0.2, 0.7}; - colorFocused[] = {0.5, 0.5, 0.5, 0.7}; - colorActive[] = {0.5, 0.5, 0.5, 0.7}; - onButtonClick = QUOTE([] call EFUNC(generator,refuel)); - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - class CLASS(generator_exitButton): RscButton { - idc = 1602; - text = ECSTRING(common,Exit); - x = 30 * GUI_GRID_W + GUI_GRID_X; - y = 17.5 * GUI_GRID_H + GUI_GRID_Y; - w = 8 * GUI_GRID_W; - h = 2 * GUI_GRID_H; - colorBackground[] = {0.2,0.2,0.2,0.7}; - colorActive[] = {0.5,0.5,0.5,0.7}; - colorFocused[] = {0.5,0.5,0.5,0.7}; - onButtonClick = QUOTE(closeDialog 2); - font = UI_MACRO_FONT; - sizeEx = UI_MACRO_TEXTSIZE; - }; - }; -}; diff --git a/addons/icons/data/circuit_board_ca.paa b/addons/icons/data/circuit_board_ca.paa new file mode 100644 index 00000000..bb7cb462 Binary files /dev/null and b/addons/icons/data/circuit_board_ca.paa differ diff --git a/addons/icons/data/droplet_off_ca.paa b/addons/icons/data/droplet_off_ca.paa new file mode 100644 index 00000000..787fe98d Binary files /dev/null and b/addons/icons/data/droplet_off_ca.paa differ diff --git a/addons/icons/data/plug_ca.paa b/addons/icons/data/plug_ca.paa new file mode 100644 index 00000000..ca15e2b2 Binary files /dev/null and b/addons/icons/data/plug_ca.paa differ diff --git a/addons/icons/data/power_ca.paa b/addons/icons/data/power_ca.paa new file mode 100644 index 00000000..d3d93f4f Binary files /dev/null and b/addons/icons/data/power_ca.paa differ diff --git a/addons/icons/data/power_off_ca.paa b/addons/icons/data/power_off_ca.paa new file mode 100644 index 00000000..ff52640f Binary files /dev/null and b/addons/icons/data/power_off_ca.paa differ diff --git a/addons/icons/data/solar_panel_ca.paa b/addons/icons/data/solar_panel_ca.paa new file mode 100644 index 00000000..9dd74183 Binary files /dev/null and b/addons/icons/data/solar_panel_ca.paa differ diff --git a/addons/icons/data/unplug_ca.paa b/addons/icons/data/unplug_ca.paa new file mode 100644 index 00000000..f922739b Binary files /dev/null and b/addons/icons/data/unplug_ca.paa differ diff --git a/addons/icons/data/zap_ca.paa b/addons/icons/data/zap_ca.paa new file mode 100644 index 00000000..7c7d6c77 Binary files /dev/null and b/addons/icons/data/zap_ca.paa differ diff --git a/addons/icons/data/zap_off_ca.paa b/addons/icons/data/zap_off_ca.paa new file mode 100644 index 00000000..01fc7150 Binary files /dev/null and b/addons/icons/data/zap_off_ca.paa differ diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 18cb6bbf..038ed69c 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -29,6 +29,18 @@ #define ACEFUNC(var1,var2) TRIPLES(DOUBLES(ACE_PREFIX,var1),fnc,var2) #define QACEFUNC(var1,var2) QUOTE(ACEFUNC(var1,var2)) +// AE3 reference macros +#define AE3_PREFIX ae3 + +#define AE3GVAR(module,var) TRIPLES(AE3_PREFIX,module,var) +#define QAE3GVAR(module,var) QUOTE(AE3GVAR(module,var)) + +#define CLASSAE3(var) DOUBLES(AE3_PREFIX,var) +#define QCLASSAE3(var) QUOTE(CLASSAE3(var)) + +#define AE3FUNC(var1,var2) TRIPLES(DOUBLES(AE3_PREFIX,var1),fnc,var2) +#define QAE3FUNC(var1,var2) QUOTE(AE3FUNC(var1,var2)) + #ifdef DISABLE_COMPILE_CACHE #undef PREP #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf) @@ -337,8 +349,8 @@ QCLASS(guttingKnife), \ ] // Fuel cans -#define MACRO_FUEL_CANS QCLASS(petrol), QCLASS(diesel), QCLASS(jetFuel) -#define MACRO_FUEL_CANS_EMPTY QCLASS(petrolEmpty), QCLASS(dieselEmpty), QCLASS(jetFuelEmpty) +#define MACRO_FUEL_CANS QCLASS(diesel), QCLASS(petrol), QCLASS(jetFuel) +#define MACRO_FUEL_CANS_EMPTY QCLASS(dieselEmpty), QCLASS(petrolEmpty), QCLASS(jetFuelEmpty) // Ambient AI #define MACRO_FACTIONS west, east, civilian, independent diff --git a/addons/maintenance/functions/fnc_initVehicles.sqf b/addons/maintenance/functions/fnc_initVehicles.sqf index b1821ce0..6f95be4d 100644 --- a/addons/maintenance/functions/fnc_initVehicles.sqf +++ b/addons/maintenance/functions/fnc_initVehicles.sqf @@ -27,7 +27,7 @@ if (isNil QEGVAR(common,vehicleData)) then { private _data = []; private _fuelType = 0; - private _fuelLiters = 100; + private _fuelLiters = 0; private _coolantLiters = 10; private _oilLiters = 8; private _batteryType = 0; @@ -41,7 +41,6 @@ if (isNil QEGVAR(common,vehicleData)) then { if (_hasConfig) then { _fuelType = getNumber (_maintConfig >> "fuelType"); - _fuelLiters = getNumber (_maintConfig >> "fuelLiters"); _coolantLiters = getNumber (_maintConfig >> "coolantLiters"); _oilLiters = getNumber (_maintConfig >> "oilLiters"); _batteryType = getNumber (_maintConfig >> "batteryType"); @@ -51,11 +50,11 @@ if (isNil QEGVAR(common,vehicleData)) then { _resupplyPrice = getNumber (_maintConfig >> "resupplyPrice"); } else { private _vehicleConfig = configFile >> "CfgVehicles" >> _vehicleName; - private _fuelCapacity = getNumber (_vehicleConfig >> "fuelCapacity"); - if (_fuelCapacity <= 0) then { - _fuelCapacity = 100; - }; + private _acefuelCapacity = getNumber (configOf _vehicle >> QACEGVAR(refuel,fuelCapacity)); + private _defaultfuelCapacity = getNumber (configOf _vehicle >> "fuelCapacity"); + + private _fuelCapacity = [_defaultfuelCapacity, _acefuelCapacity] select (_acefuelCapacity > 0); if (_vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane") then { _fuelType = 2; diff --git a/addons/power/$PBOPREFIX$ b/addons/power/$PBOPREFIX$ new file mode 100644 index 00000000..7a160c35 --- /dev/null +++ b/addons/power/$PBOPREFIX$ @@ -0,0 +1 @@ +z\misery\addons\power diff --git a/addons/generator/CfgEventHandlers.hpp b/addons/power/CfgEventHandlers.hpp similarity index 100% rename from addons/generator/CfgEventHandlers.hpp rename to addons/power/CfgEventHandlers.hpp diff --git a/addons/power/XEH_PREP.hpp b/addons/power/XEH_PREP.hpp new file mode 100644 index 00000000..6d0dfe96 --- /dev/null +++ b/addons/power/XEH_PREP.hpp @@ -0,0 +1,7 @@ +PREP(applyStates); +PREP(generatorInteractions); +PREP(getGeneratorFuelIndex); +PREP(grabDeviceStates); +PREP(initLightSources); +PREP(refuelGenerator); +PREP(syphonGenerator); diff --git a/addons/power/XEH_postInit.sqf b/addons/power/XEH_postInit.sqf new file mode 100644 index 00000000..390998e0 --- /dev/null +++ b/addons/power/XEH_postInit.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +if (isServer) then { + call FUNC(initLightSources); + + [{ + call FUNC(applyStates); + }, [], 0.2] call CBA_fnc_waitAndExecute; + + if (isClass (missionConfigFile >> "CfgGradPersistence")) then { + { + [_x] call GRADFUNC(persistence,blacklistClasses); + } forEach GVAR(powerEquipment); + }; +}; + +if !(hasInterface) exitWith {}; + +call FUNC(generatorInteractions); + diff --git a/addons/power/XEH_preInit.sqf b/addons/power/XEH_preInit.sqf new file mode 100644 index 00000000..5756901d --- /dev/null +++ b/addons/power/XEH_preInit.sqf @@ -0,0 +1,36 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "XEH_PREP.hpp" + +GVAR(powerEquipment) = [ + "Land_PortableGenerator_01_F_AE3", + "Land_PortableGenerator_01_black_F_AE3", + "Land_PortableGenerator_01_sand_F_AE3", + "Land_Portable_generator_F_AE3", + "Land_MobileRadar_01_generator_F_AE3", + "Land_DieselGroundPowerUnit_01_F_AE3", + "Land_PowerGenerator_F_AE3", + "Land_SolarPanel_04_olive_F_AE3", + "Land_SolarPanel_04_black_F_AE3", + "Land_SolarPanel_04_sand_F_AE3", + "Land_BatteryPack_01_open_olive_F_AE3", + "Land_BatteryPack_01_open_black_F_AE3", + "Land_BatteryPack_01_open_sand_F_AE3", + "Land_Laptop_03_black_F_AE3", + "Land_Laptop_03_olive_F_AE3", + "Land_Laptop_03_sand_F_AE3" +]; + +GVAR(generators) = [ + "Land_PortableGenerator_01_F_AE3", + "Land_PortableGenerator_01_black_F_AE3", + "Land_PortableGenerator_01_sand_F_AE3", + "Land_Portable_generator_F_AE3", + "Land_MobileRadar_01_generator_F_AE3", + "Land_DieselGroundPowerUnit_01_F_AE3", + "Land_PowerGenerator_F_AE3" +]; + +ADDON = true; diff --git a/addons/generator/config.cpp b/addons/power/config.cpp similarity index 82% rename from addons/generator/config.cpp rename to addons/power/config.cpp index 3e1293bc..65c7206e 100644 --- a/addons/generator/config.cpp +++ b/addons/power/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {QCLASS(common)}; + requiredAddons[] = {QCLASS(common), QCLASSAE3(power)}; authors[] = {"TenuredCLOUD"}; VERSION_CONFIG; }; diff --git a/addons/power/functions/fnc_applyStates.sqf b/addons/power/functions/fnc_applyStates.sqf new file mode 100644 index 00000000..34c5df4c --- /dev/null +++ b/addons/power/functions/fnc_applyStates.sqf @@ -0,0 +1,62 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Re-apply AE3 device states from stored missionNamespace hashmap + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_applyStates; + */ + +if (!isServer) exitWith {}; + +private _masterDeviceMap = missionNamespace getVariable [QGVAR(deviceStates), createHashMap]; +if (count _masterDeviceMap isEqualTo 0) exitWith {}; + +{ + _x params ["_className", "_powerSource", "_powerType", "_savedPosASL", "_savedVector"]; + + private _device = createVehicle [_className, _savedPosASL, [], 0, "CAN_COLLIDE"]; + _device setPosASL _savedPosASL; + _device setVectorDirAndUp _savedVector; + + switch (_powerType) do { + case 0: { + [ + { + private _dummy = _this select 0 getVariable [QAE3GVAR(power,internal), objNull]; + (!isNull _dummy) && {alive _dummy} + }, + { + params ["_device", "_powerSource"]; + [{ + params ["_device", "_powerSource"]; + private _dummy = _device getVariable QAE3GVAR(power,internal); + if (!isNull _dummy) then { + _dummy setVariable [QAE3GVAR(power,batteryLevel), _powerSource, true]; + }; + }, [_device, _powerSource], 0.1] call CBA_fnc_waitAndExecute; + }, + [_device, _powerSource], + 0.2 + ] call CBA_fnc_waitUntilAndExecute; + }; + case 1: { + [{ + params ["_device", "_powerSource"]; + _device setVariable [QAE3GVAR(power,batteryLevel), _powerSource, true]; + }, [_device, _powerSource], 0.2] call CBA_fnc_waitAndExecute; + }; + case 2: { + [{ + params ["_device", "_powerSource"]; + _device setFuel _powerSource; + }, [_device, _powerSource], 0.2] call CBA_fnc_waitAndExecute; + }; + }; +} forEach (values _masterDeviceMap); diff --git a/addons/power/functions/fnc_generatorInteractions.sqf b/addons/power/functions/fnc_generatorInteractions.sqf new file mode 100644 index 00000000..c0702a80 --- /dev/null +++ b/addons/power/functions/fnc_generatorInteractions.sqf @@ -0,0 +1,113 @@ +#include "..\script_component.hpp" + /* + * Author: TenuredCLOUD + * Generator interactions + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_generatorInteractions + * +*/ + +private _generatorMainAction = [ + QGVAR(generator_MainMenu), + localize LSTRING(MaintenanceAction), + QPATHTOEF(markers,data\wrench_ca.paa), + { }, + {alive _target}, + {}, + ["_target", "_player"], + [0, 0, 0], + 3 +] call ACEFUNC(interact_menu,createAction); + +private _generatorCheckFuelAction = [ + QGVAR(generator_checkFuelMenu), + localize LSTRING(CheckFuel), + "", + { + params ["_target", "_player"]; + + [_target] call AE3FUNC(power,checkFuelLevelAction); + }, + {true}, + {}, + ["_target", "_player"], + [0, 0, 0], + 3 +] call ACEFUNC(interact_menu,createAction); + +private _generatorCheckOutputAction = [ + QGVAR(generator_checkOutputMenu), + localize LSTRING(CheckPowerOutput), + QPATHTOEF(icons,data\circuit_board_ca.paa), + { + params ["_target", "_player"]; + + [_target, true] call AE3FUNC(power,getPowerOutput); + }, + {true}, + {}, + ["_target", "_player"], + [0, 0, 0], + 3 +] call ACEFUNC(interact_menu,createAction); + +private _generatorRefuelAction = [ + QGVAR(generator_refuelMenu), + localize LSTRING(Refuel), + "z\ace\addons\refuel\ui\icon_refuel_interact.paa", + { + params ["_target", "_player"]; + + [_player, _target] call FUNC(refuelGenerator); + }, + { + params ["_target", "_player"]; + if ([_target] call AE3FUNC(power,getPowerState) isNotEqualTo "Off") exitWith { false }; + + if (fuel _target >= 1) exitWith { false }; + + true + }, + {}, + [], + [0, 0, 0], + 3 +] call ACEFUNC(interact_menu,createAction); + +private _generatorSyphonAction = [ + QGVAR(generator_syphonMenu), + localize LSTRING(SyphonFuel), + "z\ace\addons\refuel\ui\icon_refuel_interact.paa", + { + params ["_target", "_player"]; + + [_player, _target] call FUNC(syphonGenerator); + }, + { + params ["_target", "_player"]; + if ([_target] call AE3FUNC(power,getPowerState) isNotEqualTo "Off") exitWith { false }; + + if (fuel _target <= 0) exitWith { false }; + + true + }, + {}, + [], + [0, 0, 0], + 3 +] call ACEFUNC(interact_menu,createAction); + +{ + [_x, 0, [QUOTE(ACE_MainActions)], _generatorMainAction] call ACEFUNC(interact_menu,addActionToClass); + [_x, 0, [QUOTE(ACE_MainActions), QGVAR(generator_MainMenu)], _generatorCheckFuelAction] call ACEFUNC(interact_menu,addActionToClass); + [_x, 0, [QUOTE(ACE_MainActions), QGVAR(generator_MainMenu)], _generatorCheckOutputAction] call ACEFUNC(interact_menu,addActionToClass); + [_x, 0, [QUOTE(ACE_MainActions), QGVAR(generator_MainMenu)], _generatorRefuelAction] call ACEFUNC(interact_menu,addActionToClass); + [_x, 0, [QUOTE(ACE_MainActions), QGVAR(generator_MainMenu)], _generatorSyphonAction] call ACEFUNC(interact_menu,addActionToClass); +} forEach GVAR(generators); diff --git a/addons/power/functions/fnc_getGeneratorFuelIndex.sqf b/addons/power/functions/fnc_getGeneratorFuelIndex.sqf new file mode 100644 index 00000000..ebb831c6 --- /dev/null +++ b/addons/power/functions/fnc_getGeneratorFuelIndex.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Checks generator object to index in generator classes array, if 0 - 4 they're petrol + * Returns fuel type index + * + * Arguments: + * 0: Generator + * + * Return Value: + * 0: Fuel type + * + * Example: + * [] call misery_power_fnc_getGeneratorFuelIndex; + */ + +params ["_generator"]; + +if ((typeOf _generator) in (GVAR(generators) select [0, 4])) exitWith { 1 }; + +0 diff --git a/addons/power/functions/fnc_grabDeviceStates.sqf b/addons/power/functions/fnc_grabDeviceStates.sqf new file mode 100644 index 00000000..3f02f593 --- /dev/null +++ b/addons/power/functions/fnc_grabDeviceStates.sqf @@ -0,0 +1,80 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Server side device state grabber for AE3 battery states and fuel states + * Creates a hashmap that is stored in a GRAD persistence trackable missionNamespace variable + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_grabDeviceStates; + */ + +if (!isServer) exitWith {}; + +private _nestedDevices = [ + "Land_SolarPanel_04_olive_F_AE3", + "Land_SolarPanel_04_black_F_AE3", + "Land_SolarPanel_04_sand_F_AE3", + "Land_Laptop_03_black_F_AE3", + "Land_Laptop_03_olive_F_AE3", + "Land_Laptop_03_sand_F_AE3" +]; + +private _directDevices = [ + "Land_BatteryPack_01_open_olive_F_AE3", + "Land_BatteryPack_01_open_black_F_AE3", + "Land_BatteryPack_01_open_sand_F_AE3" +]; + +private _fueledDevices = [ + "Land_PortableGenerator_01_F_AE3", + "Land_PortableGenerator_01_black_F_AE3", + "Land_PortableGenerator_01_sand_F_AE3", + "Land_Portable_generator_F_AE3", + "Land_MobileRadar_01_generator_F_AE3", + "Land_DieselGroundPowerUnit_01_F_AE3", + "Land_PowerGenerator_F_AE3" +]; + +private _masterDeviceMap = createHashMap; + +{ + { + private _device = _x; + private _dummy = _device getVariable [QAE3GVAR(power,internal), objNull]; + + if (!isNull _dummy) then { + private _powerSource = _dummy getVariable [QAE3GVAR(power,batteryLevel), 0.1]; + + private _key = _device call BIS_fnc_objectVar; + + _masterDeviceMap set [_key, [typeOf _device, _powerSource, 0, getPosASL _device, [vectorDir _device, vectorUp _device]]]; + }; + } forEach (allMissionObjects _x); +} forEach _nestedDevices; + +{ + { + private _device = _x; + private _powerSource = _device getVariable [QAE3GVAR(power,batteryLevel), 1]; + private _key = _device call BIS_fnc_objectVar; + + _masterDeviceMap set [_key, [typeOf _device, _powerSource, 1, getPosASL _device, [vectorDir _device, vectorUp _device]]]; + } forEach (allMissionObjects _x); +} forEach _directDevices; + +{ + { + private _device = _x; + private _key = _device call BIS_fnc_objectVar; + + _masterDeviceMap set [_key, [typeOf _device, fuel _device, 2, getPosASL _device, [vectorDir _device, vectorUp _device]]]; + } forEach (allMissionObjects _x); +} forEach _fueledDevices; + +missionNamespace setVariable [QGVAR(deviceStates), _masterDeviceMap, true]; diff --git a/addons/power/functions/fnc_initLightSources.sqf b/addons/power/functions/fnc_initLightSources.sqf new file mode 100644 index 00000000..f09ed5dd --- /dev/null +++ b/addons/power/functions/fnc_initLightSources.sqf @@ -0,0 +1,67 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Initializes dynamic light sources that can be placeable with other systems + * Removes ACE interactions for light cycling (on/off) to prep sources for power component + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_initLightSources; + * + * Public: No +*/ + +["Land_Camping_Light_off_F", "Init", { + params ["_lightSource"]; + + [_lightSource, _lightSource] call ACEFUNC(common,claim); + + private _lightSourceAction = [ + QGVAR(lightSource_TakeMenuLantern), + format [localize ECSTRING(common,TakeItem), [_lightSource] call EFUNC(common,getObjectData) select 0], + "a3\ui_f\data\igui\cfg\actions\take_ca.paa", + { + params ["_target", "_player"]; + deleteVehicle _target; + [_player, QCLASS(lantern_NoBattery), true] call CBA_fnc_addItem; + }, + {true}, + {}, + ["_target", "_player"], + [0, 0, 0], + 3 + ] call ACEFUNC(interact_menu,createAction); + + [_lightSource, 0, [QUOTE(ACE_MainActions)], _lightSourceAction] call ACEFUNC(interact_menu,addActionToObject); +}, true, [], true] call CBA_fnc_addClassEventHandler; + +["Land_Camping_Light_F", "Init", { + params ["_lightSource"]; + + _lightSource switchLight "OFF"; + + [_lightSource, _lightSource] call ACEFUNC(common,claim); + + private _lightSourceAction = [ + QGVAR(lightSource_TakeMenuLantern_1), + format [localize ECSTRING(common,TakeItem), [_lightSource] call EFUNC(common,getObjectData) select 0], + "a3\ui_f\data\igui\cfg\actions\take_ca.paa", + { + params ["_target", "_player"]; + deleteVehicle _target; + [_player, QCLASS(lantern_NoBattery), true] call CBA_fnc_addItem; + }, + {true}, + {}, + ["_target", "_player"], + [0, 0, 0], + 3 + ] call ACEFUNC(interact_menu,createAction); + + [_lightSource, 0, [QUOTE(ACE_MainActions)], _lightSourceAction] call ACEFUNC(interact_menu,addActionToObject); +}, true, [], true] call CBA_fnc_addClassEventHandler; diff --git a/addons/power/functions/fnc_refuelGenerator.sqf b/addons/power/functions/fnc_refuelGenerator.sqf new file mode 100644 index 00000000..58da53a9 --- /dev/null +++ b/addons/power/functions/fnc_refuelGenerator.sqf @@ -0,0 +1,78 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Process refueling generators with fuel can + * + * Arguments: + * 0: Unit refueling + * 1: Generator + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_refuelGenerator + * +*/ + +params ["_unit", "_generator"]; + +if (isNull _generator) exitWith {}; + +private _genFuelIndex = [_generator] call FUNC(getGeneratorFuelIndex); + +private _foundCanClass = [MACRO_FUEL_CANS] select _genFuelIndex; + +private _fuelStrings = [localize LSTRING(Diesel), localize LSTRING(Petrol)]; +private _canFuelTypeString = _fuelStrings select _genFuelIndex; + +if !([[_foundCanClass]] call EFUNC(common,hasItem)) exitWith { + private _msg = format [localize LSTRING(NeedsJerrycan), _canFuelTypeString]; + hintSilent format ["%1", _msg]; +}; + +private _generatorClass = typeOf _generator; +private _maxTankCapacity = switch (true) do { + case (_generatorClass in (GVAR(generators) select [0, 4])): { 5 }; + case (_generatorClass isEqualTo "Land_MobileRadar_01_generator_F_AE3"): { 470 }; + default { 300 }; +}; + +private _fuelChange = 1 / _maxTankCapacity; + +private _lastPos = getPosATL _unit; + +[{ + params ["_args", "_handle"]; + _args params ["_unit", "_generator", "_genFuelIndex","_foundCanClass", "_canFuelTypeString", "_fuelChange", "_lastPos"]; + + private _currentPos = getPosATL _unit; + + hintSilent format ["%1", localize LSTRING(Refueling)]; + + if ((_currentPos distance _lastPos) > 0.01 || !alive _unit || { [_generator] call AE3FUNC(power,getPowerState) isNotEqualTo "Off" }) exitWith { + hintSilent format ["%1", localize LSTRING(RefuelingInterrupted)]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + if (fuel _generator >= 1) exitWith { + hintSilent format ["%1", localize LSTRING(FullTank)]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + if !([[_foundCanClass]] call EFUNC(common,hasItem)) exitWith { + private _msg = format [localize LSTRING(NeedsJerrycan), _canFuelTypeString]; + hintSilent format ["%1", _msg]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + private _emptyCanClass = [MACRO_FUEL_CANS_EMPTY] select _genFuelIndex; + + if (fuel _generator < 1) then { + [_foundCanClass, _emptyCanClass] call EFUNC(common,itemDecrement) params ["_decremented"]; + if (_decremented) then { + _generator setFuel ((fuel _generator) + _fuelChange); + }; + }; +}, 1, [_unit, _generator, _genFuelIndex, _foundCanClass, _canFuelTypeString, _fuelChange, _lastPos]] call CBA_fnc_addPerFrameHandler; + diff --git a/addons/power/functions/fnc_syphonGenerator.sqf b/addons/power/functions/fnc_syphonGenerator.sqf new file mode 100644 index 00000000..75c552ba --- /dev/null +++ b/addons/power/functions/fnc_syphonGenerator.sqf @@ -0,0 +1,97 @@ +#include "..\script_component.hpp" +/* + * Author: TenuredCLOUD + * Process syphoning generators + * + * Arguments: + * 0: Unit syphoning + * 1: Generator + * + * Return Value: + * None + * + * Example: + * [] call misery_power_fnc_syphonGenerator + * +*/ + +params ["_unit", "_generator"]; + +if (isNull _generator) exitWith {}; + +if !([["ToolKit"]] call EFUNC(common,hasItem)) exitWith { + hintSilent format ["%1", localize LSTRING(NeedToolkitSyphon)]; +}; + +private _genFuelIndex = [_generator] call FUNC(getGeneratorFuelIndex); + +private _foundCanClass = [MACRO_FUEL_CANS] select _genFuelIndex; + +private _emptyCanClass = [MACRO_FUEL_CANS_EMPTY] select _genFuelIndex; + +private _fuelStrings = [localize LSTRING(Diesel), localize LSTRING(Petrol)]; +private _canFuelTypeString = _fuelStrings select _genFuelIndex; + +if !([[_foundCanClass, _emptyCanClass]] call EFUNC(common,hasItem)) exitWith { + private _msg = format [localize LSTRING(NeedJerrycanSyphon), _canFuelTypeString]; + hintSilent format ["%1", _msg]; +}; + +private _generatorClass = typeOf _generator; + +private _maxTankCapacity = switch (true) do { + case (_generatorClass in (GVAR(generators) select [0, 4])): { 5 }; + case (_generatorClass isEqualTo "Land_MobileRadar_01_generator_F_AE3"): { 470 }; + default { 300 }; +}; + +private _fuelChange = 1 / _maxTankCapacity; + +private _lastPos = getPosATL _unit; + +private _isInitialSwapDone = false; + +[{ + params ["_args", "_handle"]; + _args params ["_unit", "_generator", "_foundCanClass", "_emptyCanClass", "_canFuelTypeString", "_fuelChange", "_lastPos", "_maxTankCapacity", "_isInitialSwapDone"]; + + private _currentPos = getPosATL _unit; + + if ((_currentPos distance _lastPos) > 0.01 || !alive _unit || { [_generator] call AE3FUNC(power,getPowerState) isNotEqualTo "Off" }) exitWith { + hintSilent format ["%1", localize LSTRING(SyphoningInterrupted)]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + private _currentLiters = (fuel _generator) * _maxTankCapacity; + + if (_currentLiters < 1) exitWith { + hintSilent format ["%1", localize LSTRING(NoFuel)]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + if (!_isInitialSwapDone && {[[_emptyCanClass]] call EFUNC(common,hasItem)}) then { + [_unit, _emptyCanClass] call CBA_fnc_removeItem; + [_unit, _foundCanClass, 1, true] call CBA_fnc_addMagazine; + _generator setFuel ((fuel _generator) - _fuelChange); + _isInitialSwapDone = true; + _args set [8, true]; + }; + + if !([[_foundCanClass, _emptyCanClass]] call EFUNC(common,hasItem)) exitWith { + private _msg = format [localize LSTRING(NeedJerrycanSyphon), _canFuelTypeString]; + hintSilent format ["%1", _msg]; + _handle call CBA_fnc_removePerFrameHandler; + }; + + hintSilent format ["%1", localize LSTRING(Syphoning)]; + + _generator setFuel ((fuel _generator) - _fuelChange); + + [_foundCanClass] call EFUNC(common,itemIncrement) params ["_incremented"]; + + if !(_incremented) exitWith { + private _msg = format [localize LSTRING(ContainerFullOrUnavailable), [_foundCanClass] call EFUNC(common,getItemData) select 0]; + hintSilent format ["%1", _msg]; + _handle call CBA_fnc_removePerFrameHandler; + }; +}, 1, [_unit, _generator, _foundCanClass, _emptyCanClass, _canFuelTypeString, _fuelChange, _lastPos, _maxTankCapacity, _isInitialSwapDone]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/generator/script_component.hpp b/addons/power/script_component.hpp similarity index 52% rename from addons/generator/script_component.hpp rename to addons/power/script_component.hpp index 4c895a29..ea85ddc0 100644 --- a/addons/generator/script_component.hpp +++ b/addons/power/script_component.hpp @@ -1,16 +1,17 @@ -#define COMPONENT generator -#define COMPONENT_BEAUTIFIED Generator +#define COMPONENT power +#define COMPONENT_BEAUTIFIED Power #include "\z\misery\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_GENERATOR +#ifdef DEBUG_ENABLED_POWER #define DEBUG_MODE_FULL #endif -#ifdef DEBUG_SETTINGS_GENERATOR - #define DEBUG_SETTINGS DEBUG_SETTINGS_GENERATOR +#ifdef DEBUG_SETTINGS_POWER + #define DEBUG_SETTINGS DEBUG_SETTINGS_POWER #endif #include "\z\misery\addons\main\script_macros.hpp" + diff --git a/addons/power/stringtable.xml b/addons/power/stringtable.xml new file mode 100644 index 00000000..4a95ef1e --- /dev/null +++ b/addons/power/stringtable.xml @@ -0,0 +1,277 @@ + + + + + Check Fuel + Zkontrolovat palivo + Vérifier le carburant + Comprobar combustible + Controlla carburante + Sprawdź poziom paliwa + Verificar Combustível + Проверить топливо + Kraftstoff prüfen + 연료 확인 + 燃料を確認 + 检查油量 / 檢查燃料 + 检查油量 / 检查燃料 + Yakıtı Kontrol Et + + + Check Power output + Zkontrolovat výkon + Vérifier la puissance de sortie + Comprobar potencia de salida + Controlla potenza erogata + Sprawdź moc wyjściową + Verificar Saída de Energia + Проверить выходную мощность + Leistung prüfen + 전력 출력 확인 + 출력を確認 + 檢查輸出功率 + 检查输出功率 + Güç Çıkışını Kontrol Et + + + %1 is full or no longer available... + %1 je plný nebo již není dostupný... + %1 est plein ou n'est plus disponible... + %1 está lleno o ya no está disponible... + %1 è pieno o non è più disponibile... + %1 jest pełny lub nie jest już dostępny... + %1 está cheio ou já não está disponível... + %1 заполнен или более недоступен... + %1 ist voll oder nicht mehr verfügbar... + %1이(가) 가득 찼거나 더 이상 사용할 수 없습니다... + %1は満タンか、または利用できません... + %1 已滿或不再可用... + %1 已满或不再可用... + %1 dolu veya artık mevcut değil... + + + Diesel + Nafta + Diesel + Diésel + Diesel + Diesel + Diesel + Дизель + Diesel + 디젤 + ディーゼル + 柴油 + 柴油 + Dizel + + + This generator has a full tank... + Tento generátor má plnou nádrž... + Ce générateur a le réservoir plein... + Este generador tiene el tanque lleno... + Questo generatore ha il serbatoio pieno... + Ten generator ma pełny bak... + Este gerador tem o depósito cheio... + У этого генератора полный бак... + Dieser Generator hat einen vollen Tank... + 이 발전기의 연료 탱크가 가득 찼습니다... + この発電機は満タンです... + 這台發電機的油箱已滿... + 这台发电机的油箱已满... + Bu jeneratörün deposu dolu... + + + Maintenance + Údržba + Entretien / Maintenance + Mantenimiento + Manutenzione + Konserwacja + Manutenção + Обслуживание + Wartung + 정비 / 유지보수 + メンテナンス / 保守 + 維護 / 保養 + 维护 / 保养 + Bakım + + + You need a %1 jerrycan to syphon this generator... + Potřebuješ %1 kanystr k odsátí tohoto generátoru... + Vous avez besoin d'un jerrycan de %1 pour siphonner ce générateur... + Necesitas un bidón de %1 para sifonar este generador... + Hai bisogno di una tanica da %1 per sifonare questo generatore... + Potrzebujesz kanistra (%1), aby spuścić paliwo z tego generatora... + Você precisa de um galão de %1 para sifonar este gerador... + Вам канистра (%1), чтобы слить топливо из этого генератора... + Du benötigst einen %1-Kanister, um diesen Generator abzusaugen... + 이 발전기에서 연료를 흡입하려면 %1 제리캔이 필요합니다... + この発電機から燃料を吸い出すには %1 ジェリカンが必要です... + 你需要一個 %1 油桶來虹吸這個發電機... + 你需要一个 %1 油桶来虹吸这个发电机... + Bu jeneratörden yakıt sifonlamak için %1 bidona ihtiyacın var... + + + You need a toolkit to syphon fuel... + K odsátí paliva potřebuješ sadu nářadí... + Vous avez besoin d'une boîte à outils pour siphonner du carburant... + Necesitas un kit de herramientas para sifonar combustible... + Hai bisogno di un kit di attrezzi para sifonare il carburante... + Potrzebujesz zestawu narzędzi, aby spuścić paliwo... + Você precisa de un kit de ferramentas para sifonar combustível... + Вам нужен набор инструментов, чтобы слить топливо... + Du benötigst ein Werkzeugset, um Kraftstoff abzusaugen... + 연료를 흡입하려면 공구 상자가 필요합니다... + 燃料を吸い出すにはツールキットが必要です... + 你需要工具箱來虹吸燃料... + 你需要工具箱来虹吸燃料... + Yakıt sifonlamak için bir alet çantasına ihtiyacın var... + + + You need a %1 jerrycan to refuel this generator... + K doplnění paliva do tohoto generátoru potřebujete kanystr s %1... + Vous avez besoin d'un jerrycan de %1 pour ravitailler ce générateur... + Necesitas un bidón de %1 para reabastecer este generador... + Hai bisogno di una tanica di %1 per rifornire questo generatore... + Potrzebujesz kanistra z %1, aby zatankować ten generator... + Precisa de um jerrican de %1 para reabastecer este gerador... + Вам нужна канистра с %1, чтобы заправить этот генератор... + Du benötigst einen %1-Kanister, um diesen Generator aufzutanken... + 이 발전기를 재충전하려면 %1 제리캔이 필요합니다... + この発電機に給油するには%1のジェリカンが必要です... + 您需要一個 %1 油桶來為這台發電機加油... + 您需要一个 %1 油桶来为这台发电机加油... + Bu jeneratöre yakıt ikmali yapmak için %1 bidona ihtiyacınız var... + + + This generator has no fuel... + Tento generátor nemá žádné palivo... + Ce générateur n'a pas de carburant... + Este generador no tiene combustible... + Questo generatore non ha carburante... + Ten generator nie ma paliwa... + Este gerador não tem combustível... + В этом генераторе нет топлива... + Dieser Generator hat keinen Kraftstoff... + 이 발전기에는 연료가 없습니다... + この発電機には燃料がありません... + 這台發電機沒有燃料... + 这台发电机没有燃料... + Bu jeneratörde yakıt yok... + + + Petrol + Benzín + Essence + Gasolina + Benzina + Benzyna + Gasolina + Бензин + Benzin + 휘발유 + ガソリン + 汽油 + 汽油 + Benzin + + + Refuel + Doplnit palivo + Ravitailler + Reabastecer + Rifornisci + Zatankuj + Reabastecer + Заправить + Auftanken + 연료 보충 + 給油 + 加油 + 加油 + Yakıt ikmali yap + + + Refueling... + Doplňování paliva... + Ravitaillement... + Repostando... + Rifornimento... + Tankowanie... + Reabastecendo... + Заправка... + Tanken... + 연료 보충 중... + 給油中... + 正在加油... + 正在加油... + Yeniden yakıt dolduruluyor... + + + Refueling interrupted... + Naplňování přerušeno... + Rechargement interrompu... + Repostaje interrumpido... + Rifornimento interrotto... + Zatankowanie przerwane... + Enchimento interrompido... + Заправка прервана... + Benzinieren unterbrochen... + 주유 중단됨... + 給油が中断されました... + 加油被中断了... + 加油被中断了... + Yakıt doldurma işlemi kesildi... + + + Syphon Fuel + Odsát palivo + Siphonner le carburant + Sifonar combustible + Sifona carburante + Spuść paliwo + Sifonar Combustível + Слить топливо + Kraftstoff absaugen + 연료 흡입 + 燃料を吸い出す + 虹吸燃料 + 虹吸燃料 + Yakıt Sifonla + + + Syphoning... + Odsávání paliva... + Siphonnage... + Sifonando... + Sifonamento... + Spuszczanie paliwa... + Sifonando... + Слив топлива... + Absaugen... + 연료 흡입 중... + 燃料の吸い出し中... + 正在虹吸... + 正在虹吸... + Sifonlanıyor... + + + Syphoning interrupted... + Odsávání paliva bylo přerušeno... + Siphonnage interrompu... + Sifonado interrumpido... + Sifonamento interrotto... + Spuszczanie paliwa przerwane... + Sifonagem interrompida... + Слив топлива прерван... + Absaugen unterbrochen... + 연료 흡입이 중단되었습니다... + 燃料の吸い出しが中断されました... + 虹吸已中斷... + 虹吸已中断... + Yakıt sifonlama kesintiye uğradı... + + + diff --git a/addons/temperature/functions/fnc_core.sqf b/addons/temperature/functions/fnc_core.sqf index b8f50f91..e5cfa7e7 100644 --- a/addons/temperature/functions/fnc_core.sqf +++ b/addons/temperature/functions/fnc_core.sqf @@ -50,20 +50,10 @@ switch (true) do { _changeMultiplier = 50; }; case (insideBuilding player isEqualTo 1 && _isInflamed): { - [player, 150] call EFUNC(generator,nearGenerator) params ["", "_generator"]; - private _hasPower = (!isNil "_generator" && {_generator getVariable [QEGVAR(generator,isRunning), false]}); - - if (_hasPower) then { - _targetExposure = 0.25 - (_wetnessChill * 0.5); - _thermalIndexModifier = (_airTemp + 30) min 35; - _wetnessModifier = -0.01; - _changeMultiplier = 50; - } else { - _targetExposure = ([0.5, 0.1] select (_airTemp < TEMP_NEUTRAL)) - (_wetnessChill * 0.5); - _thermalIndexModifier = (_airTemp + 20) min 35; - _wetnessModifier = -0.005; - _changeMultiplier = 50; - }; + _targetExposure = ([0.5, 0.1] select (_airTemp < TEMP_NEUTRAL)) - (_wetnessChill * 0.5); + _thermalIndexModifier = (_airTemp + 20) min 35; + _wetnessModifier = -0.005; + _changeMultiplier = 50; }; case (_isInflamed): { _targetExposure = ([0.5, 0.1] select (_airTemp < TEMP_NEUTRAL)) - (_wetnessChill * 0.5); @@ -72,20 +62,10 @@ switch (true) do { _changeMultiplier = 50; }; case (insideBuilding player isEqualTo 1): { - [player, 150] call EFUNC(generator,nearGenerator) params ["", "_generator"]; - private _hasPower = (!isNil "_generator" && {_generator getVariable [QEGVAR(generator,isRunning), false]}); - - if (_hasPower) then { - _targetExposure = 0 - (_wetnessChill * 0.2); - _thermalIndexModifier = TEMP_NEUTRAL; - _wetnessModifier = -0.001; - _changeMultiplier = 50; - } else { - _targetExposure = ((_ambientTarget + 0.3) min 0) - _wetnessChill; - _thermalIndexModifier = _airTemp + 10; - _wetnessModifier = -0.0001; - _changeMultiplier = 50; - }; + _targetExposure = ((_ambientTarget + 0.3) min 0) - _wetnessChill; + _thermalIndexModifier = _airTemp + 10; + _wetnessModifier = -0.0001; + _changeMultiplier = 50; }; case !(isNull objectParent player): { private _config = missionConfigFile >> "CfgMisery_VehicleData";