Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Timi007 committed Mar 25, 2023
2 parents 7107ce9 + a79e486 commit 7b200b5
Show file tree
Hide file tree
Showing 114 changed files with 1,246 additions and 753 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ releases/*
keys/*
.hemtt/local
####

.vscode/
8 changes: 5 additions & 3 deletions 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/Metis-Team/mts_enhanced/releases/latest">
<img src="https://img.shields.io/badge/Version-1.5.0-blue.svg?style=flat-square" alt="Metis Enhanced Version">
<img src="https://img.shields.io/badge/Version-1.6.0-blue.svg?style=flat-square" alt="Metis Enhanced Version">
</a>
<a href="https://github.com/Metis-Team/mts_enhanced/releases/latest">
<img src="https://img.shields.io/github/downloads/Metis-Team/mts_enhanced/total.svg?style=flat-square&label=Downloads" alt="Metis Enhanced Downloads">
Expand All @@ -31,11 +31,13 @@

## Components:
- **Armory**: Allows you to save and load loadouts from a database across all server and missions.
- **Common**: Grass and bush cutter ACE action and chat commands for logged in admins.
- **Common**: Chat commands for logged in admins.
- **Cords**: Cords for PBW uniforms (BW Kleiderkammer).
- **Cutter**: Grass and bush cutter ACE actions allowing to remove grass and bushes.
- **Drill**: Animation and actions for exercise.
- **Engineer**: Equipment for engineers like a Mine Clearing Line Charge (MICLIC).
- **Items**: Flags in different colors and markers/signs which are carryable and placable.
- **Flags**: Flags with various colors which can be placed or carried by players.
- **Items**: Markers/signs which are placable.
- **Map**: Actions for the player to place his current map on the ground and on vehicles for others to look into.
- **Remove Snakes**: Removes snakes from all maps.
- **Whistle**: Adds a FOX 40 whistle.
Expand Down
3 changes: 0 additions & 3 deletions addons/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
PREP(addBushCutter);
PREP(addChatCommands);
PREP(addGrassCutter);
PREP(areModsLoaded);
PREP(arsenalPBWFix);
PREP(parseNameToPlayer);
PREP(seesBush);
2 changes: 0 additions & 2 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "script_component.hpp"

call FUNC(addBushCutter);
call FUNC(addGrassCutter);
call FUNC(arsenalPBWFix);
call FUNC(addChatCommands);
6 changes: 0 additions & 6 deletions addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

// Print version to rpt log
private _version = getText (configFile >> "CfgPatches" >> "mts_main" >> "versionStr");
INFO_1("Metis Enhanced version: %1.", _version);

#include "initSettings.hpp"

ADDON = true;
2 changes: 1 addition & 1 deletion addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"mts_main", "ace_common", "ace_interact_menu"};
requiredAddons[] = {"mts_main", "ace_common"};
author = ECSTRING(main,authors);
authors[] = {"PhILoX", "Timi007"};
url = ECSTRING(main,URL);
Expand Down
68 changes: 0 additions & 68 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
@@ -1,74 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="mts">
<Package name="common">
<Container name="Grasscutter">
<Key ID="STR_mts_common_grasscutter_subCategory">
<Original>Grass cutter</Original>
<German>Grasschneider</German>
</Key>
<Key ID="STR_mts_common_grasscutter">
<Original>Add grass cutter</Original>
<German>Grasschneider hinzufügen</German>
</Key>
<Key ID="STR_mts_common_grasscutter_tooltip">
<Original>Adds the grass cutter to ACE interaction menu.</Original>
<German>Fügt den Grasschneider zu dem ACE Interaktionmenu hinzu.</German>
</Key>
<Key ID="STR_mts_common_grasscutter_removeGrass">
<Original>Remove grass</Original>
<German>Gras entfernen</German>
</Key>
<Key ID="STR_mts_common_grasscutter_size">
<Original>Grass cutter size</Original>
<German>Grasschneidergröße</German>
</Key>
<Key ID="STR_mts_common_grasscutter_size_tooltip">
<Original>Changes the size of the grass cutter.</Original>
<German>Ändert die Größe des Grasschneiders.</German>
</Key>
<Key ID="STR_mts_common_grasscutter_size_large">
<Original>Large</Original>
<German>Groß</German>
</Key>
<Key ID="STR_mts_common_grasscutter_size_medium">
<Original>Medium</Original>
<German>Mittel</German>
</Key>
<Key ID="STR_mts_common_grasscutter_duration">
<Original>Duration</Original>
<German>Dauer</German>
</Key>
<Key ID="STR_mts_common_grasscutter_duration_tooltip">
<Original>Time it takes in seconds to remove grass.</Original>
<German>Zeit in Sekunden, um Gras zu enfernen.</German>
</Key>
</Container>
<Container name="Bushcutter">
<Key ID="STR_mts_common_bushcutter_subCategory">
<Original>Bush cutter</Original>
<German>Buschschere</German>
</Key>
<Key ID="STR_mts_common_bushcutter">
<Original>Add bush cutter</Original>
<German>Buschschere hinzufügen</German>
</Key>
<Key ID="STR_mts_common_bushcutter_tooltip">
<Original>Adds the bush cutter to ACE interaction menu.</Original>
<German>Fügt die Buschschere zu dem ACE Interaktionmenu hinzu.</German>
</Key>
<Key ID="STR_mts_common_bushcutter_removeBush">
<Original>Remove bush</Original>
<German>Busch entfernen</German>
</Key>
<Key ID="STR_mts_common_bushcutter_duration">
<Original>Duration</Original>
<German>Dauer</German>
</Key>
<Key ID="STR_mts_common_bushcutter_duration_tooltip">
<Original>Time it takes in seconds to remove a bush.</Original>
<German>Zeit in Sekunden, um einen Busch zu enfernen.</German>
</Key>
</Container>
<Container name="chatCommands">
<Key ID="STR_mts_common_chatCommands_zeusCreated">
<Original>You can now use zeus.</Original>
Expand Down
6 changes: 4 additions & 2 deletions addons/cords/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ GVAR(PBWLoaded) = [["PBW_German_Uniform", "PBW_German_Common"]] call EFUNC(commo
[LELSTRING(main,category), LLSTRING(subCategory)],
true,
0,
{}
{},
true
] call CBA_fnc_addSetting;

[
Expand All @@ -25,7 +26,8 @@ GVAR(PBWLoaded) = [["PBW_German_Uniform", "PBW_German_Common"]] call EFUNC(commo
[LELSTRING(main,category), LLSTRING(subCategory)],
"[""""]",
1,
{}
{},
true
] call CBA_fnc_addSetting;

ADDON = true;
1 change: 1 addition & 0 deletions addons/cutter/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\mts_enhanced\addons\cutter
17 changes: 17 additions & 0 deletions addons/cutter/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
};
};

class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
};
};

class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};
20 changes: 20 additions & 0 deletions addons/cutter/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class CfgWeapons {
class CBA_MiscItem;
class CBA_MiscItem_ItemInfo;

class GVAR(folding_saw): CBA_MiscItem {
scope = 2;
author = CSTRING(authors);
descriptionShort = CSTRING(foldingSawDescription);
descriptionUse = CSTRING(foldingSawDescription);

displayName = CSTRING(foldingSaw);
picture = QPATHTOF(data\pictures\folding_saw_item.paa);

GVAR(canCutBushes) = 1;

class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
};
};
};
4 changes: 4 additions & 0 deletions addons/cutter/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREP(addBushCutter);
PREP(addGrassCutter);
PREP(canCutBush);
PREP(seesBush);
18 changes: 18 additions & 0 deletions addons/cutter/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "script_component.hpp"

CHECK(!hasinterface);

private _cfgWeapons = configFile >> "CfgWeapons";
private _itemsAbleToCutBushes = (call (uiNamespace getVariable [QGVAR(itemsAbleToCutBushes), {[]}])) apply {_cfgWeapons >> _x};
{
private _name = configName _x;

GVAR(bushCutterCache) set [_name, 1];
} forEach _itemsAbleToCutBushes;

// Support for other tools able to cut bushes without mod dependency
GVAR(bushCutterCache) set ["ACE_EntrenchingTool", 1];


call FUNC(addBushCutter);
call FUNC(addGrassCutter);
13 changes: 13 additions & 0 deletions addons/cutter/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "script_component.hpp"

ADDON = false;

PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

#include "initSettings.hpp"

GVAR(bushCutterCache) = createHashMap;

ADDON = true;
6 changes: 6 additions & 0 deletions addons/cutter/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "script_component.hpp"

#include "XEH_PREP.hpp"

private _itemsAbleToCutBushes = (configProperties [configfile >> "CfgWeapons", QUOTE(isClass _x && {(getNumber (_x >> QQGVAR(canCutBushes))) isEqualTo 1}), true]) apply {configName _x};
uiNamespace setVariable [QGVAR(itemsAbleToCutBushes), compileFinal str _itemsAbleToCutBushes];
18 changes: 18 additions & 0 deletions addons/cutter/config.cpp
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[] = {"mts_main", "ace_common", "ace_interact_menu"};
author = ECSTRING(main,authors);
authors[] = {"PhILoX", "Timi007"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
File renamed without changes.
File renamed without changes.
Binary file added addons/cutter/data/pictures/folding_saw_item.paa
Binary file not shown.
Binary file added addons/cutter/data/sounds/bush_cutting_1.ogg
Binary file not shown.
Binary file added addons/cutter/data/sounds/bush_cutting_2.ogg
Binary file not shown.
Binary file added addons/cutter/data/sounds/bush_cutting_3.ogg
Binary file not shown.
Binary file added addons/cutter/data/sounds/bush_cutting_4.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
* Nothing
*
* Example:
* call mts_common_fnc_addBushCutter
* call mts_cutter_fnc_addBushCutter
*
*/

