Skip to content

Commit

Permalink
Merge branch 'acemod:master' into eyeInjury
Browse files Browse the repository at this point in the history
  • Loading branch information
MiszczuZPolski authored Sep 12, 2024
2 parents c7c44fd + fef34a8 commit d6435bb
Show file tree
Hide file tree
Showing 103 changed files with 2,575 additions and 639 deletions.
1 change: 1 addition & 0 deletions .github/workflows/arma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ jobs:
with:
name: ace3-${{ github.sha }}-nobin
path: .hemttout/@*
include-hidden-files: true # Because .hemttout is a hidden directory
2 changes: 1 addition & 1 deletion .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arrays.os.target }}
path: target/debug/ace.dll
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/hemtt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ jobs:
with:
name: ace3-${{ github.sha }}
path: .hemttout/@*
include-hidden-files: true # Because .hemttout is a hidden directory
15 changes: 12 additions & 3 deletions addons/advanced_fatigue/functions/fnc_mainLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ if (!alive ACE_player) exitWith {
private _velocity = velocity ACE_player;
private _normal = surfaceNormal (getPosWorld ACE_player);
private _movementVector = vectorNormalized _velocity;
private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal);
private _fwdAngle = asin (_movementVector select 2);
private _sideAngle = asin (_sideVector select 2);
private _sideAngle = if ((getPosATL ACE_player) select 2 > 0.01) then {
0 // ignore terrain normal if not touching it
} else {
private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal);
asin (_sideVector select 2);
};
if (GVAR(isSwimming)) then { // ignore when floating
_fwdAngle = 0;
_sideAngle = 0;
};


private _currentWork = REE;
private _currentSpeed = (vectorMagnitude _velocity) min 6;
Expand Down Expand Up @@ -62,7 +71,7 @@ if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround
};

