Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
PhILoXs committed Sep 23, 2023
2 parents 7b200b5 + 02aacec commit a85b3cd
Show file tree
Hide file tree
Showing 28 changed files with 414 additions and 195 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ releases/*
keys/*
.hemtt/local
####

.vscode/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"blackfisch.sqf-language",
"editorconfig.editorconfig",
"bux578.vscode-openlastrpt"
]
}
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/*.pbo": true,
"**/*.exe": true,
"**/keys": true,
"**/release": true,
},
"files.associations": {
"**/*.hpp": "ext",
// "**/*.hpp": "cpp",
"**/*.cpp": "ext",
"**/XEH_PREP.hpp": "sqf",
"*.rpt": "log",
"init*.hpp": "sqf",
},
"sqf.enableACE3": true,
"sqf.enableCBA": true,
}
27 changes: 27 additions & 0 deletions .vscode/sqf.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"SQF Function header": {
"description": "SQF Function header",
"prefix": "header",
"body": [
"#include \"script_component.hpp\"",
"/**",
" * Author: ${1:Author}",
" *",
" * Description:",
" * ${2:Description}",
" *",
" * Parameter(s):",
" * ${3:0: TYPE - Parameter description}",
" *",
" * Returns:",
" * ${4:TYPE - Description}",
" *",
" * Example:",
" * _this call mts_${TM_DIRECTORY/(.*)addons\\\\(.*)\\\\functions(.*)/$2/}_${TM_FILENAME_BASE}",
" *",
" */",
"",
"params [];"
],
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Debug",
"detail": "Build Arma addon with HEMTT in debug mode.",
"type": "process",
"command": "hemtt.exe",
"args": ["build"],
"group": "build",
"presentation": {
"close": true,
"reveal": "always",
"showReuseMessage": false
}
},
{
"label": "Build Release",
"detail": "Build Arma addon with HEMTT for release.",
"type": "process",
"command": "hemtt.exe",
"args": [
"build",
"--release",
"--time",
"-f"
],
"group": "build"
}
]
}
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/Metis-Team/mts_enhanced/releases/latest">
<img src="https://img.shields.io/badge/Version-1.6.0-blue.svg?style=flat-square" alt="Metis Enhanced Version">
<img src="https://img.shields.io/badge/Version-1.6.1-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 Down
6 changes: 6 additions & 0 deletions addons/armory/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers {
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
};
};

class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};
2 changes: 2 additions & 0 deletions addons/armory/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
PREP(buttonCreateEquipment);
PREP(createEquipment);
PREP(equipLoadout);
PREP(equipBackpack);
PREP(initEquipment);
PREP(openArmory);
PREP(openArsenal);
PREP(openNewEquipmentDialog);
PREP(saveEquipment);
PREP(setEditArea);
PREP(toggleSettings);
Expand Down
163 changes: 163 additions & 0 deletions addons/armory/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#include "script_component.hpp"

GVAR(initialized) = false;
[QGVAR(updateArsenal), FUNC(updateArsenal)] call CBA_fnc_addEventHandler;

TRACE_2("", isDedicated, GVAR(allowPlayerDBConnection));

