Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9e1c146
added init config
killerswin2 Oct 22, 2022
158eed7
initial support for csw on vehicle turrets
killerswin2 Oct 23, 2022
6e1fc0f
crows mag
killerswin2 Oct 23, 2022
3c6b6cb
USF done
killerswin2 Oct 25, 2022
a8a7ec6
rhs afrf done
killerswin2 Oct 26, 2022
9ba4dcf
fix string table
killerswin2 Oct 26, 2022
c0c023f
rhs saf done
killerswin2 Oct 26, 2022
c58b722
gref
killerswin2 Oct 27, 2022
0e6f1fd
sog done
killerswin2 Oct 27, 2022
0ed2ad6
added more ui pictures
killerswin2 Oct 27, 2022
9413e37
added newline at end
killerswin2 Oct 27, 2022
1fc78ca
vanilla weapons added
killerswin2 Oct 27, 2022
8b8bb48
added ace_csw to base classes
killerswin2 Oct 27, 2022
0d8265e
remove random typeOf
killerswin2 Oct 27, 2022
e34ac50
add dummy p3d
killerswin2 Oct 27, 2022
58de212
add dummy p3d in include
killerswin2 Oct 27, 2022
bdacbe5
fixes for passing style checker
killerswin2 Oct 27, 2022
e2b54a3
Update addons/csw/CfgMagazineGroups.hpp
killerswin2 Oct 28, 2022
c4c6b17
Update optionals/compat_sog/stringtable.xml
killerswin2 Oct 28, 2022
12b23af
remove double semicolon
killerswin2 Oct 28, 2022
bd396d1
you can now use csw in the gunner slot
killerswin2 Nov 1, 2022
a088e71
converted tabs to spaces
killerswin2 Nov 1, 2022
743214d
Update addons/csw/functions/fnc_reload_canLoadMagazine.sqf
killerswin2 Nov 2, 2022
f9fd085
Update addons/csw/functions/fnc_reload_handleReturnAmmo.sqf
killerswin2 Nov 2, 2022
0a2d8a6
Commy suggestions
killerswin2 Nov 12, 2022
17c8c72
Merge remote-tracking branch 'upstream/master' into CSW_FOR_VEHICLE_T…
killerswin2 Jun 22, 2023
e855a0a
replace turrent ammo with csw mags
killerswin2 Jun 22, 2023
ffa6aec
add newlines at the end
killerswin2 Jun 22, 2023
f67f117
review changes
killerswin2 Jun 23, 2023
42b5ac3
fix missing semicolon
killerswin2 Jun 23, 2023
bc05e7f
stringtable spacing
killerswin2 Jun 23, 2023
00f9455
Update addons/csw/XEH_postInit.sqf
killerswin2 Jun 23, 2023
6e8e70a
Update addons/csw/functions/fnc_getCarryMagazine.sqf
killerswin2 Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions addons/csw/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ GVAR(vehicleMagCache) = createHashMap;
[QGVAR(returnAmmo), LINKFUNC(reload_handleReturnAmmo)] call CBA_fnc_addEventHandler;


