forked from ampersand38/ride-where-you-look
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cd9ef2
commit 9157796
Showing
30 changed files
with
2,444 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = crlf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: python | ||
python: | ||
- '3.4' | ||
script: | ||
- python3 tools/sqf_validator.py | ||
- python3 tools/config_style_checker.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z\rwyl\addons\main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preStart)); | ||
}; | ||
}; | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class CfgFactionClasses { | ||
class NO_CATEGORY; | ||
class RWYL: NO_CATEGORY { | ||
displayName = "RWYL"; | ||
priority = 2; | ||
side = 7; | ||
}; | ||
}; | ||
|
||
class CfgVehicleClasses { | ||
class RWYL_Vehicles { | ||
displayName = "RWYL Vehicles"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rwyl_main | ||
======== | ||
|
||
Backbone of other components, defining most of the commonly used macros. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// testing, update fncs on the fly | ||
//#define PREP(var1) TRIPLES(ADDON,fnc,var1) = { call compile preProcessFileLineNumbers '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT_F\functions\DOUBLES(fnc,var1).sqf' } | ||
//amp_slingload_fnc_adjustRigging = {call compile preProcessFileLineNumbers '\z\amp\addons\slingload\functions\fnc_adjustRigging.sqf'} | ||
|
||
PREP(findSeat); | ||
PREP(moveSeat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "script_component.hpp" | ||
|
||
["rwyl_main_moveSeat", { | ||
params ["_unit", "_role", "_cargoIndex", "_turretPath"]; | ||
if (rwyl_main_vehicle == vehicle _unit) then {moveOut _unit;}; | ||
[{ | ||
params ["_unit"]; | ||
vehicle _unit == _unit | ||
},{ | ||
params ["_unit", "_role", "_cargoIndex", "_turretPath"]; | ||
if (toLower _role isEqualTo "cargo") then { | ||
_unit moveInCargo [rwyl_main_vehicle, _cargoIndex]; | ||
} else { | ||
_unit moveInTurret [rwyl_main_vehicle, _turretPath]; | ||
}; | ||
rwyl_main_vehicle = objNull; | ||
rwyl_main_proxy = nil; | ||
}, [_unit, _role, _cargoIndex, _turretPath]] call CBA_fnc_waitUntilAndExecute; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
[ | ||
"Ride Where You Look", "rwyl_main_selectSeat", "Select Seat",{ | ||
if (isNull curatorCamera) then { | ||
[player] call rwyl_main_fnc_findSeat; | ||
} else { | ||
if (count (curatorSelected # 0) == 1) then { | ||
[curatorSelected # 0 # 0] call rwyl_main_fnc_findSeat; | ||
}; | ||
}; | ||
},{ | ||
rwyl_main_pfh_running = false; | ||
if (isNull curatorCamera) then { | ||
[player] call rwyl_main_fnc_moveSeat; | ||
} else { | ||
if (count (curatorSelected # 0) == 1) then { | ||
[curatorSelected # 0 # 0] call rwyl_main_fnc_moveSeat; | ||
}; | ||
}; | ||
}, [45, [false, false, false]], false //, 0, true | ||
] call CBA_fnc_addKeybind; // x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
#include "XEH_PREP.hpp" | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "script_component.hpp" | ||
|
||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
name = COMPONENT_NAME; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"cba_common"}; | ||
author = "Ampersand"; | ||
authors[] = {"Ampersand"}; | ||
authorUrl = "https://github.com/ampersand38/rwyl"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" | ||
#include "CfgModuleCategories.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Author: Ampers | ||
PFH to show which seat the unit is looking at | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* - | ||
* Exrwylle: | ||
* [player] call rwyl_main_fnc_findSeat | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
rwyl_main_vehicle = vehicle _unit; | ||
if (rwyl_main_vehicle == _unit) then { | ||
private _start = AGLtoASL (_unit modelToWorldVisual (_unit selectionPosition "pilot")); | ||
private _end = (_start vectorAdd (getCameraViewDirection _unit vectorMultiply 3)); | ||
private _objects = lineIntersectsSurfaces [_start, _end, _unit]; | ||
rwyl_main_vehicle = (_objects param [0, []]) param [2, objNull]; | ||
}; | ||
|
||
if (isNull rwyl_main_vehicle) exitWith {"no pfh"}; | ||
if (locked rwyl_main_vehicle in [2,3]) exitWith { | ||
hintSilent "Vehicle Locked"; | ||
false | ||
}; | ||
|
||
rwyl_main_pfh_running = true; | ||
[{ | ||
params ["", "_pfID"]; | ||
rwyl_main_proxy = nil; | ||
if (!rwyl_main_pfh_running) exitWith { | ||
[_pfID] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
|
||
private _sn = selectionNames rwyl_main_vehicle select { | ||
private _lastChar = _x select [count _x -1]; | ||
((parseNumber _lastChar > 0) || {_lastChar isEqualTo "0"}) && { | ||
("cargo" in toLower _x) && { | ||
!((rwyl_main_vehicle selectionPosition _x) isEqualTo [0,0,0])}}}; | ||
|
||
if (_sn isEqualTo []) exitWith { | ||
rwyl_main_vehicle = objNull; | ||
"no cargo proxies found in selectionNames" | ||
}; | ||
|
||
private _sp = _sn apply {rwyl_main_vehicle selectionPosition _x}; | ||
|
||
private _screenPosArray = _sp apply { | ||
private _w2s = worldToScreen (rwyl_main_vehicle modelToWorld _x); | ||
if (_w2s isEqualTo []) then { | ||
1000 | ||
} else { | ||
([getMousePosition, [0.5,0.5]] select (isNull curatorCamera)) distance2D _w2s | ||
}; | ||
}; | ||
|
||
rwyl_main_proxy = _sn # (_screenPosArray findIf {_x == selectMin _screenPosArray}); | ||
|
||
if (isNil "rwyl_main_proxy") exitWith { | ||
rwyl_main_vehicle = objNull; | ||
"no cargo proxies on screen" | ||
}; | ||
|
||
drawIcon3D ["\a3\3den\Data\Cfg3DEN\Object\iconCargo_ca.paa", [1,1,1,1], rwyl_main_vehicle modelToWorld (rwyl_main_vehicle selectionPosition rwyl_main_proxy), 1, 1, 0, rwyl_main_proxy select [(rwyl_main_proxy find ".") + 1]]; | ||
}, 0] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
Author: Ampers | ||
Move unit into vehicle seat near center of view | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* - | ||
* Exrwylle: | ||
* [player] call rwyl_main_fnc_moveSeat | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
rwyl_main_pfh_running = false; | ||
if (isNull rwyl_main_vehicle) then { | ||
rwyl_main_vehicle = vehicle _unit; | ||
if (rwyl_main_vehicle == _unit) then { | ||
rwyl_main_vehicle = nearestObject [positionCameraToWorld [0,0,2], "AllVehicles"]; | ||
}; | ||
}; | ||
|
||
if (isNil "rwyl_main_proxy") then { | ||
private _sn = selectionNames rwyl_main_vehicle select {("cargo" in toLower _x) && {!((rwyl_main_vehicle selectionPosition _x) isEqualTo [0,0,0])}}; | ||
|
||
if (_sn isEqualTo []) exitWith { "no cargo proxies found in selectionNames"}; | ||
|
||
private _sp = _sn apply {rwyl_main_vehicle selectionPosition _x}; | ||
|
||
private _screenPosArray = _sp apply { | ||
private _w2s = worldToScreen (rwyl_main_vehicle modelToWorld _x); | ||
if (_w2s isEqualTo []) then { | ||
1000 | ||
} else { | ||
[0.5,0.5] distance2D _w2s | ||
}; | ||
}; | ||
|
||
rwyl_main_proxy = _sn # (_screenPosArray findIf {_x == selectMin _screenPosArray}); | ||
}; | ||
|
||
if (rwyl_main_proxy isEqualTo "") exitWith { ["no seat found", rwyl_main_vehicle]}; | ||
|
||
// get cargo index from proxy name | ||
private _cargoIndexStr = rwyl_main_proxy select [(rwyl_main_proxy find ".") + 1]; | ||
|
||
// get all cargo seat indexes | ||
private _fullCrew = fullCrew [rwyl_main_vehicle, "", true]; | ||
|
||
private _role = ""; | ||
private _cargoIndex = -1; | ||
private _turretPath = []; | ||
|
||
{ | ||
//_x params ["_seatOccupant", "_seatRole", "_seatCargoIndex", "_seatTurretPath"]; | ||
_x params ["_seatOccupant", "_seatRole", "_seatCargoIndex", "_seatTurretPath"]; | ||
if ( | ||
isNull _seatOccupant && { | ||
parseNumber _cargoIndexStr == _seatCargoIndex + 1} | ||
) then { | ||
_cargoIndex = _seatCargoIndex; | ||
_role = _seatRole; | ||
_turretPath = _seatTurretPath; | ||
}; | ||
_seatCargoIndex == _cargoIndex && {isNull _seatOccupant} | ||
} forEach _fullCrew; | ||
|
||
if (_cargoIndex < 0) exitWith { | ||
["_cargoIndex not found", rwyl_main_proxy, _cargoIndexStr, _cargoIndex] | ||
}; | ||
|
||
["rwyl_main_moveSeat", [_unit, _role, _cargoIndex, _turretPath], _unit] call CBA_fnc_targetEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "\z\rwyl\addons\main\script_component.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#define COMPONENT main | ||
#include "\z\rwyl\addons\main\script_mod.hpp" | ||
|
||
// #define DEBUG_MODE_FULL | ||
// #define DISABLE_COMPILE_CACHE | ||
// #define CBA_DEBUG_SYNCHRONOUS | ||
// #define ENABLE_PERFORMANCE_COUNTERS | ||
|
||
#ifdef DEBUG_ENABLED_MAIN | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
|
||
#ifdef DEBUG_SETTINGS_MAIN | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN | ||
#endif | ||
|
||
#include "\z\rwyl\addons\main\script_macros.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "\z\ace\addons\main\script_macros.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp | ||
|
||
#define MAINPREFIX z | ||
#define PREFIX rwyl | ||
|
||
#include "script_version.hpp" | ||
|
||
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD | ||
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD | ||
|
||
#define RWYL_TAG RWYL | ||
|
||
// MINIMAL required version for the Mod. Components can specify others.. | ||
#define REQUIRED_VERSION 1.56 | ||
|
||
#ifdef COMPONENT_BEAUTIFIED | ||
#define COMPONENT_NAME QUOTE(rwyl - COMPONENT_BEAUTIFIED) | ||
#else | ||
#define COMPONENT_NAME QUOTE(rwyl - COMPONENT) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#define MAJOR 1 | ||
#define MINOR 0 | ||
#define PATCHLVL 1 | ||
#define BUILD 0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.