Skip to content

Commit

Permalink
Add headquater symbols (#77)
Browse files Browse the repository at this point in the history
* Add headquater symbols
  • Loading branch information
Timi007 authored Dec 8, 2023
1 parent 9a2f6b5 commit 743164f
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 17 deletions.
12 changes: 12 additions & 0 deletions addons/markers/CfgMarkers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class CfgMarkers {
class mts_bludash_vanilla_frameshape: mts_bludash_frameshape {
icon = QPATHTOF(data\blu\mts_markers_bludash_vanilla_frameshape.paa);
};
class mts_blu_hq: mts_blu_frameshape {
icon = QPATHTOF(data\blu\mts_markers_blu_hq.paa);
};
class mts_red_frameshape: o_unknown {
author = CSTRING(authors);
scope = 0;
Expand All @@ -57,6 +60,9 @@ class CfgMarkers {
class mts_reddash_vanilla_frameshape: mts_reddash_frameshape {
icon = QPATHTOF(data\red\mts_markers_reddash_vanilla_frameshape.paa);
};
class mts_red_hq: mts_red_frameshape {
icon = QPATHTOF(data\red\mts_markers_red_hq.paa);
};
class mts_neu_frameshape: n_unknown {
author = CSTRING(authors);
scope = 0;
Expand All @@ -66,6 +72,9 @@ class CfgMarkers {
class mts_neu_vanilla_frameshape: mts_neu_frameshape {
icon = QPATHTOF(data\neu\mts_markers_neu_vanilla_frameshape.paa);
};
class mts_neu_hq: mts_neu_frameshape {
icon = QPATHTOF(data\neu\mts_markers_neu_hq.paa);
};
class mts_unk_frameshape: n_unknown {
author = CSTRING(authors);
scope = 0;
Expand All @@ -81,6 +90,9 @@ class CfgMarkers {
class mts_unkdash_vanilla_frameshape: mts_unkdash_frameshape {
icon = QPATHTOF(data\unk\mts_markers_unkdash_vanilla_frameshape.paa);
};
class mts_unk_hq: mts_unk_frameshape {
icon = QPATHTOF(data\unk\mts_markers_unk_hq.paa);
};

class mts_special_textmarker: b_unknown {
author = CSTRING(authors);
Expand Down
Binary file added addons/markers/data/blu/mts_markers_blu_hq.paa
Binary file not shown.
Binary file added addons/markers/data/neu/mts_markers_neu_hq.paa
Binary file not shown.
Binary file added addons/markers/data/red/mts_markers_red_hq.paa
Binary file not shown.
Binary file added addons/markers/data/unk/mts_markers_unk_hq.paa
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_convertCreateMarkerParams.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (_frameshape isEqualType "") then {
_dashedFrameshape = true;
};

_markerParameter set [0, [_frameshape, _dashedFrameshape]];
_markerParameter set [0, [_frameshape, _dashedFrameshape, false]];
};

TRACE_2("Converted createMarker params", _params, _createMarkerParams);
Expand Down
3 changes: 2 additions & 1 deletion addons/markers/functions/fnc_createMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* 0: ARRAY - Frameshape of the marker.
* 0: STRING - Identity (blu, red, neu, unk).
* 1: BOOLEAN - Dashed (e.g. supect).
* 2: BOOLEAN - Headquaters.
* 1: ARRAY - Composition of modifier for the marker. IDs are listed in the wiki. (Optional, default: no modifiers)
* 0: NUMBER - Icon (0 for none).
* 1: NUMBER - Modifier 1 (0 for none).
Expand All @@ -31,7 +32,7 @@
* STRING - Marker prefix.
*
* Example:
* _namePrefix = [[2000,1000], 1, true, [["blu", false], [4,0,0], [4, false, true], ["3","3"], "9", ["4"]]] call mts_markers_fnc_createMarker
* _namePrefix = [[2000,1000], 1, true, [["blu", false, false], [4,0,0], [4, false, true], ["3","3"], "9", ["4"]]] call mts_markers_fnc_createMarker
*
*/

Expand Down
18 changes: 14 additions & 4 deletions addons/markers/functions/fnc_createMarkerLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* 0: ARRAY - Frameshape of the marker.
* 0: STRING - Identity (blu, red, neu, unk).
* 1: BOOLEAN - Dashed (e.g. supect).
* 2: BOOLEAN - Headquaters.
* 1: ARRAY - Composition of modifier for the marker. IDs are listed in the wiki. (Optional, default: no modifiers)
* 0: NUMBER - Icon (0 for none).
* 1: NUMBER - Modifier 1 (0 for none).
Expand All @@ -33,7 +34,7 @@
* STRING - Marker prefix.
*
* Example:
* _namePrefix = ["mtsmarker#123/0/1", 1, [2000,1000], [["blu", false], [4,0,0], [4, false, true], ["3","3"], "9", ["4"]]] call mts_markers_fnc_createMarkerLocal
* _namePrefix = ["mtsmarker#123/0/1", 1, [2000,1000], [["blu", false, false], [4,0,0], [4, false, true], ["3","3"], "9", ["4"]]] call mts_markers_fnc_createMarkerLocal
*
*/

Expand All @@ -47,7 +48,7 @@ params [
];

_markerParameter params [
["_frameshape", ["", false], [[]]],
["_frameshape", ["", false, false], [[]]],
["_modifier", [0,0,0], [[]], 3],
["_size", [0,false,false], [[]], 3],
["_uniqueDesignation", [], [[]]],
Expand All @@ -58,9 +59,9 @@ _size params [["_grpsize", 0, [0]], ["_reinforced", false, [false]], ["_reduced"

CHECK(!hasInterface);
CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(!(_frameshape isEqualTypeParams [ARR_2("", false)]) || ((_frameshape select 0) isEqualTo ""), ERROR("No frameshape or wrong format. Expected format: [STRING, BOOLEAN]"));
CHECKRET((_frameshape select 0) isEqualTo "", ERROR("No frameshape or wrong format. Expected format: [STRING, BOOLEAN, BOOLEAN]"));

_frameshape params [["_identity", "", [""]], ["_dashedFrameshape", false, [false]]];
_frameshape params [["_identity", "", [""]], ["_dashedFrameshape", false, [false]], ["_isHq", false, [false]]];
_identity = toLower _identity;

//prevent unscaled markers
Expand Down Expand Up @@ -108,6 +109,15 @@ CHECKRET(_frameshapeColor isEqualTo "", ERROR_1("Could not get corresponding van

_markerFrame setMarkerColorLocal _frameshapeColor;

if (_isHq) then {
private _markerHq = createMarkerLocal [format ["%1_hq", _namePrefix], _pos];
_markerHq setMarkerTypeLocal format ["mts_%1_hq", _identity];
_markerHq setMarkerSizeLocal [_scale, _scale];
_markerHq setMarkerAlphaLocal _alpha;

_markerFamily pushBack _markerHq;
};

//create group size marker
if (_grpsize > 0) then {
private _unitsize = format ["mts_%1_size_%2", _identity, _grpsize];
Expand Down
5 changes: 3 additions & 2 deletions addons/markers/functions/fnc_getUIData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ private _mainDisplay = findDisplay MAIN_DISPLAY;
private _identity = (_mainDisplay displayCtrl FRIENDLY_BTN_FRAME) getVariable [QGVAR(currentIdentitySelected), ""];
CHECKRET(_identity isEqualTo "", ERROR("No identity"));

//check if frameshape is dashed
// Check if frameshape is dashed or HQ
private _dashedFrameshape = cbChecked (_mainDisplay displayCtrl SUSPECT_CHECKBOX);
private _isHq = cbChecked (_mainDisplay displayCtrl HQ_CHECKBOX);

private _iconCtrl = _mainDisplay displayCtrl ICON_DROPDOWN;
private _mod1Ctrl = _mainDisplay displayCtrl MOD1_DROPDOWN;
Expand Down Expand Up @@ -54,4 +55,4 @@ private _higherFormation = (toUpper (ctrlText (_mainDisplay displayCtrl HIGHER_E
private _additionalInfo = ctrlText (_mainDisplay displayCtrl ADDITIONAL_EDIT);

// This will be the marker parameters in createMarker
[[_identity, _dashedFrameshape], _modifier, [_grpsize, _reinforced, _reduced], _uniqueDesignation, _additionalInfo, _higherFormation]
[[_identity, _dashedFrameshape, _isHq], _modifier, [_grpsize, _reinforced, _reduced], _uniqueDesignation, _additionalInfo, _higherFormation]
3 changes: 2 additions & 1 deletion addons/markers/functions/fnc_initializeUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ if (!isMultiplayer || is3DEN) then {
private _suspectedCbCtrl = _mainDisplay displayCtrl SUSPECT_CHECKBOX;
private _reinforcedCbCtrl = _mainDisplay displayCtrl REINFORCED_CHECKBOX;
private _reducedCbCtrl = _mainDisplay displayCtrl REDUCED_CHECKBOX;
private _hqCbCtrl = _mainDisplay displayCtrl HQ_CHECKBOX;

private _markerScale = MARKER_SCALE;
private _markerAlpha = MARKER_ALPHA;
Expand Down Expand Up @@ -211,7 +212,7 @@ if ((ctrlIDD _curMapDisplay) in [MAP_BRIEFING_CLIENT_DISPLAY, MAP_BRIEFING_SERVE

{
_x ctrlAddEventHandler ["CheckedChanged", {[false] call FUNC(transmitUIData);}];
} forEach [_suspectedCbCtrl, _reinforcedCbCtrl, _reducedCbCtrl];
} forEach [_suspectedCbCtrl, _reinforcedCbCtrl, _reducedCbCtrl, _hqCbCtrl];

//fill the Presets list with saved Presets from the profile
call FUNC(updatePresetsList);
Expand Down
22 changes: 19 additions & 3 deletions addons/markers/functions/fnc_setMarkerPreview.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* 0: ARRAY - Frameshape.
* 0: STRING - Identity (blu, red, neu, unk).
* 1: BOOLEAN - Dashed (e.g. supect).
* 2: BOOLEAN - HQ.
* 1: ARRAY - Composition of modifier for the marker. (Optional, default: no modifiers)
* 0: NUMBER - Icon (0 for none).
* 1: NUMBER - Modifier 1 (0 for none).
Expand All @@ -22,7 +23,7 @@
* Nothing.
*
* Example:
* [["blu", false], [4,0,0], [5, false, true]] call mts_markers_fnc_setMarkerPreview
* [["blu", false, false], [4,0,0], [5, false, true]] call mts_markers_fnc_setMarkerPreview
*
*/

Expand All @@ -33,7 +34,8 @@ params [
];
_frameshape params [
["_identity", "", [""]],
["_dashedFrameshape", false, [false]]
["_dashedFrameshape", false, [false]],
["_isHq", false, [false]]
];
_size params [
["_grpsize", 0, [0]],
Expand All @@ -45,6 +47,7 @@ CHECKRET(_identity isEqualTo "", ERROR("No identity"));

private _mainDisplay = findDisplay MAIN_DISPLAY;
private _previewIdentityCtrl = _mainDisplay displayCtrl PREVIEW_LYR_IDENTITY;
private _previewHqCtrl = _mainDisplay displayCtrl PREVIEW_LYR_HQ;
private _previewMod1Ctrl = _mainDisplay displayCtrl PREVIEW_LYR_MOD_1;
private _previewMod2Ctrl = _mainDisplay displayCtrl PREVIEW_LYR_MOD_2;
private _previewMod3Ctrl = _mainDisplay displayCtrl PREVIEW_LYR_MOD_3;
Expand All @@ -55,7 +58,16 @@ private _previewSizeModCtrl = _mainDisplay displayCtrl PREVIEW_LYR_SIZE_MOD;
//clear all layers
{
_x ctrlSetText "";
} count [_previewIdentityCtrl, _previewMod1Ctrl, _previewMod2Ctrl, _previewMod3Ctrl, _previewMod4Ctrl, _previewEchelonCtrl, _previewSizeModCtrl];
} count [
_previewIdentityCtrl,
_previewHqCtrl,
_previewMod1Ctrl,
_previewMod2Ctrl,
_previewMod3Ctrl,
_previewMod4Ctrl,
_previewEchelonCtrl,
_previewSizeModCtrl
];

private _identityComplete = if (_dashedFrameshape) then {
format ["%1dash", _identity]
Expand All @@ -66,6 +78,10 @@ private _identityComplete = if (_dashedFrameshape) then {
//set selected identity to corresponding layer
_previewIdentityCtrl ctrlSetText (format [QPATHTOF(data\%1\mts_markers_%2_frameshape_preview.paa), _identity, _identityComplete]);

if (_isHq) then {
_previewHqCtrl ctrlSetText (format [QPATHTOF(data\%1\mts_markers_%1_hq.paa), _identity]);
};

//set all modifiers to corresponding layer
private _allModifiers = _modifier call FUNC(getAllModifiers);
if (_allModifiers isNotEqualTo []) then {
Expand Down
12 changes: 7 additions & 5 deletions addons/markers/functions/fnc_setUIData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* Nothing.
*
* Example:
* [["blu", false], [4,0,0], [4, false, true], ["3","3"], "9"] call mts_markers_fnc_setUIData
* [["blu", false, false], [4,0,0], [4, false, true], ["3","3"], "9"] call mts_markers_fnc_setUIData
*
*/

params [
["_frameshape", ["",false], [[]]],
["_frameshape", ["",false,false], [[]]],
["_modifier", [0,0,0], [[]], 3],
["_size", [0,false,false], [[]], 3],
["_uniqueDesignation", [], [[]]],
["_additionalInfo", "", [""]],
["_higherFormation", [], [[]]]
];
_frameshape params [["_identity", "", [""]], ["_dashedFrameshape", false, [false]]];
_frameshape params [["_identity", "", [""]], ["_dashedFrameshape", false, [false]], ["_isHq", false, [false]]];
_size params [["_grpsize", 0, [0]], ["_reinforced", false, [false]], ["_reduced", false, [false]]];

private _mainDisplay = findDisplay MAIN_DISPLAY;
Expand All @@ -39,7 +39,7 @@ private _ctrlArray = [
[(_mainDisplay displayCtrl MOD2_DROPDOWN), GVAR(mod2Array)]
];

//because of the sorting, the index needs to be found with the help of the value
// Because of the sorting, the index needs to be found with the help of the value
{
_x params ["_ctrl", "_dropdownArray"];

Expand All @@ -59,6 +59,8 @@ private _ctrlArray = [
(_mainDisplay displayCtrl HIGHER_EDIT) ctrlSetText (_higherFormation joinString "");
(_mainDisplay displayCtrl ADDITIONAL_EDIT) ctrlSetText _additionalInfo;

//select right identity in the dialog & update preview
(_mainDisplay displayCtrl HQ_CHECKBOX) cbSetChecked _isHq;

// Select right identity in the dialog & update preview
(_mainDisplay displayCtrl SUSPECT_CHECKBOX) cbSetChecked _dashedFrameshape;
[_identity] call FUNC(identityButtonsAction);
4 changes: 4 additions & 0 deletions addons/markers/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
<Original>Additional Info:</Original>
<German>Zusatzinformationen:</German>
</Key>
<Key ID="str_mts_markers_ui_general_headquatersTXT">
<Original>Headquaters</Original>
<German>Führungseinrichtung</German>
</Key>
<Key ID="str_mts_markers_ui_general_channelTXT">
<Original>Channel:</Original>
<German>Kanal:</German>
Expand Down
20 changes: 20 additions & 0 deletions addons/markers/ui/mts_markers_dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class GVAR(RscPreview): RscControlsGroupNoScrollbars {
h = QPOS_H(PREVIEW_LAYER_H);
text = "";
};
class HQ: Identity {
idc = PREVIEW_LYR_HQ;
};
class Mod1: Identity {
idc = PREVIEW_LYR_MOD_1;
};
Expand Down Expand Up @@ -332,6 +335,23 @@ class GVAR(RscConfiguration): RscControlsGroupNoScrollbars {
y = QPOS_H(12);
maxChars = HIGHER_FORMATION_MAX_CHARS;
};

class HQText: GVAR(RscText) {
idc = HQ_TXT;
x = QPOS_W(0.5);
y = QPOS_H(15);
w = QPOS_W(6.5);
h = QPOS_H(1);
text = CSTRING(ui_general_headquatersTXT);
style = 1;
};
class HQCheckbox: GVAR(RscCheckBoxSound) {
idc = HQ_CHECKBOX;
x = QPOS_W(0.5 + 6.5);
y = QPOS_H(15);
w = QPOS_W(1);
h = QPOS_H(1);
};

class AlphaText: GVAR(RscText) {
idc = ALPHA_TXT;
Expand Down
3 changes: 3 additions & 0 deletions addons/markers/ui/mts_markers_ui_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#define ADDITIONAL_TXT 214
#define ALPHA_TXT 215
#define SCALE_TXT 216
#define HQ_TXT 217

// Identity Buttons
#define FRIENDLY_BTN_FRAME 300
Expand All @@ -94,6 +95,7 @@
#define SUSPECT_CHECKBOX 400
#define REINFORCED_CHECKBOX 401
#define REDUCED_CHECKBOX 402
#define HQ_CHECKBOX 403

// Dropdowns
#define ICON_DROPDOWN 500
Expand Down Expand Up @@ -128,6 +130,7 @@
#define PREVIEW_LYR_ECHELON 805
#define PREVIEW_LYR_SIZE_MOD 806
#define PREVIEW_GRID 807
#define PREVIEW_LYR_HQ 808

// Icons
#define DELETE_PRESETS_ICON 900
Expand Down

0 comments on commit 743164f

Please sign in to comment.