if (isDedicated || GVAR(allowPlayerDBConnection)) then {

private _dbConnected = ["armory", "armory.ini"] call DB_CONNECT;
if (isNil "_dbConnected" || !(_dbConnected select 0)) exitWith {
WARNING("Can't connect to Database! Disabling module.");
};
GVAR(sessionID) = _dbConnected select 1;

GVAR(equipment) = [true] call CBA_fnc_createNamespace;
publicVariable QGVAR(equipment);

GVAR(equipmentInitialized) = [];
[QGVAR(updateLoadout), FUNC(updateLoadout)] call CBA_fnc_addEventHandler;
[QGVAR(updateBackpack), FUNC(updateBackpack)] call CBA_fnc_addEventHandler;
[QGVAR(updateEditors), FUNC(updateEditors)] call CBA_fnc_addEventHandler;
[QGVAR(createEquipment), FUNC(createEquipment)] call CBA_fnc_addEventHandler;

[QGVAR(initEquipment), {
params [["_unit", objNull, [objNull]], ["_callBackEvent", "", [""]], ["_args", [], [[]]]];
CHECK(!GVAR(initialized) || isNull _unit || _callBackEvent isEqualTo "" || (_args param [ARR_2(0,"")]) isEqualTo "");
_args params ["_equipmentName"];

if ([_equipmentName] call FUNC(initEquipment)) then {
[_callBackEvent, _args, _unit] call CBA_fnc_targetEvent;
} else {
[QGVAR(error), [_unit, _callBackEvent, _args], _unit] call CBA_fnc_targetEvent;
};
}] call CBA_fnc_addEventhandler;

GVAR(initialized) = true;
publicVariable QGVAR(initialized);
};

