Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
51be9ec
Added header attribute to intel items
prisonerMO Mar 17, 2025
64d02e8
Photo control value
prisonerMO Mar 17, 2025
3fd50b7
Removed diag_logs
prisonerMO Mar 24, 2025
9b61eaa
Added name to authors
prisonerMO Mar 28, 2025
20b3a25
Changed zeus label to edit
prisonerMO Mar 28, 2025
494f133
Update header if only header defined via attributes
prisonerMO Mar 28, 2025
3cf18aa
added set header data function and get set
prisonerMO Mar 28, 2025
af6644b
Update addons/intelitems/stringtable.xml
prisonerMO Apr 5, 2025
e4c7fe4
Update addons/intelitems/functions/fnc_setObjectHeader.sqf
prisonerMO Apr 5, 2025
c889677
Update addons/intelitems/functions/fnc_setObjectHeader.sqf
prisonerMO Apr 5, 2025
f139782
Update addons/intelitems/functions/fnc_setObjectData.sqf
prisonerMO Apr 5, 2025
3cf7045
Keep header '' if not defined
prisonerMO Apr 7, 2025
192a408
Update script_component.hpp
prisonerMO Apr 9, 2025
5db8fe3
Update addons/intelitems/script_component.hpp
prisonerMO Apr 10, 2025
3d8be78
Update addons/intelitems/functions/fnc_pickup.sqf
prisonerMO Apr 14, 2025
5e9850a
Update addons/intelitems/functions/fnc_addIntel.sqf
prisonerMO Apr 14, 2025
1fcbf60
Update addons/intelitems/functions/fnc_setObjectHeader.sqf
prisonerMO Apr 14, 2025
53131df
Update addons/intelitems/functions/fnc_setObjectHeader.sqf
prisonerMO Apr 14, 2025
fd80f26
Readd deleted comment and get header only if needed
johnb432 May 8, 2025
ad579c9
Make data optional
johnb432 May 8, 2025
16de507
Use params
johnb432 May 8, 2025
5899942
Add space
johnb432 May 8, 2025
fcb2f8b
Add missing argument in function header
johnb432 May 8, 2025
4a5dccf
Sort stringtable, readd space
johnb432 May 10, 2025
cdc9aee
Remove unused macro
johnb432 May 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ PaxJaromeMalues <[email protected]>
Phyma <[email protected]>
PiZZADOX <[email protected]>
pokertour
Prisoner
Professor <[email protected]>
Pterolatypus <[email protected]>
QuantX
Expand Down
13 changes: 12 additions & 1 deletion addons/intelitems/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ class CfgVehicles {
editorSubcategory = QUOTE(XADDON);
GVAR(magazine) = "";
class Attributes {
class GVAR(header) {
displayName = CSTRING(Header);
tooltip = CSTRING(Header_Tooltip);
property = QGVAR(header);
control = "Edit";
expression = QUOTE([ARR_2(FUNC(setObjectHeader),[ARR_2(_this,_value)])] call CBA_fnc_execNextFrame;);
defaultValue = "''";
validate = "STRING";
typeName = "STRING";
};
class GVAR(data) {
displayName = CSTRING(Text);
property = QGVAR(data);
Expand Down Expand Up @@ -74,9 +84,10 @@ class CfgVehicles {
scopeCurator = 2;
GVAR(magazine) = QXGVAR(photo);
class Attributes: Attributes {
class GVAR(header): GVAR(header) {};
class GVAR(data): GVAR(data) {
displayName = CSTRING(Photo_Filename);
control = "Edit";
control = "edit";
};
};
};
Expand Down
1 change: 1 addition & 0 deletions addons/intelitems/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ ACEX_PREP(onMouseButtonUp);
ACEX_PREP(onMouseMoving);
ACEX_PREP(pickup);
ACEX_PREP(setObjectData);
ACEX_PREP(setObjectHeader);
8 changes: 7 additions & 1 deletion addons/intelitems/functions/fnc_addActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ private _openIndices = GVAR(controlsGroups) apply {_x getVariable QGVAR(index)};

// Only add actions for intel indices that are not open
if !(_index in _openIndices) then {
private _header = GET_DATA(_index) select 1;

if (_header == "") then {
_header = _displayName;
};

private _action = [
format [QGVAR(%1), _index],
_displayName,
_header,
_picture,
{(_this select 2) call FUNC(createControl)},
{true},
Expand Down
7 changes: 4 additions & 3 deletions addons/intelitems/functions/fnc_addIntel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
* 0: Unit <OBJECT>
* 1: Item <STRING>
* 2: Data <STRING>
* 3: Header <STRING> (default: "")
*
* Return Value:
* Successful <BOOL>
*
* Example:
* [_unit, "acex_intelitems_notepad", "Notes!"] call ace_intelitems_fnc_addIntel
* [_unit, "acex_intelitems_notepad", "Notes!", "New Header"] call ace_intelitems_fnc_addIntel
*
* Public: Yes
*/
Expand All @@ -22,7 +23,7 @@ if (canSuspend) exitWith {
[FUNC(addIntel), _this] call CBA_fnc_directCall;
};

params [["_unit", objNull, [objNull]], ["_item", "", [""]], ["_data", "", [""]]];
params [["_unit", objNull, [objNull]], ["_item", "", [""]], ["_data", "", [""]], ["_header", "", [""]]];

if (
!isServer
Expand All @@ -41,6 +42,6 @@ if (_magazineId isEqualTo []) exitWith {false};

// Assign an intel index to the added magazine id and set its data
private _index = [_magazineId select 0] call FUNC(handleMagIndex);
SET_DATA(_index,_data);
SET_DATA(_index,_data,_header);

true
15 changes: 6 additions & 9 deletions addons/intelitems/functions/fnc_attributeFocus.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,23 @@ private _ctrlButtonOK = _display displayCtrl 1; // IDC_OK
private _object = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);

_control ctrlRemoveAllEventHandlers "SetFocus";

private _ctrlLabel = _display displayCtrl IDC_ATTRIBUTE_LABEL;
private _labelText = getText ((configOf _object) >> "Attributes" >> QGVAR(data) >> "displayName");
_ctrlLabel ctrlSetText _labelText;

private _index = _object getVariable [QGVAR(index), -1];

if (_index != -1) then {
(GET_DATA(_index)) params ["_ctrlEditText", "_labelText"];
private _ctrlEdit = _display displayCtrl IDC_ATTRIBUTE_EDIT;
_ctrlEdit ctrlSetText GET_DATA(_index);
_ctrlEdit ctrlSetText _ctrlEditText;
private _ctrlLabel = _display displayCtrl IDC_ATTRIBUTE_LABEL;
_ctrlLabel ctrlSetText _labelText;
};

private _fnc_onConfirm = {
params ["_ctrlButtonOK"];

private _display = ctrlParent _ctrlButtonOK;
private _object = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
private _data = ctrlText (_display displayCtrl IDC_ATTRIBUTE_EDIT);

[QGVAR(setObjectData), [_object, _data]] call CBA_fnc_serverEvent;
private _header = ctrlText (_display displayCtrl IDC_ATTRIBUTE_LABEL);
[QGVAR(setObjectData), [_object, _data, _header]] call CBA_fnc_serverEvent;
};

_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];
9 changes: 8 additions & 1 deletion addons/intelitems/functions/fnc_createControl.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ _ctrlClose ctrlAddEventHandler ["ButtonClick", {

// Set data in content control
private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT;
_ctrlContent ctrlSetText GET_DATA(_index);
_ctrlContent ctrlSetText (GET_DATA(_index) select 0);

// Set data in header control
private _header = GET_DATA(_index) select 1;
if (_header == "") then {
_header = ctrlText _ctrlHeader;
};
_ctrlHeader ctrlSetText _header;

// Restore position of controls group (center if not saved)
private _position = GVAR(controlsData) get _index;
Expand Down
7 changes: 5 additions & 2 deletions addons/intelitems/functions/fnc_deleteControl.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ GVAR(controlsData) set [_index, [_posX, _posY]];
// Update data if modified
private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT;
private _data = ctrlText _ctrlContent;
private _savedData = GET_DATA(_index) select 0;

if (_data isNotEqualTo GET_DATA(_index)) then {
SET_DATA(_index,_data);
if (_data isNotEqualTo _savedData) then {
private _ctrlHeader = _controlsGroup controlsGroupCtrl IDC_HEADER;
private _header = ctrlText _ctrlHeader;
SET_DATA(_index,_data,_header);
};

// Delete the controls group
Expand Down
14 changes: 12 additions & 2 deletions addons/intelitems/functions/fnc_setObjectData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Arguments:
* 0: Object <OBJECT>
* 1: Data <STRING>
* 2: Header <STRING>
*
* Return Value:
* None
Expand All @@ -16,7 +17,8 @@
* Public: No
*/

params ["_object", "_data"];
params ["_object", "_data", "_header"];
TRACE_1("setObjectData",_this);

private _index = _object getVariable [QGVAR(index), -1];

Expand All @@ -25,6 +27,14 @@ if (_index == -1) then {
GVAR(intelCount) = GVAR(intelCount) + 1;

_object setVariable [QGVAR(index), _index, true];

if (isNil "_header") then {
_header = getText (configOf _object >> "displayName");
};
} else {
if (isNil "_header") then {
_header = GET_DATA(_index) select 1;
};
};

SET_DATA(_index,_data);
SET_DATA(_index,_data,_header);
30 changes: 30 additions & 0 deletions addons/intelitems/functions/fnc_setObjectHeader.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror, mharis001
* Sets the intel header for an object. Used by 3DEN and Zeus attributes.
*
* Arguments:
* 0: Object <OBJECT>
* 1: Header <STRING>
*
* Return Value:
* None
*
* Example:
* [cursorObject, "New Header"] call ace_intelitems_fnc_setObjectHeader
*
* Public: No
*/

params ["_object", "_header"];
TRACE_1("setObjectHeader",_this);
private _data = "";
private _index = _object getVariable [QGVAR(index), -1];
if (_index == -1) then {
_index = GVAR(intelCount);
GVAR(intelCount) = GVAR(intelCount) + 1;
_object setVariable [QGVAR(index), _index, true];
} else {
_data = GET_DATA(_index) select 0;
};
SET_DATA(_index,_data,_header);
3 changes: 2 additions & 1 deletion addons/intelitems/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class GVAR(RscPhoto): GVAR(RscBase) {
};

// Zeus Attributes Display
class RscEdit;
class RscText;
class RscEditMulti;
class RscControlsGroup;
Expand Down Expand Up @@ -163,7 +164,7 @@ class GVAR(RscSetData): RscDisplayAttributes {
w = QUOTE(POS_W(26));
h = QUOTE(POS_H(6));
class controls {
class Label: RscText {
class Label: RscEdit {
idc = IDC_ATTRIBUTE_LABEL;
x = 0;
y = 0;
Expand Down
6 changes: 3 additions & 3 deletions addons/intelitems/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
#define IDC_ATTRIBUTE_LABEL 4801
#define IDC_ATTRIBUTE_EDIT 4802

#define SYS_DATA(index) (format [QGVAR(%1), index])
#define SET_DATA(index,data) (GVAR(intelData) setVariable [SYS_DATA(index), data, true])
#define GET_DATA(index) (GVAR(intelData) getVariable [SYS_DATA(index), ""])
#define SYS_DATA(index) (format [QGVAR(%1), index])
#define SET_DATA(index,data,header) (GVAR(intelData) setVariable [SYS_DATA(index), [data,header], true])
#define GET_DATA(index) (GVAR(intelData) getVariable [SYS_DATA(index), ["",""]])
19 changes: 19 additions & 0 deletions addons/intelitems/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@
<Chinesesimp>文件</Chinesesimp>
<Turkish>Döküman</Turkish>
</Key>
<Key ID="STR_ACE_IntelItems_Header">
<English>Header</English>
<Czech>Záhlaví</Czech>
<French>En-tête</French>
<Spanish>Encabezamiento</Spanish>
<Italian>Intestazione</Italian>
<Polish>Nagłówek</Polish>
<Portuguese>Cabeçalho</Portuguese>
<Russian>Заголовок</Russian>
<German>Überschrift</German>
<Korean>헤더</Korean>
<Japanese>ヘッダー</Japanese>
<Chinese>標題</Chinese>
<Chinesesimp>标题</Chinesesimp>
<Turkish>Üstbilgi</Turkish>
</Key>
<Key ID="STR_ACE_IntelItems_Header_Tooltip">
<English>Defines the header for the intel item. If the value is empty (""), the object's display name is used.</English>
</Key>
<Key ID="STR_ACE_IntelItems_Notepad_Description">
<English>Notepad - Can access from the map screen</English>
<French>Bloc-note - Consultable depuis la carte</French>
Expand Down