mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge remote-tracking branch 'upstream/master' into corpse-carry-continued2
This commit is contained in:
commit
1ad961cbe0
@ -36,3 +36,11 @@ preset = "Hemtt"
|
||||
workshop = [
|
||||
"450814997", # CBA_A3's Workshop ID
|
||||
]
|
||||
|
||||
[hemtt.launch.vn]
|
||||
workshop = [
|
||||
"450814997", # CBA_A3's Workshop ID
|
||||
]
|
||||
dlc = [
|
||||
"S.O.G. Prairie Fire",
|
||||
]
|
||||
|
@ -10,7 +10,7 @@ Brett Mayson
|
||||
bux578 <github@jonathandavid.de>
|
||||
commy2
|
||||
Dahlgren
|
||||
Dani (TCVM) <baileydanyluk@gmail.com>
|
||||
tcvm <baileydanyluk@gmail.com>
|
||||
esteldunedain <nicolas.d.badano@gmail.com>
|
||||
Felix Wiegand <koffeinflummi@gmail.com>
|
||||
Garth "L-H" de Wet <garthofhearts@gmail.com>
|
||||
@ -21,11 +21,11 @@ Janus
|
||||
jokoho482 <jokoho482@gmail.com>
|
||||
Jonpas <jonpas33@gmail.com>
|
||||
Kieran
|
||||
kymckay
|
||||
mharis001 <mhariszakar@gmail.com>
|
||||
NouberNou
|
||||
PabstMirror <pabstmirror@gmail.com>
|
||||
Ruthberg <ulteq@web.de>
|
||||
SilentSpike <SilentSpike100@gmail.com>
|
||||
tpM
|
||||
veteran29
|
||||
ViperMaul
|
||||
@ -44,6 +44,7 @@ aeroson
|
||||
Aggr094 <bastards4glory@gmail.com>
|
||||
alef <alefor@gmail.com>
|
||||
Aleksey EpMAK Yermakov <epmak777@gmail.com>
|
||||
AleM
|
||||
Alganthe <alganthe@live.fr>
|
||||
Andrea "AtixNeon" Verano <veranoandrea88@gmail.com>
|
||||
Anthariel <Contact@storm-simulation.com>
|
||||
@ -113,6 +114,7 @@ Hawkins
|
||||
Head <brobergsebastian@gmail.com>
|
||||
Hybrid V
|
||||
JasperRab <jasper@jasperrab.eu>
|
||||
JDT
|
||||
john681611 <john681611@hotmail.com>
|
||||
JoramD
|
||||
Karneck <dschultz26@hotmail.com>
|
||||
@ -131,6 +133,7 @@ MarcBook
|
||||
meat <p.humberdroz@gmail.com>
|
||||
Michail Nikolaev
|
||||
MikeMatrix <m.braun92@gmail.com>
|
||||
MikeMF
|
||||
mjc4wilton <mjc4wilton@gmail.com>
|
||||
Mysteryjuju
|
||||
nic547 <nic547@outlook.com>
|
||||
@ -174,7 +177,6 @@ Toaster <jonathan.pereira@gmail.com>
|
||||
Tonic
|
||||
Tourorist <tourorist@gmail.com>
|
||||
Tuupertunut
|
||||
TyroneMF <TyroneMF@hotmail.com>
|
||||
Valentin Torikian <valentin.torikian@gmail.com>
|
||||
voiper
|
||||
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
|
||||
|
@ -2,22 +2,22 @@
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
[missionNamespace, "ACE_setCustomAimCoef", QUOTE(ADDON), {
|
||||
private _unit = ACE_player;
|
||||
private _fatigue = _unit getVariable [QGVAR(aimFatigue), 0];
|
||||
|
||||
switch (stance _unit) do {
|
||||
["baseline", {
|
||||
private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0];
|
||||
switch (stance ACE_player) do {
|
||||
case ("CROUCH"): {
|
||||
(1.0 + _fatigue ^ 2 * 0.1) * GVAR(swayFactor)
|
||||
(1.0 + _fatigue ^ 2 * 0.1)
|
||||
};
|
||||
case ("PRONE"): {
|
||||
(1.0 + _fatigue ^ 2 * 2.0) * GVAR(swayFactor)
|
||||
(1.0 + _fatigue ^ 2 * 2.0)
|
||||
};
|
||||
default {
|
||||
(1.5 + _fatigue ^ 2 * 3.0) * GVAR(swayFactor)
|
||||
(1.5 + _fatigue ^ 2 * 3.0)
|
||||
};
|
||||
};
|
||||
}] call EFUNC(common,arithmeticSetSource);
|
||||
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
|
||||
|
||||
["multiplier", {GVAR(swayFactor)}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
|
||||
|
||||
// recheck weapon inertia after weapon swap, change of attachments or switching unit
|
||||
["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler;
|
||||
|
@ -94,6 +94,3 @@ if (_overexhausted) then {
|
||||
};
|
||||
|
||||
_unit setVariable [QGVAR(aimFatigue), _fatigue];
|
||||
|
||||
private _aimCoef = [missionNamespace, "ACE_setCustomAimCoef", "max"] call EFUNC(common,arithmeticGetResult);
|
||||
_unit setCustomAimCoef _aimCoef;
|
||||
|
@ -38,7 +38,7 @@ if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGr
|
||||
|
||||
// Calculate muscle damage increase
|
||||
// Note: Muscle damage recovery is ignored as it takes multiple days
|
||||
GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004;
|
||||
GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004) min 1;
|
||||
private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage));
|
||||
|
||||
// Calculate available power
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas, SilentSpike
|
||||
* Author: Dslyecxi, Jonpas, kymckay
|
||||
* Handles drawing the currently selected or cooked throwable.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,3 +1,5 @@
|
||||
PREP(assignNVG);
|
||||
PREP(assignNVGpfh);
|
||||
PREP(drawCuratorGarrisonPathing);
|
||||
PREP(garrison);
|
||||
PREP(garrisonMove);
|
||||
|
@ -68,3 +68,11 @@
|
||||
params ["_unit", "_mode"];
|
||||
_unit enableGunLights _mode;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
if (isServer) then {
|
||||
["CAManBase", "init", {
|
||||
// wait for HMD to be assigned so `hmd _unit` works
|
||||
[FUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute;
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
};
|
||||
|
@ -6,4 +6,11 @@ PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
if (isServer) then {
|
||||
GVAR(assignNVGthread) = false;
|
||||
GVAR(assignNVGstate) = false;
|
||||
};
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
ADDON = true;
|
||||
|
39
addons/ai/functions/fnc_assignNVG.sqf
Normal file
39
addons/ai/functions/fnc_assignNVG.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Assigns AI first found NVG in their inventory during night time and unassigns it during day time.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [cursorObject] call ace_ai_fnc_assignNVG
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
if (!GVAR(assignNVG)) exitWith {};
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (alive _unit && {!isPlayer _unit}) then {
|
||||
private _nvg = hmd _unit;
|
||||
|
||||
if (GVAR(assignNVGstate)) then {
|
||||
if (_nvg == "") then {
|
||||
private _items = [_unit, false, true, true, true, false, false] call CBA_fnc_uniqueUnitItems; // backpack, vest, uniform
|
||||
{
|
||||
if (getText (configFile >> "CfgWeapons" >> _x >> "simulation") == "NVGoggles") exitWith {
|
||||
_unit assignItem _x;
|
||||
};
|
||||
} forEach _items;
|
||||
};
|
||||
} else {
|
||||
if (_nvg != "" && {currentVisionMode _unit == 0} && {_unit canAdd _nvg}) then {
|
||||
_unit unassignItem _nvg;
|
||||
};
|
||||
};
|
||||
};
|
27
addons/ai/functions/fnc_assignNVGpfh.sqf
Normal file
27
addons/ai/functions/fnc_assignNVGpfh.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* waitAndExecute Handler for periodic NVG assignment.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_ai_fnc_assignNVGpfh
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
TRACE_1("assignNVGpfh",count allUnits);
|
||||
|
||||
if (!GVAR(assignNVG)) exitWith { TRACE_1("shutdown loop",_this); GVAR(assignNVGthread) = false; };
|
||||
|
||||
GVAR(assignNVGstate) = sunOrMoon < 1 || {moonIntensity > 0.8};
|
||||
|
||||
{
|
||||
_x call FUNC(assignNVG);
|
||||
} forEach allUnits;
|
||||
|
||||
[FUNC(assignNVGpfh), [], 300] call CBA_fnc_waitAndExecute;
|
19
addons/ai/initSettings.sqf
Normal file
19
addons/ai/initSettings.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
private _category = format ["ACE %1", LLSTRING(DisplayName)];
|
||||
|
||||
[
|
||||
QGVAR(assignNVG), "CHECKBOX",
|
||||
[LSTRING(AssignNVG_DisplayName), LSTRING(AssignNVG_Description)],
|
||||
_category,
|
||||
false,
|
||||
1,
|
||||
{
|
||||
if (isServer) then {
|
||||
params ["_enabled"];
|
||||
if (_enabled && {!GVAR(assignNVGthread)}) then {
|
||||
TRACE_1("start loop",_this);
|
||||
GVAR(assignNVGthread) = true;
|
||||
[FUNC(assignNVGpfh), [], 1] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
};
|
||||
}
|
||||
] call CBA_fnc_addSetting;
|
@ -1,6 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="AI">
|
||||
<Key ID="STR_ACE_AI_DisplayName">
|
||||
<English>AI</English>
|
||||
<Chinese>AI</Chinese>
|
||||
<French>IA</French>
|
||||
<Spanish>IA</Spanish>
|
||||
<Italian>AI</Italian>
|
||||
<Polish>SI</Polish>
|
||||
<Russian>ИИ</Russian>
|
||||
<German>KI</German>
|
||||
<Czech>UI</Czech>
|
||||
<Portuguese>IA</Portuguese>
|
||||
<Korean>AI</Korean>
|
||||
<Chinesesimp>AI</Chinesesimp>
|
||||
<Japanese>AI</Japanese>
|
||||
<Turkish>AI</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AI_GarrisonInvalidPosition">
|
||||
<English>Invalid position provided.</English>
|
||||
<German>Ungültige Position</German>
|
||||
@ -65,5 +81,11 @@
|
||||
<Czech>Nenalezena žádná budova.</Czech>
|
||||
<Turkish>Bir yapı bulunamadı</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AI_AssignNVG_DisplayName">
|
||||
<English>Auto-Equip NVGs</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AI_AssignNVG_Description">
|
||||
<English>Equips NVG in inventory during night time and unequips it during day time.\nDoes not add NVGs to inventory!</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -12,6 +12,6 @@ class Extended_PreInit_EventHandlers {
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
1
addons/arsenal/ACE_Arsenal_Actions.hpp
Normal file
1
addons/arsenal/ACE_Arsenal_Actions.hpp
Normal file
@ -0,0 +1 @@
|
||||
class GVAR(actions) {};
|
@ -75,6 +75,14 @@ class GVAR(stats) {
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_scopeMag));
|
||||
tabs[] = {{}, {0}};
|
||||
};
|
||||
class ACE_binoMagnification: statBase {
|
||||
scope = 2;
|
||||
priority = 2;
|
||||
displayName = CSTRING(statMagnification);
|
||||
showText = 1;
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_binoMag));
|
||||
tabs[] = {{9}, {}};
|
||||
};
|
||||
class ACE_scopeVisionMode: statBase {
|
||||
scope = 2;
|
||||
priority = 1.6;
|
||||
@ -83,6 +91,14 @@ class GVAR(stats) {
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_scopeVisionMode));
|
||||
tabs[] = {{}, {0}};
|
||||
};
|
||||
class ACE_binoVisionMode: statBase {
|
||||
scope = 2;
|
||||
priority = 1.6;
|
||||
displayName = CSTRING(statVisionModeGeneric);
|
||||
showText = 1;
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_binoVisionMode));
|
||||
tabs[] = {{8,9}, {}};
|
||||
};
|
||||
class ACE_ballisticProtection: statBase {
|
||||
scope = 2;
|
||||
priority = 5;
|
||||
@ -128,4 +144,12 @@ class GVAR(stats) {
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_explosionTime));
|
||||
tabs[] = {{}, {5}};
|
||||
};
|
||||
class ACE_magCount: statBase {
|
||||
scope = 2;
|
||||
priority = 1;
|
||||
displayName = CSTRING(statMagCount);
|
||||
showText = 1;
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_magCount));
|
||||
tabs[] = {{}, {4}};
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,8 @@
|
||||
PREP(addAction);
|
||||
PREP(addDefaultLoadout);
|
||||
PREP(addListBoxItem);
|
||||
PREP(addSort);
|
||||
PREP(addRightPanelButton);
|
||||
PREP(addSort);
|
||||
PREP(addStat);
|
||||
PREP(addVirtualItems);
|
||||
PREP(attributeAddCompatible);
|
||||
@ -16,9 +17,11 @@ PREP(attributeLoad);
|
||||
PREP(attributeMode);
|
||||
PREP(attributeSelect);
|
||||
PREP(baseWeapon);
|
||||
PREP(buttonActionsPage);
|
||||
PREP(buttonCargo);
|
||||
PREP(buttonClearAll);
|
||||
PREP(buttonExport);
|
||||
PREP(buttonFavorites);
|
||||
PREP(buttonHide);
|
||||
PREP(buttonImport);
|
||||
PREP(buttonLoadoutsDelete);
|
||||
@ -26,15 +29,17 @@ PREP(buttonLoadoutsLoad);
|
||||
PREP(buttonLoadoutsRename);
|
||||
PREP(buttonLoadoutsSave);
|
||||
PREP(buttonLoadoutsShare);
|
||||
PREP(buttonStats);
|
||||
PREP(buttonStatsPage);
|
||||
PREP(canEditDefaultLoadout);
|
||||
PREP(clearSearchbar);
|
||||
PREP(compileActions);
|
||||
PREP(compileSorts);
|
||||
PREP(compileStats);
|
||||
PREP(fillLeftPanel);
|
||||
PREP(fillLoadoutsList);
|
||||
PREP(fillRightPanel);
|
||||
PREP(fillSort);
|
||||
PREP(handleActions);
|
||||
PREP(handleLoadoutsSearchbar);
|
||||
PREP(handleMouse);
|
||||
PREP(handleScrollWheel);
|
||||
@ -51,6 +56,7 @@ PREP(onLoadoutsClose);
|
||||
PREP(onLoadoutsOpen);
|
||||
PREP(onMouseButtonDown);
|
||||
PREP(onMouseButtonUp);
|
||||
PREP(onPanelDblClick);
|
||||
PREP(onSelChangedLeft);
|
||||
PREP(onSelChangedLoadouts);
|
||||
PREP(onSelChangedRight);
|
||||
@ -58,15 +64,21 @@ PREP(onSelChangedRightListnBox);
|
||||
PREP(open3DEN);
|
||||
PREP(openBox);
|
||||
PREP(portVALoadouts);
|
||||
PREP(refresh);
|
||||
PREP(removeAction);
|
||||
PREP(removeBox);
|
||||
PREP(removeDefaultLoadout);
|
||||
PREP(removeSort);
|
||||
PREP(removeStat);
|
||||
PREP(removeVirtualItems);
|
||||
PREP(renameDefaultLoadout);
|
||||
PREP(replaceUniqueItemsLoadout);
|
||||
PREP(scanConfig);
|
||||
PREP(showItem);
|
||||
PREP(sortPanel);
|
||||
PREP(sortStatement_accuracy);
|
||||
PREP(statTextStatement_binoMag);
|
||||
PREP(statTextStatement_binoVisionMode);
|
||||
PREP(sortStatement_amount);
|
||||
PREP(sortStatement_magCount);
|
||||
PREP(sortStatement_mass);
|
||||
@ -80,6 +92,7 @@ PREP(statBarStatement_impact);
|
||||
PREP(statBarStatement_rateOfFIre);
|
||||
PREP(statTextStatement_accuracy);
|
||||
PREP(statTextStatement_explosionTime);
|
||||
PREP(statTextStatement_magCount);
|
||||
PREP(statTextStatement_mass);
|
||||
PREP(statTextStatement_rateOfFire);
|
||||
PREP(statTextStatement_scopeMag);
|
||||
|
@ -14,6 +14,9 @@ GVAR(lastSortDirectionRight) = DESCENDING;
|
||||
|
||||
[QGVAR(initBox), LINKFUNC(initBox)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(removeBox), LINKFUNC(removeBox)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(addDefaultLoadout), LINKFUNC(addDefaultLoadout)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(removeDefaultLoadout), LINKFUNC(removeDefaultLoadout)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(renameDefaultLoadout), LINKFUNC(renameDefaultLoadout)] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(broadcastFace), {
|
||||
params ["_unit", "_face"];
|
||||
|
@ -20,24 +20,14 @@ PREP_RECOMPILE_END;
|
||||
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
|
||||
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
|
||||
|
||||
private _statsButtonCtrl = _display displayCtrl IDC_statsButton;
|
||||
private _statsButtonCloseCtrl = _display displayCtrl IDC_statsButtonClose;
|
||||
|
||||
{
|
||||
_x ctrlShow (GVAR(showStats) && {_showStats});
|
||||
} forEach [
|
||||
_statsCtrlGroupCtrl,
|
||||
_statsPreviousPageCtrl,
|
||||
_statsNextPageCtrl,
|
||||
_statsCurrentPageCtrl,
|
||||
_statsButtonCloseCtrl
|
||||
_statsCurrentPageCtrl
|
||||
];
|
||||
|
||||
_statsButtonCtrl ctrlShow (!GVAR(showStats) && {_showStats})
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(statsButton), {
|
||||
_this call FUNC(buttonStats);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(statsChangePage), {
|
||||
@ -48,9 +38,35 @@ PREP_RECOMPILE_END;
|
||||
_this call FUNC(handleStats);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// Compile sorts and stats
|
||||
call FUNC(compileStats);
|
||||
[QGVAR(actionsChangePage), {
|
||||
_this call FUNC(buttonActionsPage);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(displayActions), {
|
||||
_this call FUNC(handleActions);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(actionsToggle), {
|
||||
params ["_display", "_showActions"];
|
||||
|
||||
private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox;
|
||||
private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage;
|
||||
private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage;
|
||||
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
|
||||
|
||||
{
|
||||
_x ctrlShow (GVAR(showActions) && {_showActions});
|
||||
} forEach [
|
||||
_actionsCtrlGroupCtrl,
|
||||
_actionsPreviousPageCtrl,
|
||||
_actionsNextPageCtrl,
|
||||
_actionsCurrentPageCtrl
|
||||
];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
call FUNC(compileActions);
|
||||
call FUNC(compileSorts);
|
||||
call FUNC(compileStats);
|
||||
|
||||
[QUOTE(ADDON), {!isNil QGVAR(camera)}] call CBA_fnc_registerFeatureCamera;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W))
|
||||
#define WIDTH_GAP (WIDTH_TOTAL / 100)
|
||||
#define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5)
|
||||
#define WIDTH_SINGLE ((WIDTH_TOTAL - 7 * WIDTH_GAP) / 6)
|
||||
|
||||
// IDDs
|
||||
#define IDD_MISSION 46
|
||||
@ -19,6 +19,9 @@
|
||||
#define ASCENDING 0
|
||||
#define DESCENDING 1
|
||||
|
||||
// Favorites
|
||||
#define FAVORITES_COLOR (GVAR(favoritesColor) + [1])
|
||||
|
||||
// IDCs
|
||||
#define IDD_ace_arsenal 1127001
|
||||
#define IDC_mouseArea 0
|
||||
@ -39,6 +42,7 @@
|
||||
#define IDC_buttonLoadouts 1003
|
||||
#define IDC_buttonExport 1004
|
||||
#define IDC_buttonImport 1005
|
||||
#define IDC_buttonFavorites 1006
|
||||
#define IDC_infoBox 11
|
||||
#define IDC_infoBackground 1101
|
||||
#define IDC_infoName 1102
|
||||
@ -142,8 +146,20 @@
|
||||
#define IDC_statsPreviousPage 52
|
||||
#define IDC_statsNextPage 53
|
||||
#define IDC_statsCurrentPage 54
|
||||
#define IDC_statsButton 55
|
||||
#define IDC_statsButtonClose 56
|
||||
#define IDC_actionsBox 90
|
||||
#define IDC_actionsText1 9001
|
||||
#define IDC_actionsButton1 9002
|
||||
#define IDC_actionsText2 9003
|
||||
#define IDC_actionsButton2 9004
|
||||
#define IDC_actionsText3 9005
|
||||
#define IDC_actionsButton3 9006
|
||||
#define IDC_actionsText4 9007
|
||||
#define IDC_actionsButton4 9008
|
||||
#define IDC_actionsText5 9009
|
||||
#define IDC_actionsButton5 9010
|
||||
#define IDC_actionsPreviousPage 91
|
||||
#define IDC_actionsNextPage 92
|
||||
#define IDC_actionsCurrentPage 93
|
||||
|
||||
#define IDD_loadouts_display 1127002
|
||||
#define IDC_centerBox 3
|
||||
|
122
addons/arsenal/functions/fnc_addAction.sqf
Normal file
122
addons/arsenal/functions/fnc_addAction.sqf
Normal file
@ -0,0 +1,122 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: johnb43
|
||||
* Adds custom action buttons.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Tabs to add action to <ARRAY>
|
||||
* 1: Action class (unique string for each action) <STRING>
|
||||
* 2: Title <STRING>
|
||||
* 3: Actions <ARRAY of ARRAYS>
|
||||
* 4: Condition <CODE> (default: {true})
|
||||
* 5: Scope editor <NUMBER> (default: 2)
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Array of IDs <ARRAY of STRINGS>
|
||||
*
|
||||
* Example:
|
||||
* [[0, 5], "TAG_myActions", "My Actions", [
|
||||
* ["text", "Text", {true}, "Text"],
|
||||
* ["statement", "Statement", {true}, "", {[_this select 0] call tag_fnc_myTextStatement}],
|
||||
* ["button", "Button", {true}, "", {}, {_this call tag_fnc_myAction}]
|
||||
* ]] call ace_arsenal_fnc_addAction
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_tabs", [], [[]]],
|
||||
["_rootClass", "", [""]],
|
||||
["_title", "", [""]],
|
||||
["_actions", [], [[]]],
|
||||
["_rootCondition", {true}, [{}]],
|
||||
["_scopeEditor", 2, [0]]
|
||||
];
|
||||
|
||||
// Compile actions from config (in case this is called before preInit)
|
||||
call FUNC(compileActions);
|
||||
|
||||
// Skip if not allowed in editor and in editor
|
||||
if (is3DEN && {_scopeEditor != 2}) exitWith {
|
||||
TRACE_1("Skipping action because in editor", _rootClass);
|
||||
[]
|
||||
};
|
||||
|
||||
// Class can't contain ~, because it's used for formatting result
|
||||
if ("~" in _rootClass) exitWith {
|
||||
TRACE_1("Classname can't contain '~'", _rootClass);
|
||||
[]
|
||||
};
|
||||
|
||||
private _return = [];
|
||||
|
||||
private _fnc_addToGroup = {
|
||||
params ["_group", "_tab"];
|
||||
|
||||
private _type = -1;
|
||||
|
||||
{
|
||||
_x params [["_class", "", [""]], ["_label", "", [""]], ["_condition", {true}, [{}]], ["_text", "", [""]], ["_textStatement", {}, [{}]], ["_statement", {}, [{}]]];
|
||||
|
||||
// Class can't contain ~, because it's used for formatting result
|
||||
if (_class == "" || {"~" in _class}) then {
|
||||
continue;
|
||||
};
|
||||
|
||||
// Don't allow two of the same class
|
||||
if (_group findIf {(_x select 0) == _class} != -1) then {
|
||||
TRACE_1("An action with this ID already exists", _class);
|
||||
continue;
|
||||
};
|
||||
|
||||
_type = switch (false) do {
|
||||
case (_text == ""): {
|
||||
_statement = format ["{""%1""}", _text];
|
||||
ACTION_TYPE_TEXT
|
||||
};
|
||||
case (_textStatement isEqualTo {}): {
|
||||
_statement = _textStatement;
|
||||
ACTION_TYPE_TEXT
|
||||
};
|
||||
case (_statement isEqualTo {}): {
|
||||
_statement = _statement;
|
||||
ACTION_TYPE_BUTTON
|
||||
};
|
||||
default {
|
||||
-1
|
||||
};
|
||||
};
|
||||
|
||||
if (_type == -1) then {
|
||||
continue;
|
||||
};
|
||||
|
||||
_statement = compile format [QUOTE([GVAR(center)] call %1), _statement];
|
||||
|
||||
_group pushBack [_class, _type, _label, _statement, _condition];
|
||||
_return pushBack ([_rootClass, _class, _tab] joinString "~");
|
||||
} forEach _actions;
|
||||
};
|
||||
|
||||
private _tab = [];
|
||||
private _index = -1;
|
||||
private _group = [];
|
||||
|
||||
{
|
||||
_tab = GVAR(actionList) select _x;
|
||||
_index = _tab findIf {(_x select 0) == _rootClass};
|
||||
|
||||
// Add to existing group
|
||||
if (_index != -1) then {
|
||||
[_tab select _index select 3, _x] call _fnc_addToGroup;
|
||||
} else {
|
||||
// Add to new group
|
||||
_group = [];
|
||||
|
||||
[_group, _x] call _fnc_addToGroup;
|
||||
|
||||
_tab pushBack [_rootClass, _title, _rootCondition, _group];
|
||||
};
|
||||
} forEach _tabs;
|
||||
|
||||
_return
|
@ -7,6 +7,7 @@
|
||||
* Arguments:
|
||||
* 0: Name of loadout <STRING>
|
||||
* 1: CBA extended loadout or getUnitLoadout array <ARRAY>
|
||||
* 2: Add globally <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -17,7 +18,11 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_name", "", [""]], ["_loadout", [], [[]]]];
|
||||
params [["_name", "", [""]], ["_loadout", [], [[]]], ["_global", false, [false]]];
|
||||
|
||||
if (_global) then {
|
||||
[QGVAR(addDefaultLoadout), [_name, _loadout]] call CBA_fnc_remoteEvent;
|
||||
};
|
||||
|
||||
private _extendedInfo = createHashMap;
|
||||
|
||||
@ -45,3 +50,7 @@ if (_index != -1) then {
|
||||
// Otherwise just add
|
||||
GVAR(defaultLoadoutsList) pushBack [_name, [_loadout, _extendedInfo]];
|
||||
};
|
||||
|
||||
if (is3DEN) then {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Dedmen, johnb43
|
||||
* Add a listbox row.
|
||||
@ -20,6 +21,26 @@
|
||||
|
||||
params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]]];
|
||||
|
||||
private _skip = GVAR(favoritesOnly) && {!(_className in GVAR(currentItems))} && {!((toLower _className) in GVAR(favorites))};
|
||||
if (_skip) then {
|
||||
switch (GVAR(currentLeftPanel)) do {
|
||||
case IDC_buttonPrimaryWeapon: {
|
||||
_skip = !(_className in (GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS));
|
||||
};
|
||||
case IDC_buttonHandgun: {
|
||||
_skip = !(_className in (GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON_ITEMS));
|
||||
};
|
||||
case IDC_buttonSecondaryWeapon: {
|
||||
_skip = !(_className in (GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS));
|
||||
};
|
||||
case IDC_buttonBinoculars: {
|
||||
_skip = !(_className in (GVAR(currentItems) select IDX_CURR_BINO_ITEMS));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_skip) exitWith {};
|
||||
|
||||
// Sanitise key, as it's public; If not in cache, find info and cache it for later use
|
||||
((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className, {
|
||||
// Get classname (config case), display name, picture and DLC
|
||||
@ -35,3 +56,8 @@ _ctrlPanel lbSetData [_lbAdd, _className];
|
||||
_ctrlPanel lbSetPicture [_lbAdd, _itemPicture];
|
||||
_ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
|
||||
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]];
|
||||
|
||||
if ((toLower _className) in GVAR(favorites)) then {
|
||||
_ctrlPanel lbSetColor [_lbAdd, FAVORITES_COLOR];
|
||||
_ctrlPanel lbSetSelectColor [_lbAdd, FAVORITES_COLOR];
|
||||
};
|
||||
|
@ -5,12 +5,12 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Tabs to add sort to <ARRAY>
|
||||
* 0.0: Left Tab Indexes <ARRAY of NUMBERS>
|
||||
* 0.1: Right Tab Indexes <ARRAY of NUMBERS>
|
||||
* 1: Sort Class (a unique string for each algorithm) <STRING>
|
||||
* - 0: Left Tab Indexes <ARRAY of NUMBERS>
|
||||
* - 1: Right Tab Indexes <ARRAY of NUMBERS>
|
||||
* 1: Sort class (a unique string for each algorithm) <STRING>
|
||||
* 2: Title <STRING>
|
||||
* 3: Algorithm <CODE>
|
||||
* 4: Condition <CODE> (default: true)
|
||||
* 4: Condition <CODE> (default: {true})
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Array of IDs <ARRAY of STRINGS>
|
||||
@ -27,7 +27,7 @@
|
||||
*
|
||||
* _fireRate sort true;
|
||||
* _fireRate param [0, 0]
|
||||
* }] call ace_arsenal_fnc_addSort;
|
||||
* }] call ace_arsenal_fnc_addSort
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
@ -37,8 +37,7 @@ params [
|
||||
["_class", "", [""]],
|
||||
["_title", "", [""]],
|
||||
["_statement", {}, [{}]],
|
||||
["_condition", {true}, [{}]],
|
||||
["_overwrite", false, [false]]
|
||||
["_condition", {true}, [{}]]
|
||||
];
|
||||
|
||||
_tabs params [
|
||||
|
@ -1,22 +1,22 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Alganthe, johnb43
|
||||
* Author: Alganthe, johnb43, LinkIsGrim
|
||||
* Adds a stat to ACE Arsenal.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Tabs to add the stat to <ARRAY of ARRAYS>
|
||||
* 0.0: Left tab indexes <ARRAY of NUMBERS>
|
||||
* 0.1: Right tab indexes <ARRAY of NUMBERS>
|
||||
* - 0: Left tab indexes <ARRAY of NUMBERS>
|
||||
* - 1: Right tab indexes <ARRAY of NUMBERS>
|
||||
* 1: Stat class (unique string for each stat) <STRING>
|
||||
* 2: Config entries to pass <ARRAY of STRINGS>
|
||||
* 3: Title <STRING>
|
||||
* 4: Show bar / show text bools <ARRAY of BOOLS>
|
||||
* 4.0: Show bar <BOOL> (default: false)
|
||||
* 4.1: Show text <BOOL> (default: false)
|
||||
* - 0: Show bar <BOOL> (default: false)
|
||||
* - 1: Show text <BOOL> (default: false)
|
||||
* 5: Array of statements <ARRAY of CODE>
|
||||
* 5.0: Bar code <CODE> (default: {})
|
||||
* 5.1: Text code <CODE> (default: {})
|
||||
* 5.2: Condition code <CODE> (default: {true})
|
||||
* - 0: Bar code <CODE> (default: {})
|
||||
* - 1: Text code <CODE> (default: {})
|
||||
* - 2: Condition code <CODE> (default: {true})
|
||||
* 6: Priority <NUMBER> (default: 0)
|
||||
*
|
||||
* Return Value:
|
||||
@ -76,20 +76,13 @@ private _fnc_addToTabs = {
|
||||
_currentTab = _tabsList select _x;
|
||||
|
||||
// Find if there is an entry with same ID
|
||||
if (_currentTab findIf {_x findIf {_x select 0 == _statName} != -1} != -1) then {
|
||||
if (_currentTab findIf {_x select 5 == _statName} != -1) then {
|
||||
TRACE_1("A stat with this ID already exists", _statName);
|
||||
} else {
|
||||
_stat = +_finalArray;
|
||||
_stat set [0, _statName];
|
||||
_stat set [5, _statName];
|
||||
|
||||
_index = _currentTab findIf {count _x < 5};
|
||||
|
||||
// Add to existing page if there's enough space, otherwise create a new page
|
||||
if (_index != -1) then {
|
||||
(_currentTab select _index) pushBack _stat;
|
||||
} else {
|
||||
_currentTab pushBack [_stat];
|
||||
};
|
||||
_currentTab pushBack _stat;
|
||||
|
||||
_return pushBack _statName;
|
||||
|
||||
@ -99,7 +92,7 @@ private _fnc_addToTabs = {
|
||||
} forEach _tabsToAddTo;
|
||||
};
|
||||
|
||||
private _finalArray = ["", _stats, _title, [_showBar, _showText], [_barStatement, _textStatement, _condition], _priority];
|
||||
private _finalArray = [_priority, _stats, _title, [_showBar, _showText], [_barStatement, _textStatement, _condition], ""];
|
||||
|
||||
if (_leftTabs isNotEqualTo []) then {
|
||||
[GVAR(statsListLeftPanel), _leftTabs, "L"] call _fnc_addToTabs;
|
||||
@ -109,7 +102,6 @@ if (_rightTabs isNotEqualTo []) then {
|
||||
[GVAR(statsListRightPanel), _rightTabs, "R"] call _fnc_addToTabs;
|
||||
};
|
||||
|
||||
private _statsFlat = [];
|
||||
private _stats = [];
|
||||
private _tabToChange = [];
|
||||
|
||||
@ -123,34 +115,10 @@ private _tabToChange = [];
|
||||
GVAR(statsListLeftPanel)
|
||||
};
|
||||
|
||||
_statsFlat = [];
|
||||
_stats = _tabToChange select _tab;
|
||||
|
||||
// Get all stats of a tab into a single array
|
||||
{
|
||||
_statsFlat append _x;
|
||||
} forEach (_tabToChange select _tab);
|
||||
|
||||
// Put priority up front
|
||||
{
|
||||
reverse _x;
|
||||
} forEach _statsFlat;
|
||||
|
||||
// Sort numerically
|
||||
_statsFlat sort false;
|
||||
|
||||
// Put it back at the rear
|
||||
{
|
||||
reverse _x;
|
||||
} forEach _statsFlat;
|
||||
|
||||
_stats = [];
|
||||
|
||||
// Group stats into groups of 5
|
||||
for "_index" from 0 to count _statsFlat - 1 step 5 do {
|
||||
_stats pushBack (_statsFlat select [_index, _index + 5]);
|
||||
};
|
||||
|
||||
_tabToChange set [_tab, _stats];
|
||||
// Sort by priority
|
||||
_stats sort false;
|
||||
} forEach _changes;
|
||||
|
||||
_return
|
||||
|
@ -19,13 +19,20 @@
|
||||
params ["_controlsGroup"];
|
||||
|
||||
private _category = lbCurSel (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_CATEGORY);
|
||||
private _filter = toLower ctrlText (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR);
|
||||
private _filter = ctrlText (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR);
|
||||
private _configItems = uiNamespace getVariable QGVAR(configItems);
|
||||
private _magazineMiscItems = uiNamespace getVariable QGVAR(magazineMiscItems);
|
||||
private _attributeValue = uiNamespace getVariable [QGVAR(attributeValue), [[], 0]];
|
||||
_attributeValue params ["_attributeItems", "_attributeMode"];
|
||||
|
||||
TRACE_3("Populating list",_category,_filter,_attributeValue);
|
||||
if (_filter != "") then {
|
||||
_filter = _filter call EFUNC(common,escapeRegex);
|
||||
_filter = ".*?" + (_filter splitString " " joinString ".*?" + ".*?/io");
|
||||
} else {
|
||||
_filter = ".*?/io";
|
||||
};
|
||||
|
||||
|
||||
private _modeSymbol = [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode;
|
||||
|
||||
@ -59,7 +66,7 @@ if (_category == IDX_CAT_ALL) exitWith {
|
||||
_displayName = getText (_config >> "displayName");
|
||||
|
||||
// Add item if not filtered
|
||||
if (_filter in (toLower _displayName) || {_filter in (toLower _x)}) then {
|
||||
if (_displayName regexMatch _filter || {_x regexMatch _filter}) then {
|
||||
_index = _listbox lnbAddRow ["", _displayName, _modeSymbol];
|
||||
_listbox lnbSetData [[_index, 1], _x];
|
||||
_listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")];
|
||||
@ -111,7 +118,7 @@ private _config = _cfgClass;
|
||||
_displayName = getText (_config >> _x >> "displayName");
|
||||
|
||||
// Add item if not filtered
|
||||
if (_filter in (toLower _displayName) || {_filter in (toLower _x)}) then {
|
||||
if (_displayName regexMatch _filter || {_x regexMatch _filter}) then {
|
||||
// Change symbol and alpha if item already selected
|
||||
if (_x in _attributeItems) then {
|
||||
_symbol = _modeSymbol;
|
||||
|
26
addons/arsenal/functions/fnc_buttonActionsPage.sqf
Normal file
26
addons/arsenal/functions/fnc_buttonActionsPage.sqf
Normal file
@ -0,0 +1,26 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Brett Mayson
|
||||
* Handles the previous / next page buttons for actions
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Arsenal display <DISPLAY>
|
||||
* 1: Actions control <CONTROL>
|
||||
* 2: Previous or next <BOOL> (false = previous, true = next)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display", "_control", "_nextPage"];
|
||||
|
||||
TRACE_1("control enabled", ctrlEnabled _control);
|
||||
if !(ctrlEnabled _control) exitWith {};
|
||||
|
||||
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
|
||||
|
||||
GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"];
|
||||
[QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;
|
32
addons/arsenal/functions/fnc_buttonFavorites.sqf
Normal file
32
addons/arsenal/functions/fnc_buttonFavorites.sqf
Normal file
@ -0,0 +1,32 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Switches the arsenal between displaying all items and favorites
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Arsenal display <DISPLAY>
|
||||
* 1: Button control <CONTROL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display", "_control"];
|
||||
|
||||
private _firstRun = false;
|
||||
|
||||
if (isNil QGVAR(favoritesOnly)) then {
|
||||
GVAR(favoritesOnly) = GVAR(defaultToFavorites);
|
||||
_firstRun = true;
|
||||
} else {
|
||||
GVAR(favoritesOnly) = !GVAR(favoritesOnly);
|
||||
};
|
||||
|
||||
_control ctrlSetText format ["%1: %2", localize "STR_GEAR_ITEMS", localize (["str_word_all", "STR_3DEN_Favorite_textPlural"] select GVAR(favoritesOnly))];
|
||||
|
||||
if (_firstRun) exitWith {};
|
||||
|
||||
[false] call FUNC(refresh);
|
@ -52,11 +52,10 @@ private _ctrl = controlNull;
|
||||
IDC_buttonCurrentMag2,
|
||||
IDC_iconBackgroundCurrentMag,
|
||||
IDC_iconBackgroundCurrentMag2,
|
||||
IDC_statsButton,
|
||||
IDC_statsPreviousPage,
|
||||
IDC_statsNextPage,
|
||||
IDC_statsCurrentPage,
|
||||
IDC_statsButtonClose
|
||||
IDC_statsCurrentPage
|
||||
];
|
||||
|
||||
[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
|
||||
[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
|
||||
|
@ -50,11 +50,8 @@ if (GVAR(shiftState) && {is3DEN}) then {
|
||||
if ((count _extendedLoadout) == 2) then {
|
||||
[GVAR(center), _extendedLoadout] call CBA_fnc_setLoadout;
|
||||
|
||||
// Update current item list
|
||||
call FUNC(updateCurrentItemsList);
|
||||
|
||||
// This takes care of items that aren't available in the arsenal (either wrong tab or arsenal doesn't have it whitelisted)
|
||||
call FUNC(updateUniqueItemsList);
|
||||
// Update current item list and unique items
|
||||
[true] call FUNC(refresh);
|
||||
|
||||
_extendedLoadout params ["_loadout", "_extendedInfo"];
|
||||
|
||||
|
@ -25,10 +25,8 @@ private _loadoutName = _contentPanelCtrl lnbText [_contentPanelCursSel, 1];
|
||||
// If loadout is local or default
|
||||
if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
|
||||
// Find loadout and delete from list
|
||||
if (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts}) then {
|
||||
GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) findIf {(_x select 0) == _loadoutName});
|
||||
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
|
||||
[_loadoutName, !is3DEN] call FUNC(removeDefaultLoadout);
|
||||
} else {
|
||||
private _data = profileNamespace getVariable [QGVAR(saved_loadouts), []];
|
||||
|
||||
|
@ -37,11 +37,8 @@ private _extendedLoadout = switch (GVAR(currentLoadoutsTab)) do {
|
||||
// Apply loadout to unit
|
||||
[GVAR(center), _extendedLoadout, true] call CBA_fnc_setLoadout;
|
||||
|
||||
// Update current item list
|
||||
call FUNC(updateCurrentItemsList);
|
||||
|
||||
// This takes care of items that aren't available in the arsenal (either wrong tab or arsenal doesn't have it whitelisted)
|
||||
call FUNC(updateUniqueItemsList);
|
||||
// Update current item list and unique items
|
||||
[true] call FUNC(refresh);
|
||||
|
||||
_extendedLoadout params ["_loadout", "_extendedInfo"];
|
||||
|
||||
|
@ -29,7 +29,7 @@ private _editBoxContent = ctrlText (_display displayCtrl IDC_textEditBox);
|
||||
// If it's the exact same name, don't do anything
|
||||
if (_editBoxContent isEqualTo _loadoutName) exitWith {};
|
||||
|
||||
private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts});
|
||||
private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (call FUNC(canEditDefaultLoadout) && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts});
|
||||
|
||||
// If there is a loadout with a similar name and it's not chosen to be renamed, don't rename and exit
|
||||
if (_editBoxContent != _loadoutName && {_data findIf {(_x select 0) == _editBoxContent} != -1}) exitWith {
|
||||
@ -42,8 +42,12 @@ private _loadoutIndex = _data findIf {(_x select 0) == _loadoutName};
|
||||
// Set new name
|
||||
(_data select _loadoutIndex) set [0, _editBoxContent];
|
||||
|
||||
if (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts}) then {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
|
||||
if (is3DEN) then {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
} else {
|
||||
[QGVAR(renameDefaultLoadout), [_loadoutName, _editBoxContent]] call CBA_fnc_remoteEvent;
|
||||
};
|
||||
};
|
||||
|
||||
private _currentLoadoutsTab = str GVAR(currentLoadoutsTab);
|
||||
|
@ -49,7 +49,7 @@ private _curSelLoadout = (_contentPanelCtrl getVariable (_loadoutName + str GVAR
|
||||
private _extendedLoadout = GVAR(center) call CBA_fnc_getLoadout;
|
||||
_extendedLoadout params ["_loadout"];
|
||||
|
||||
private _loadouts = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (is3DEN && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts});
|
||||
private _loadouts = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select ((call FUNC(canEditDefaultLoadout)) && {GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts});
|
||||
private _loadoutIndex = _loadouts findIf {(_x select 0) == _editBoxContent};
|
||||
|
||||
// Return what loadout was saved
|
||||
@ -57,16 +57,14 @@ private _savedLoadout = switch (GVAR(currentLoadoutsTab)) do {
|
||||
// Local loadouts tab
|
||||
case IDC_buttonMyLoadouts: {
|
||||
// If saved to default loadout
|
||||
if (GVAR(shiftState) && {is3DEN} && {_loadoutName != ""} && {_curSelRow != -1} && {_loadoutIndex != -1}) then {
|
||||
if (GVAR(shiftState) && FUNC(canEditDefaultLoadout) && {_loadoutName != ""} && {_curSelRow != -1} && {_loadoutIndex != -1}) then {
|
||||
private _defaultLoadoutsSearch = GVAR(defaultLoadoutsList) findIf {(_x select 0) == _loadoutName};
|
||||
|
||||
if (_defaultLoadoutsSearch == -1) then {
|
||||
_loadoutIndex = GVAR(defaultLoadoutsList) pushBack [_loadoutName, _curSelLoadout];
|
||||
} else {
|
||||
GVAR(defaultLoadoutsList) set [_defaultLoadoutsSearch, [_loadoutName, _curSelLoadout]];
|
||||
};
|
||||
[_loadoutName, _curSelLoadout, !is3DEN] call FUNC(addDefaultLoadout);
|
||||
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
if (_defaultLoadoutsSearch == -1) then {
|
||||
_loadoutIndex = (count GVAR(defaultLoadoutsList)) - 1;
|
||||
};
|
||||
|
||||
_curSelLoadout
|
||||
} else {
|
||||
@ -111,19 +109,15 @@ private _savedLoadout = switch (GVAR(currentLoadoutsTab)) do {
|
||||
};
|
||||
// Default loadouts tab
|
||||
case IDC_buttonDefaultLoadouts: {
|
||||
if (is3DEN) then {
|
||||
// Replace unique items with their bases and replace weapons with their base weapons
|
||||
_loadout = [_loadout] call FUNC(replaceUniqueItemsLoadout);
|
||||
if (call FUNC(canEditDefaultLoadout)) then {
|
||||
|
||||
// Add or overwrite loadout in loadout storage
|
||||
[_editBoxContent, _extendedLoadout, !is3DEN] call FUNC(addDefaultLoadout);
|
||||
|
||||
// Get loadout index
|
||||
if (_loadoutIndex == -1) then {
|
||||
_loadoutIndex = GVAR(defaultLoadoutsList) pushBack [_editBoxContent, _extendedLoadout];
|
||||
} else {
|
||||
GVAR(defaultLoadoutsList) set [_loadoutIndex, [_editBoxContent, _extendedLoadout]];
|
||||
_loadoutIndex = (count GVAR(defaultLoadoutsList)) - 1;
|
||||
};
|
||||
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
|
||||
// Refresh loadout list; Delete previous loadout row
|
||||
for "_lbIndex" from 0 to (lnbSize _contentPanelCtrl select 0) - 1 do {
|
||||
if ((_contentPanelCtrl lnbText [_lbIndex, 1]) == _editBoxContent) exitWith {
|
||||
|
@ -1,30 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Toggle the stats control group.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Arsenal display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display"];
|
||||
|
||||
(_display displayCtrl IDC_statsButton) ctrlShow GVAR(showStats);
|
||||
|
||||
GVAR(showStats) = !GVAR(showStats);
|
||||
|
||||
{
|
||||
(_display displayCtrl _x) ctrlShow GVAR(showStats);
|
||||
} forEach [
|
||||
IDC_statsBox,
|
||||
IDC_statsPreviousPage,
|
||||
IDC_statsNextPage,
|
||||
IDC_statsCurrentPage,
|
||||
IDC_statsButtonClose
|
||||
];
|
@ -20,11 +20,8 @@ params ["_display", "_control", "_nextPage"];
|
||||
TRACE_1("control enabled", ctrlEnabled _control);
|
||||
if !(ctrlEnabled _control) exitWith {};
|
||||
|
||||
GVAR(statsInfo) params ["_isLeftPanel", "_statsIndex", "_panelControl", "_curSel", "_itemCfg"];
|
||||
GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage;
|
||||
|
||||
private _pageList = [GVAR(statsPagesRight), GVAR(statsPagesLeft)] select _isLeftPanel;
|
||||
private _newPageNumber = [(_pageList select _statsIndex) - 1, (_pageList select _statsIndex) + 1] select _nextPage;
|
||||
|
||||
_pageList set [_statsIndex, _newPageNumber];
|
||||
GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"];
|
||||
|
||||
[QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;
|
||||
|
16
addons/arsenal/functions/fnc_canEditDefaultLoadout.sqf
Normal file
16
addons/arsenal/functions/fnc_canEditDefaultLoadout.sqf
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Whether the player can save a default loadout in the current mission state
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Can Save <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
is3DEN || EFUNC(common,hasZeusAccess)
|
107
addons/arsenal/functions/fnc_compileActions.sqf
Normal file
107
addons/arsenal/functions/fnc_compileActions.sqf
Normal file
@ -0,0 +1,107 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Brett Mayson
|
||||
* Create the internal actions arrays when needed for the first time.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
if (!isNil QGVAR(actionList)) exitWith {};
|
||||
|
||||
private _actionList = [
|
||||
[], // Primary 0
|
||||
[], // Handgun 1
|
||||
[], // Launcher 2
|
||||
[], // Uniform 3
|
||||
[], // Vests 4
|
||||
[], // Backpacks 5
|
||||
[], // Headgear 6
|
||||
[], // Goggles 7
|
||||
[], // NVGs 8
|
||||
[], // Binoculars 9
|
||||
[], // Map 10
|
||||
[], // GPS 11
|
||||
[], // Radio 12
|
||||
[], // Compass 13
|
||||
[], // Watch 14
|
||||
[], // Face 15
|
||||
[], // Voice 16
|
||||
[] // Insignia 17
|
||||
];
|
||||
|
||||
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
|
||||
|
||||
{
|
||||
private _scopeEditor = getNumber (_x >> "scopeEditor");
|
||||
|
||||
if (is3DEN && {_scopeEditor != 2}) then {continue};
|
||||
|
||||
private _configActions = "true" configClasses _x;
|
||||
|
||||
private _rootClass = configName _x;
|
||||
private _rootDisplayName = getText (_x >> "displayName");
|
||||
private _rootCondition = getText (_x >> "condition");
|
||||
private _rootTabs = getArray (_x >> "tabs");
|
||||
|
||||
if (_rootCondition != "") then {
|
||||
_rootCondition = compile _rootCondition;
|
||||
} else {
|
||||
_rootCondition = {true};
|
||||
};
|
||||
|
||||
private _group = [];
|
||||
|
||||
{
|
||||
private _class = configName _x;
|
||||
private _label = getText (_x >> "label");
|
||||
private _condition = getText (_x >> "condition");
|
||||
private _statement = getText (_x >> "statement");
|
||||
private _text = getText (_x >> "text");
|
||||
private _textStatement = getText (_x >> "textStatement");
|
||||
|
||||
private _type = switch (false) do {
|
||||
case (_text == ""): {
|
||||
_statement = format ["""%1""", _text];
|
||||
ACTION_TYPE_TEXT
|
||||
};
|
||||
case (_textStatement == ""): {
|
||||
_statement = _textStatement;
|
||||
ACTION_TYPE_TEXT
|
||||
};
|
||||
case (_statement == ""): {
|
||||
_statement = _statement;
|
||||
ACTION_TYPE_BUTTON
|
||||
};
|
||||
default {
|
||||
-1
|
||||
};
|
||||
};
|
||||
|
||||
if (_type == -1) then {
|
||||
continue;
|
||||
};
|
||||
|
||||
_statement = compile format [QUOTE([GVAR(center)] call {%1}), _statement];
|
||||
|
||||
if (_condition != "") then {
|
||||
_condition = compile _condition;
|
||||
} else {
|
||||
_condition = {true};
|
||||
};
|
||||
|
||||
// No duplicates are possible here
|
||||
_group pushBack [_class, _type, _label, _statement, _condition];
|
||||
} forEach _configActions;
|
||||
|
||||
{
|
||||
(_actionList select _x) pushBack [_rootClass, _rootDisplayName, _rootCondition, _group];
|
||||
} forEach _rootTabs;
|
||||
} forEach _configGroupEntries;
|
||||
|
||||
GVAR(actionList) = _actionList;
|
@ -63,7 +63,6 @@ private _sortListRightPanel = [
|
||||
[] // Misc 7
|
||||
];
|
||||
|
||||
//------------------------- Config handling
|
||||
private _class = "";
|
||||
private _displayName = "";
|
||||
private _statement = "";
|
||||
|
@ -23,7 +23,7 @@ private _fnc_addToTabs = {
|
||||
{
|
||||
// Make stat name
|
||||
_stat = +_finalArray;
|
||||
_stat set [0, [_class, _tabSide, [str _x, format ["0%1", _x]] select (_x < 10)] joinString ""];
|
||||
_stat set [5, [_class, _tabSide, [str _x, format ["0%1", _x]] select (_x < 10)] joinString ""];
|
||||
|
||||
(_tabsList select _x) pushBack _stat;
|
||||
} forEach _tabsToAddTo;
|
||||
@ -31,39 +31,12 @@ private _fnc_addToTabs = {
|
||||
|
||||
// Sort by priority
|
||||
private _fnc_sortLists = {
|
||||
params ["_tabsList"];
|
||||
params ["_tabs"];
|
||||
|
||||
{
|
||||
// Put priority up front
|
||||
{
|
||||
reverse _x;
|
||||
} forEach _x;
|
||||
|
||||
// Sort numerically
|
||||
_x sort false;
|
||||
|
||||
// Put it back at the rear
|
||||
{
|
||||
reverse _x;
|
||||
} forEach _x;
|
||||
} forEach _tabsList;
|
||||
};
|
||||
|
||||
// Group stats into groups of 5
|
||||
private _fnc_toStatsArray = {
|
||||
params ["_tabsList", "_tabsListAll"];
|
||||
|
||||
private _stats = [];
|
||||
|
||||
{
|
||||
_stats = [];
|
||||
|
||||
for "_index" from 0 to count _x - 1 step 5 do {
|
||||
_stats pushBack (_x select [_index, _index + 5]);
|
||||
};
|
||||
|
||||
_tabsList set [_forEachIndex, _stats];
|
||||
} forEach _tabsList;
|
||||
} forEach _tabs;
|
||||
};
|
||||
|
||||
private _statsListLeftPanel = [
|
||||
@ -95,7 +68,6 @@ private _statsListRightPanel = [
|
||||
[] // Misc 7
|
||||
];
|
||||
|
||||
//------------------------- Config handling
|
||||
private _finalArray = [];
|
||||
private _class = "";
|
||||
private _stats = [];
|
||||
@ -119,7 +91,7 @@ private _priority = 0;
|
||||
_condition = compile _condition;
|
||||
};
|
||||
|
||||
_finalArray = ["", _stats, _displayName, [_showBar, _showText], [{}, {}, _condition], _priority];
|
||||
_finalArray = [_priority, _stats, _displayName, [_showBar, _showText], [{}, {}, _condition], ""];
|
||||
|
||||
if (_showBar) then {
|
||||
(_finalArray select 4) set [0, compile (getText (_x >> "barStatement"))];
|
||||
@ -144,10 +116,5 @@ private _priority = 0;
|
||||
[_statsListLeftPanel] call _fnc_sortLists;
|
||||
[_statsListRightPanel] call _fnc_sortLists;
|
||||
|
||||
// Group into 5 stats
|
||||
[_statsListLeftPanel] call _fnc_toStatsArray;
|
||||
[_statsListRightPanel] call _fnc_toStatsArray;
|
||||
|
||||
//------------------------- Config Handling
|
||||
GVAR(statsListLeftPanel) = _statsListLeftPanel;
|
||||
GVAR(statsListRightPanel) = _statsListRightPanel;
|
||||
|
@ -43,9 +43,13 @@ private _cfgMagazines = configFile >> "CfgMagazines";
|
||||
private _cfgWeapons = configFile >> "CfgWeapons";
|
||||
private _rightPanelCache = uiNamespace getVariable QGVAR(rightPanelCache);
|
||||
|
||||
private _currentCargo = itemsWithMagazines GVAR(center);
|
||||
|
||||
private _fnc_fillRightContainer = {
|
||||
params ["_configCategory", "_className", "_hasItemInfo", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]];
|
||||
|
||||
if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLower _className) in GVAR(favorites))}) exitWith {};
|
||||
|
||||
// If item is not in the arsenal, it must be unique
|
||||
if (!_isUnique && {!(_className in GVAR(virtualItemsFlat))}) then {
|
||||
_isUnique = true;
|
||||
@ -94,11 +98,16 @@ private _fnc_fillRightContainer = {
|
||||
}, true]) params ["_displayName", "_picture", "_mass"];
|
||||
|
||||
private _lbAdd = _ctrlPanel lnbAddRow ["", _displayName, "0"];
|
||||
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
|
||||
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
|
||||
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
|
||||
_ctrlPanel lnbSetValue [[_lbAdd, 0], _mass];
|
||||
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
|
||||
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
|
||||
if ((toLower _className) in GVAR(favorites)) then {
|
||||
_ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR];
|
||||
_ctrlPanel lnbSetColorRight [[_lbAdd, 1], FAVORITES_COLOR];
|
||||
};
|
||||
};
|
||||
|
||||
private _ctrlPanel = _display displayCtrl IDC_rightTabContent;
|
||||
|
148
addons/arsenal/functions/fnc_handleActions.sqf
Normal file
148
addons/arsenal/functions/fnc_handleActions.sqf
Normal file
@ -0,0 +1,148 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Brett Mayson
|
||||
* Handles the actions control group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Arsenal display <DISPLAY>
|
||||
* 1: Current panel control <CONTROL>
|
||||
* 2: Current panel selection <SCALAR>
|
||||
* 3: Item config entry <CONFIG>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display", "_control", "_curSel", "_itemCfg"];
|
||||
|
||||
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
|
||||
|
||||
private _panel = [
|
||||
IDC_buttonPrimaryWeapon,
|
||||
IDC_buttonHandgun,
|
||||
IDC_buttonSecondaryWeapon,
|
||||
IDC_buttonUniform,
|
||||
IDC_buttonVest,
|
||||
IDC_buttonBackpack,
|
||||
IDC_buttonHeadgear,
|
||||
IDC_buttonGoggles,
|
||||
IDC_buttonNVG,
|
||||
IDC_buttonBinoculars,
|
||||
IDC_buttonMap,
|
||||
IDC_buttonGPS,
|
||||
IDC_buttonRadio,
|
||||
IDC_buttonCompass,
|
||||
IDC_buttonWatch,
|
||||
IDC_buttonFace,
|
||||
IDC_buttonVoice,
|
||||
IDC_buttonInsignia
|
||||
] find GVAR(currentLeftPanel);
|
||||
|
||||
private _groups = (GVAR(actionList) select _panel) select {
|
||||
[GVAR(center)] call (_x select 2)
|
||||
};
|
||||
|
||||
private _show = _groups isNotEqualTo [];
|
||||
private _ctrl = _display displayCtrl IDC_actionsBox;
|
||||
_ctrl ctrlShow _show;
|
||||
_ctrl ctrlCommit 0.15;
|
||||
|
||||
if (!_show) exitWith {};
|
||||
|
||||
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
|
||||
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
|
||||
|
||||
private _currentPage = GVAR(currentActionPage);
|
||||
private _pages = count _groups;
|
||||
|
||||
if (_currentPage < 0) then {
|
||||
_currentPage = _pages - 1;
|
||||
};
|
||||
|
||||
if (_currentPage >= _pages) then {
|
||||
_currentPage = 0;
|
||||
GVAR(currentActionPage) = _currentPage;
|
||||
};
|
||||
|
||||
{
|
||||
private _ctrl = _display displayCtrl _x;
|
||||
_ctrl ctrlShow (_pages > 1);
|
||||
_ctrl ctrlCommit 0;
|
||||
} forEach [IDC_actionsPreviousPage, IDC_actionsNextPage];
|
||||
|
||||
private _group = _groups select _currentPage;
|
||||
private _items = _group select 3 select {
|
||||
[GVAR(center)] call (_x select 4)
|
||||
};
|
||||
|
||||
_actionsCurrentPageCtrl ctrlSetText (_group select 1);
|
||||
_actionsCurrentPageCtrl ctrlSetFade 0;
|
||||
_actionsCurrentPageCtrl ctrlShow true;
|
||||
_actionsCurrentPageCtrl ctrlCommit 0;
|
||||
|
||||
{
|
||||
_x params ["", "_type", "_label", "_statement"];
|
||||
|
||||
private _idc = 9001 + _forEachIndex * 2;
|
||||
private _actionTextCtrl = _display displayCtrl _idc;
|
||||
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
|
||||
|
||||
switch (_type) do {
|
||||
case ACTION_TYPE_BUTTON: {
|
||||
_actionButtonCtrl ctrlRemoveAllEventHandlers "ButtonClick";
|
||||
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", {
|
||||
if (is3DEN) exitWith {[true] call FUNC(refresh)};
|
||||
[{
|
||||
[true] call FUNC(refresh);
|
||||
}] call CBA_fnc_execNextFrame;
|
||||
}];
|
||||
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement];
|
||||
_actionButtonCtrl ctrlSetText _label;
|
||||
_actionButtonCtrl ctrlSetFade 0;
|
||||
_actionButtonCtrl ctrlEnable true;
|
||||
_actionButtonCtrl ctrlCommit 0;
|
||||
_actionTextCtrl ctrlSetFade 1;
|
||||
_actionTextCtrl ctrlCommit 0;
|
||||
};
|
||||
case ACTION_TYPE_TEXT: {
|
||||
private _text = call _statement;
|
||||
|
||||
if (isNil "_text") then {
|
||||
_text = "";
|
||||
};
|
||||
|
||||
_actionTextCtrl ctrlSetText _text;
|
||||
_actionTextCtrl ctrlSetFade 0;
|
||||
_actionTextCtrl ctrlCommit 0;
|
||||
_actionButtonCtrl ctrlSetFade 1;
|
||||
_actionButtonCtrl ctrlCommit 0;
|
||||
};
|
||||
default {
|
||||
_actionTextCtrl ctrlSetFade 1;
|
||||
_actionTextCtrl ctrlCommit 0;
|
||||
_actionButtonCtrl ctrlSetFade 1;
|
||||
_actionButtonCtrl ctrlCommit 0;
|
||||
};
|
||||
};
|
||||
} forEach _items;
|
||||
|
||||
private _actionCount = count _items;
|
||||
|
||||
{
|
||||
private _idc = 9001 + _x * 2;
|
||||
private _actionTextCtrl = _display displayCtrl _idc;
|
||||
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
|
||||
|
||||
_actionTextCtrl ctrlSetFade 1;
|
||||
_actionTextCtrl ctrlCommit 0;
|
||||
_actionButtonCtrl ctrlSetFade 1;
|
||||
_actionButtonCtrl ctrlCommit 0;
|
||||
} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]);
|
||||
|
||||
private _pos = ctrlPosition _actionsBoxCtrl;
|
||||
_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H];
|
||||
_actionsBoxCtrl ctrlSetPosition _pos;
|
||||
_actionsBoxCtrl ctrlCommit 0;
|
@ -8,9 +8,9 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Arguments <ARRAY>
|
||||
* 1.0: Mouse area control <CONTROL>
|
||||
* 1.1: Mouse X position <NUMBER>
|
||||
* 1.2: Mouse Y position <NUMBER>
|
||||
* - 0: Mouse area control <CONTROL>
|
||||
* - 1: Mouse X position <NUMBER>
|
||||
* - 2: Mouse Y position <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: onMouseZChanged EH return <ARRAY>
|
||||
* 1.0: Not used
|
||||
* 1.1: Mousewheel Z position <NUMBER>
|
||||
* - 0: Not used
|
||||
* - 1: Mousewheel Z position <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
@ -17,11 +17,15 @@
|
||||
params ["_display", "_control"];
|
||||
|
||||
private _searchString = ctrlText _control;
|
||||
if (_searchString != "") then {
|
||||
_searchString = _searchString call EFUNC(common,escapeRegex);
|
||||
_searchString = ".*?" + (_searchString splitString " " joinString ".*?") + ".*?/io";
|
||||
};
|
||||
|
||||
// Right panel search bar
|
||||
if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
// Don't refill if there is no need
|
||||
if (GVAR(lastSearchTextRight) != "" && {(_searchString find GVAR(lastSearchTextRight)) != 0}) then {
|
||||
if (GVAR(lastSearchTextRight) != "" && {GVAR(lastSearchTextRight) isNotEqualTo _searchString}) then {
|
||||
[_display, _display displayCtrl GVAR(currentRightPanel)] call FUNC(fillRightPanel);
|
||||
};
|
||||
|
||||
@ -33,8 +37,6 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
private _rightPanelState = GVAR(currentLeftPanel) in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon, IDC_buttonBinoculars];
|
||||
private _rightPanelCtrl = [_display displayCtrl IDC_rightTabContentListnBox, _display displayCtrl IDC_rightTabContent] select _rightPanelState;
|
||||
|
||||
_searchString = toLower _searchString;
|
||||
|
||||
// If right panel selection is weapons or binoculars
|
||||
if (_rightPanelState) then {
|
||||
// Get the currently selected item in panel
|
||||
@ -51,11 +53,11 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
|
||||
// Go through all items in panel and see if they need to be deleted or not
|
||||
for "_lbIndex" from (lbSize _rightPanelCtrl) - 1 to 0 step -1 do {
|
||||
_currentDisplayName = toLower (_rightPanelCtrl lbText _lbIndex);
|
||||
_currentClassname = toLower (_rightPanelCtrl lbData _lbIndex);
|
||||
_currentDisplayName = _rightPanelCtrl lbText _lbIndex;
|
||||
_currentClassname = _rightPanelCtrl lbData _lbIndex;
|
||||
|
||||
// Remove item in panel if it doesn't match search, skip otherwise
|
||||
if ((_currentDisplayName == "") || {!(_searchString in _currentDisplayName) && {!(_searchString in _currentClassname)}}) then {
|
||||
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
|
||||
_rightPanelCtrl lbDelete _lbIndex;
|
||||
};
|
||||
};
|
||||
@ -91,11 +93,11 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
|
||||
// Go through all items in panel and see if they need to be deleted or not
|
||||
for "_lbIndex" from (lnbSize _rightPanelCtrl select 0) - 1 to 0 step -1 do {
|
||||
_currentDisplayName = toLower (_rightPanelCtrl lnbText [_lbIndex, 1]);
|
||||
_currentClassname = toLower (_rightPanelCtrl lnbData [_lbIndex, 0]);
|
||||
_currentDisplayName = _rightPanelCtrl lnbText [_lbIndex, 1];
|
||||
_currentClassname = _rightPanelCtrl lnbData [_lbIndex, 0];
|
||||
|
||||
// Remove item in panel if it doesn't match search, skip otherwise
|
||||
if ((_currentDisplayName == "") || {!(_searchString in _currentDisplayName) && {!(_searchString in _currentClassname)}}) then {
|
||||
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
|
||||
_rightPanelCtrl lnbDeleteRow _lbIndex;
|
||||
};
|
||||
};
|
||||
@ -122,7 +124,7 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
} else {
|
||||
// Left panel search bar
|
||||
// Don't refill if there is no need
|
||||
if (GVAR(lastSearchTextLeft) != "" && {(_searchString find GVAR(lastSearchTextLeft)) != 0}) then {
|
||||
if (GVAR(lastSearchTextLeft) != "" && {GVAR(lastSearchTextLeft) isNotEqualTo _searchString}) then {
|
||||
[_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel);
|
||||
};
|
||||
|
||||
@ -133,8 +135,6 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
|
||||
private _leftPanelCtrl = _display displayCtrl IDC_leftTabContent;
|
||||
|
||||
_searchString = toLower _searchString;
|
||||
|
||||
// Get the currently selected item in panel
|
||||
private _selectedItemIndex = lbCurSel _leftPanelCtrl;
|
||||
private _selectedItem = "";
|
||||
@ -149,11 +149,11 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
|
||||
|
||||
// Go through all items in panel and see if they need to be deleted or not
|
||||
for "_lbIndex" from (lbSize _leftPanelCtrl) - 1 to 0 step -1 do {
|
||||
_currentDisplayName = toLower (_leftPanelCtrl lbText _lbIndex);
|
||||
_currentClassname = toLower (_leftPanelCtrl lbData _lbIndex);
|
||||
_currentDisplayName = _leftPanelCtrl lbText _lbIndex;
|
||||
_currentClassname = _leftPanelCtrl lbData _lbIndex;
|
||||
|
||||
// Remove item in panel if it doesn't match search, skip otherwise
|
||||
if ((_currentDisplayName == "") || {!(_searchString in _currentDisplayName) && {!(_searchString in _currentClassname)}}) then {
|
||||
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchString) && {!(_currentClassname regexMatch _searchString)}}) then {
|
||||
_leftPanelCtrl lbDelete _lbIndex;
|
||||
};
|
||||
};
|
||||
|
@ -16,20 +16,21 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display", "_control", "_curSel", "_itemCfg"];
|
||||
params ["_display", "_control", "_curSel", ["_itemCfg", configNull]];
|
||||
|
||||
private _statsBoxCtrl = _display displayCtrl IDC_statsBox;
|
||||
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
|
||||
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
|
||||
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
|
||||
|
||||
private _hideUnusedFnc = {
|
||||
params ["_numbers"];
|
||||
private _fnc_hideUnused = {
|
||||
params ["_count"];
|
||||
|
||||
{
|
||||
private _statsTitleCtrl = _display displayCtrl (IDC_statsTitle1 + ((_x - 1) * 4));
|
||||
private _statsTitleIDC = ctrlIDC _statsTitleCtrl;
|
||||
if (_count <= 0) exitWith {};
|
||||
for "_i" from 0 to (_count - 1) do {
|
||||
private _statsTitleIDC = IDC_statsTitle5 - (_i * 4);
|
||||
|
||||
private _statsTitleCtrl = _display displayCtrl _statsTitleIDC;
|
||||
private _statsBackgroundCtrl = _display displayCtrl (_statsTitleIDC + 1);
|
||||
private _statsBarCtrl = _display displayCtrl (_statsTitleIDC + 2);
|
||||
private _statsTextCtrl = _display displayCtrl (_statsTitleIDC + 3);
|
||||
@ -43,204 +44,28 @@ private _hideUnusedFnc = {
|
||||
_statsBarCtrl,
|
||||
_statsTextCtrl
|
||||
];
|
||||
} forEach _numbers;
|
||||
};
|
||||
};
|
||||
|
||||
if (!isNil "_itemCfg") then {
|
||||
private _handleStatsFnc = {
|
||||
params ["_statsIndex", "_leftPanel"];
|
||||
private _fnc_hideEverything = {
|
||||
5 call _fnc_hideUnused;
|
||||
|
||||
// Get the proper list and page
|
||||
if (_leftPanel) then {
|
||||
[(GVAR(statsListLeftPanel)) select _statsIndex, GVAR(statsPagesLeft) select _statsIndex]
|
||||
} else {
|
||||
[(GVAR(statsListRightPanel)) select _statsIndex, GVAR(statsPagesRight) select _statsIndex]
|
||||
} params ["_statsArray", "_currentPage"];
|
||||
|
||||
private _statsList = _statsArray select _currentPage;
|
||||
private _statsCount = 0;
|
||||
|
||||
// Handle titles, bars and text
|
||||
_statsList = _statsList select [0, 5];
|
||||
|
||||
if (_statsList isNotEqualTo []) then {
|
||||
private _statsTitleCtrl = controlNull;
|
||||
private _statsTitleIDC = -1;
|
||||
private _statsBackgroundCtrl = controlNull;
|
||||
private _statsBarCtrl = controlNull;
|
||||
private _statsTextCtrl = controlNull;
|
||||
private _textStatementResult = "";
|
||||
|
||||
{
|
||||
_x params ["_ID", "_configEntry", "_title", "_bools", "_statements"];
|
||||
_bools params ["_showBar", "_showText"];
|
||||
_statements params [["_barStatement", {}, [{}]], ["_textStatement", {}, [{}]], ["_condition", {true}, [{}]]];
|
||||
|
||||
_statsTitleCtrl = _display displayCtrl (IDC_statsTitle1 + _forEachIndex * 4);
|
||||
_statsTitleIDC = ctrlIDC _statsTitleCtrl;
|
||||
_statsBackgroundCtrl = _display displayCtrl (_statsTitleIDC + 1);
|
||||
_statsBarCtrl = _display displayCtrl (_statsTitleIDC + 2);
|
||||
_statsTextCtrl = _display displayCtrl (_statsTitleIDC + 3);
|
||||
|
||||
_statsCount = _statsCount + 1;
|
||||
_statsTitleCtrl ctrlSetText _title;
|
||||
_statsTitleCtrl ctrlSetFade 0;
|
||||
|
||||
// Handle bars
|
||||
if (_showBar) then {
|
||||
_statsBarCtrl progressSetPosition ([_configEntry, _itemCfg] call _barStatement);
|
||||
_statsBackgroundCtrl ctrlSetFade 0;
|
||||
_statsBarCtrl ctrlSetFade 0;
|
||||
} else {
|
||||
_statsBackgroundCtrl ctrlSetFade 1;
|
||||
_statsBarCtrl ctrlSetFade 1;
|
||||
};
|
||||
|
||||
// Handle text entries
|
||||
if (_showText) then {
|
||||
_textStatementResult = [_configEntry, _itemCfg] call _textStatement;
|
||||
|
||||
if !(_textStatementResult isEqualtype "") then {
|
||||
_textStatementResult = str _textStatementResult;
|
||||
};
|
||||
|
||||
_statsTextCtrl ctrlSetText _textStatementResult;
|
||||
_statsTextCtrl ctrlSetTextColor ([[1, 1, 1, 1], [0, 0, 0, 1]] select (_showBar));
|
||||
_statsTextCtrl ctrlSetFade 0;
|
||||
} else {
|
||||
_statsTextCtrl ctrlSetFade 1;
|
||||
};
|
||||
|
||||
{
|
||||
_x ctrlCommit 0;
|
||||
} forEach [
|
||||
_statsTitleCtrl,
|
||||
_statsBackgroundCtrl,
|
||||
_statsBarCtrl,
|
||||
_statsTextCtrl
|
||||
];
|
||||
} forEach (_statsList select {
|
||||
_x params ["", "_configEntry", "", "", "_statements"];
|
||||
_statements params ["", "", ["_condition", {true}, [{}]]];
|
||||
|
||||
([_configEntry, _itemCfg] call _condition)
|
||||
});
|
||||
};
|
||||
|
||||
// Resize the window
|
||||
[[1, 2, 3, 4, 5] select [_statsCount, 5]] call _hideUnusedFnc;
|
||||
_statsBoxCtrl ctrlSetPosition [
|
||||
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
|
||||
safezoneY + 1.8 * GRID_H,
|
||||
47 * GRID_W,
|
||||
([11, (10 * _statsCount) + 5] select (_statsCount > 0)) * GRID_H
|
||||
];
|
||||
_statsBoxCtrl ctrlCommit 0;
|
||||
|
||||
GVAR(statsInfo) = [_leftPanel, _statsIndex, _control, _curSel, _itemCfg];
|
||||
|
||||
// Toggle page buttons
|
||||
_statsPreviousPageCtrl ctrlEnable (_currentPage > 0);
|
||||
_statsNextPageCtrl ctrlEnable (_currentPage + 1 < count _statsArray);
|
||||
_statsCurrentPageCtrl ctrlSetText ([LLSTRING(page), str (_currentPage + 1)] joinString " ");
|
||||
|
||||
{
|
||||
_x ctrlSetFade 0;
|
||||
_x ctrlCommit 0;
|
||||
} forEach [
|
||||
_statsPreviousPageCtrl,
|
||||
_statsNextPageCtrl,
|
||||
_statsCurrentPageCtrl
|
||||
];
|
||||
};
|
||||
|
||||
// Check if in left or right panel
|
||||
if (ctrlIDC _control == IDC_leftTabContent) then {
|
||||
// Faces, voices and insigna do not have stats
|
||||
if ([IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsignia] find GVAR(currentLeftPanel) > -1) then {
|
||||
[[1, 2, 3, 4, 5]] call _hideUnusedFnc;
|
||||
_statsBoxCtrl ctrlSetPosition [
|
||||
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
|
||||
safezoneY + 1.8 * GRID_H,
|
||||
47 * GRID_W,
|
||||
11 * GRID_H
|
||||
];
|
||||
_statsBoxCtrl ctrlCommit 0;
|
||||
|
||||
{
|
||||
_x ctrlSetFade 1;
|
||||
_x ctrlCommit 0;
|
||||
} forEach [
|
||||
_statsPreviousPageCtrl,
|
||||
_statsNextPageCtrl,
|
||||
_statsCurrentPageCtrl
|
||||
];
|
||||
} else {
|
||||
[[
|
||||
IDC_buttonPrimaryWeapon,
|
||||
IDC_buttonHandgun,
|
||||
IDC_buttonSecondaryWeapon,
|
||||
IDC_buttonUniform,
|
||||
IDC_buttonVest,
|
||||
IDC_buttonBackpack,
|
||||
IDC_buttonHeadgear,
|
||||
IDC_buttonGoggles,
|
||||
IDC_buttonNVG,
|
||||
IDC_buttonBinoculars,
|
||||
IDC_buttonMap,
|
||||
IDC_buttonGPS,
|
||||
IDC_buttonRadio,
|
||||
IDC_buttonCompass,
|
||||
IDC_buttonWatch
|
||||
] find GVAR(currentLeftPanel), true] call _handleStatsFnc;
|
||||
};
|
||||
} else {
|
||||
switch (GVAR(currentRightPanel)) do {
|
||||
case IDC_buttonOptic: {
|
||||
[0, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonItemAcc: {
|
||||
[1, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonMuzzle: {
|
||||
[2, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonBipod: {
|
||||
[3, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonCurrentMag;
|
||||
case IDC_buttonCurrentMag2;
|
||||
case IDC_buttonMag;
|
||||
case IDC_buttonMagALL: {
|
||||
[4, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonThrow: {
|
||||
[5, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonPut: {
|
||||
[6, false] call _handleStatsFnc;
|
||||
};
|
||||
case IDC_buttonMisc: {
|
||||
[7, false] call _handleStatsFnc;
|
||||
};
|
||||
default {
|
||||
if (GVAR(currentRightPanel) in [RIGHT_PANEL_CUSTOM_BUTTONS]) then {
|
||||
[7, false] call _handleStatsFnc;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// If nothing is chosen, hide stats
|
||||
[[1, 2, 3, 4, 5]] call _hideUnusedFnc;
|
||||
// Hide the stats box
|
||||
_statsBoxCtrl ctrlSetPosition [
|
||||
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
|
||||
safezoneY + 1.8 * GRID_H,
|
||||
47 * GRID_W,
|
||||
11 * GRID_H
|
||||
0,
|
||||
0
|
||||
];
|
||||
_statsBoxCtrl ctrlCommit 0;
|
||||
|
||||
// Move action display
|
||||
private _ctrl = _display displayCtrl IDC_actionsBox;
|
||||
private _pos = ctrlPosition _ctrl;
|
||||
_pos set [1, safezoneY + 1.8 * GRID_H];
|
||||
_ctrl ctrlSetPosition _pos;
|
||||
_ctrl ctrlCommit 0;
|
||||
|
||||
{
|
||||
_x ctrlSetFade 1;
|
||||
_x ctrlCommit 0;
|
||||
@ -250,3 +75,187 @@ if (!isNil "_itemCfg") then {
|
||||
_statsCurrentPageCtrl
|
||||
];
|
||||
};
|
||||
|
||||
// If nothing is chosen, hide stats
|
||||
if (isNull _itemCfg) exitWith {
|
||||
call _fnc_hideEverything
|
||||
};
|
||||
|
||||
private _fnc_handleStats = {
|
||||
params ["_statsIndex", "_leftPanel"];
|
||||
|
||||
private _statsPanel = [GVAR(statsListRightPanel), GVAR(statsListLeftPanel)] select _leftPanel;
|
||||
|
||||
// Get all viable stats for this tab
|
||||
private _statsTab = _statsPanel select _statsIndex select {
|
||||
_x params ["", "_configEntry", "", "", "_statements"];
|
||||
_statements params ["", "", ["_condition", {true}, [{}]]];
|
||||
|
||||
([_configEntry, _itemCfg] call _condition)
|
||||
};
|
||||
|
||||
// If there are no stats to show (unlikely), just hide everything
|
||||
if (_statsTab isEqualTo []) exitWith {
|
||||
call _fnc_hideEverything
|
||||
};
|
||||
|
||||
GVAR(currentStatPage) = GVAR(currentStatPage) min floor ((count _statsTab) / 5);
|
||||
private _statsToDisplay = _statsTab select [GVAR(currentStatPage) * 5, 5];
|
||||
|
||||
|
||||
private _statsCount = 0;
|
||||
|
||||
private _statsTitleCtrl = controlNull;
|
||||
private _statsTitleIDC = -1;
|
||||
private _statsBackgroundCtrl = controlNull;
|
||||
private _statsBarCtrl = controlNull;
|
||||
private _statsTextCtrl = controlNull;
|
||||
private _textStatementResult = "";
|
||||
|
||||
{
|
||||
_x params ["", "_configEntry", "_title", "_bools", "_statements"];
|
||||
_bools params ["_showBar", "_showText"];
|
||||
_statements params [["_barStatement", {}, [{}]], ["_textStatement", {}, [{}]], ["_condition", {true}, [{}]]];
|
||||
|
||||
_statsTitleCtrl = _display displayCtrl (IDC_statsTitle1 + _forEachIndex * 4);
|
||||
_statsTitleIDC = ctrlIDC _statsTitleCtrl;
|
||||
_statsBackgroundCtrl = _display displayCtrl (_statsTitleIDC + 1);
|
||||
_statsBarCtrl = _display displayCtrl (_statsTitleIDC + 2);
|
||||
_statsTextCtrl = _display displayCtrl (_statsTitleIDC + 3);
|
||||
|
||||
_statsCount = _statsCount + 1;
|
||||
_statsTitleCtrl ctrlSetText _title;
|
||||
_statsTitleCtrl ctrlSetFade 0;
|
||||
|
||||
// Handle bars
|
||||
if (_showBar) then {
|
||||
_statsBarCtrl progressSetPosition ([_configEntry, _itemCfg] call _barStatement);
|
||||
_statsBackgroundCtrl ctrlSetFade 0;
|
||||
_statsBarCtrl ctrlSetFade 0;
|
||||
} else {
|
||||
_statsBackgroundCtrl ctrlSetFade 1;
|
||||
_statsBarCtrl ctrlSetFade 1;
|
||||
};
|
||||
|
||||
// Handle text entries
|
||||
if (_showText) then {
|
||||
_textStatementResult = [_configEntry, _itemCfg] call _textStatement;
|
||||
|
||||
if !(_textStatementResult isEqualtype "") then {
|
||||
_textStatementResult = str _textStatementResult;
|
||||
};
|
||||
|
||||
_statsTextCtrl ctrlSetText _textStatementResult;
|
||||
_statsTextCtrl ctrlSetTextColor ([[1, 1, 1, 1], [0, 0, 0, 1]] select (_showBar));
|
||||
_statsTextCtrl ctrlSetFade 0;
|
||||
} else {
|
||||
_statsTextCtrl ctrlSetFade 1;
|
||||
};
|
||||
|
||||
{
|
||||
_x ctrlCommit 0;
|
||||
} forEach [
|
||||
_statsTitleCtrl,
|
||||
_statsBackgroundCtrl,
|
||||
_statsBarCtrl,
|
||||
_statsTextCtrl
|
||||
];
|
||||
} forEach _statsToDisplay;
|
||||
|
||||
|
||||
// Resize the window
|
||||
(5 - _statsCount) call _fnc_hideUnused;
|
||||
private _height = 10 * _statsCount + 5;
|
||||
_statsBoxCtrl ctrlSetPosition [
|
||||
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
|
||||
safezoneY + 1.8 * GRID_H,
|
||||
47 * GRID_W,
|
||||
_height * GRID_H
|
||||
];
|
||||
_statsBoxCtrl ctrlCommit 0;
|
||||
|
||||
// Move the actions box
|
||||
private _ctrl = _display displayCtrl IDC_actionsBox;
|
||||
private _pos = ctrlPosition _ctrl;
|
||||
_pos set [1, safezoneY + (_height + 3.6) * GRID_H];
|
||||
_ctrl ctrlSetPosition _pos;
|
||||
_ctrl ctrlCommit 0;
|
||||
|
||||
|
||||
GVAR(statsInfo) = [_leftPanel, _control, _curSel, _itemCfg];
|
||||
|
||||
// Toggle page buttons
|
||||
_statsPreviousPageCtrl ctrlEnable (GVAR(currentStatPage) > 0);
|
||||
_statsNextPageCtrl ctrlEnable ((GVAR(currentStatPage) + 1) * 5 < count _statsTab);
|
||||
_statsCurrentPageCtrl ctrlSetText ([LLSTRING(page), str (GVAR(currentStatPage) + 1)] joinString " ");
|
||||
|
||||
{
|
||||
_x ctrlSetFade 0;
|
||||
_x ctrlCommit 0;
|
||||
} forEach [
|
||||
_statsPreviousPageCtrl,
|
||||
_statsNextPageCtrl,
|
||||
_statsCurrentPageCtrl
|
||||
];
|
||||
};
|
||||
|
||||
// Check if in left or right panel
|
||||
if (ctrlIDC _control == IDC_leftTabContent) then {
|
||||
// Faces, voices and insigna do not have stats
|
||||
if ([IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsignia] find GVAR(currentLeftPanel) > -1) then {
|
||||
call _fnc_hideEverything;
|
||||
} else {
|
||||
[[
|
||||
IDC_buttonPrimaryWeapon,
|
||||
IDC_buttonHandgun,
|
||||
IDC_buttonSecondaryWeapon,
|
||||
IDC_buttonUniform,
|
||||
IDC_buttonVest,
|
||||
IDC_buttonBackpack,
|
||||
IDC_buttonHeadgear,
|
||||
IDC_buttonGoggles,
|
||||
IDC_buttonNVG,
|
||||
IDC_buttonBinoculars,
|
||||
IDC_buttonMap,
|
||||
IDC_buttonGPS,
|
||||
IDC_buttonRadio,
|
||||
IDC_buttonCompass,
|
||||
IDC_buttonWatch
|
||||
] find GVAR(currentLeftPanel), true] call _fnc_handleStats;
|
||||
};
|
||||
} else {
|
||||
switch (GVAR(currentRightPanel)) do {
|
||||
case IDC_buttonOptic: {
|
||||
[0, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonItemAcc: {
|
||||
[1, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonMuzzle: {
|
||||
[2, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonBipod: {
|
||||
[3, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonCurrentMag;
|
||||
case IDC_buttonCurrentMag2;
|
||||
case IDC_buttonMag;
|
||||
case IDC_buttonMagALL: {
|
||||
[4, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonThrow: {
|
||||
[5, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonPut: {
|
||||
[6, false] call _fnc_handleStats;
|
||||
};
|
||||
case IDC_buttonMisc: {
|
||||
[7, false] call _fnc_handleStats;
|
||||
};
|
||||
default {
|
||||
if (GVAR(currentRightPanel) in [RIGHT_PANEL_CUSTOM_BUTTONS]) then {
|
||||
[7, false] call _fnc_handleStats;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -26,6 +26,7 @@ if (isClass _itemCfg) then {
|
||||
_ctrlInfo ctrlCommit FADE_DELAY;
|
||||
|
||||
[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
|
||||
[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
|
||||
|
||||
// Name + author
|
||||
(_display displayCtrl IDC_infoName) ctrlSetText ([_control lbText _curSel, _control lnbText [_curSel, 1]] select (ctrlType _control == CT_LISTNBOX));
|
||||
@ -48,16 +49,16 @@ if (isClass _itemCfg) then {
|
||||
|
||||
// If an item is from a DLC, set it so when you press the icon on the bottom right it opens the DLC page
|
||||
if ((getNumber (configfile >> "CfgMods" >> _dlc >> "appId")) > 0) then {
|
||||
_ctrlDLC ctrlSetEventHandler ["mouseExit", format ["(_this select 0) ctrlSetText '%1';", _logo]];
|
||||
_ctrlDLC ctrlSetEventHandler ["mouseEnter", format ["(_this select 0) ctrlSetText '%1';", _logoOver]];
|
||||
_ctrlDLC ctrlSetEventHandler ["MouseExit", format ["(_this select 0) ctrlSetText '%1';", _logo]];
|
||||
_ctrlDLC ctrlSetEventHandler ["MouseEnter", format ["(_this select 0) ctrlSetText '%1';", _logoOver]];
|
||||
_ctrlDLC ctrlSetEventHandler [
|
||||
"buttonClick",
|
||||
"ButtonClick",
|
||||
format ["uiNamespace setVariable ['RscDisplayDLCPreview_dlc','%1']; ctrlParent (_this select 0) createDisplay 'RscDisplayDLCPreview';", _dlc]
|
||||
];
|
||||
} else {
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "mouseExit";
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "mouseEnter";
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "buttonClick";
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "MouseExit";
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "MouseEnter";
|
||||
_ctrlDLC ctrlRemoveAllEventHandlers "ButtonClick";
|
||||
};
|
||||
} else {
|
||||
_ctrlDLC ctrlSetFade 1;
|
||||
@ -69,6 +70,7 @@ if (isClass _itemCfg) then {
|
||||
|
||||
} else {
|
||||
[QGVAR(displayStats), [_display, _control, -1, nil]] call CBA_fnc_localEvent;
|
||||
[QGVAR(displayActions), [_display, _control, -1, nil]] call CBA_fnc_localEvent;
|
||||
|
||||
_ctrlInfo ctrlSetFade 1;
|
||||
_ctrlInfo ctrlCommit FADE_DELAY;
|
||||
|
@ -48,7 +48,7 @@ switch (ctrlIDC _control) do {
|
||||
case IDC_buttonMyLoadouts: {
|
||||
_centerBoxTitleCtrl ctrlSetText LLSTRING(tabMyLoadoutsText);
|
||||
|
||||
if (is3DEN) then {
|
||||
if (call FUNC(canEditDefaultLoadout)) then {
|
||||
_saveButtonCtrl ctrlSetTooltip format ["%1\n%2", LLSTRING(buttonSaveTooltip), LLSTRING(buttonSaveTooltip_shiftClick)];
|
||||
};
|
||||
|
||||
@ -59,18 +59,18 @@ switch (ctrlIDC _control) do {
|
||||
case IDC_buttonDefaultLoadouts: {
|
||||
_centerBoxTitleCtrl ctrlSetText LLSTRING(tabDefaultLoadoutsText);
|
||||
|
||||
if (is3DEN) then {
|
||||
if (call FUNC(canEditDefaultLoadout)) then {
|
||||
_saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip);
|
||||
};
|
||||
|
||||
_saveButtonCtrl ctrlEnable is3DEN;
|
||||
_saveButtonCtrl ctrlEnable call FUNC(canEditDefaultLoadout);
|
||||
_saveButtonCtrl ctrlCommit 0;
|
||||
};
|
||||
// Shared loadouts
|
||||
case IDC_buttonSharedLoadouts: {
|
||||
_centerBoxTitleCtrl ctrlSetText LLSTRING(tabSharedLoadoutsText);
|
||||
|
||||
if (is3DEN) then {
|
||||
if (call FUNC(canEditDefaultLoadout)) then {
|
||||
_saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip);
|
||||
};
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Args <ARRAY>
|
||||
* 1.0: Not used
|
||||
* 1.1: Exit code <NUMBER>
|
||||
* - 0: Not used
|
||||
* - 1: Exit code <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -121,10 +121,16 @@ GVAR(currentInsignia) = nil;
|
||||
GVAR(currentAction) = nil;
|
||||
|
||||
GVAR(showStats) = nil;
|
||||
GVAR(statsPagesLeft) = nil;
|
||||
GVAR(statsPagesRight) = nil;
|
||||
GVAR(currentStatPage) = nil;
|
||||
GVAR(statsInfo) = nil;
|
||||
|
||||
GVAR(showActions) = nil;
|
||||
GVAR(currentActionPage) = nil;
|
||||
|
||||
profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)];
|
||||
GVAR(favoritesOnly) = nil;
|
||||
GVAR(favorites) = nil;
|
||||
|
||||
GVAR(center) = nil;
|
||||
GVAR(centerNotPlayer) = nil;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Arguments <ARRAY>
|
||||
* 1.0: Arsenal display <DISPLAY>
|
||||
* - 0: Arsenal display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -76,6 +76,8 @@ if (isNil QGVAR(virtualItems)) then {
|
||||
GVAR(virtualItemsFlat) = _virtualItemsFlat;
|
||||
};
|
||||
|
||||
GVAR(virtualItemsFlatAll) = +GVAR(virtualItemsFlat);
|
||||
|
||||
GVAR(currentFace) = face GVAR(center);
|
||||
GVAR(currentVoice) = speaker GVAR(center);
|
||||
GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia;
|
||||
@ -84,105 +86,20 @@ GVAR(currentAction) = "Stand";
|
||||
GVAR(shiftState) = false;
|
||||
|
||||
GVAR(showStats) = true;
|
||||
GVAR(statsPagesLeft) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
GVAR(statsPagesRight) = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
GVAR(statsInfo) = [true, 0, controlNull, nil, nil];
|
||||
GVAR(currentStatPage) = 0;
|
||||
GVAR(statsInfo) = [true, controlNull, nil, nil];
|
||||
|
||||
// Add the items the player has to virtualItems
|
||||
{
|
||||
switch (_forEachIndex) do {
|
||||
// Primary weapon, Secondary weapon, Handgun weapon, Binoculars
|
||||
case IDX_LOADOUT_PRIMARY_WEAPON;
|
||||
case IDX_LOADOUT_SECONDARY_WEAPON;
|
||||
case IDX_LOADOUT_HANDGUN_WEAPON;
|
||||
case IDX_LOADOUT_BINO: {
|
||||
_x params [["_weapon", ""], ["_muzzle", ""], ["_flashlight", ""], ["_optics", ""], ["_primaryMagazine", []], ["_secondaryMagazine", []], ["_bipod", ""]];
|
||||
|
||||
// Add weapon
|
||||
if (_weapon != "") then {
|
||||
_weapon = _weapon call FUNC(baseWeapon);
|
||||
|
||||
// If bino, add it in a different place than regular weapons
|
||||
if (_forEachIndex != IDX_LOADOUT_BINO) then {
|
||||
((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _forEachIndex) set [_weapon, nil];
|
||||
} else {
|
||||
(GVAR(virtualItems) get IDX_VIRT_BINO) set [_weapon, nil];
|
||||
};
|
||||
};
|
||||
|
||||
// Add weapon attachments
|
||||
{
|
||||
if (_x != "") then {
|
||||
((GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS) get _forEachIndex) set [_x call FUNC(baseWeapon), nil];
|
||||
};
|
||||
} forEach [_optics, _flashlight, _muzzle, _bipod];
|
||||
|
||||
// Add magazines
|
||||
{
|
||||
// Check if there is a magazine (ammo count is unnecssary to check)
|
||||
if ((_x param [0, ""]) != "") then {
|
||||
(GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL) set [_x select 0, nil];
|
||||
};
|
||||
} forEach [_primaryMagazine, _secondaryMagazine];
|
||||
};
|
||||
|
||||
// Uniform, vest, backpack
|
||||
case IDX_LOADOUT_UNIFORM;
|
||||
case IDX_LOADOUT_VEST;
|
||||
case IDX_LOADOUT_BACKPACK: {
|
||||
_x params [["_containerClass", ""]];
|
||||
|
||||
if (_containerClass != "") then {
|
||||
(GVAR(virtualItems) get (_forEachIndex + 1)) set [_containerClass, nil];
|
||||
};
|
||||
};
|
||||
// Helmet
|
||||
case IDX_LOADOUT_HEADGEAR: {
|
||||
if (_x != "") then {
|
||||
(GVAR(virtualItems) get IDX_VIRT_HEADGEAR) set [_x, nil];
|
||||
};
|
||||
};
|
||||
// Facewear
|
||||
case IDX_LOADOUT_GOGGLES: {
|
||||
if (_x != "") then {
|
||||
(GVAR(virtualItems) get IDX_VIRT_GOGGLES) set [_x, nil];
|
||||
};
|
||||
};
|
||||
// Assigned items: Map, Compass, Watch, GPS / UAV Terminal, Radio, NVGs
|
||||
case IDX_LOADOUT_ASSIGNEDITEMS: {
|
||||
{
|
||||
// Order of storing virtualItems is different than what getUnitLoadout returns, so do some math
|
||||
if (_x != "") then {
|
||||
(GVAR(virtualItems) get (IDX_VIRT_NVG + ([2, 6, 4, 3, 5, 0] select _forEachIndex))) set [_x, nil];
|
||||
};
|
||||
} forEach _x;
|
||||
};
|
||||
};
|
||||
} forEach (getUnitLoadout GVAR(center)); // Only need items, not extended loadout
|
||||
|
||||
// Get a list of all virtual items, including single panel items that are unique
|
||||
private _virtualItemsFlat = +GVAR(virtualItems);
|
||||
private _weapons = _virtualItemsFlat deleteAt IDX_VIRT_WEAPONS;
|
||||
private _attachments = _virtualItemsFlat deleteAt IDX_VIRT_ATTACHMENTS;
|
||||
|
||||
for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
|
||||
_virtualItemsFlat merge [_virtualItemsFlat deleteAt _index, true];
|
||||
};
|
||||
|
||||
for "_index" from IDX_VIRT_PRIMARY_WEAPONS to IDX_VIRT_HANDGUN_WEAPONS do {
|
||||
_virtualItemsFlat merge [_weapons deleteAt _index, true];
|
||||
};
|
||||
|
||||
for "_index" from IDX_VIRT_OPTICS_ATTACHMENTS to IDX_VIRT_BIPOD_ATTACHMENTS do {
|
||||
_virtualItemsFlat merge [_attachments deleteAt _index, true];
|
||||
};
|
||||
|
||||
GVAR(virtualItemsFlatAll) = _virtualItemsFlat;
|
||||
GVAR(showActions) = true;
|
||||
GVAR(currentActionPage) = 0;
|
||||
|
||||
// Update current item list
|
||||
call FUNC(updateCurrentItemsList);
|
||||
|
||||
// This takes care of items that aren't available in the arsenal (either wrong tab or arsenal doesn't have it whitelisted)
|
||||
// Setup favorites button text and switch to default mode defined by setting
|
||||
[_display, _display displayCtrl IDC_buttonFavorites] call FUNC(buttonFavorites);
|
||||
GVAR(favorites) = profileNamespace getVariable [QGVAR(favorites), createHashMap];
|
||||
|
||||
// This takes care of unique inventory items and unique equipment (arsenal doesn't have items/equipment whitelisted)
|
||||
call FUNC(updateUniqueItemsList);
|
||||
|
||||
[QGVAR(displayOpened), [_display]] call CBA_fnc_localEvent;
|
||||
@ -223,7 +140,15 @@ _statsBoxCtrl ctrlSetPosition [
|
||||
_statsBoxCtrl ctrlEnable false;
|
||||
_statsBoxCtrl ctrlCommit 0;
|
||||
|
||||
(_display displayCtrl IDC_statsButton) ctrlShow false;
|
||||
// Handle actions
|
||||
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
|
||||
_actionsBoxCtrl ctrlSetPosition [
|
||||
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
|
||||
safezoneY + 58.6 * GRID_H,
|
||||
47 * GRID_W,
|
||||
11 * GRID_H
|
||||
];
|
||||
_actionsBoxCtrl ctrlCommit 0;
|
||||
|
||||
// Disable import in MP
|
||||
if (isMultiplayer) then {
|
||||
@ -291,7 +216,7 @@ if (is3DEN) then {
|
||||
_ctrl ctrlCommit 0;
|
||||
} forEach [IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsignia];
|
||||
|
||||
_buttonCloseCtrl = _display displayCtrl IDC_menuBarClose;
|
||||
private _buttonCloseCtrl = _display displayCtrl IDC_menuBarClose;
|
||||
_buttonCloseCtrl ctrlSetText (localize "str_ui_debug_but_apply");
|
||||
} else {
|
||||
GVAR(centerNotPlayer) = GVAR(center) != player;
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Arguments <ARRAY>
|
||||
* 1.0: Loadouts display <DISPLAY>
|
||||
* - 0: Loadouts display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
@ -6,10 +6,10 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Args <ARRAY>
|
||||
* 1.0: Not used
|
||||
* 1.1: Mouse button <NUMBER>
|
||||
* 1.2: Mouse X position <NUMBER>
|
||||
* 1.3: Mouse Y position <NUMBER>
|
||||
* - 0: Not used
|
||||
* - 1: Mouse button <NUMBER>
|
||||
* - 2: Mouse X position <NUMBER>
|
||||
* - 3: Mouse Y position <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Args <ARRAY>
|
||||
* 1.0: Not used
|
||||
* 1.1: Mouse button <NUMBER>
|
||||
* - 0: Not used
|
||||
* - 1: Mouse button <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
|
50
addons/arsenal/functions/fnc_onPanelDblClick.sqf
Normal file
50
addons/arsenal/functions/fnc_onPanelDblClick.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
#include "\a3\ui_f\hpp\defineResincl.inc"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Add or remove item(s) to favorites when LShift is pressed
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Left panel control <CONTROL>
|
||||
* 1: Left panel selection <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_control", "_curSel"];
|
||||
|
||||
if !(GVAR(shiftState)) exitWith {};
|
||||
|
||||
if (GVAR(currentLeftPanel) in [IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigina]) exitWith {};
|
||||
|
||||
private _isLnB = (ctrlType _control) == CT_LISTNBOX;
|
||||
|
||||
private _favorited = false;
|
||||
|
||||
// Favorites/blacklist will always be lowercase to handle configCase changes
|
||||
private _item = "";
|
||||
if (_isLnB) then {
|
||||
_item = toLower (_control lnbData [_curSel, 0]);
|
||||
} else {
|
||||
_item = toLower (_control lbData _curSel);
|
||||
};
|
||||
|
||||
if (_item in GVAR(favorites)) then {
|
||||
GVAR(favorites) deleteAt _item;
|
||||
} else {
|
||||
GVAR(favorites) set [_item, nil];
|
||||
_favorited = true;
|
||||
};
|
||||
|
||||
private _color = ([[1, 1, 1], GVAR(favoritesColor)] select _favorited) + [1];
|
||||
|
||||
if (_isLnB) then {
|
||||
_control lnbSetColor [[_curSel, 1], _color];
|
||||
_control lnbSetColorRight [[_curSel, 1], _color];
|
||||
} else {
|
||||
_control lbSetColor [_curSel, _color];
|
||||
_control lbSetSelectColor [_curSel, _color];
|
||||
};
|
@ -74,7 +74,7 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
|
||||
// Enable delete and renaming button if in 3DEN
|
||||
{
|
||||
_x ctrlEnable (is3DEN);
|
||||
_x ctrlEnable (call FUNC(canEditDefaultLoadout));
|
||||
_x ctrlCommit 0;
|
||||
} forEach [_renameButtonCtrl, _deleteButtonCtrl];
|
||||
|
||||
|
@ -27,6 +27,7 @@ private _itemIndex = [IDC_buttonMuzzle, IDC_buttonItemAcc, IDC_buttonOptic, IDC_
|
||||
switch (_currentItemsIndex) do {
|
||||
// Primary weapon
|
||||
case IDX_CURR_PRIMARY_WEAPON_ITEMS: {
|
||||
private _currentItemInSlot = (GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS) select _itemIndex;
|
||||
// If removal
|
||||
if (_item == "") then {
|
||||
private _secondaryMagazine = (GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS) select 5;
|
||||
@ -40,11 +41,11 @@ switch (_currentItemsIndex) do {
|
||||
// Add magazine back into primary muzzle
|
||||
GVAR(center) addWeaponItem [primaryWeapon GVAR(center), _secondaryMagazine, true];
|
||||
} else {
|
||||
GVAR(center) removePrimaryWeaponItem ((GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS) select _itemIndex);
|
||||
GVAR(center) removePrimaryWeaponItem _currentItemInSlot;
|
||||
};
|
||||
} else {
|
||||
// Don't add item if it isn't a different item than what the unit already has
|
||||
if (_item != ((GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON_ITEMS) select _itemIndex)) then {
|
||||
// Don't add item if it isn't a magazine or a different item than what the unit already has
|
||||
if (_itemIndex >= 4 || {_item != _currentItemInSlot}) then {
|
||||
// If magazine, make sure to add to correct muzzle
|
||||
if (_itemIndex >= 4) then {
|
||||
private _weapon = primaryWeapon GVAR(center);
|
||||
@ -64,6 +65,7 @@ switch (_currentItemsIndex) do {
|
||||
};
|
||||
// Secondary weapon
|
||||
case IDX_CURR_SECONDARY_WEAPON_ITEMS: {
|
||||
private _currentItemInSlot = (GVAR(currentItems) select IDX_CURR_SECONDARY_WEAPON_ITEMS) select _itemIndex;
|
||||
private _isDisposable = CBA_disposable_replaceDisposableLauncher && {!isNil {CBA_disposable_loadedLaunchers getVariable (secondaryWeapon GVAR(center))}};
|
||||
|
||||
// If removal
|
||||
@ -84,11 +86,11 @@ switch (_currentItemsIndex) do {
|
||||
// Add magazine back into primary muzzle
|
||||
GVAR(center) addWeaponItem [secondaryWeapon GVAR(center), _secondaryMagazine, true];
|
||||
} else {
|
||||
GVAR(center) removeSecondaryWeaponItem ((GVAR(currentItems) select IDX_CURR_SECONDARY_WEAPON_ITEMS) select _itemIndex);
|
||||
GVAR(center) removeSecondaryWeaponItem _currentItemInSlot;
|
||||
};
|
||||
} else {
|
||||
// Don't add item if it isn't a different item than what the unit already has
|
||||
if (_item != ((GVAR(currentItems) select IDX_CURR_SECONDARY_WEAPON_ITEMS) select _itemIndex)) then {
|
||||
// Don't add item if it isn't a magazine or a different item than what the unit already has
|
||||
if (_itemIndex >= 4 || {_item != _currentItemInSlot}) then {
|
||||
// If magazine, make sure to add to correct muzzle
|
||||
if (_itemIndex >= 4) then {
|
||||
private _weapon = secondaryWeapon GVAR(center);
|
||||
@ -110,6 +112,7 @@ switch (_currentItemsIndex) do {
|
||||
};
|
||||
// Handgun weapon
|
||||
case IDX_CURR_HANDGUN_WEAPON_ITEMS: {
|
||||
private _currentItemInSlot = (GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON_ITEMS) select _itemIndex;
|
||||
if (_item == "") then {
|
||||
private _secondaryMagazine = (GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON_ITEMS) select 5;
|
||||
|
||||
@ -122,11 +125,11 @@ switch (_currentItemsIndex) do {
|
||||
// Add magazine back into primary muzzle
|
||||
GVAR(center) addWeaponItem [handgunWeapon GVAR(center), _secondaryMagazine, true];
|
||||
} else {
|
||||
GVAR(center) removeHandgunItem ((GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON_ITEMS) select _itemIndex);
|
||||
GVAR(center) removeHandgunItem _currentItemInSlot;
|
||||
};
|
||||
} else {
|
||||
// Don't add item if it isn't a different item than what the unit already has
|
||||
if (_item != ((GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON_ITEMS) select _itemIndex)) then {
|
||||
// Don't add item if it isn't a magazine or a different item than what the unit already has
|
||||
if (_itemIndex >= 4 || {_item != _currentItemInSlot}) then {
|
||||
// If magazine, make sure to add to correct muzzle
|
||||
if (_itemIndex >= 4) then {
|
||||
private _weapon = handgunWeapon GVAR(center);
|
||||
@ -140,20 +143,13 @@ switch (_currentItemsIndex) do {
|
||||
|
||||
// Update currentItems
|
||||
(getUnitLoadout GVAR(center) select IDX_LOADOUT_HANDGUN_WEAPON) params ["", "_muzzle", "_flashlight", "_optics", "_primaryMagazine", "_secondaryMagazine", "_bipod"];
|
||||
|
||||
// https://feedback.bistudio.com/T173880
|
||||
_primaryMagazine = _primaryMagazine param [0, ""];
|
||||
private _handgunMagazines = handgunMagazine GVAR(center);
|
||||
|
||||
// Delete the first magazine (but keep one if both magazines are the same)
|
||||
_handgunMagazines deleteAt (_handgunMagazines findIf {_x == _primaryMagazine});
|
||||
|
||||
GVAR(currentItems) set [IDX_CURR_HANDGUN_WEAPON_ITEMS, [_muzzle, _flashlight, _optics, _bipod, _primaryMagazine, _handgunMagazines param [0, ""]]];
|
||||
GVAR(currentItems) set [IDX_CURR_HANDGUN_WEAPON_ITEMS, [_muzzle, _flashlight, _optics, _bipod, _primaryMagazine param [0, ""], _secondaryMagazine param [0, ""]]];
|
||||
|
||||
[_display, _control, _curSel, configFile >> ["CfgWeapons", "CfgMagazines"] select (_itemIndex >= 4) >> _item] call FUNC(itemInfo);
|
||||
};
|
||||
// Binoculars
|
||||
case IDX_CURR_BINO_ITEMS: {
|
||||
private _currentItemInSlot = (GVAR(currentItems) select IDX_CURR_BINO_ITEMS) select _itemIndex;
|
||||
if (_item == "") then {
|
||||
private _secondaryMagazine = (GVAR(currentItems) select IDX_CURR_BINO_ITEMS) select 5;
|
||||
|
||||
@ -166,11 +162,11 @@ switch (_currentItemsIndex) do {
|
||||
// Add magazine back into primary muzzle
|
||||
GVAR(center) addWeaponItem [binocular GVAR(center), _secondaryMagazine, true];
|
||||
} else {
|
||||
GVAR(center) removeBinocularItem ((GVAR(currentItems) select IDX_CURR_BINO_ITEMS) select _itemIndex);
|
||||
GVAR(center) removeBinocularItem _currentItemInSlot;
|
||||
};
|
||||
} else {
|
||||
// Don't add item if it isn't a different item than what the unit already has
|
||||
if (_item != ((GVAR(currentItems) select IDX_CURR_BINO_ITEMS) select _itemIndex)) then {
|
||||
// Don't add item if it isn't a magazine or a different item than what the unit already has
|
||||
if (_itemIndex >= 4 || {_item != _currentItemInSlot}) then {
|
||||
// If magazine, make sure to add to correct muzzle
|
||||
if (_itemIndex >= 4) then {
|
||||
private _weapon = binocular GVAR(center);
|
||||
@ -184,15 +180,7 @@ switch (_currentItemsIndex) do {
|
||||
|
||||
// Update currentItems
|
||||
(getUnitLoadout GVAR(center) select IDX_LOADOUT_BINO) params ["", "_muzzle", "_flashlight", "_optics", "_primaryMagazine", "_secondaryMagazine", "_bipod"];
|
||||
|
||||
// https://feedback.bistudio.com/T173880 (unsure if binocular weapons are affected by this)
|
||||
_primaryMagazine = _primaryMagazine param [0, ""];
|
||||
private _binocularMagazines = binocularMagazine GVAR(center);
|
||||
|
||||
// Delete the first magazine (but keep one if both magazines are the same)
|
||||
_binocularMagazines deleteAt (_binocularMagazines findIf {_x == _primaryMagazine});
|
||||
|
||||
GVAR(currentItems) set [IDX_CURR_BINO_ITEMS, [_muzzle, _flashlight, _optics, _bipod, _primaryMagazine, _binocularMagazines param [0, ""]]];
|
||||
GVAR(currentItems) set [IDX_CURR_BINO_ITEMS, [_muzzle, _flashlight, _optics, _bipod, _primaryMagazine param [0, ""], _secondaryMagazine param [0, ""]]];
|
||||
|
||||
[_display, _control, _curSel, configFile >> ["CfgWeapons", "CfgMagazines"] select (_itemIndex >= 4) >> _item] call FUNC(itemInfo);
|
||||
};
|
||||
|
33
addons/arsenal/functions/fnc_refresh.sqf
Normal file
33
addons/arsenal/functions/fnc_refresh.sqf
Normal file
@ -0,0 +1,33 @@
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Brett Mayson, johnb43
|
||||
* Refreshes the arsenal to show external changes.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Update current and unique items lists <BOOL> (default: true)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_arsenal_fnc_refresh
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
params [["_updateItems", true, [true]]];
|
||||
|
||||
if (_updateItems) then {
|
||||
// Update current item list
|
||||
call FUNC(updateCurrentItemsList);
|
||||
|
||||
// This takes care of unique inventory items (arsenal doesn't have it whitelisted)
|
||||
call FUNC(updateUniqueItemsList);
|
||||
};
|
||||
|
||||
// Don't refresh left panel if in loadout tab
|
||||
if (!isNull findDisplay IDD_loadouts_display) exitWith {};
|
||||
|
||||
private _display = findDisplay IDD_ace_arsenal;
|
||||
|
||||
[_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel);
|
41
addons/arsenal/functions/fnc_removeAction.sqf
Normal file
41
addons/arsenal/functions/fnc_removeAction.sqf
Normal file
@ -0,0 +1,41 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: johnb43
|
||||
* Remove a custom action button from ACE Arsenal.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Array of IDs <ARRAY of STRINGS>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [["TAG_myActions~text~0", "TAG_myActions~statement~0", "TAG_myActions~button~0"]] call ace_arsenal_fnc_removeAction
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_IDList"];
|
||||
|
||||
// Compile sorts from config (in case this is called before preInit)
|
||||
call FUNC(compileActions);
|
||||
|
||||
// Remove entries (all names are unique, there are no duplicates)
|
||||
{
|
||||
(_x splitString "~") params ["_rootClass", "_class", "_tab"];
|
||||
|
||||
_tab = parseNumber _tab;
|
||||
|
||||
{
|
||||
if ((_x select 0) == _rootClass) exitWith {
|
||||
(_x select 3) deleteAt ((_x select 3) findIf {(_x select 0) == _class});
|
||||
|
||||
// If no entries left in group, remove group
|
||||
if ((_x select 3) isEqualTo []) then {
|
||||
(GVAR(actionList) select _tab) deleteAt _forEachIndex;
|
||||
};
|
||||
};
|
||||
} forEach (GVAR(actionList) select _tab);
|
||||
} forEach _IDList;
|
||||
|
||||
nil // return
|
28
addons/arsenal/functions/fnc_removeDefaultLoadout.sqf
Normal file
28
addons/arsenal/functions/fnc_removeDefaultLoadout.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Removes a loadout from the "Default Loadouts" list.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name of loadout <STRING>
|
||||
* 1: Remove globally <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Squad Leader", true] call ace_arsenal_fnc_removeDefaultLoadout
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
params [["_name", "", [""]], ["_global", false, [false]]];
|
||||
|
||||
if (_global) then {
|
||||
[QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_remoteEvent;
|
||||
};
|
||||
|
||||
GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) findIf {(_x select 0) == _name});
|
||||
|
||||
if (is3DEN) then {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
};
|
@ -10,8 +10,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
[["scopeSortL00", "scopeSortL01", "scopeSortL02", "scopeSortR07"]] call ace_arsenal_fnc_removeSort;
|
||||
* [["scopeSortL00", "scopeSortL01", "scopeSortL02", "scopeSortR07"]] call ace_arsenal_fnc_removeSort;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
@ -25,7 +25,6 @@ private _stringCount = 0;
|
||||
private _tabSide = "";
|
||||
private _tab = "";
|
||||
private _tabToChange = [];
|
||||
private _changes = [];
|
||||
|
||||
{
|
||||
// Get tab info
|
||||
@ -44,41 +43,5 @@ private _changes = [];
|
||||
};
|
||||
|
||||
// Delete stat
|
||||
{
|
||||
_x deleteAt (_x findIf {_x select 0 == _currentID});
|
||||
} forEach _tabToChange;
|
||||
|
||||
// Store information, so that only tabs that were changed can be sorted again
|
||||
_changes pushBackUnique [_tab, _tabSide];
|
||||
_tabToChange deleteAt (_tabToChange findIf {_x select 5 == _currentID});
|
||||
} forEach _IDList;
|
||||
|
||||
private _statsFlat = [];
|
||||
private _stats = [];
|
||||
|
||||
// Fill empty spots
|
||||
{
|
||||
_x params ["_tab", "_tabSide"];
|
||||
|
||||
_tabToChange = if (_tabSide == "R") then {
|
||||
GVAR(statsListRightPanel)
|
||||
} else {
|
||||
GVAR(statsListLeftPanel)
|
||||
};
|
||||
|
||||
_statsFlat = [];
|
||||
|
||||
// Get all stats of a tab into a single array
|
||||
{
|
||||
_statsFlat append _x;
|
||||
} forEach (_tabToChange select _tab);
|
||||
|
||||
// Priority has stayed intact, so no need to sort
|
||||
_stats = [];
|
||||
|
||||
// Group stats into groups of 5
|
||||
for "_index" from 0 to count _statsFlat - 1 step 5 do {
|
||||
_stats pushBack (_statsFlat select [_index, _index + 5]);
|
||||
};
|
||||
|
||||
_tabToChange set [_tab, _stats];
|
||||
} forEach _changes;
|
||||
|
25
addons/arsenal/functions/fnc_renameDefaultLoadout.sqf
Normal file
25
addons/arsenal/functions/fnc_renameDefaultLoadout.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Renames a loadout from the "Default Loadouts" list.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Current name of loadout <STRING>
|
||||
* 1: New name of loadout <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Squad Leader", "Team Leader"] call ace_arsenal_fnc_renameDefaultLoadout
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
params [["_currentName", "", [""]], ["_newName", "", [""]]];
|
||||
|
||||
if (_currentName isEqualTo _newName) exitWith {};
|
||||
|
||||
private _loadoutIndex = GVAR(defaultLoadoutsList) findIf {(_x select 0) == _currentName};
|
||||
if (_loadoutIndex isEqualTo -1) exitWith {};
|
||||
|
||||
(GVAR(defaultLoadoutsList) select _loadoutIndex) set [0, _newName];
|
@ -98,12 +98,16 @@ private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
|
||||
// Check weapon & weapon attachments
|
||||
{
|
||||
// Magazines
|
||||
// Magazines in weapons have 2 entries: Name and ammo count
|
||||
if (_forEachIndex in [4, 5]) then {
|
||||
_uniqueBaseCfgText = (getText (_cfgMagazines >> _x >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
|
||||
_x params [["_magazine", ""], "_count"];
|
||||
|
||||
if (_uniqueBaseCfgText != "") then {
|
||||
_weaponsInfo set [_forEachIndex, _uniqueBaseCfgText];
|
||||
if (_magazine != "") then {
|
||||
_uniqueBaseCfgText = (getText (_cfgMagazines >> _magazine >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName);
|
||||
|
||||
if (_uniqueBaseCfgText != "") then {
|
||||
_weaponsInfo set [_forEachIndex, [_uniqueBaseCfgText, _count]];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// Other
|
||||
@ -132,7 +136,7 @@ private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
// Assigned items: Map, Compass, Watch, GPS / UAV Terminal, Radio, NVGs
|
||||
case IDX_LOADOUT_ASSIGNEDITEMS: {
|
||||
// Check if assignedItems have items that need replacing with a defined base
|
||||
_items = _x;
|
||||
private _items = _x;
|
||||
|
||||
{
|
||||
if (_x != "") then {
|
||||
|
@ -141,6 +141,7 @@ private _isTool = false;
|
||||
} forEach configProperties [_cfgWeapons, _filterFunction, true];
|
||||
|
||||
// Get all grenades
|
||||
// Explicitly don't look at scope for these, we want hidden items to be sorted as grenades/explosives properly
|
||||
private _grenadeList = createHashMap;
|
||||
|
||||
{
|
||||
@ -154,11 +155,17 @@ private _putList = createHashMap;
|
||||
_putList insert [true, (getArray (_cfgWeapons >> "Put" >> _x >> "magazines")) apply {_x call EFUNC(common,getConfigName)}, []];
|
||||
} forEach getArray (_cfgWeapons >> "Put" >> "muzzles");
|
||||
|
||||
// Get all magazine misc items
|
||||
private _magazineMiscItems = createHashMap;
|
||||
|
||||
{
|
||||
_magazineMiscItems set [configName _x, nil];
|
||||
} forEach ((toString {getNumber (_x >> "ACE_isUnique") == 1}) configClasses _cfgMagazines);
|
||||
|
||||
// Remove invalid/non-existent entries
|
||||
_grenadeList deleteAt "";
|
||||
_putList deleteAt "";
|
||||
|
||||
private _magazineMiscItems = createHashMap;
|
||||
_magazineMiscItems deleteAt "";
|
||||
|
||||
// Get all other grenades, explosives (and similar) and magazines
|
||||
{
|
||||
@ -166,9 +173,8 @@ private _magazineMiscItems = createHashMap;
|
||||
|
||||
switch (true) do {
|
||||
// "Misc. items" magazines (e.g. spare barrels, intel, photos)
|
||||
case (getNumber (_x >> "ACE_isUnique") isEqualTo 1): {
|
||||
case (_className in _magazineMiscItems): {
|
||||
(_configItems get IDX_VIRT_MISC_ITEMS) set [_className, nil];
|
||||
_magazineMiscItems set [_className, nil];
|
||||
if (getNumber (_x >> "ACE_isTool") isEqualTo 1) then {_toolList set [_className, nil]};
|
||||
};
|
||||
// Grenades
|
||||
|
@ -132,6 +132,7 @@ private _quantity = "";
|
||||
private _itemCfg = configNull;
|
||||
private _value = "";
|
||||
private _name = "";
|
||||
private _fillerChar = toString [1];
|
||||
|
||||
private _magazineMiscItems = uiNamespace getVariable QGVAR(magazineMiscItems);
|
||||
private _sortCache = uiNamespace getVariable QGVAR(sortCache);
|
||||
@ -217,16 +218,20 @@ _for do {
|
||||
|
||||
// Save the current row's item's name in a cache and set text to it's sorting value
|
||||
if (_right) then {
|
||||
_originalNames set [_item, _panel lnbText [_i, 1]];
|
||||
_name = _panel lnbText [_i, 1];
|
||||
_originalNames set [_item, _name];
|
||||
|
||||
// Use tooltip to sort, as it also contains the classname, which means a fixed alphabetical order is guaranteed
|
||||
_panel lnbSetText [[_i, 1], format ["%1%2", _value, _panel lbTooltip (_i * _countColumns)]];
|
||||
// Use value, display name and classname to sort, which means a fixed alphabetical order is guaranteed
|
||||
// Filler char has lowest lexicographical order possible
|
||||
_panel lnbSetText [[_i, 1], format ["%1%2%4%3", _value, _name, _item, _fillerChar]];
|
||||
} else {
|
||||
if (_item != "") then {
|
||||
_originalNames set [_item, _panel lbText _i];
|
||||
_name = _panel lbText _i;
|
||||
_originalNames set [_item, _name];
|
||||
|
||||
// Use tooltip to sort, as it also contains the classname, which means a fixed alphabetical order is guaranteed
|
||||
_panel lbSetText [_i, format ["%1%2", _value, _panel lbTooltip _i]];
|
||||
// Use value, display name and classname to sort, which means a fixed alphabetical order is guaranteed
|
||||
// Filler char has lowest lexicographical order possible
|
||||
_panel lbSetText [_i, format ["%1%2%4%3", _value, _name, _item, _fillerChar]];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -7,8 +7,8 @@
|
||||
* 0: Not used
|
||||
* 1: Item config path <CONFIG>
|
||||
* 2: Args <ARRAY>
|
||||
* 2.0: Stat limits <ARRAY of BOOLS>
|
||||
* 2.1: Bar limits <ARRAY of NUMBERS>
|
||||
* - 0: Stat limits <ARRAY of BOOLS>
|
||||
* - 1: Bar limits <ARRAY of NUMBERS>
|
||||
*
|
||||
* Return Value:
|
||||
* <NUMBER>
|
||||
|
@ -7,9 +7,9 @@
|
||||
* 0: Stat <STRING>
|
||||
* 1: Item config path <CONFIG>
|
||||
* 2: Args for configExtreme <ARRAY>
|
||||
* 2.0: Stat limits <ARRAY of BOOLS>
|
||||
* 2.1: Bar limits <ARRAY of NUMBERS>
|
||||
* 2.2: Evaluate as a logarithmic number <BOOL>
|
||||
* - 0: Stat limits <ARRAY of BOOLS>
|
||||
* - 1: Bar limits <ARRAY of NUMBERS>
|
||||
* - 2: Evaluate as a logarithmic number <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Bar statement <NUMBER>
|
||||
|
@ -8,8 +8,8 @@
|
||||
* 0: Stats array <ARRAY>
|
||||
* 1: Item config path <CONFIG>
|
||||
* 2: Args for configExtreme <ARRAY>
|
||||
* 2.0: Stats limits <ARRAY of BOOLS>
|
||||
* 2.1: Bar limits <ARRAY of NUMBERS>
|
||||
* - 0: Stats limits <ARRAY of BOOLS>
|
||||
* - 1: Bar limits <ARRAY of NUMBERS>
|
||||
*
|
||||
* Return Value:
|
||||
* Number
|
||||
|
@ -7,8 +7,8 @@
|
||||
* 0: Not used
|
||||
* 1: Item config path <CONFIG>
|
||||
* 2: Args <ARRAY>
|
||||
* 2.0: Stat limits <ARRAY of BOOLS>
|
||||
* 2.1: Bar limits <ARRAY of NUMBERS>
|
||||
* - 0: Stat limits <ARRAY of BOOLS>
|
||||
* - 1: Bar limits <ARRAY of NUMBERS>
|
||||
*
|
||||
* Return Value:
|
||||
* Number
|
||||
|
35
addons/arsenal/functions/fnc_statTextStatement_binoMag.sqf
Normal file
35
addons/arsenal/functions/fnc_statTextStatement_binoMag.sqf
Normal file
@ -0,0 +1,35 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror, LinkIsGrim
|
||||
* Text statement for the binocular magnification stat.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Item config path <CONFIG>
|
||||
*
|
||||
* Return Value:
|
||||
* Stat Text <STRING>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["", "_config"];
|
||||
TRACE_1("statTextStatement_binoMag",_config);
|
||||
|
||||
private _minZoom = getNumber (_config >> "opticsZoomMin"); // FOV, so smaller is more zoomed in
|
||||
private _maxZoom = getNumber (_config >> "opticsZoomMax");
|
||||
|
||||
if (_minZoom == 0) exitWith {"?"};
|
||||
|
||||
private _maxMagnification = (0.25 / _minZoom) toFixed 1;
|
||||
private _minMagnification = (0.25 / _maxZoom);
|
||||
if (_minMagnification < 1) then {
|
||||
_minMagnification = 1;
|
||||
};
|
||||
_minMagnification = _minMagnification toFixed 1;
|
||||
|
||||
if (_minMagnification == _maxMagnification) exitWith {
|
||||
format ["%1x", _maxMagnification]
|
||||
};
|
||||
|
||||
format ["%1x-%2x", _minMagnification, _maxMagnification]
|
@ -0,0 +1,27 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Dedmen, johnb43, LinkIsGrim
|
||||
* Text statement for the binocular/NVG vision mode stat.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Not used
|
||||
* 1: Item config path <CONFIG>
|
||||
*
|
||||
* Return Value:
|
||||
* Stat Text <STRING>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["", "_config"];
|
||||
TRACE_1("statTextStatement_binoVisionMode",_config);
|
||||
|
||||
private _text = [];
|
||||
private _visionModes = getArray (_config >> "visionMode") apply {toLower _x};
|
||||
{
|
||||
if (_x in _visionModes) then {
|
||||
_text pushBack (localize ([LSTRING(VisionNormal), LSTRING(VisionNight), LSTRING(VisionThermal)] select _forEachIndex));
|
||||
};
|
||||
} forEach ["normal", "nvg", "ti"];
|
||||
|
||||
_text joinString ", "
|
19
addons/arsenal/functions/fnc_statTextStatement_magCount.sqf
Normal file
19
addons/arsenal/functions/fnc_statTextStatement_magCount.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Text statement for the magazine capacity stat.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Stats Array <ARRAY> (not used)
|
||||
* 1: Item config path <CONFIG>
|
||||
*
|
||||
* Return Value:
|
||||
* String to display
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["", "_config"];
|
||||
TRACE_1("statTextStatement_magCount",_config)
|
||||
|
||||
getNumber (_config >> "count");
|
@ -17,11 +17,31 @@ params ["", "_config"];
|
||||
TRACE_1("statTextStatement_scopeMag",_config);
|
||||
|
||||
private _minZoom = 999; // FOV, so smaller is more zoomed in
|
||||
private _maxZoom = 1.25; // Cap at 1x zoomed out
|
||||
|
||||
private _opticsModes = "true" configClasses (_config >> "ItemInfo" >> "OpticsModes");
|
||||
{
|
||||
// If there is a primary mode then just use that
|
||||
if (getNumber (_x >> "useModelOptics") == 1 || {count _opticsModes == 1}) exitWith {
|
||||
_minZoom = getNumber (_x >> "opticsZoomMin");
|
||||
_maxZoom = getNumber (_x >> "opticsZoomMax");
|
||||
};
|
||||
// Otherwise go through the optic's modes
|
||||
_minZoom = _minZoom min (getNumber (_x >> "opticsZoomMin"));
|
||||
} forEach configProperties [_config >> "ItemInfo" >> "OpticsModes"];
|
||||
_maxZoom = _maxZoom max (getNumber (_x >> "opticsZoomMax"));
|
||||
} forEach _opticsModes;
|
||||
|
||||
if (_minZoom in [0, 999]) exitWith {"?"};
|
||||
|
||||
format ["%1x", (0.25 / _minZoom) toFixed 1]
|
||||
private _maxMagnification = (0.25 / _minZoom) toFixed 1;
|
||||
private _minMagnification = (0.25 / _maxZoom);
|
||||
if (_minMagnification < 1) then {
|
||||
_minMagnification = 1;
|
||||
};
|
||||
_minMagnification = _minMagnification toFixed 1;
|
||||
|
||||
if (_minMagnification == _maxMagnification) exitWith {
|
||||
format ["%1x", _maxMagnification]
|
||||
};
|
||||
|
||||
format ["%1x-%2x", _minMagnification, _maxMagnification]
|
||||
|
@ -22,15 +22,18 @@ private _rightPanelCache = uiNamespace getVariable [QGVAR(rightPanelCache), crea
|
||||
|
||||
private _mass = -1;
|
||||
private _color = [];
|
||||
private _alpha = 1;
|
||||
|
||||
// Grey out items that are too big to fit in remaining space of the container
|
||||
for "_row" from 0 to (lnbSize _control select 0) - 1 do {
|
||||
_mass = _rightPanelCache getOrDefault [_control lnbData [_row, 0], 0];
|
||||
_color = _control lnbColor [_row, 1];
|
||||
|
||||
// Lower alpha on color for items that can't fit
|
||||
_color = [1, 1, 1, [0.25, 1] select (_mass <= _loadRemaining)];
|
||||
_alpha = [0.25, 1] select (_mass <= _loadRemaining);
|
||||
_color set [3, _alpha];
|
||||
_control lnbSetColor [[_row, 1], _color];
|
||||
_control lnbSetColor [[_row, 2], _color];
|
||||
_control lnbSetColor [[_row, 2], [1, 1, 1, _alpha]];
|
||||
};
|
||||
|
||||
private _display = ctrlParent _control;
|
||||
|
@ -2,8 +2,9 @@
|
||||
#include "..\defines.hpp"
|
||||
/*
|
||||
* Author: Alganthe, johnb43
|
||||
* Updates the list of unique items.
|
||||
* Unique items are items that can't be multiplied using the arsenal.
|
||||
* Updates the list of unique inventory items and unique equipment.
|
||||
* Unique inventory items are items within containers that can't be multiplied using the arsenal.
|
||||
* Unique equipment are any items (such as weapons, containers, etc.) that can't be multiplied using the arsenal.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
@ -30,14 +31,111 @@ private _cfgMagazines = configFile >> "CfgMagazines";
|
||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
private _cfgGlasses = configFile >> "CfgGlasses";
|
||||
|
||||
// Remove unique equipment in every panel
|
||||
private _items = createHashMap;
|
||||
|
||||
private _fnc_uniqueEquipment = {
|
||||
params ["_items", "_item", ["_removeAllUniqueItems", true]];
|
||||
|
||||
// Remove all unique equipment from tab
|
||||
if (_removeAllUniqueItems) then {
|
||||
private _itemsToDelete = [];
|
||||
|
||||
{
|
||||
if (!isNil "_y") then {
|
||||
_itemsToDelete pushBack _x;
|
||||
};
|
||||
} forEach _items;
|
||||
|
||||
{
|
||||
_items deleteAt _x;
|
||||
GVAR(virtualItemsFlatAll) deleteAt _x;
|
||||
} forEach _itemsToDelete;
|
||||
};
|
||||
|
||||
// Add item as a unique equipment
|
||||
if (_item != "") then {
|
||||
_items set [_item, true, true];
|
||||
GVAR(virtualItemsFlatAll) set [_item, true, true];
|
||||
};
|
||||
};
|
||||
|
||||
// Add the items the player has to virtualItems as unique equipment
|
||||
{
|
||||
switch (_forEachIndex) do {
|
||||
// Primary weapon, Secondary weapon, Handgun weapon, Binoculars
|
||||
case IDX_LOADOUT_PRIMARY_WEAPON;
|
||||
case IDX_LOADOUT_SECONDARY_WEAPON;
|
||||
case IDX_LOADOUT_HANDGUN_WEAPON;
|
||||
case IDX_LOADOUT_BINO: {
|
||||
_x params [["_weapon", ""], ["_muzzle", ""], ["_flashlight", ""], ["_optics", ""], ["_primaryMagazine", []], ["_secondaryMagazine", []], ["_bipod", ""]];
|
||||
|
||||
// If bino, add it in a different place than regular weapons
|
||||
_items = if (_forEachIndex != IDX_LOADOUT_BINO) then {
|
||||
(GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _forEachIndex
|
||||
} else {
|
||||
GVAR(virtualItems) get IDX_VIRT_BINO
|
||||
};
|
||||
|
||||
// Remove all unique equipment in tab; Add weapon as a unique equipment
|
||||
[_items, _weapon call FUNC(baseWeapon)] call _fnc_uniqueEquipment;
|
||||
|
||||
private _removeUniqueItems = _forEachIndex == IDX_LOADOUT_PRIMARY_WEAPON;
|
||||
|
||||
// Add weapon attachments
|
||||
{
|
||||
// Remove all unique equipment in tab; Add weapon attachment as a unique equipment
|
||||
[(GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS) get _forEachIndex, _x call FUNC(baseWeapon), _removeUniqueItems] call _fnc_uniqueEquipment;
|
||||
} forEach [_optics, _flashlight, _muzzle, _bipod];
|
||||
|
||||
// Add magazines
|
||||
{
|
||||
// Remove all unique equipment in tab; Add magazine as unique equipment
|
||||
[GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL, _x param [0, ""], _removeUniqueItems && {_forEachIndex == 0}] call _fnc_uniqueEquipment;
|
||||
} forEach [_primaryMagazine, _secondaryMagazine];
|
||||
};
|
||||
|
||||
// Uniform, vest, backpack
|
||||
case IDX_LOADOUT_UNIFORM;
|
||||
case IDX_LOADOUT_VEST;
|
||||
case IDX_LOADOUT_BACKPACK: {
|
||||
_x params [["_containerClass", ""]];
|
||||
|
||||
// Remove all unique equipment in tab; Add container as a unique equipment
|
||||
[GVAR(virtualItems) get (_forEachIndex + 1), _containerClass] call _fnc_uniqueEquipment;
|
||||
};
|
||||
// Helmet
|
||||
case IDX_LOADOUT_HEADGEAR: {
|
||||
// Remove all unique equipment in tab; Add item as a unique equipment
|
||||
[GVAR(virtualItems) get IDX_VIRT_HEADGEAR, _x] call _fnc_uniqueEquipment;
|
||||
};
|
||||
// Facewear
|
||||
case IDX_LOADOUT_GOGGLES: {
|
||||
// Remove all unique equipment in tab; Add item as a unique equipment
|
||||
[GVAR(virtualItems) get IDX_VIRT_GOGGLES, _x] call _fnc_uniqueEquipment;
|
||||
};
|
||||
// Assigned items: Map, Compass, Watch, GPS / UAV Terminal, Radio, NVGs
|
||||
case IDX_LOADOUT_ASSIGNEDITEMS: {
|
||||
{
|
||||
// Order of storing virtualItems is different than what getUnitLoadout returns, so do some math
|
||||
// Remove all unique equipment in tab; Add item as a unique equipment
|
||||
[GVAR(virtualItems) get (IDX_VIRT_NVG + ([2, 6, 4, 3, 5, 0] select _forEachIndex)), _x] call _fnc_uniqueEquipment;
|
||||
} forEach _x;
|
||||
};
|
||||
};
|
||||
} forEach (getUnitLoadout GVAR(center)); // Only need items, not extended loadout
|
||||
|
||||
|
||||
private _isMagazine = false;
|
||||
private _isWeapon = false;
|
||||
private _isGrenade = false;
|
||||
private _isPut = false;
|
||||
private _isMiscItem = false;
|
||||
private _config = configNull;
|
||||
private _simulationType = "";
|
||||
private _configItemInfo = "";
|
||||
private _hasItemInfo = false;
|
||||
private _itemInfoType = 0;
|
||||
private _isMiscItem = false;
|
||||
|
||||
{
|
||||
_isMagazine = isClass (_cfgMagazines >> _x);
|
||||
@ -47,39 +145,42 @@ private _isMiscItem = false;
|
||||
// Magazines
|
||||
case (_isMagazine): {
|
||||
_config = _cfgMagazines >> _x;
|
||||
_isGrenade = _x in (uiNamespace getVariable QGVAR(grenadeCache));
|
||||
_isPut = _x in (uiNamespace getVariable QGVAR(putCache));
|
||||
_isMiscItem = _x in (uiNamespace getVariable QGVAR(magazineMiscItems));
|
||||
|
||||
switch (true) do {
|
||||
// "Misc. items" magazines (e.g. spare barrels, intel, photos)
|
||||
case (
|
||||
!(_x in (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS)) &&
|
||||
{_x in (uiNamespace getVariable QGVAR(magazineMiscItems)) ||
|
||||
{getNumber (_config >> "ACE_isUnique") == 1}}
|
||||
{_isMiscItem}
|
||||
): {
|
||||
(GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS) set [_x, nil];
|
||||
};
|
||||
// Primary, Handgun, Secondary weapon magazines
|
||||
case (
|
||||
!(_x in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL)) &&
|
||||
{_x in (_configItems get IDX_VIRT_ITEMS_ALL) ||
|
||||
{getNumber (_config >> QGVAR(hide)) == -1} ||
|
||||
{getNumber (_config >> "type") in [TYPE_MAGAZINE_PRIMARY_AND_THROW, TYPE_MAGAZINE_SECONDARY_AND_PUT, 1536, TYPE_MAGAZINE_HANDGUN_AND_GL, TYPE_MAGAZINE_MISSILE]}}
|
||||
): {
|
||||
(GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL) set [_x, nil];
|
||||
};
|
||||
// Grenades
|
||||
case (
|
||||
!(_x in (GVAR(virtualItems) get IDX_VIRT_GRENADES)) &&
|
||||
{_x in (uiNamespace getVariable QGVAR(grenadeCache))}
|
||||
{_isGrenade}
|
||||
): {
|
||||
(GVAR(virtualItems) get IDX_VIRT_UNIQUE_GRENADES) set [_x, nil];
|
||||
};
|
||||
// Explosives
|
||||
case (
|
||||
!(_x in (GVAR(virtualItems) get IDX_VIRT_EXPLOSIVES)) &&
|
||||
{_x in (uiNamespace getVariable QGVAR(putCache))}
|
||||
{_isPut}
|
||||
): {
|
||||
(GVAR(virtualItems) get IDX_VIRT_UNIQUE_EXPLOSIVES) set [_x, nil];
|
||||
};
|
||||
// Primary, Handgun, Secondary weapon magazines
|
||||
case (
|
||||
!(_x in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL)) &&
|
||||
{!_isGrenade && {!_isPut} && {!_isMiscItem}} &&
|
||||
{_x in (_configItems get IDX_VIRT_ITEMS_ALL) ||
|
||||
{getNumber (_config >> QGVAR(hide)) == -1} ||
|
||||
{getNumber (_config >> "type") in [TYPE_MAGAZINE_PRIMARY_AND_THROW, TYPE_MAGAZINE_SECONDARY_AND_PUT, 1536, TYPE_MAGAZINE_HANDGUN_AND_GL, TYPE_MAGAZINE_MISSILE]}}
|
||||
): {
|
||||
(GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL) set [_x, nil];
|
||||
};
|
||||
// Unknown
|
||||
default {
|
||||
// Don't add items that are part of the arsenal
|
||||
|
@ -33,10 +33,29 @@ private _category = LLSTRING(settingCategory);
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[
|
||||
QGVAR(defaultToFavorites),
|
||||
"CHECKBOX",
|
||||
[LSTRING(defaultToFavoritesSetting), LSTRING(defaultToFavoritesTooltip)],
|
||||
_category,
|
||||
false,
|
||||
2 // never overwrite the client
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[
|
||||
QGVAR(favoritesColor),
|
||||
"COLOR",
|
||||
[LSTRING(favoritesColorSetting), LSTRING(favoritesColorTooltip)],
|
||||
_category,
|
||||
[0.9, 0.875, 0.6],
|
||||
2 // never overwrite the client
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
private _loadoutCategory = LLSTRING(loadoutSubcategory);
|
||||
|
||||
// Arsenal loadouts
|
||||
[QGVAR(allowDefaultLoadouts),
|
||||
[
|
||||
QGVAR(allowDefaultLoadouts),
|
||||
"CHECKBOX",
|
||||
[LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)],
|
||||
[_category, _loadoutCategory],
|
||||
@ -44,7 +63,8 @@ private _loadoutCategory = LLSTRING(loadoutSubcategory);
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[QGVAR(allowSharedLoadouts),
|
||||
[
|
||||
QGVAR(allowSharedLoadouts),
|
||||
"CHECKBOX",
|
||||
LLSTRING(allowSharingSetting),
|
||||
[_category, _loadoutCategory],
|
||||
@ -52,7 +72,8 @@ private _loadoutCategory = LLSTRING(loadoutSubcategory);
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[QGVAR(EnableRPTLog),
|
||||
[
|
||||
QGVAR(EnableRPTLog),
|
||||
"CHECKBOX",
|
||||
[LSTRING(printToRPTSetting),
|
||||
LSTRING(printToRPTTooltip)],
|
||||
@ -61,21 +82,24 @@ private _loadoutCategory = LLSTRING(loadoutSubcategory);
|
||||
false
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[QGVAR(loadoutsSaveFace),
|
||||
[
|
||||
QGVAR(loadoutsSaveFace),
|
||||
"CHECKBOX",
|
||||
LLSTRING(loadoutsSaveFaceSetting),
|
||||
[_category, _loadoutCategory],
|
||||
false
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[QGVAR(loadoutsSaveVoice),
|
||||
[
|
||||
QGVAR(loadoutsSaveVoice),
|
||||
"CHECKBOX",
|
||||
LLSTRING(loadoutsSaveVoiceSetting),
|
||||
[_category, _loadoutCategory],
|
||||
false
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[QGVAR(loadoutsSaveInsignia),
|
||||
[
|
||||
QGVAR(loadoutsSaveInsignia),
|
||||
"CHECKBOX",
|
||||
LLSTRING(loadoutsSaveInsigniaSetting),
|
||||
[_category, _loadoutCategory],
|
||||
|
@ -15,3 +15,6 @@
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define ACTION_TYPE_BUTTON 0
|
||||
#define ACTION_TYPE_TEXT 1
|
||||
|
@ -997,7 +997,7 @@
|
||||
<Spanish>Ninguna unidad de jugador disponible! Coloca una unidad y márcala como "Jugador".</Spanish>
|
||||
<French>Aucune unité joueur disponible ! Placez une unité et marquez-la en tant que "joueur".</French>
|
||||
<German>Keine Spielereinheit verfügbar. Setze eine Einheit und markiere sie als "Spieler".</German>
|
||||
<Japanese>プレイヤー ユニットがありません!ユニットを設置し"Player"と名付けてください。</Japanese>
|
||||
<Japanese>プレイヤーユニットがありません!ユニットを設置し"Player"と名付けてください。</Japanese>
|
||||
<Korean>플레이어 유닛을 사용할 수 없습니다! 유닛을 놓고 "플레이어"라고 표시하십시오.</Korean>
|
||||
<Chinese>沒有可用的玩家單位!請擺放一個單位並設定成"玩家"</Chinese>
|
||||
<Chinesesimp>没有可用的玩家单位!请摆放一个单位并设定成“玩家”。</Chinesesimp>
|
||||
@ -1240,6 +1240,70 @@
|
||||
<Turkish>Desteklenmiyor</Turkish>
|
||||
<Korean>지원되지 않음</Korean>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_statVisionModeGeneric">
|
||||
<English>Vision Mode</English>
|
||||
<German>Sichtmodus</German>
|
||||
<Japanese>ビジョン モード</Japanese>
|
||||
<Italian>Modalità Visiva</Italian>
|
||||
<Chinese>視覺模式</Chinese>
|
||||
<Chinesesimp>视觉模式</Chinesesimp>
|
||||
<Korean>보기 모드</Korean>
|
||||
<French>Mode de vision</French>
|
||||
<Polish>Tryb Wizji</Polish>
|
||||
<Russian>Режим видения</Russian>
|
||||
<Portuguese>Modo de Visão</Portuguese>
|
||||
<Czech>Režim sledování</Czech>
|
||||
<Turkish>Görüş Modu</Turkish>
|
||||
<Spanish>Modo de visión</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_VisionNormal">
|
||||
<English>Normal</English>
|
||||
<German>Normal</German>
|
||||
<Polish>Normalna</Polish>
|
||||
<Portuguese>Normal</Portuguese>
|
||||
<Russian>Нормальное</Russian>
|
||||
<Czech>Normální</Czech>
|
||||
<Spanish>Normal</Spanish>
|
||||
<Italian>Normale</Italian>
|
||||
<French>Normale</French>
|
||||
<Japanese>通常</Japanese>
|
||||
<Korean>일반</Korean>
|
||||
<Chinesesimp>正常</Chinesesimp>
|
||||
<Chinese>正常</Chinese>
|
||||
<Turkish>Normal</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_VisionNight">
|
||||
<English>Night</English>
|
||||
<German>Nacht</German>
|
||||
<Polish>Noc</Polish>
|
||||
<Portuguese>Visão Norturna</Portuguese>
|
||||
<Russian>Ночное</Russian>
|
||||
<Czech>Noční</Czech>
|
||||
<Spanish>Nocturna</Spanish>
|
||||
<Italian>Notturno</Italian>
|
||||
<French>Nocturne</French>
|
||||
<Japanese>暗視装置</Japanese>
|
||||
<Korean>야간</Korean>
|
||||
<Chinesesimp>夜视</Chinesesimp>
|
||||
<Chinese>夜視</Chinese>
|
||||
<Turkish>Gece</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_VisionThermal">
|
||||
<English>Thermal</English>
|
||||
<German>Wärme</German>
|
||||
<Polish>Termo</Polish>
|
||||
<Portuguese>Térmica</Portuguese>
|
||||
<Russian>Тепловизор</Russian>
|
||||
<Czech>Termální</Czech>
|
||||
<Spanish>Térmica</Spanish>
|
||||
<Italian>Termico</Italian>
|
||||
<French>Thermique</French>
|
||||
<Japanese>熱源画像</Japanese>
|
||||
<Korean>열상</Korean>
|
||||
<Chinesesimp>热成像</Chinesesimp>
|
||||
<Chinese>熱成像</Chinese>
|
||||
<Turkish>Termal</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_page">
|
||||
<English>Page</English>
|
||||
<Spanish>Página</Spanish>
|
||||
@ -1261,7 +1325,7 @@
|
||||
<Spanish>Habilitar las pestañas de caras / voces / insignias</Spanish>
|
||||
<German>Aktiviere die Gesichter-, Stimmen- und Abzeichenübersicht</German>
|
||||
<French>Activer les onglets visages/voix/insignes</French>
|
||||
<Japanese>顔 / 声 / 記章タブを有効化</Japanese>
|
||||
<Japanese>顔 / 声 / 記章(バッジ)タブを有効化</Japanese>
|
||||
<Chinesesimp>启用脸谱/语音/徽章选项</Chinesesimp>
|
||||
<Chinese>啟用臉譜/聲音/徽章選項</Chinese>
|
||||
<Italian>Abilita volti, voci e insegne</Italian>
|
||||
@ -1470,24 +1534,29 @@
|
||||
<Korean>얼굴 저장</Korean>
|
||||
<Russian>Сохранить лицо</Russian>
|
||||
<Spanish>Guardar Cara</Spanish>
|
||||
<Japanese>顔の保存</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_loadoutsSaveVoiceSetting">
|
||||
<English>Save Voice</English>
|
||||
<Korean>목소리 저장</Korean>
|
||||
<Russian>Сохранить голос</Russian>
|
||||
<Spanish>Guardar Voz</Spanish>
|
||||
<Japanese>声の保存</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_loadoutsSaveInsigniaSetting">
|
||||
<English>Save Insignia</English>
|
||||
<Korean>계급장 저장</Korean>
|
||||
<Russian>Сохранить эмблему</Russian>
|
||||
<Spanish>Guardar Insignia</Spanish>
|
||||
<Japanese>記章(バッジ)の保存</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_sortDescending">
|
||||
<English>Descending</English>
|
||||
<Japanese>下降</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_sortAscending">
|
||||
<English>Ascending</English>
|
||||
<Japanese>昇順</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_toolsTab">
|
||||
<English>Tools</English>
|
||||
@ -1505,5 +1574,29 @@
|
||||
<Chinesesimp>工具</Chinesesimp>
|
||||
<Turkish>Araçlar</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_statMagCount">
|
||||
<English>Ammo count</English>
|
||||
<Japanese>弾薬数</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_defaultToFavoritesSetting">
|
||||
<English>Default to Favorites</English>
|
||||
<Japanese>お気に入りをデフォルト</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_defaultToFavoritesTooltip">
|
||||
<English>Controls whether the ACE Arsenal defaults to showing all items or favorites.</English>
|
||||
<Japanese>ACE Arsenalがデフォルトで全てのアイテムを表示するか、お気に入りを表示するかを制御します。</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_favoritesColorSetting">
|
||||
<English>Favorites Color</English>
|
||||
<Japanese>お気に入りの色</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_favoritesColorTooltip">
|
||||
<English>Highlight color for favorited items.</English>
|
||||
<Japanese>お気に入りアイテムのハイライト色。</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Arsenal_buttonFavoritesTooltip">
|
||||
<English>Switch between displaying all items or your favorites.\nDouble click while holding Shift to add or remove an item.</English>
|
||||
<Japanese>Shiftを押しながらダブルクリックするとアイテムを追加・削除できます。</Japanese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -176,6 +176,7 @@ class GVAR(display) {
|
||||
text = CSTRING(buttonHideText);
|
||||
sizeEx = QUOTE(5 * GRID_H);
|
||||
tooltip = CSTRING(buttonHideTooltip);
|
||||
onMouseEnter = QUOTE(ctrlSetFocus (_this select 0));
|
||||
onButtonClick = QUOTE([ctrlParent (_this select 0)] call FUNC(buttonHide));
|
||||
};
|
||||
class buttonLoadouts: buttonHide {
|
||||
@ -199,10 +200,17 @@ class GVAR(display) {
|
||||
tooltip = CSTRING(buttonImportTooltip);
|
||||
onButtonClick = QUOTE([ctrlParent (_this select 0)] call FUNC(buttonImport));
|
||||
};
|
||||
class buttonFavorites: buttonHide {
|
||||
idc = IDC_buttonFavorites;
|
||||
x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE);
|
||||
text = "";
|
||||
tooltip = CSTRING(buttonFavoritesTooltip);
|
||||
onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0), (_this select 0))] call FUNC(buttonFavorites));
|
||||
};
|
||||
class buttonClose: ctrlButtonOK {
|
||||
idc = IDC_menuBarClose;
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE);
|
||||
x = QUOTE(6 * WIDTH_GAP + 5 * WIDTH_SINGLE);
|
||||
y = QUOTE(0);
|
||||
w = QUOTE(WIDTH_SINGLE);
|
||||
h = QUOTE(7 * GRID_H);
|
||||
@ -403,17 +411,6 @@ class GVAR(display) {
|
||||
};
|
||||
};
|
||||
};
|
||||
class statsButton: ctrlButton {
|
||||
idc = IDC_statsButton;
|
||||
style = 2;
|
||||
text = ">";
|
||||
onButtonClick = QUOTE([ARR_2(QQGVAR(statsButton), [ctrlParent (_this select 0)])] call CBA_fnc_localEvent);
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP);
|
||||
y = QUOTE(safezoneY + 1.8 * GRID_H);
|
||||
w = QUOTE(6 * GRID_W);
|
||||
h = QUOTE(6 * GRID_H);
|
||||
sizeEx = QUOTE(5 * GRID_H);
|
||||
};
|
||||
class statsPreviousPage: ctrlButton {
|
||||
idc = IDC_statsPreviousPage;
|
||||
style = 2;
|
||||
@ -431,29 +428,126 @@ class GVAR(display) {
|
||||
idc = IDC_statsNextPage;
|
||||
text = ">";
|
||||
onButtonClick = QUOTE([ARR_2(QQGVAR(statsChangePage),[ARR_3(ctrlParent (_this select 0), _this select 0, true)])] call CBA_fnc_localEvent);
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 30 * GRID_W);
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 42 * GRID_W);
|
||||
};
|
||||
class statsCurrentPage: RscText {
|
||||
idc = IDC_statsCurrentPage;
|
||||
style = ST_CENTER;
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 5 * GRID_W);
|
||||
y = QUOTE(safezoneY + 1.8 * GRID_H);
|
||||
w = QUOTE(25 * GRID_W);
|
||||
w = QUOTE(37 * GRID_W);
|
||||
h = QUOTE(5 * GRID_H);
|
||||
colorBackground[] = {0,0,0,0};
|
||||
shadow = 2;
|
||||
sizeEx = QUOTE(5 * GRID_H);
|
||||
text = "";
|
||||
};
|
||||
class statsButtonClose: ctrlButtonPicture {
|
||||
idc = IDC_statsButtonClose;
|
||||
colorBackground[] = {0,0,0,0};
|
||||
text = "\a3\3DEN\Data\Displays\Display3DEN\search_end_ca.paa";
|
||||
onButtonClick = QUOTE([ARR_2(QQGVAR(statsButton), [ctrlParent (_this select 0)])] call CBA_fnc_localEvent);
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 42 * GRID_W);
|
||||
y = QUOTE(safezoneY + 1.8 * GRID_H);
|
||||
w = QUOTE(5 * GRID_W);
|
||||
h = QUOTE(5 * GRID_H);
|
||||
class actionsBox: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_actionsBox;
|
||||
x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP);
|
||||
y = QUOTE(safezoneY + 58.6 * GRID_H);
|
||||
w = QUOTE(47 * GRID_W);
|
||||
h = QUOTE(55 * GRID_H);
|
||||
class controls {
|
||||
class actionsStaticBackground1: ctrlStaticBackground {
|
||||
idc = -1;
|
||||
x = QUOTE(0);
|
||||
y = QUOTE(0);
|
||||
w = QUOTE(47 * GRID_W);
|
||||
h = QUOTE(56 * GRID_H);
|
||||
colorBackground[]={0.1,0.1,0.1,0.5};
|
||||
};
|
||||
class actionsStaticBackground2: ctrlStaticBackground {
|
||||
idc = -1;
|
||||
x = QUOTE(0);
|
||||
y = QUOTE(0);
|
||||
w = QUOTE(47 * GRID_W);
|
||||
h = QUOTE(5 * GRID_H);
|
||||
colorBackground[]={0.1,0.1,0.1,0.8};
|
||||
};
|
||||
class actionsText1: RscText {
|
||||
idc = IDC_actionsText1;
|
||||
fade = 1;
|
||||
x = QUOTE(0 * GRID_W);
|
||||
y = QUOTE(5 * GRID_H);
|
||||
w = QUOTE(45 * GRID_W);
|
||||
h = QUOTE(5 * GRID_H);
|
||||
colorBackground[]={0,0,0,0};
|
||||
colorText[]={0.7,0.7,0.7,1};
|
||||
sizeEx = QUOTE(5 * GRID_H);
|
||||
text = "";
|
||||
};
|
||||
class actionsButton1: ctrlButton {
|
||||
idc = IDC_actionsButton1;
|
||||
fade = 1;
|
||||
text = "";
|
||||
x = QUOTE(1 * GRID_W);
|
||||
y = QUOTE(6 * GRID_H);
|
||||
w = QUOTE(45 * GRID_W);
|
||||
h = QUOTE(4 * GRID_H);
|
||||
};
|
||||
class actionsText2: actionsText1 {
|
||||
idc = IDC_actionsText2;
|
||||
y = QUOTE(10 * GRID_H);
|
||||
};
|
||||
class actionsButton2: actionsButton1 {
|
||||
idc = IDC_actionsButton2;
|
||||
y = QUOTE(11 * GRID_H);
|
||||
};
|
||||
class actionsText3: actionsText1 {
|
||||
idc = IDC_actionsText3;
|
||||
y = QUOTE(15 * GRID_H);
|
||||
};
|
||||
class actionsButton3: actionsButton1 {
|
||||
idc = IDC_actionsButton3;
|
||||
y = QUOTE(16 * GRID_H);
|
||||
};
|
||||
class actionsText4: actionsText1 {
|
||||
idc = IDC_actionsText4;
|
||||
y = QUOTE(20 * GRID_H);
|
||||
};
|
||||
class actionsButton4: actionsButton1 {
|
||||
idc = IDC_actionsButton4;
|
||||
y = QUOTE(21 * GRID_H);
|
||||
};
|
||||
class actionsText5: actionsText1 {
|
||||
idc = IDC_actionsText5;
|
||||
y = QUOTE(25 * GRID_H);
|
||||
};
|
||||
class actionsButton5: actionsButton1 {
|
||||
idc = IDC_actionsButton5;
|
||||
y = QUOTE(26 * GRID_H);
|
||||
};
|
||||
class actionsPreviousPage: ctrlButton {
|
||||
idc = IDC_actionsPreviousPage;
|
||||
style= 2;
|
||||
text="<";
|
||||
colorBackground[]={0,0,0,0};
|
||||
colorBackgroundDisabled[]= {0,0,0,0};
|
||||
onButtonClick = QUOTE([ARR_2(QQGVAR(actionsChangePage),[ARR_3(ctrlParent (_this select 0), _this select 0, false)])] call CBA_fnc_localEvent);
|
||||
x = QUOTE(0);
|
||||
y = QUOTE(0);
|
||||
w = QUOTE(5 * GRID_W);
|
||||
h = QUOTE(5 * GRID_H);
|
||||
sizeEx = QUOTE(5.5 * GRID_H);
|
||||
};
|
||||
class actionsNextPage: actionsPreviousPage {
|
||||
idc = IDC_actionsNextPage;
|
||||
text = ">";
|
||||
onButtonClick = QUOTE([ARR_2(QQGVAR(actionsChangePage),[ARR_3(ctrlParent (_this select 0), _this select 0, true)])] call CBA_fnc_localEvent);
|
||||
x = QUOTE(42 * GRID_W);
|
||||
};
|
||||
class actionsCurrentPage: RscText {
|
||||
idc = IDC_actionsCurrentPage;
|
||||
style = ST_CENTER;
|
||||
x = QUOTE(5 * GRID_W);
|
||||
w = QUOTE(37 * GRID_W);
|
||||
colorBackground[]={0,0,0,0};
|
||||
shadow=2;
|
||||
sizeEx = QUOTE(5 * GRID_H);
|
||||
text = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
class mouseBlock: RscText {
|
||||
idc = IDC_mouseBlock;
|
||||
@ -473,6 +567,7 @@ class GVAR(display) {
|
||||
colorSelect2[] = {1,1,1,1};
|
||||
colorPictureRightSelected[] = {1,1,1,1};
|
||||
onLBSelChanged = QUOTE(_this call FUNC(onSelChangedLeft));
|
||||
onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick));
|
||||
onSetFocus = QUOTE(GVAR(leftTabFocus) = true);
|
||||
onKillFocus = QUOTE(GVAR(leftTabFocus) = false);
|
||||
x = QUOTE(safezoneX + 13 * GRID_W);
|
||||
@ -486,6 +581,7 @@ class GVAR(display) {
|
||||
drawSideArrows = 1;
|
||||
disableOverflow = 1;
|
||||
onLBSelChanged = QUOTE(_this call FUNC(onSelChangedRight));
|
||||
onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick));
|
||||
onSetFocus = QUOTE(GVAR(rightTabFocus) = true);
|
||||
onKillFocus = QUOTE(GVAR(rightTabFocus) = false);
|
||||
x = QUOTE(safezoneX + safezoneW - 93 * GRID_W);
|
||||
@ -506,6 +602,7 @@ class GVAR(display) {
|
||||
drawSideArrows = 1;
|
||||
disableOverflow = 1;
|
||||
onLBSelChanged = QUOTE(_this call FUNC(onSelChangedRightListnBox));
|
||||
onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick));
|
||||
onSetFocus = QUOTE(GVAR(rightTabLnBFocus) = true);
|
||||
onKillFocus = QUOTE(GVAR(rightTabLnBFocus) = false);
|
||||
x = QUOTE(safezoneX + safezoneW - 93 * GRID_W);
|
||||
|
@ -46,10 +46,10 @@ TRACE_2("searching for new vehicles",_vehicleAdded,_rangeTablesShown);
|
||||
} forEach allTurrets _vehicle;
|
||||
TRACE_3("",_vehicle,configName _vehicleCfg,_turret);
|
||||
if (isNull _turretCfg) exitWith { ERROR_1("no primaryGunner %1",configName _vehicleCfg); };
|
||||
if ((count _turret) != 1) then { WARNING_2("sub turret %1-%2",_typeOf,_turret); };
|
||||
if ((count _turret) != 1) then { WARNING_2("sub turret %1-%2",configName _vehicleCfg,_turret); };
|
||||
|
||||
private _weaponsTurret = _vehicle weaponsTurret _turret;
|
||||
if ((count _weaponsTurret) != 1) exitWith { WARNING_1("multiple weapons - %1",_typeOf); };
|
||||
if ((count _weaponsTurret) != 1) exitWith { WARNING_1("multiple weapons - %1",configName _vehicleCfg); };
|
||||
private _weapon = _weaponsTurret select 0;
|
||||
|
||||
private _turretAnimBody = getText (_turretCfg >> "animationSourceBody");
|
||||
|
@ -24,6 +24,7 @@ class EGVAR(arsenal,stats) {
|
||||
stats[] = {"ammo", "displayName"};
|
||||
displayName = "$STR_dn_ammo";
|
||||
showText = 1;
|
||||
condition = QUOTE(getText (_this select 1 >> _this select 0 select 0) isNotEqualTo '');
|
||||
textStatement = QUOTE(params [ARR_2('_stat', '_config')]; private _ammoDisplayName = getText (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo')) >> _stat select 1); [ARR_2(_ammoDisplayName, getText (_config >> _stat select 0))] select (_ammoDisplayName == ''));
|
||||
tabs[] = {{}, {4}};
|
||||
};
|
||||
@ -50,11 +51,11 @@ class EGVAR(arsenal,stats) {
|
||||
class ACE_magMuzzleVelocity: statBase {
|
||||
scope = 2;
|
||||
priority = 3;
|
||||
stats[] = {"initSpeed"};
|
||||
stats[] = {"initSpeed", "ammo"};
|
||||
displayName= CSTRING(statMuzzleVelocity);
|
||||
showText= 1;
|
||||
textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_magazineMuzzleVelocity));
|
||||
condition = QUOTE(getNumber (_this select 1 >> (_this select 0) select 0) > 0);
|
||||
condition = QUOTE(getText (_this select 1 >> _this select 0 select 1) isNotEqualTo '' && {getNumber (_this select 1 >> (_this select 0) select 0) > 0});
|
||||
tabs[] = {{}, {4}};
|
||||
};
|
||||
class ACE_weaponMuzzleVelocity: statBase {
|
||||
@ -66,4 +67,14 @@ class EGVAR(arsenal,stats) {
|
||||
textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_weaponMuzzleVelocity));
|
||||
tabs[] = {{0,1}, {}};
|
||||
};
|
||||
class ACE_magazineAiUsage: statBase {
|
||||
scope = 2;
|
||||
priority = 0;
|
||||
stats[] = {"aiAmmoUsageFlags"};
|
||||
displayName= CSTRING(ammoUsage_ai);
|
||||
showText= 1;
|
||||
textStatement = QUOTE(call FUNC(statTextStatement_magazineAiUsage));
|
||||
condition = QUOTE(is3DEN || {!isNull getAssignedCuratorLogic player} || {missionNamespace getVariable [ARR_2(QQGVAR(showAIMagazineUse), missionName == 'Arsenal')]});
|
||||
tabs[] = {{}, {4}};
|
||||
};
|
||||
};
|
||||
|
@ -1,2 +1,3 @@
|
||||
PREP(statTextStatement_weaponMuzzleVelocity);
|
||||
PREP(statTextStatement_magazineAiUsage);
|
||||
PREP(statTextStatement_magazineMuzzleVelocity);
|
||||
PREP(statTextStatement_weaponMuzzleVelocity);
|
||||
|
@ -0,0 +1,32 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Text statement for the magazine's AI Usage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: not used
|
||||
* 1: item config path (CONFIG)
|
||||
*
|
||||
* Return Value:
|
||||
* String to display
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["", "_config"];
|
||||
TRACE_1("statTextStatement_magazineAiUsage",_config);
|
||||
|
||||
private _ammo = getText (_config >> "ammo");
|
||||
private _aiAmmoUsageFlags = getNumber (configFile >> "CfgAmmo" >> _ammo >> "aiAmmoUsageFlags");
|
||||
private _cost = getNumber (configFile >> "CfgAmmo" >> _ammo >> "cost");
|
||||
|
||||
private _output = [];
|
||||
|
||||
if ([_aiAmmoUsageFlags, 1] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_illumination) };
|
||||
if ([_aiAmmoUsageFlags, 4] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_concealment) };
|
||||
if ([_aiAmmoUsageFlags, 64] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_infantry) };
|
||||
if ([_aiAmmoUsageFlags, 128] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_lightVehicle) };
|
||||
if ([_aiAmmoUsageFlags, 256] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_armor) };
|
||||
if ([_aiAmmoUsageFlags, 512] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_aircraft) };
|
||||
|
||||
(_output joinString ", ") + format [" [%1 %2]", localize "str_a3_cfgvehicles_modulecuratorsetobjectcost_f_arguments_cost", _cost]
|
@ -3511,5 +3511,33 @@
|
||||
<Turkish>Namlu çıkış hızı</Turkish>
|
||||
<Korean>총구 속도</Korean>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsage_ai">
|
||||
<English>AI Usage</English>
|
||||
<Japanese>AIの使用</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_illumination">
|
||||
<English>Illum</English>
|
||||
<Japanese>照明弾</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_concealment">
|
||||
<English>Smoke</English>
|
||||
<Japanese>発煙弾</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_infantry">
|
||||
<English>Inf</English>
|
||||
<Japanese>歩兵</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_lightVehicle">
|
||||
<English>Veh</English>
|
||||
<Japanese>車両</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_armor">
|
||||
<English>Armor</English>
|
||||
<Japanese>機甲</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Ballistics_ammoUsageShort_aircraft">
|
||||
<English>Air</English>
|
||||
<Japanese>航空</Japanese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -4,6 +4,7 @@ class CfgWeapons {
|
||||
|
||||
class ACE_CableTie: ACE_ItemCore {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
GVAR(restraint) = 1;
|
||||
displayName = CSTRING(CableTie);
|
||||
descriptionShort = CSTRING(CableTieDescription);
|
||||
model = QPATHTOF(models\ace_cabletie.p3d);
|
||||
|
@ -8,6 +8,8 @@ PREP_RECOMPILE_END;
|
||||
|
||||
GVAR(captivityEnabled) = false;
|
||||
|
||||
GVAR(restraints) = call (uiNamespace getVariable QGVAR(restraints));
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,3 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
private _restraints = (QUOTE(getNumber (_x >> QQGVAR(restraint)) > 0) configClasses (configFile >> "CfgWeapons") apply {configName _x});
|
||||
uiNamespace setVariable [QGVAR(restraints), compileFinal str _restraints];
|
||||
|
@ -20,7 +20,7 @@ params ["_unit", "_target"];
|
||||
//Check sides, Player has cableTie, target is alive and not already handcuffed
|
||||
|
||||
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
|
||||
{"ACE_CableTie" in (_unit call EFUNC(common,uniqueItems))} &&
|
||||
{((_unit call EFUNC(common,uniqueItems)) findAny GVAR(restraints)) != -1} &&
|
||||
{alive _target} &&
|
||||
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
||||
{
|
||||
|
@ -23,4 +23,6 @@ playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (get
|
||||
|
||||
[QGVAR(setHandcuffed), [_target, true, _unit], [_target]] call CBA_fnc_targetEvent;
|
||||
|
||||
_unit removeItem "ACE_CableTie";
|
||||
private _cuffs = (_unit call EFUNC(common,uniqueItems)) arrayIntersect GVAR(restraints);
|
||||
|
||||
_unit removeItem (_cuffs#0);
|
||||
|
@ -430,7 +430,7 @@
|
||||
<English>Require AI surrendering</English>
|
||||
<German>Benötigt für KI Kapitulation</German>
|
||||
<Italian>Necessita arresa AI</Italian>
|
||||
<Japanese>AI の投降を必要とする</Japanese>
|
||||
<Japanese>AIの投降を必要とする</Japanese>
|
||||
<Chinese>需要AI先行投降</Chinese>
|
||||
<Chinesesimp>需要 AI 先行投降</Chinesesimp>
|
||||
<Korean>AI 항복 필요</Korean>
|
||||
@ -445,7 +445,7 @@
|
||||
<English>Require AI to surrender before they can be arrested</English>
|
||||
<German>KI muss sich erst ergeben, bevor sie gefangen genommen werden kann</German>
|
||||
<Italian>Necessita che le AI si arrendano prima di essere arrestate</Italian>
|
||||
<Japanese>AI の拘束は AI が投降している場合に限り可能にします。</Japanese>
|
||||
<Japanese>AIの拘束はAIが投降している場合に限り可能にします。</Japanese>
|
||||
<Chinese>在逮捕AI之前該AI必須先進入投降狀態</Chinese>
|
||||
<Chinesesimp>在俘获 AI 之前该 AI 必须先进入投降状态。</Chinesesimp>
|
||||
<Korean>포박하기 전에 먼저 AI가 투항해야만 합니다.</Korean>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal, SilentSpike
|
||||
* Author: Glowbal, kymckay
|
||||
* Get the cargo size of an object.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal, SilentSpike
|
||||
* Author: Glowbal, kymckay
|
||||
* Initializes variables for loadable objects. Called from init EH.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Author: kymckay
|
||||
* Set the cargo size of any object. Has global effect.
|
||||
* Adds the load action menu if necessary.
|
||||
* Negative size makes unloadable.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Author: kymckay
|
||||
* Set the cargo space of any object. Has global effect.
|
||||
* Adds the cargo action menu if necessary.
|
||||
*
|
||||
|
@ -497,12 +497,14 @@
|
||||
<Korean>화물 내린 후 운반</Korean>
|
||||
<Russian>Нести после выгрузки</Russian>
|
||||
<Spanish>Llevar encima tras la descarga</Spanish>
|
||||
<Japanese>荷降ろし後の運搬</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_carryAfterUnload_description">
|
||||
<English>Controls whether cargo items are carried or dragged after unloading.</English>
|
||||
<Korean>화물 아이템을 내린 후 들거나 끌지 여부를 결정합니다.</Korean>
|
||||
<Russian>Нужно ли переносить или тащить предметы после их выгрузки.</Russian>
|
||||
<Spanish>Controla si los objetos de carga son llevados encima o arrastrados despues de la descarga.</Spanish>
|
||||
<Japanese>荷降ろし後、貨物アイテムを運ぶか引きずるかを制御する。</Japanese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -10,6 +10,7 @@ PREP(readSettingsFromParamsArray);
|
||||
PREP(actionKeysNamesConverted);
|
||||
PREP(addCanInteractWithCondition);
|
||||
PREP(addLineToDebugDraw);
|
||||
PREP(addSwayFactor);
|
||||
PREP(addToInventory);
|
||||
PREP(addWeapon);
|
||||
PREP(assignedItemFix);
|
||||
@ -51,6 +52,7 @@ PREP(dropBackpack);
|
||||
PREP(endRadioTransmission);
|
||||
PREP(eraseCache);
|
||||
PREP(errorMessage);
|
||||
PREP(escapeRegex);
|
||||
PREP(findUnloadPosition);
|
||||
PREP(firedEH);
|
||||
PREP(fixCollision);
|
||||
@ -180,6 +182,7 @@ PREP(statusEffect_sendEffects);
|
||||
PREP(statusEffect_set);
|
||||
PREP(stringCompare);
|
||||
PREP(stringToColoredText);
|
||||
PREP(swayLoop);
|
||||
PREP(switchPersistentLaser);
|
||||
PREP(switchToGroupSide);
|
||||
PREP(throttledPublicVariable);
|
||||
|
@ -481,6 +481,23 @@ GVAR(reloadMutex_lastMagazines) = [];
|
||||
GVAR(reloadMutex_lastMagazines) = _mags;
|
||||
}, true] call CBA_fnc_addPlayerEventHandler;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Start the sway loop
|
||||
//////////////////////////////////////////////////
|
||||
["CBA_settingsInitialized", {
|
||||
[{
|
||||
// frame after settingsInitialized to ensure all other addons have added their factors
|
||||
if ((GVAR(swayFactorsBaseline) + GVAR(swayFactorsMultiplier)) isNotEqualTo []) then {
|
||||
call FUNC(swayLoop)
|
||||
};
|
||||
// check for pre-3.16 sway factors being added
|
||||
if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then {
|
||||
WARNING("ACE_setCustomAimCoef no longer supported - use ace_common_fnc_addSwayFactor");
|
||||
WARNING_1("source: %1",(missionNamespace getVariable "ACE_setCustomAimCoef") apply {_x});
|
||||
};
|
||||
}] call CBA_fnc_execNextFrame;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Set up PlayerJIP eventhandler
|
||||
//////////////////////////////////////////////////
|
||||
@ -545,21 +562,30 @@ GVAR(deviceKeyCurrentIndex) = -1;
|
||||
[0xC7, [true, false, false]], false] call CBA_fnc_addKeybind; //SHIFT + Home Key
|
||||
|
||||
|
||||
["ACE3 Weapons", QGVAR(unloadWeapon), LLSTRING(unloadWeapon), {
|
||||
// Conditions:
|
||||
if !([ACE_player, objNull, ["isNotInside"]] call FUNC(canInteractWith)) exitWith {false};
|
||||
["ACE3 Weapons", QGVAR(unloadWeapon), LSTRING(unloadWeapon), {
|
||||
private _unit = ACE_player;
|
||||
|
||||
private _currentWeapon = currentWeapon ACE_player;
|
||||
if !(_currentWeapon != primaryWeapon _unit && {_currentWeapon != handgunWeapon _unit} && {_currentWeapon != secondaryWeapon _unit}) exitWith {false};
|
||||
// Conditions
|
||||
if !([_unit, objNull, ["isNotInside"]] call FUNC(canInteractWith)) exitWith {false};
|
||||
|
||||
private _currentMuzzle = currentMuzzle ACE_player;
|
||||
private _currentAmmoCount = ACE_player ammo _currentMuzzle;
|
||||
if (_currentAmmoCount < 1) exitWith {false};
|
||||
if !(_unit call CBA_fnc_canUseWeapon) exitWith {false};
|
||||
|
||||
(weaponState _unit) params ["_weapon", "_muzzle", "", "_magazine", "_ammo"];
|
||||
|
||||
// Check if there is any ammo
|
||||
if (_ammo < 1) exitWith {false};
|
||||
|
||||
// Check if the unit has a weapon
|
||||
if (_weapon == "") exitWith {false};
|
||||
|
||||
// Check if the unit has a weapon selected
|
||||
if !(_weapon in [primaryWeapon _unit, handgunWeapon _unit, secondaryWeapon _unit]) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[_unit, _weapon, _muzzle, _magazine, _ammo, false] call FUNC(unloadUnitWeapon);
|
||||
|
||||
// Statement:
|
||||
[ACE_player, _currentWeapon, _currentMuzzle, _currentAmmoCount, false] call FUNC(unloadUnitWeapon);
|
||||
true
|
||||
}, {false}, [19, [false, false, true]], false] call CBA_fnc_addKeybind; //ALT + R Key
|
||||
}, {false}, [19, [false, false, true]], false] call CBA_fnc_addKeybind; // Alt + R
|
||||
|
||||
["CBA_loadoutSet", {
|
||||
params ["_unit", "_loadout"];
|
||||
|
@ -19,6 +19,9 @@ GVAR(isModLoadedCache) = createHashMap;
|
||||
GVAR(settingsInitFinished) = false;
|
||||
GVAR(runAtSettingsInitialized) = [];
|
||||
|
||||
GVAR(swayFactorsBaseline) = [];
|
||||
GVAR(swayFactorsMultiplier) = [];
|
||||
|
||||
// @todo: Generic local-managed global-synced objects (createVehicleLocal)
|
||||
|
||||
//Debug
|
||||
|
35
addons/common/functions/fnc_addSwayFactor.sqf
Normal file
35
addons/common/functions/fnc_addSwayFactor.sqf
Normal file
@ -0,0 +1,35 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: LinkIsGrim
|
||||
* Adds a factor to player sway calculation
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Type of factor, "baseline" or "multiplier" <STRING>
|
||||
* 1: Factor function, must return number <CODE>
|
||||
* 2: Factor ID, unique to type <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Factor added <BOOLEAN>
|
||||
*
|
||||
* Example:
|
||||
* ["baseline", {1}, "ace_common"] call ace_common_fnc_addSwayFactor
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
params ["_type", "_code", "_id"];
|
||||
|
||||
_type = toLower _type;
|
||||
|
||||
if !(_type in ["baseline", "multiplier"]) exitWith { ERROR_2("%1-%2 type unsupported",_type,_id); false };
|
||||
|
||||
if !((call _code) isEqualType 0) exitWith { ERROR_2("%1-%2 bad return type",_type,_id); false };
|
||||
|
||||
[missionNamespace, format ["ACE_setCustomAimCoef_%1", _type], _id, _code] call FUNC(arithmeticSetSource);
|
||||
|
||||
if (_type isEqualTo "baseline") then {
|
||||
GVAR(swayFactorsBaseline) pushBackUnique [_id];
|
||||
} else {
|
||||
GVAR(swayFactorsMultiplier) pushBackUnique [_id];
|
||||
};
|
||||
|
||||
true
|
@ -22,8 +22,8 @@ private _posASL = _input;
|
||||
|
||||
if ((_input isEqualType objNull) && {
|
||||
_posASL = getPosASL _input;
|
||||
(getPosATL _unit) select 2 > 0.05 || // Walking on objects, such as buildings, pavements, etc.
|
||||
{surfaceIsWater _posASL} // posATL in low water (not as low to allow awalking) is negative
|
||||
(getPosATL _input) select 2 > 0.05 || // Walking on objects, such as buildings, pavements, etc.
|
||||
{surfaceIsWater _posASL} // posATL in low water (not as low to allow walking) is negative
|
||||
}) exitWith {false};
|
||||
|
||||
private _surfaceClass = (surfaceType _posASL) select [1];
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user