if (hasinterface) then {
[QGVAR(openArmory), FUNC(openArmory)] call CBA_fnc_addEventhandler;
[QGVAR(equipBackpack), FUNC(equipBackpack)] call CBA_fnc_addEventhandler;
[QGVAR(equipLoadout), FUNC(equipLoadout)] call CBA_fnc_addEventhandler;

[QGVAR(error), {
params ["_unit", "_callBackEvent", "_args"];
ERROR(format [ARR_4("Something went wrong: Unit: %1 | CallBackEvent: %2 | Args: %3", _unit, _callBackEvent, _args)]);
if (hasinterface) then {
hint "MTS Armory:\nSomething went wrong, please take a look into your logfiles.";
};
}] call CBA_fnc_addEventhandler;

[QGVAR(addAction), {
params [["_equipmentName", "", [""]], ["_object", objNull, [objNull]]];
CHECK(isNull _object || _equipmentName isEqualTo "");

if (GVAR(openUIActionMenu) isEqualTo "ace_interaction" && isClass (configFile >> "CfgPatches" >> "ace_interact_menu")) then {
private _actionOpenArmory = [
QGVAR(ace_interact_openArmory),
format["%1: %2", LLSTRING(displayName), _equipmentName],
"",
{
params ["_object", "", "_params"];
_params params ["_equipmentName"];

[_equipmentName, _object] call FUNC(openArmory);
},
{true},
{},
[_equipmentName]
] call ace_interact_menu_fnc_createAction;
[_object, 0, ["ACE_MainActions"], _actionOpenArmory] call ace_interact_menu_fnc_addActionToObject;
} else {
_object addAction [format["%1: %2", LLSTRING(displayName), _equipmentName], {[(_this select 3), (_this select 0)] call FUNC(openArmory)}, _equipmentName];
};
}] call CBA_fnc_addEventhandler;

GVAR(IDCsToHide) = [
IDC_CHECKBOX_ARSENAL,
IDC_EDITBOX_EQUIPMENT_NAME,
IDC_LISTBOX_MEDIC,
IDC_LISTBOX_ENGINEER,
IDC_BUTTON_SAVE_EQUIPMENT,
IDC_BUTTON_DELETE_EQUIPMENT,
IDC_BACKGROUND_DELETE_EQUIPMENT,
IDC_ICON_DELETE_EQUIPMENT,
IDC_EDITBOX_EDITORS,
IDC_BUTTON_SAVE_EDITORS,
IDC_BUTTON_EDIT_LOADOUT_1,
IDC_BUTTON_EDIT_LOADOUT_2,
IDC_BUTTON_EDIT_LOADOUT_3,
IDC_BUTTON_EDIT_LOADOUT_4,
IDC_BUTTON_EDIT_LOADOUT_5,
IDC_BUTTON_EDIT_LOADOUT_6,
IDC_BUTTON_EDIT_LOADOUT_7,
IDC_BUTTON_EDIT_LOADOUT_8,
IDC_BUTTON_EDIT_LOADOUT_9,
IDC_BUTTON_EDIT_LOADOUT_10,
IDC_BUTTON_EDIT_LOADOUT_11,
IDC_BUTTON_EDIT_LOADOUT_12,
IDC_BACKGROUND_EDIT_LOADOUT_1,
IDC_BACKGROUND_EDIT_LOADOUT_2,
IDC_BACKGROUND_EDIT_LOADOUT_3,
IDC_BACKGROUND_EDIT_LOADOUT_4,
IDC_BACKGROUND_EDIT_LOADOUT_5,
IDC_BACKGROUND_EDIT_LOADOUT_6,
IDC_BACKGROUND_EDIT_LOADOUT_7,
IDC_BACKGROUND_EDIT_LOADOUT_8,
IDC_BACKGROUND_EDIT_LOADOUT_9,
IDC_BACKGROUND_EDIT_LOADOUT_10,
IDC_BACKGROUND_EDIT_LOADOUT_11,
IDC_BACKGROUND_EDIT_LOADOUT_12,
IDC_ICON_EDIT_LOADOUT_1,
IDC_ICON_EDIT_LOADOUT_2,
IDC_ICON_EDIT_LOADOUT_3,
IDC_ICON_EDIT_LOADOUT_4,
IDC_ICON_EDIT_LOADOUT_5,
IDC_ICON_EDIT_LOADOUT_6,
IDC_ICON_EDIT_LOADOUT_7,
IDC_ICON_EDIT_LOADOUT_8,
IDC_ICON_EDIT_LOADOUT_9,
IDC_ICON_EDIT_LOADOUT_10,
IDC_ICON_EDIT_LOADOUT_11,
IDC_ICON_EDIT_LOADOUT_12,
IDC_BUTTON_EDIT_BACKPACK_1,
IDC_BUTTON_EDIT_BACKPACK_2,
IDC_BUTTON_EDIT_BACKPACK_3,
IDC_BUTTON_EDIT_BACKPACK_4,
IDC_BUTTON_EDIT_BACKPACK_5,
IDC_BUTTON_EDIT_BACKPACK_6,
IDC_BUTTON_EDIT_BACKPACK_7,
IDC_BUTTON_EDIT_BACKPACK_8,
IDC_BUTTON_EDIT_BACKPACK_9,
IDC_BUTTON_EDIT_BACKPACK_10,
IDC_BUTTON_EDIT_BACKPACK_11,
IDC_BUTTON_EDIT_BACKPACK_12,
IDC_BACKGROUND_EDIT_BACKPACK_1,
IDC_BACKGROUND_EDIT_BACKPACK_2,
IDC_BACKGROUND_EDIT_BACKPACK_3,
IDC_BACKGROUND_EDIT_BACKPACK_4,
IDC_BACKGROUND_EDIT_BACKPACK_5,
IDC_BACKGROUND_EDIT_BACKPACK_6,
IDC_BACKGROUND_EDIT_BACKPACK_7,
IDC_BACKGROUND_EDIT_BACKPACK_8,
IDC_BACKGROUND_EDIT_BACKPACK_9,
IDC_BACKGROUND_EDIT_BACKPACK_10,
IDC_BACKGROUND_EDIT_BACKPACK_11,
IDC_BACKGROUND_EDIT_BACKPACK_12,
IDC_ICON_EDIT_BACKPACK_1,
IDC_ICON_EDIT_BACKPACK_2,
IDC_ICON_EDIT_BACKPACK_3,
IDC_ICON_EDIT_BACKPACK_4,
IDC_ICON_EDIT_BACKPACK_5,
IDC_ICON_EDIT_BACKPACK_6,
IDC_ICON_EDIT_BACKPACK_7,
IDC_ICON_EDIT_BACKPACK_8,
IDC_ICON_EDIT_BACKPACK_9,
IDC_ICON_EDIT_BACKPACK_10,
IDC_ICON_EDIT_BACKPACK_11,
IDC_ICON_EDIT_BACKPACK_12
];
};
Loading

0 comments on commit a85b3cd

Please sign in to comment.