Skip to content

Commit

Permalink
Merge pull request #2 from acemod/master
Browse files Browse the repository at this point in the history
Update from original
  • Loading branch information
classicarma authored May 1, 2019
2 parents d5b226a + 0e09879 commit 8fe35c8
Show file tree
Hide file tree
Showing 754 changed files with 23,116 additions and 18,806 deletions.
4 changes: 4 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ Aleksey EpMAK Yermakov <[email protected]>
Alganthe <[email protected]>
Andrea "AtixNeon" Verano <[email protected]>
Anthariel <[email protected]>
Arcanum417 <[email protected]>
Anton
Arcanum417 <[email protected]>
Arkhir <[email protected] >
Asgar Serran <[email protected]>
BaerMitUmlaut
Expand Down Expand Up @@ -127,6 +129,7 @@ Raspu86
Riccardo Petricca <[email protected]>
Robert Boklahánics <[email protected]>
ruPaladin <[email protected]>
Rutger "RedBery" Meijering <[email protected]>
simon84 <[email protected]>
Skengman2
Sniperwolf572 <[email protected]>
Expand All @@ -144,4 +147,5 @@ voiper
VyMajoris(W-Cephei)<[email protected]>
Winter <[email protected]>
xrufix
Zakant <[email protected]>
zGuba
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p align="center">
<a href="https://github.com/acemod/ACE3/releases/latest">
<img src="https://img.shields.io/badge/Version-3.12.5-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/badge/Version-3.12.6-blue.svg?style=flat-square" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/issues">
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.5.40
3.12.6.43
Binary file modified ace_medical.dll
Binary file not shown.
Binary file modified ace_medical_x64.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* muzzle velocity shift - m/s <NUMBER>
*
* Example:
* [[], 5] call ace_advanced_ballistics_fnc_calcilateAmmoTemperatureVelocityShift
* [[], 5] call ace_advanced_ballistics_fnc_calculateAmmoTemperatureVelocityShift
*
* Public: No
*/
Expand Down
20 changes: 19 additions & 1 deletion addons/advanced_fatigue/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#include "script_component.hpp"

if (!hasInterface) exitWith {};

[missionNamespace, "ACE_setCustomAimCoef", QUOTE(ADDON), {
private _unit = ACE_player;
private _fatigue = _unit getVariable [QGVAR(aimFatigue), 0];

switch (stance _unit) do {
case ("CROUCH"): {
1.0 + _fatigue ^ 2 * 0.1
};
case ("PRONE"): {
1.0 + _fatigue ^ 2 * 2.0
};
default {
1.5 + _fatigue ^ 2 * 3.0
};
};
}] call EFUNC(common,arithmeticSetSource);

["ace_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};

Expand Down Expand Up @@ -30,7 +48,7 @@ if (!hasInterface) exitWith {};
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
}] call FUNC(addDutyFactor);
[QEGVAR(medical,bloodVolume), { // 100->1.0, 90->1.1, 80->1.2
linearConversion [100, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true];
linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true];
}] call FUNC(addDutyFactor);
};
if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then {
Expand Down
15 changes: 4 additions & 11 deletions addons/advanced_fatigue/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ if (_overexhausted) then {
};
};

switch (stance _unit) do {
case ("CROUCH"): {
[_unit, QUOTE(ADDON), (1.0 + _fatigue ^ 2 * 0.1) * GVAR(swayFactor)] call EFUNC(common,setAimCoef);
};
case ("PRONE"): {
[_unit, QUOTE(ADDON), (1.0 + _fatigue ^ 2 * 2.0) * GVAR(swayFactor)] call EFUNC(common,setAimCoef);
};
default {
[_unit, QUOTE(ADDON), (1.5 + _fatigue ^ 2 * 3.0) * GVAR(swayFactor)] call EFUNC(common,setAimCoef);
};
};
_unit setVariable [QGVAR(aimFatigue), _fatigue];

