/* * Author: PabstMirror (based on repack from commy2, esteldunedain, Ruthberg) * Simulates repacking a set of magazines. * Returns the timing and magazines counts at every stage. * * Arguments: * 0: Arguments [classname,lastAmmoStatus,events] * 1: Elapsed Time * 2: Total Time Repacking Will Take * 3: Error Code * * Return Value: * Nothing * * Example: * (args from progressBar) call ace_magazinerepack_fnc_magazineRepackFinish * * Public: No */ #include "script_component.hpp" PARAMS_4(_args,_elapsedTime,_totalTime,_errorCode); EXPLODE_2_PVT(_args,_magazineClassname,_lastAmmoCount); _fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); _structuredOutputText = if (_errorCode == 0) then { format ["%1
", (localize "STR_ACE_MagazineRepack_RepackComplete")]; } else { format ["%1
", (localize "STR_ACE_MagazineRepack_RepackInterrupted")]; }; _picture = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "picture"); _structuredOutputText = _structuredOutputText + format ["
", _picture]; _fullMags = 0; _partialMags = 0; { EXPLODE_2_PVT(_x,_xClassname,_xCount); if ((_xClassname == _magazineClassname) && {_xCount > 0}) then { if (_xCount == _fullMagazineCount) then { _fullMags = _fullMags + 1; } else { _partialMags = _partialMags + 1; }; }; } forEach (magazinesAmmoFull ACE_player); _structuredOutputText = _structuredOutputText + format [("" + (localize "STR_ACE_MagazineRepack_RepackedMagazinesCount") + ""), _fullMags, _partialMags]; [parseText _structuredOutputText] call EFUNC(common,displayTextStructured);