if (isServer) then
{
Comment thread
killerswin2 marked this conversation as resolved.
Outdated
[QGVAR(setMaxLoad), {(_this#0) setMaxLoad (_this#1)}] call CBA_fnc_addEventHandler;
}

#ifdef DEBUG_MODE_FULL
call compile preprocessFileLineNumbers QPATHTOF(dev\checkStaticWeapons.sqf);
Expand Down
2 changes: 1 addition & 1 deletion addons/csw/functions/fnc_reload_canLoadMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "coun
private _loadedMag = "";
private _isBeltLinking = false;

// Zeus Enhanced will keep the mags in the turrent and set the count to zero
// Zeus Enhanced will keep the mags in the Turret and set the count to zero
{
_x params ["_xMag", "_xTurret", "_xAmmo"];
if (_xTurret isEqualTo _turret && {_xAmmo isEqualTo 0}) then {
Expand Down
5 changes: 2 additions & 3 deletions addons/csw/functions/fnc_staticWeaponVehicleInit.sqf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs handling for AI reload (GetIn and Fired events). Also we might want at least one magazine to remain loaded? And take GVAR(ammoHandling) into account. Refactoring and then just using FUNC(staticWeaponInit_handleExtraMags) might be a good idea for all that.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params["_vehicle"];
// exit with the user doesn't want the ammo to be replaced
if(!GVAR(replaceTurrentAmmoWithCSW)) exitwith {};
if(!GVAR(replaceTurretAmmoWithCSW)) exitwith {};
private _turretPath = [_vehicle] call EFUNC(common,getTurretGunner);
if((count _turretPath) isNotEqualTo 1) exitwith {};

Expand All @@ -41,8 +41,7 @@ private _addLoad = maxLoad _vehicle;
} forEach (magazinesAllTurrets _vehicle);

// set the load, so that users can remove the mags and add them other items to the vehicle.
[_vehicle, _addLoad] remoteExecCall ["setMaxLoad", 2];

[QGVAR(setMaxLoad), [_vehicle, _addLoad]] call CBA_fnc_serverEvent;
{
_x params ["_cswMag", "_xAmmo"];
_vehicle addMagazineAmmoCargo [_cswMag, 1, _xAmmo];
Expand Down
8 changes: 4 additions & 4 deletions addons/csw/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ private _categoryArray = [format ["ACE %1", localize LSTRING(DisplayName)]];


[
QGVAR(replaceTurrentAmmoWithCSW), "CHECKBOX",
[LSTRING(replaceTurrentAmmoWithCSW_displayName), LSTRING(replaceTurrentAmmoWithCSW_description)],
QGVAR(replaceTurretAmmoWithCSW), "CHECKBOX",
[LSTRING(replaceTurretAmmoWithCSW_displayName), LSTRING(replaceTurretAmmoWithCSW_description)],
_categoryArray,
true, // default value
true, // isGlobal
{
if !(_this && {isServer} && {isNil QGVAR(replaceTurrentAmmoWithCSW_initialized)}) exitWith {};
GVAR(replaceTurrentAmmoWithCSW_initialized) = true;
if !(_this && {isServer} && {isNil QGVAR(replaceTurretAmmoWithCSW_initialized)}) exitWith {};
GVAR(replaceTurretAmmoWithCSW_initialized) = true;
["Car", "init", LINKFUNC(staticWeaponVehicleInit), true, [], true] call CBA_fnc_addClassEventHandler;
},
false // Needs mission restart
Expand Down
40 changes: 9 additions & 31 deletions addons/csw/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,35 +303,13 @@
<Russian>После развертывания начать тащить треногу на другое место</Russian>
<Korean>조립 후 위치선정을 위해 배치하지 않고 끌고다닙니다.</Korean>
</Key>
<Key ID="STR_ACE_CSW_replaceTurrentAmmoWithCSW_displayName">
<English>Replace turrent ammo with CSW mags</English>
<German></German>
<Portuguese></Portuguese>
<French></French>
<Japanese></Japanese>
<Chinese></Chinese>
<Chinesesimp></Chinesesimp>
<Italian></Italian>
<Czech></Czech>
<Polish></Polish>
<Spanish></Spanish>
<Russian></Russian>
<Korean></Korean>
</Key>
<Key ID="STR_ACE_CSW_replaceTurrentAmmoWithCSW_description">
<English>Turrent ammo will be replaced with CSW mags in the vehicle's cargo</English>
<German></German>
<Portuguese></Portuguese>
<French></French>
<Japanese></Japanese>
<Chinese></Chinese>
<Chinesesimp></Chinesesimp>
<Italian></Italian>
<Czech></Czech>
<Polish></Polish>
<Spanish></Spanish>
<Russian></Russian>
<Korean></Korean>
<Key ID="STR_ACE_CSW_replaceTurretAmmoWithCSW_displayName">
<English>Replace Turret ammo with CSW mags</English>

</Key>
<Key ID="STR_ACE_CSW_replaceTurretAmmoWithCSW_description">
<English>Turret ammo will be replaced with CSW mags in the vehicle's cargo</English>

</Key>
<Key ID="STR_ACE_CSW_Pickup_displayName">
<English>Pickup Tripod</English>
Expand Down Expand Up @@ -689,7 +667,7 @@
<Korean>[CSW] 20mm 고속유탄발사기 탄띠</Korean>
</Key>
<Key ID="STR_ACE_CSW_GMGBelt96_displayName">
<English>[CSW] 40mm Grenade GMG Belt 96 Count</English>
<English>[CSW] 40mm Grenade GMG Belt</English>
</Key>
<Key ID="STR_ACE_CSW_SPGHEAT_displayName">
<English>[CSW] SPG9 HEAT Rounds</English>
Expand All @@ -698,7 +676,7 @@
<English>[CSW] SPG9 HE Rounds</English>
</Key>
<Key ID="STR_ACE_CSW_65_39Belt_displayName">
<English>[CSW] 6.5X39mm Belt</English>
<English>[CSW] 6.5x39 mm Belt</English>
</Key>
<Key ID="STR_ACE_CSW_m3Tripod_displayName">
<English>M3 Tripod</English>
Expand Down
8 changes: 4 additions & 4 deletions optionals/compat_rhs_usf3/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@
<Spanish>[CSW] Mk. 19 40mm M1001 Bote de metralla</Spanish>
</Key>
<Key ID="STR_ACE_Compat_RHS_USF3_mag_400rnd_127x99_displayName">
<English>[CSW] M2 12.7x99mm HMG Belt 400 Count</English>
<English>[CSW] M2 12.7x99mm HMG Belt</English>
</Key>
<Key ID="STR_ACE_Compat_RHS_USF3_mag_400rnd_127x99_Red_displayName">
<English>[CSW] M2 12.7x99mm HMG Tracer Red Belt 400 Count</English>
<English>[CSW] M2 12.7x99mm HMG Tracer Red Belt</English>
</Key>
<Key ID="STR_ACE_Compat_RHS_USF3_mag_400rnd_127x99_SLAP_displayName">
<English>[CSW] M2 12.7x99mm HMG SLAP Belt 400 Count</English>
<English>[CSW] M2 12.7x99mm HMG SLAP Belt</English>
</Key>
<Key ID="STR_ACE_Compat_RHS_USF3_mag_400rnd_127x99_SLAP_Red_displayName">
<English>[CSW] M2 12.7x99mm HMG Red Tracer SLAP Belt 400 Count </English>
<English>[CSW] M2 12.7x99mm HMG Red Tracer SLAP Belt</English>
</Key>
<Key ID="STR_ACE_Compat_RHS_USF3_mag_762x51_m80a1_4000_displayName">
<English>[CSW] M134D 7.62x51mm Belt</English>
Expand Down