// Used to simulate the unevenness/roughness of the terrain
if ((getPosATL ACE_player) select 2 < 0.01) then {
if (_sideAngle != 0) then {
private _sideGradient = abs (_sideAngle / 45) min 1;

_terrainFactor = 1 + _sideGradient ^ 4;
Expand Down
2 changes: 2 additions & 0 deletions addons/arsenal/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
#define IDC_statsPreviousPage 52
#define IDC_statsNextPage 53
#define IDC_statsCurrentPage 54
#define IDC_statsBoxTitleBackground 55
#define IDC_statsBoxBackground 56
#define IDC_actionsBox 90
#define IDC_actionsBackground1 90010
#define IDC_actionsBackground2 90011
Expand Down
54 changes: 47 additions & 7 deletions addons/arsenal/functions/fnc_handleStats.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
params ["_display", "_control", "_curSel", ["_itemCfg", configNull]];

private _statsBoxCtrl = _display displayCtrl IDC_statsBox;
private _statsBoxTitleBackgroundCtrl = _display displayCtrl IDC_statsBoxTitleBackground;
private _statsBoxBackgroundCtrl = _display displayCtrl IDC_statsBoxBackground;
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
Expand Down Expand Up @@ -111,6 +113,7 @@ private _fnc_handleStats = {
private _statsBarCtrl = controlNull;
private _statsTextCtrl = controlNull;
private _textStatementResult = "";
private _lastCtrl = _statsBoxTitleBackgroundCtrl;

{
_x params ["", "_configEntry", "_title", "_bools", "_statements"];
Expand All @@ -127,6 +130,17 @@ private _fnc_handleStats = {
_statsTitleCtrl ctrlSetText _title;
_statsTitleCtrl ctrlSetFade 0;

// Vertical Position
ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"];
_statsTitleCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
{
_x ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H + (5 * GRID_H));
} forEach [
_statsBackgroundCtrl,
_statsBarCtrl,
_statsTextCtrl
];

// Handle bars
if (_showBar) then {
_statsBarCtrl progressSetPosition ([_configEntry, _itemCfg] call _barStatement);
Expand All @@ -140,18 +154,39 @@ private _fnc_handleStats = {
// Handle text entries
if (_showText) then {
_textStatementResult = [_configEntry, _itemCfg] call _textStatement;

if !(_textStatementResult isEqualType "") then {
_textStatementResult = str _textStatementResult;
if (_textStatementResult isEqualType []) then {
_textStatementResult = _textStatementResult joinString endl;
} else {
if !(_textStatementResult isEqualType "") then {
_textStatementResult = str _textStatementResult;
};
};

_statsTextCtrl ctrlSetText _textStatementResult;
_statsTextCtrl ctrlSetTextColor ([[1, 1, 1, 1], [0, 0, 0, 1]] select (_showBar));

//Height based on Text lines
{
_x ctrlSetPositionH (ctrlTextHeight _statsTextCtrl);
} forEach [
_statsBackgroundCtrl,
_statsBarCtrl,
_statsTextCtrl
];

_statsTextCtrl ctrlSetFade 0;
} else {
_statsTextCtrl ctrlSetFade 1;
//Ensure default height
{
_x ctrlSetPositionH (5 * GRID_H);
} forEach [
_statsBackgroundCtrl,
_statsBarCtrl,
_statsTextCtrl
];
};

{
_x ctrlCommit 0;
} forEach [
Expand All @@ -160,24 +195,29 @@ private _fnc_handleStats = {
_statsBarCtrl,
_statsTextCtrl
];

_lastCtrl = _statsTextCtrl;

} forEach _statsToDisplay;


// Resize the window
(5 - _statsCount) call _fnc_hideUnused;
private _height = 10 * _statsCount + 5;
ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"];
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safeZoneY + 1.8 * GRID_H,
47 * GRID_W,
_height * GRID_H
_lastPosY + _lastPosH + GRID_H
];
_statsBoxBackgroundCtrl ctrlSetPositionH (_lastPosY + _lastPosH + GRID_H);
_statsBoxBackgroundCtrl ctrlCommit 0;
_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];
_pos set [1, safeZoneY + (_lastPosY + _lastPosH + GRID_H + (3.6 * GRID_H))];
_ctrl ctrlSetPosition _pos;
_ctrl ctrlCommit 0;

Expand Down
14 changes: 7 additions & 7 deletions addons/arsenal/ui/RscAttributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ class GVAR(display) {
h = QUOTE(55 * GRID_H);
class controls {
class statsStaticBackground1: ctrlStaticBackground {
idc = -1;
idc = IDC_statsBoxBackground;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
h = QUOTE(55 * GRID_H);
colorBackground[] = {0.1,0.1,0.1,0.5};
};
class statsStaticBackground2: ctrlStaticBackground {
idc = -1;
idc = IDC_statsBoxTitleBackground;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
Expand All @@ -316,7 +316,7 @@ class GVAR(display) {
x = QUOTE(1 * GRID_W);
y = QUOTE(10 * GRID_H);
w = QUOTE(45 * GRID_W);
h = QUOTE(4 * GRID_H);
h = QUOTE(5 * GRID_H);
colorBackground[] = {1,1,1,0.15};
};
class statsBar1: ctrlProgress {
Expand All @@ -329,9 +329,9 @@ class GVAR(display) {
x = QUOTE(1 * GRID_W);
y = QUOTE(10 * GRID_H);
w = QUOTE(45 * GRID_W);
h = QUOTE(4 * GRID_H);
h = QUOTE(5 * GRID_H);
};
class statsText1: RscText {
class statsText1: RscTextMulti {
idc = IDC_statsText1;
shadow = 0;
fade = 1;
Expand All @@ -340,7 +340,7 @@ class GVAR(display) {
x = QUOTE(0 * GRID_W);
y = QUOTE(10 * GRID_H);
w = QUOTE(45 * GRID_W);
h = QUOTE(4 * GRID_H);
h = QUOTE(5 * GRID_H);
sizeEx = QUOTE(5 * GRID_H);
text = "";
};
Expand Down Expand Up @@ -482,7 +482,7 @@ class GVAR(display) {
x = QUOTE(1 * GRID_W);
y = QUOTE(6 * GRID_H);
w = QUOTE(45 * GRID_W);
h = QUOTE(4 * GRID_H);
h = QUOTE(5 * GRID_H);
};
class actionsText2: actionsText1 {
idc = IDC_actionsText2;
Expand Down
1 change: 1 addition & 0 deletions addons/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ PREP(_handleRequestAllSyncedEvents);
// other eventhandlers
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addExplosionEventHandler);
PREP(addMapMarkerCreatedEventHandler);
PREP(addPlayerEH);

Expand Down
48 changes: 48 additions & 0 deletions addons/common/functions/fnc_addExplosionEventHandler.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "..\script_component.hpp"
/*
* Author: johnb432, PabstMirror
* Adds event hander for explosions (for local projectiles)
* Warning: For shots that are tracers and explosive the event will trigger on all machines in range
* This function may be changed after 2.18!
*
* Arguments:
* 0: Code to execute <CODE>
*
* Return Value:
* The CBA Event Handler Index <NUMBER>
*
* Example:
* [{systemChat "boom"}] call ace_common_fnc_addExplosionEventHandler
*
* Public: No (maybe after 2.18)
*/

params [["_code", {}, [{}]]];

if !(missionNamespace getVariable [QGVAR(addExplosionEventHandlerActive), false]) then {
GVAR(addExplosionEventHandlerActive) = true;

// Add EH to existing projectiles and mines
{
TRACE_2("existing",typeOf _x,local _x);
// Rockets only explode on local clients
_x addEventHandler ["Explode", {
TRACE_1("exp (existing)",_this);
[QGVAR(explosion), _this] call CBA_fnc_localEvent;
}];
} forEach ((8 allObjects 2) select {local _x});

addMissionEventHandler ["ProjectileCreated", {
params ["_projectile"];
TRACE_2("pc",typeOf _projectile,local _projectile);

if (!local _projectile) exitWith {}; // Rockets only explode on local clients

_projectile addEventHandler ["Explode", {
TRACE_1("exp",_this);
[QGVAR(explosion), _this] call CBA_fnc_localEvent;
}];
}];
};

[QGVAR(explosion), _code] call CBA_fnc_addEventHandler
6 changes: 3 additions & 3 deletions addons/common/functions/fnc_claim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ _target setVariable [QGVAR(owner), _unit, true];

// lock target object
if (_lockTarget) then {
if (!isNull _unit) then {
[QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent;
} else {
if (isNull _unit) then {
[QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent;
} else {
[QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent;
};
};

Expand Down
6 changes: 3 additions & 3 deletions addons/common/functions/fnc_getDeathAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText

TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);

if (!isNull objectParent _unit) then {
if (isNull objectParent _unit) then {
_returnAnimation = getText (_unitActionsCfg >> "die");
} else {
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");

for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
Expand All @@ -42,8 +44,6 @@ if (!isNull objectParent _unit) then {
_returnAnimation = _indexAnimation;
};
};
} else {
_returnAnimation = getText (_unitActionsCfg >> "die");
};

//Fallback if nothing valid found:
Expand Down
49 changes: 40 additions & 9 deletions addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,51 @@ class CfgAmmo {

class ace_missileguidance {
enabled = 1;
minDeflection = 0.00005;
maxDeflection = 0.025;
incDeflection = 0.00005;

pitchRate = 120; // degrees per second
yawRate = 120;
stabilityCoefficient = 0.2;
bangBangGuidance = 0;

canVanillaLock = 0;

// Guidance type for munitions
defaultSeekerType = "Optic";
seekerTypes[] = {"Optic"};
seekerTypes[] = { "Optic" };

defaultSeekerLockMode = "LOBL";
seekerLockModes[] = {"LOBL"};
seekerAngle = 180;
seekerAccuracy = 1;
seekerLockModes[] = { "LOBL" };

defaultNavigationType = "Direct";
navigationTypes[] = { "Direct", "ZeroEffortMiss" };

navigationGain = 3;

seekerAngle = 180; // Angle in front of the missile which can be searched
seekerAccuracy = 1; // seeker accuracy multiplier

seekerMinRange = 0;
seekerMaxRange = 2500;
seekerMaxRange = 2500; // Range from the missile which the seeker can visually search

seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos]

// Attack profile type selection
defaultAttackProfile = "JAV_TOP";
attackProfiles[] = {"JAV_TOP", "JAV_DIR"};
attackProfiles[] = { "JAV_TOP", "JAV_DIR" };
useModeForAttackProfile = 1;

class navigationStates {
class initial {
transitionCondition = QEFUNC(missileguidance,javelin_midCourseTransition);
navigationType = "Direct";
};
class terminal {
transitionCondition = "";
navigationType = "ZeroEffortMiss";
};
// transitions from initial -> termimal
states[] = {"initial", "terminal"};
};
};
};
};
Loading

0 comments on commit d6435bb

Please sign in to comment.