Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayd committed Jan 24, 2019
2 parents 5c107af + 1c40cb5 commit f6ba94e
Show file tree
Hide file tree
Showing 38 changed files with 490 additions and 275 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Revive: Marker für bewusstlose Einheiten werden jetzt vom GPS-System gehandhabt, d.h. in Echtzeit aktualisiert. Dadurch kommt es nicht mehr zu "Ghost"-Markern an falscher Stelle
- Waffenwechsel: Komponente wurde überarbeitet und in einzelne Funktionen aufgeteilt. Einige Fehler aus dem Forum behoben.
- Kritischer Bugfix #45: Fahne kann nicht mehr länger per Hotkey aus der Entfernung gezogen werden
- Flip: Bugfix sowie Refactoring in der Komponente Flip. Fahrzeuge und Flugzeuge können wieder umgedreht werden, falls sie schief liegen oder umgekippt sind
- Waffenwechsel: Weitere Bugfixes durch Lord

### Editor

Expand Down
6 changes: 6 additions & 0 deletions [J]OPT.Altis/CfgEventhandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class Extended_PreInit_EventHandlers {
};
class GVARMAIN(fieldrepair) {
init = QUOTE(call compile preProcessFileLineNumbers 'fieldrepair\XEH_PreInit.sqf');
};
class GVARMAIN(flip) {
init = QUOTE(call compile preProcessFileLineNumbers 'flip\XEH_PreInit.sqf');
};
class GVARMAIN(gps) {
init = QUOTE(call compile preProcessFileLineNumbers 'gps\XEH_PreInit.sqf');
Expand Down Expand Up @@ -104,6 +107,9 @@ class Extended_PostInit_EventHandlers {
class GVARMAIN(fieldrepair) {
init = QUOTE(call compile preProcessFileLineNumbers 'fieldrepair\XEH_PostInit.sqf');
};
class GVARMAIN(flip) {
init = QUOTE(call compile preProcessFileLineNumbers 'flip\XEH_PostInit.sqf');
};
class GVARMAIN(gps) {
init = QUOTE(call compile preProcessFileLineNumbers 'gps\XEH_PostInit.sqf');
};
Expand Down
Binary file added [J]OPT.Altis/assets/paa/schild_fahrzeuge.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_luftwaffe.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_marine.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_muni.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_nachschub.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_panzer.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_radar.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_service.paa
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_teleport.paa
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added [J]OPT.Altis/assets/paa/schild_verkaufen.paa
Binary file not shown.
2 changes: 0 additions & 2 deletions [J]OPT.Altis/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ PREP(addToCurator);
PREP(createMarker);
PREP(execFunc);
PREP(fillLB);
PREP(flipCheck);
PREP(nearbyPlayers);
PREP(playerName);
PREP(playerSide);
PREP(renderBudget);
PREP(renewCurator);
PREP(unFlip);
PREP(updateBudget);
PREP(vehicleSide);
PREP(weaponCheck);
5 changes: 5 additions & 0 deletions [J]OPT.Altis/flip/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

PREP(initCBAClassEvents);
PREP(initCBASettings);
PREP(flipCheck);
PREP(unFlip);
10 changes: 10 additions & 0 deletions [J]OPT.Altis/flip/XEH_PostInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "script_component.hpp"

/*
this line is commented, otherwise it would disturb the linter.
["LandVehicle", "init", FUNC(onInit), nil, nil, true] call CBA_fnc_addClassEventHandler;
*/

if (!GVAR(on)) exitWith{};

[] call FUNC(initCBAClassEvents);
17 changes: 17 additions & 0 deletions [J]OPT.Altis/flip/XEH_PreInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "script_component.hpp"

ADDON = false;

PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

ADDON = true;

/* INITIALIZE GLOBAL VARS */
// list all global variables used within the component
// define variable with default value!
// GVAR(...)

// initialize CBA Settings
[] call FUNC(initCBASettings);
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* no
*
* Public:
* no - should be called via condition of addAction
* no - should be called via condition check of addAction command
*
* Global:
* no
Expand All @@ -25,12 +25,12 @@
* no
*
* Example:
* [vec, unit] call EFUNC(common,flipCheck);
* [vec, unit] call EFUNC(flip,flipCheck);
*/
#include "script_component.hpp"

/* PARAMS */
params
params
[
["_target", objNull, [objNull], 1],
["_caller", objNull, [objNull], 1]
Expand All @@ -41,17 +41,17 @@ private _ret = false;
if (_target isEqualTo objNull or _caller isEqualTo objNull) exitWith{_ret};

/* CODE BODY */
// check speed of vehicle, distance between target and caller, type and status of vehicle and facing dir
private _cond =
// check speed of vehicle, distance between target and caller, type and status of vehicle and facing dir
private _cond =
(
(speed _target < 1) and
((_target distance _caller) < 10) and
(_target isKindOf 'landVehicle') and
(alive _target) and
(speed _target < 1) and
(crew _target isEqualTo []) and
((_target distance _caller) < 10) and
(alive _target) and
((vectorUp _target) select 2 < 0.4)
);

if (_cond) then
if (_cond) then
{
_ret = true;
};
Expand Down
71 changes: 71 additions & 0 deletions [J]OPT.Altis/flip/functions/fnc_initCBAClassEvents.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* Description:
* initialize CBA class event handler
*
* Author:
* James
*
* Arguments:
* None
*
* Return Value:
* None
*
* Server only:
* no
*
* Public:
* no - should be called only once at mission start from XEH_PostInit.sqf
*
* Global:
* no
*
* Sideeffects:
* add action menu item to vehicles (both land and air) to unflip vehicle
*
* Example:
* [] call EFUNC(flip,initCBAClassEvents);
*
*/
#include "script_component.hpp"

/* CLASS EH */
/* EXAMPLE FROM https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects
["CAManBase", "fired", {systemChat str _this}] call CBA_fnc_addClassEventHandler;
This will show a chat message every time a soldier fires a weapon. It is advised to use CAManBase instead of Man when dealing with soldiers, because Man is the parent class of all animals, including the randomly spawning rabbits, snakes and fish. Using CAManBase slightly reduces the overhead that would happen when any of these spawn (which actually happens pretty frequently).
["AllVehicles", "getIn", {hint str _this}] call CBA_fnc_addClassEventHandler;
This event happens every time a soldier enters a vehicle.
*/


// fügt auf allen clients einen Add Action Eintrag für umgekippte Fahrzeuge hinzu
// ersetzt player add action in onPlayerRespawn (viel performanter, da kein pulling)
["LandVehicle", "Air"] apply
{
[
_x,
"init",
{
params ["_vec"];

_vec addAction
[
FLIP_ACTION_UNFLIP_TEXT call XTuerkiesText,
{
params ["_target", "_caller", "_actionId", "_arguments"];
[_target] call FUNC(unFlip);
},
[],
0,
false,
true,
"",
format["[_target, _this] call %1", QFUNC(flipCheck)]
];
},
nil,
nil,
true
] call CBA_fnc_addClassEventHandler;
};
41 changes: 41 additions & 0 deletions [J]OPT.Altis/flip/functions/fnc_initCBASettings.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Description:
* initialize CBA settings
*
* Author:
* James
*
* Arguments:
* None
*
* Return Value:
* None
*
* Server only:
* no
*
* Public:
* no - should be called only once from XEH_PreInit.sqf at mission start
*
* Global:
* no
*
* Sideeffects:
* yes - create a new setting in the game addons options (according to category and name)
*
* Example:
* [] call EFUNC(beam,initCBASettings);
*/
#include "script_component.hpp"

[
QGVAR(on), // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
"CHECKBOX", // setting type
"Aktiviert die Flip-Komponente", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"OPT Komponenten", // Pretty name of the category where the setting can be found. Can be stringtable entry.
true, // Default value <BOOLEAN>
1, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{} // function that will be executed once on mission start and every time the setting is changed.
] call CBA_Settings_fnc_init;

if (!GVAR(on)) exitWith{};
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* no
*
* Example:
* [cursorObject] call EFUNC(common,unFlip);
* [cursorObject] call EFUNC(flip,unFlip);
*/
#include "script_component.hpp"

Expand All @@ -39,9 +39,9 @@ if (_veh isEqualTo objNull) exitWith{};

/* CODE BODY */
_veh setVectorUp [0,0,1];
_veh setPosATL
_veh setPosATL
[
(getPosATL _veh) select 0,
(getPosATL _veh) select 1,
(getPosATL _veh) select 0,
(getPosATL _veh) select 1,
0.3
];
1 change: 1 addition & 0 deletions [J]OPT.Altis/flip/functions/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "..\script_component.hpp"
15 changes: 15 additions & 0 deletions [J]OPT.Altis/flip/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#define COMPONENT flip
#define COMPONENT_BEAUTIFIED Flip
#include "..\main\script_mission.hpp"

#define DEBUG_MODE_MINIMAL
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_flip
#define DEBUG_MODE_FULL
#endif

#include "..\main\script_macros.hpp"
#include "setup.hpp"
5 changes: 5 additions & 0 deletions [J]OPT.Altis/flip/setup.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// hier bitte alle Variablen anlegen, die man in irgendeiner Weise
// einstellen können soll oder irgendwann mal ändern will
// Beispiele: Add-Action Texte, Variablen, Konstanten, Marker etc
// #define MEIN_MAKRO ...
#define FLIP_ACTION_UNFLIP_TEXT "Fahrzeug aufrichten"
2 changes: 1 addition & 1 deletion [J]OPT.Altis/main/script_version.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define MAJOR 4
#define MINOR 15
#define BUILD 1
#define BUILD 2
Loading

0 comments on commit f6ba94e

Please sign in to comment.