From 24bd515814a35aa8d8d47e2d5d979b8858c51f53 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 8 Feb 2015 22:44:23 -0600 Subject: [PATCH] Commenting and some stringtables --- addons/magazinerepack/CfgSounds.hpp | 2 +- addons/magazinerepack/config.cpp | 2 +- .../magazinerepack/functions/fnc_magazineRepackFinish.sqf | 2 +- .../functions/fnc_magazineRepackProgress.sqf | 7 +++---- .../magazinerepack/functions/fnc_openSelectMagazineUI.sqf | 4 ++-- .../functions/fnc_startRepackingMagazine.sqf | 3 ++- addons/magazinerepack/script_component.hpp | 2 -- addons/magazinerepack/stringtable.xml | 6 ++++++ 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/addons/magazinerepack/CfgSounds.hpp b/addons/magazinerepack/CfgSounds.hpp index bc1d0fe0ee..15104d905d 100644 --- a/addons/magazinerepack/CfgSounds.hpp +++ b/addons/magazinerepack/CfgSounds.hpp @@ -12,4 +12,4 @@ class CfgSounds sound[] = {QUOTE(PATHTOF(sounds\magrepack_single.wav)),1,1}; titles[] = {}; }; -}; \ No newline at end of file +}; diff --git a/addons/magazinerepack/config.cpp b/addons/magazinerepack/config.cpp index 2df0d62bff..3a95c10643 100644 --- a/addons/magazinerepack/config.cpp +++ b/addons/magazinerepack/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common","ace_interaction"}; + requiredAddons[] = {"ace_interaction"}; author[] = {"commy2","CAA-Picard"}; authorUrl = "https://github.com/commy2/"; VERSION_CONFIG; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index 50817bcfe7..038b7fb151 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -1,5 +1,5 @@ /* - * Author: PabstMirror + * Author: PabstMirror (based on repack from commy2, esteldunedain, Ruthberg) * Simulates repacking a set of magazines. * Returns the timing and magazines counts at every stage. * diff --git a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf index 3c829a8933..1d3b5ec6cf 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf @@ -36,6 +36,7 @@ _currentAmmoCount = []; }; } forEach (magazinesAmmo ACE_player); //only inventory mags +//Go through mags we currently have and check off the ones we should have _addedMagazines = +_currentAmmoCount; _missingAmmo = false; { @@ -49,10 +50,7 @@ _missingAmmo = false; }; } forEach _lastAmmoCount; -if (_missingAmmo) exitWith {false}; //something removed ammo that was being repacked -if ((count _addedMagazines) > 0) then { - TRACE_1("Added Magazine While Repacking",_addedMagazines); -}; +if (_missingAmmo) exitWith {false}; //something removed ammo that was being repacked (could be other players or scripts) _updateMagazinesOnPlayerFnc = { ACE_player removeMagazines _magazineClassname; //remove inventory magazines @@ -67,6 +65,7 @@ _updateMagazinesOnPlayerFnc = { if (_nextEventIsBullet) then { playSound QGVAR(soundMagazineFinished); if ((((count _simEvents) % 3) == 0) || {(count _simEvents) == 1}) then { + //For performance - only update mags every 3 bullets (or if it's the last event) call _updateMagazinesOnPlayerFnc; }; } else { diff --git a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf index 9d99ad56b5..e96e84e9a1 100644 --- a/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf +++ b/addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf @@ -37,7 +37,7 @@ _unitMagCounts = []; (_unitMagCounts select _index) pushBack _xCount; }; }; -} forEach magazinesAmmoFull _unit; +} forEach (magazinesAmmoFull _unit); _actions = [localize "STR_ACE_MagazineRepack_SelectMagazineMenu", localize "STR_ACE_MagazineRepack_SelectMagazine"] call EFUNC(interaction,prepareSelectMenu); @@ -53,7 +53,7 @@ _actions = [localize "STR_ACE_MagazineRepack_SelectMagazineMenu", localize "STR_ _actions, { [_this] call FUNC(startRepackingMagazine); }, { - call EFUNC(interaction,hideMenu); + call EFUNC(interaction,hideMenu); //ToDo: Self Interaction Integration if !(profileNamespace getVariable [QGVAR(AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)}; } ] call EFUNC(interaction,openSelectMenu); diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index d83cc649b0..06c0f0a137 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -1,6 +1,7 @@ /* * Author: PabstMirror (based on repack from commy2, esteldunedain, Ruthberg) * Starts repacking a specific magazine classname. + * If room in inventory, unload magazine from weapon to be repacked. * Precalcs all the event timings and starts the progressBar. * * Arguments: @@ -24,7 +25,7 @@ if (isNil "_magazineClassname" || {_magazineClassname == ""}) exitWith {ERROR("B _unit = ACE_player; [ACE_player] call EFUNC(common,goKneeling); -call EFUNC(interaction,hideMenu); +call EFUNC(interaction,hideMenu);//ToDo: Self Interaction Integration // Calculate actual ammo to transfer during repack _fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); diff --git a/addons/magazinerepack/script_component.hpp b/addons/magazinerepack/script_component.hpp index 15563f0fe8..7b390f7126 100644 --- a/addons/magazinerepack/script_component.hpp +++ b/addons/magazinerepack/script_component.hpp @@ -1,5 +1,3 @@ -#define DEBUG_MODE_FULL - #define COMPONENT magazinerepack #include "\z\ace\addons\main\script_mod.hpp" diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 2e3d9500e0..937cfcbf9a 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -76,12 +76,18 @@ Repacking Finished + Wiederverpacken Fertig + Reembalaje Finalizado Repacking Interrupted + Umpacken Unterbrochen + Reempaque Interrupted %1 Full and %2 Partial + %1 Vollständigen und %2 Teilweisen + %1 Total y %2 Parcial \ No newline at end of file