CHECK(!GVAR(bushcutter_enabled) || !hasinterface);
CHECK(!hasinterface);

#define SOUND_DISTANCE 30
#define SOUND_VOLUME 5
#define SOUND_DELAY_FACTOR 0.2

private _action = [
QGVAR(bushcutter),
LLSTRING(bushcutter_removeBush),
QPATHTOF(ui\mts_bushcutter.paa),
QPATHTOF(data\icons\bushcutter_icon.paa),
{
params ["", "_player"];

Expand All @@ -35,6 +39,15 @@ private _action = [
_player playMove "AinvPknlMstpSnonWnonDnon_medic0";
};

private _soundDelay = GVAR(bushcutter_duration) * SOUND_DELAY_FACTOR;
[{
params ["_bush"];

private _soundFile = format [QPATHTO_R(data\sounds\bush_cutting_%1.ogg), (floor random 4) + 1];

playSound3D [_soundFile, _bush, false, getPosASL _bush, SOUND_VOLUME, 1, SOUND_DISTANCE];
}, [_bush], _soundDelay] call CBA_fnc_waitAndExecute;

[GVAR(bushcutter_duration), [_bush], {
(_this select 0) params ["_bush"];

Expand All @@ -45,8 +58,7 @@ private _action = [
},
{
params ["", "_player"];
[_player, objNull] call ace_common_fnc_canInteractWith &&
{!isNull ([_player, BUSH_CUTTING_DISTANCE] call FUNC(seesBush))}
([_player, BUSH_CUTTING_DISTANCE] call FUNC(canCutBush))
}
] call ace_interact_menu_fnc_createAction;
[(typeOf ACE_player), 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass;
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
* Nothing
*
* Example:
* call mts_common_fnc_addGrassCutter
* call mts_cutter_fnc_addGrassCutter
*
*/

CHECK(!GVAR(grasscutter_enabled) || !hasinterface);
CHECK(!hasinterface);

private _action = [
QGVAR(grasscutter),
LLSTRING(grasscutter_removeGrass),
QPATHTOF(ui\mts_grasscutter.paa),
QPATHTOF(data\icons\grasscutter_icon.paa),
{
params ["", "_player"];

Expand All @@ -43,7 +43,8 @@ private _action = [
},
{
params ["", "_player"];
[_player, objNull] call ace_common_fnc_canInteractWith
GVAR(grasscutter_enabled) &&
{[_player, objNull] call ace_common_fnc_canInteractWith}
}
] call ace_interact_menu_fnc_createAction;
[(typeOf ACE_player), 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass;
31 changes: 31 additions & 0 deletions addons/cutter/functions/fnc_canCutBush.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "script_component.hpp"
/**
* Author: Timi007
*
* Description:
* Checks if the given unit can cut the bush in front of him.
*
* Parameter(s):
* 0: OBJECT - Unit.
* 1: NUMBER - Max distance the unit can be away from the bush.
*
* Returns:
* BOOLEAN - Can cut the bush.
*
* Example:
* [player, 6] call mts_cutter_fnc_canCutBush;
*
*/

params ["_player", ["_maxDistance", 5, [0]]];

if (!GVAR(bushcutter_enabled)) exitwith {false};
if (!([_player, objNull] call ace_common_fnc_canInteractWith)) exitwith {false};

private _hasItem = if (GVAR(bushcutter_requireItem)) then {
count (([_player] call ace_common_fnc_uniqueItems) arrayIntersect keys GVAR(bushCutterCache)) > 0
} else {
true
};

_hasItem && {!isNull ([_player, _maxDistance] call FUNC(seesBush))}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* OBJECT - Bush that the given unit sees or objNull if there is no bush.
*
* Example:
* [player] call mts_common_fnc_seesBush;
* [player] call mts_cutter_fnc_seesBush;
*
*/

Expand Down
1 change: 1 addition & 0 deletions addons/cutter/functions/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "\z\mts_enhanced\addons\cutter\script_component.hpp"
Loading

0 comments on commit 7b200b5

Please sign in to comment.