Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various misc improvements for ACE Arsenal #6111

Merged
merged 13 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
2 changes: 2 additions & 0 deletions addons/arsenal/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium
[QGVAR(camInverted), "CHECKBOX", localize LSTRING(invertCameraSetting), localize LSTRING(settingCategory), false] call CBA_Settings_fnc_init;
[QGVAR(enableModIcons), "CHECKBOX", [LSTRING(modIconsSetting), LSTRING(modIconsTooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init;
[QGVAR(fontHeight), "SLIDER", [LSTRING(fontHeightSetting), LSTRING(fontHeightTooltip)], localize LSTRING(settingCategory), [1, 10, 4.5, 1]] call CBA_Settings_fnc_init;
[QGVAR(enableIdentityTabs), "CHECKBOX", localize LSTRING(enableIdentityTabsSettings), localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init;


// Arsenal loadouts
[QGVAR(allowDefaultLoadouts), "CHECKBOX", [LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)], localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init;
Expand Down
2 changes: 2 additions & 0 deletions addons/arsenal/functions/fnc_buttonExport.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ if (GVAR(shiftState)) then {

[_display, localize LSTRING(exportCurrent)] call FUNC(message);
};

[QGVAR(loadoutExported), [_display, GVAR(shiftState)]] call CBA_fnc_localEvent;
2 changes: 2 additions & 0 deletions addons/arsenal/functions/fnc_buttonImport.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ if (GVAR(shiftState) && {is3DEN}) then {
[_display, localize LSTRING(importedCurrent)] call FUNC(message);
};
};

[QGVAR(loadoutImported), [_display, (GVAR(shiftState) && {is3DEN})]] call CBA_fnc_localEvent;
2 changes: 2 additions & 0 deletions addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ call FUNC(updateUniqueItemsList);
[GVAR(center), GVAR(currentInsignia)] call bis_fnc_setUnitInsignia;

[(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutLoaded), _loadoutName] joinString " "] call FUNC(message);

[QGVAR(onLoadoutLoad), [_loadout]] call CBA_fnc_localEvent;
1 change: 1 addition & 0 deletions addons/arsenal/functions/fnc_onArsenalClose.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ GVAR(currentInsignia) = nil;
GVAR(currentAction) = nil;

GVAR(center) = nil;
GVAR(centerNotPlayer) = nil;

showHUD true;
13 changes: 13 additions & 0 deletions addons/arsenal/functions/fnc_onArsenalOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,19 @@ if (is3DEN) then {

_buttonCloseCtrl = _display displayCtrl IDC_menuBarClose;
_buttonCloseCtrl ctrlSetText (localize "str_ui_debug_but_apply");
} else {
GVAR(centerNotPlayer) = (GVAR(center) != player);

{
private _ctrl = _display displayCtrl _x;
_ctrl ctrlEnable GVAR(enableIdentityTabs);
_ctrl ctrlSetFade ([0.6, 0] select GVAR(enableIdentityTabs));
_ctrl ctrlcommit 0;
} foreach [
Copy link
Contributor

Choose a reason for hiding this comment

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

ctrlcommit, foreach -> ctrlCommit, forEach

IDC_buttonFace,
IDC_buttonVoice,
IDC_buttonInsigna
];
};

//--------------- Prepare the left panel
Expand Down
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_showItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "script_component.hpp"
#include "..\defines.hpp"


if (GVAR(centerNotPlayer)) exitWith {};

private _nextAction = switch (GVAR(currentLeftPanel)) do {

Expand Down
4 changes: 4 additions & 0 deletions addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -543,5 +543,9 @@
<English>Import current / default loadouts</English>
<French>Importer l'équipement actuel ou la liste d'équipements de base</French>
</Key>
<Key ID="STR_ACE_Arsenal_enableIdentityTabsSettings">
<English>Enable the faces / voices / insignias tabs</English>
<French>Activer les onglets faces / voix / insignes</French>
</Key>
</Package>
</Project>
11 changes: 11 additions & 0 deletions addons/arsenal/ui/RscCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ class Display3DEN {
class ContextMenu :ctrlMenu {
class Items {
class Arsenal {
items[]= {"aceArsenal", "virtualArsenal"};
};
class virtualArsenal {
text = "BI Virtual Arsenal";
action= QUOTE(['arsenal'] call bis_fnc_3DENEntityMenu);
value=0;
data="Arsenal";
opensNewWindow=1;
};
class aceArsenal: virtualArsenal {
text = "ACE Arsenal";
action= QUOTE(call FUNC(open3DEN));
};
};
Expand Down
5 changes: 5 additions & 0 deletions addons/zeus/CfgFactionClasses.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ class CfgFactionClasses {
priority = 2;
side = 7;
};
class GVAR(Arsenal) {
displayName = "ACE Arsenal";
priority = 2;
side = 7;
};
};
12 changes: 12 additions & 0 deletions addons/zeus/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,18 @@ class CfgVehicles {
displayName = CSTRING(ModuleRemoveArsenal_DisplayName);
function = QFUNC(moduleRemoveArsenal);
};
class GVAR(AddFullAceArsenal): GVAR(moduleBase) {
curatorCanAttach = 1;
category = QGVAR(Arsenal);
displayName = CSTRING(ModuleAddFullACEArsenal_DisplayName);
function = QFUNC(moduleAddAceArsenal);
};
class GVAR(RemoveFullAceArsenal): GVAR(moduleBase) {
curatorCanAttach = 1;
category = QGVAR(Arsenal);
displayName = CSTRING(ModuleRemoveACEArsenal_DisplayName);
function = QFUNC(moduleRemoveAceArsenal);
};
class ModuleArsenal_F: Module_F {
function=QFUNC(bi_moduleArsenal);
};
Expand Down
2 changes: 2 additions & 0 deletions addons/zeus/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PREP(bi_moduleRemoteControl);
PREP(getModuleDestination);
PREP(handleZeusUnitAssigned);
PREP(moduleAddArsenal);
PREP(moduleAddAceArsenal);
PREP(moduleAddSpareTrack);
PREP(moduleAddSpareWheel);
PREP(moduleAddOrRemoveFRIES);
Expand All @@ -18,6 +19,7 @@ PREP(moduleGlobalSetSkill);
PREP(moduleGroupSide);
PREP(moduleLoadIntoCargo);
PREP(moduleRemoveArsenal);
PREP(moduleRemoveAceArsenal);
PREP(moduleSearchNearby);
PREP(moduleSetMedic);
PREP(moduleSetMedicalVehicle);
Expand Down
9 changes: 9 additions & 0 deletions addons/zeus/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class CfgPatches {
QGVAR(moduleSuppressiveFire),
QGVAR(AddFullArsenal),
QGVAR(RemoveFullArsenal),
QGVAR(AddFullAceArsenal),
QGVAR(RemoveFullAceArsenal),
QGVAR(moduleTeleportPlayers)
};
weapons[] = {};
Expand Down Expand Up @@ -69,6 +71,12 @@ class CfgPatches {
QGVAR(moduleConfigurePylons)
};
};
class GVAR(arsenal): ADDON {
units[] = {
QGVAR(AddFullAceArsenal),
QGVAR(RemoveFullAceArsenal)
};
};
};

class ACE_Curator {
Expand All @@ -78,6 +86,7 @@ class ACE_Curator {
GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"};
GVAR(fastroping) = "ace_fastroping";
GVAR(pylons) = "ace_pylons";
GVAR(arsenal) = "ace_arsenal";
};

#include "CfgFactionClasses.hpp"
Expand Down
36 changes: 36 additions & 0 deletions addons/zeus/functions/fnc_moduleAddAceArsenal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Author: alganthe
* Add a full ACE Arsenal to an object
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"

params ["_logic"];
if (!local _logic) exitWith {};

private _object = attachedTo _logic;
TRACE_3("moduleAddArsenal",_logic,_object,typeOf _object);

switch (true) do {
case (isNull _object): {
[LSTRING(NothingSelected)] call FUNC(showMessage);
};
case (isPlayer _object): {
["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage);
};
case (!alive _object): {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
};
default {
[_object, true, true] call EFUNC(arsenal,initBox);
};
};

deleteVehicle _logic;
12 changes: 3 additions & 9 deletions addons/zeus/functions/fnc_moduleAddArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@ switch (true) do {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
};
default {
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {

[_object, true, true] call EFUNC(arsenal,initBox);
} else {

TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object);
// Global Effects: "Action to access the Arsenal will be added automatically on all clients."
["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal;
};
TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object);
// Global Effects: "Action to access the Arsenal will be added automatically on all clients."
["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal;
};
};

Expand Down
37 changes: 37 additions & 0 deletions addons/zeus/functions/fnc_moduleRemoveAceArsenal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Author: alganthe
* Remove ACE Arsenal from an object
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/

#include "script_component.hpp"

params ["_logic"];
if (!local _logic) exitWith {};

private _object = attachedTo _logic;
TRACE_3("moduleRemoveArsenal",_logic,_object,typeOf _object);

switch (true) do {
case (isNull _object): {
[LSTRING(NothingSelected)] call FUNC(showMessage);
};
case (isPlayer _object): {
["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage);
};
case (!alive _object): {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
};
default {
[_object, true, true] call EFUNC(arsenal,removeBox);
};
};

deleteVehicle _logic;
16 changes: 5 additions & 11 deletions addons/zeus/functions/fnc_moduleRemoveArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,11 @@ switch (true) do {
};
default {

if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {

[_object, true, true] call EFUNC(arsenal,removeBox);
} else {

TRACE_1("Calling removeVirtualXXXCargo functions",_object);
[_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo;
[_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo;
[_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo;
[_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo;
};
TRACE_1("Calling removeVirtualXXXCargo functions", _object);
[_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo;
[_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo;
[_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo;
[_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo;
};
};

Expand Down
6 changes: 6 additions & 0 deletions addons/zeus/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1238,5 +1238,11 @@
<Chinesesimp>解除驻军驻守状态</Chinesesimp>
<Korean>주둔해제</Korean>
</Key>
<Key ID="STR_ACE_Zeus_ModuleAddFullACEArsenal_DisplayName">
<English>Add full ACE Arsenal</English>
</Key>
<Key ID="STR_ACE_Zeus_ModuleRemoveACEArsenal_DisplayName">
<English>Remove ACE Arsenal</English>
</Key>
</Package>
</Project>