private _aimCoef = [missionNamespace, "ACE_setCustomAimCoef", "max"] call EFUNC(common,arithmeticGetResult);
_unit setCustomAimCoef _aimCoef;
41 changes: 38 additions & 3 deletions addons/arsenal/Cfg3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Cfg3DEN {
};
class Category: ctrlToolboxPictureKeepAspect {
idc = IDC_ATTRIBUTE_CATEGORY;
onToolBoxSelChanged = QUOTE([ctrlParentControlsGroup (_this select 0)] call FUNC(attributeAddItems));
onToolBoxSelChanged = QUOTE([ARR_2(ctrlParentControlsGroup (_this select 0), _this select 1)] call FUNC(attributeCategory));
x = QUOTE(5 * ATTRIBUTE_W);
y = QUOTE(15 * ATTRIBUTE_H);
w = QUOTE(125 * ATTRIBUTE_W);
Expand Down Expand Up @@ -129,7 +129,14 @@ class Cfg3DEN {
};
class SearchButton: ctrlButtonPicture {
idc = IDC_ATTRIBUTE_SEARCH_BUTTON;
onButtonClick = QUOTE(((ctrlParentControlsGroup (_this select 0)) controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR) ctrlSetText ''; [ctrlParentControlsGroup (_this select 0)] call FUNC(attributeAddItems));
onButtonClick = QUOTE( \
params ['_searchButton']; \
private _controlsGroup = ctrlParentControlsGroup _searchButton; \
private _searchBar = _controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_SEARCHBAR; \
_searchBar ctrlSetText ''; \
ctrlSetFocus _searchBar; \
[_controlsGroup] call FUNC(attributeAddItems); \
);
text = "\a3\Ui_f\data\GUI\RscCommon\RscButtonSearch\search_start_ca.paa";
x = QUOTE(5 * ATTRIBUTE_W);
y = QUOTE(101.83 * ATTRIBUTE_H);
Expand All @@ -140,9 +147,16 @@ class Cfg3DEN {
class SearchBar: ctrlEdit {
idc = IDC_ATTRIBUTE_SEARCHBAR;
onKeyUp = QUOTE([ctrlParentControlsGroup (_this select 0)] call FUNC(attributeAddItems));
onMouseButtonClick = QUOTE( \
params [ARR_2('_searchBar','_button')]; \
if (_button != 1) exitWith {}; \
_searchBar ctrlSetText ''; \
ctrlSetFocus _searchBar; \
[ctrlParentControlsGroup _searchBar] call FUNC(attributeAddItems); \
);
x = QUOTE(11 * ATTRIBUTE_W);
y = QUOTE(101.83 * ATTRIBUTE_H);
w = QUOTE(55 * ATTRIBUTE_W);
w = QUOTE(40 * ATTRIBUTE_W);
h = QUOTE(5 * ATTRIBUTE_H);
};
class ClearButton: ctrlButton {
Expand All @@ -162,6 +176,27 @@ class Cfg3DEN {
tooltip = CSTRING(AttributeExport_Tooltip);
x = QUOTE(79 * ATTRIBUTE_W);
};
class ImportButton: ClearButton {
idc = IDC_ATTRIBUTE_IMPORT_BUTTON;
onButtonClick = QUOTE([ctrlParentControlsGroup (_this select 0)] call FUNC(attributeImport));
text = CSTRING(buttonImportText);
tooltip = CSTRING(AttributeImport_Tooltip);
x = QUOTE(53 * ATTRIBUTE_W);
};
class AddCompatible: ctrlButton {
idc = IDC_ATTRIBUTE_ADD_COMPATIBLE;
style = ST_CENTER;
onButtonClick = QUOTE([ctrlParentControlsGroup (_this select 0)] call FUNC(attributeAddCompatible));
text = CSTRING(AttributeAddCompatible_DisplayName);
tooltip = CSTRING(AttributeAddCompatible_Tooltip);
font = "RobotoCondensedLight";
x = QUOTE(98.75 * ATTRIBUTE_W);
y = QUOTE(10.5 * ATTRIBUTE_H);
w = QUOTE(31.25 * ATTRIBUTE_W);
h = QUOTE(4 * ATTRIBUTE_H);
sizeEx = QUOTE(4 * ATTRIBUTE_H);
colorBackground[] = {0, 0, 0, 0.5};
};
};
};
};
Expand Down
8 changes: 4 additions & 4 deletions addons/arsenal/Display3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ class Display3DEN {
};
class aceArsenal: virtualArsenal {
text = "ACE Arsenal";
action = QUOTE(call FUNC(open3DEN));
action = QUOTE(call DFUNC(open3DEN));
};
};
};
class Controls {
class MenuStrip: ctrlMenuStrip {
class Items {
class Tools {
items[] += {"ACE_arsenal_portVALoadouts"};
items[] += {QGVAR(portVALoadouts)};
};
class ACE_arsenal_portVALoadouts {
class GVAR(portVALoadouts) {
text = CSTRING(portLoadoutsText);
picture = QPATHTOEF(common,data\logo_ace3_ca.paa);
action = "call ace_arsenal_fnc_portVALoadouts;";
action = QUOTE(call DFUNC(portVALoadouts););
};
};
};
Expand Down
3 changes: 3 additions & 0 deletions addons/arsenal/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ PREP(addDefaultLoadout);
PREP(addListBoxItem);
PREP(addStat);
PREP(addVirtualItems);
PREP(attributeAddCompatible);
PREP(attributeAddItems);
PREP(attributeCategory);
PREP(attributeClear);
PREP(attributeDblClick);
PREP(attributeImport);
PREP(attributeInit);
PREP(attributeKeyDown);
PREP(attributeLoad);
Expand Down
11 changes: 11 additions & 0 deletions addons/arsenal/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,15 @@ GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium

call FUNC(compileStats);

// compatibility with CBA scripted 2d optics framework
[QGVAR(displayOpened), {
"cba_optics_arsenalOpened" call CBA_fnc_localEvent;
"cba_disposable_arsenalOpened" call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;

[QGVAR(displayClosed), {
"cba_optics_arsenalClosed" call CBA_fnc_localEvent;
"cba_disposable_arsenalClosed" call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;

ADDON = true;
2 changes: 2 additions & 0 deletions addons/arsenal/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@
#define IDC_ATTRIBUTE_SEARCHBAR 8106
#define IDC_ATTRIBUTE_CLEAR_BUTTON 8107
#define IDC_ATTRIBUTE_EXPORT_BUTTON 8108
#define IDC_ATTRIBUTE_IMPORT_BUTTON 8109
#define IDC_ATTRIBUTE_ADD_COMPATIBLE 8110

#define SYMBOL_ITEM_NONE ""
#define SYMBOL_ITEM_REMOVE "×"
Expand Down
75 changes: 75 additions & 0 deletions addons/arsenal/functions/fnc_attributeAddCompatible.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "script_component.hpp"
#include "..\defines.hpp"
/*
* Author: mharis001
* Adds compatible attachments or magazines for all weapons in 3DEN attribute.
*
* Arguments:
* 0: Attribute controls group <CONTROL>
*
* Return Value:
* None
*
* Example:
* [CONTROL] call ace_arsenal_fnc_attributeAddCompatible
*
* Public: No
*/

params ["_controlsGroup"];

private _category = lbCurSel (_controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_CATEGORY);

// Exit if selected category is not attachments or magazines
if !(_category in [4, 5, 6, 7, 8]) exitWith {};

private _configItems = +(uiNamespace getVariable [QGVAR(configItems), []]);
private _attributeValue = uiNamespace getVariable [QGVAR(attributeValue), [[], 0]];
_attributeValue params ["_attributeItems"];

// Get list of all weapons in attribute items
(_configItems select 0) params ["_primaryWeapons", "_secondaryWeapons", "_handgunWeapons"];
private _attributeWeapons = _attributeItems select {_x in _primaryWeapons || {_x in _secondaryWeapons} || {_x in _handgunWeapons}};

// Add compatible attachments or magazines to attribute
private _cfgWeapons = configFile >> "CfgWeapons";
private _itemsToAdd = [];

if (_category == 8) then {
private _magazineGroups = uiNamespace getVariable QGVAR(magazineGroups);
private _cfgMagazines = configFile >> "CfgMagazines";

{
private _weaponConfig = _cfgWeapons >> _x;

{
private _muzzleConfig = if (_x == "this") then {_weaponConfig} else {_weaponConfig >> _x};

// Only add existent magazines and ensure correct classname case
private _magazines = getArray (_muzzleConfig >> "magazines") select {isClass (_cfgMagazines >> _x)};
_magazines = _magazines apply {configName (_cfgMagazines >> _x)};
_itemsToAdd append _magazines;

{
_itemsToAdd append ([_magazineGroups, toLower _x] call CBA_fnc_hashGet);
} forEach getArray (_muzzleConfig >> "magazineWell");
} forEach getArray (_weaponConfig >> "muzzles");
} forEach _attributeWeapons;
} else {
private _attachmentCategory = _category - 4;
private _filter = ["optic", "pointer", "muzzle", "bipod"] select _attachmentCategory;

{
_itemsToAdd append ([_x, _filter] call CBA_fnc_compatibleItems);
} forEach _attributeWeapons;

// Only add items with scope of 2 and ensure correct classname case
_itemsToAdd = _itemsToAdd select {getNumber (_cfgWeapons >> _x >> "scope") == 2};
_itemsToAdd = _itemsToAdd apply {configName (_cfgWeapons >> _x)};
};

_attributeItems append _itemsToAdd;
_attributeValue set [0, _attributeItems arrayIntersect _attributeItems];

// Refresh the list for new items
[_controlsGroup] call FUNC(attributeAddItems);
32 changes: 32 additions & 0 deletions addons/arsenal/functions/fnc_attributeCategory.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "script_component.hpp"
#include "..\defines.hpp"
/*
* Author: mharis001
* Handles changing the category in 3DEN attribute.
*
* Arguments:
* 0: Attribute controls group <CONTROL>
* 1: Category <NUMBER>
*
* Return Value:
* None
*
* Example:
* [CONTROL, 0] call ace_arsenal_fnc_attributeCategory
*
* Public: No
*/

params ["_controlsGroup", "_category"];

// Store selected category
uiNamespace setVariable [QGVAR(attributeCategory), _category];

// Show add compatible items button when category is attachments or magazines
private _compatibleButton = _controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_ADD_COMPATIBLE;
private _enable = _category in [4, 5, 6, 7, 8];
_compatibleButton ctrlEnable _enable;
_compatibleButton ctrlShow _enable;

// Refresh the list for selected category
[_controlsGroup] call FUNC(attributeAddItems);
49 changes: 49 additions & 0 deletions addons/arsenal/functions/fnc_attributeImport.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "script_component.hpp"
/*
* Author: mharis001
* Handles importing items list from clipboard into 3DEN attribute.
*
* Arguments:
* 0: Attribute controls group <CONTROL>
*
* Return Value:
* None
*
* Example:
* [CONTROL] call ace_arsenal_fnc_attributeImport
*
* Public: No
*/

params ["_controlsGroup"];

private _importList = call compile copyFromClipboard;

// Verify import list is in correct format
if (isNil "_importList" || {!(_importList isEqualType [])} || {!(_importList isEqualTypeAll "")}) exitWith {
playSound ["3DEN_notificationWarning", true];
};

// Ensure imported items are in scanned config array and classname case is correct
private _configItems = +(uiNamespace getVariable [QGVAR(configItems), []]);
private _configItemsFlat = _configItems select [2, 16];
_configItemsFlat append (_configItems select 0);
_configItemsFlat append (_configItems select 1);

private _filteredList = [];

{
private _item = _x;
{
private _index = _x findIf {_x == _item};
if (_index > -1) then {
_filteredList pushBackUnique (_x select _index);
};
} forEach _configItemsFlat;
} forEach _importList;

private _attributeValue = uiNamespace getVariable [QGVAR(attributeValue), [[], 0]];
_attributeValue set [0, _filteredList];

// Refresh the list for new items
[_controlsGroup] call FUNC(attributeAddItems);
Loading

0 comments on commit 8fe35c8

Please sign in to comment.