Skip to content

Commit 001bb5f

Browse files
authored
Add Zeus and 3DEN comments (#785)
1 parent dce79ab commit 001bb5f

44 files changed

Lines changed: 1275 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ PlayerBot
5050
Ryan180602
5151
shukari
5252
SilentSpike
53+
Timi007
5354
Toinane
5455
Tuupertunut
5556
veteran29

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Special thanks to the [ACE3 Team](https://ace3.acemod.org/team) for their open s
4949
- Settings to control Zeus camera properties such as speed and available vision modes.
5050
- Zeus camera flashlight for easier editing at night.
5151
- New waypoint types such as paradrop available through Zeus.
52+
- Ability to place comments and see comments created in 3DEN.
5253

5354
## Contributing
5455

addons/comments/$PBOPREFIX$

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
x\zen\addons\comments

addons/comments/Cfg3DEN.hpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
class Cfg3DEN {
2+
class Attributes {
3+
class Default;
4+
class GVAR(hiddenAttribute): Default {
5+
onLoad = QUOTE((ctrlParentControlsGroup ctrlParentControlsGroup (_this select 0)) ctrlShow false);
6+
};
7+
};
8+
9+
class Mission {
10+
class Scenario {
11+
class AttributeCategories {
12+
class ADDON {
13+
displayName = STR_DISPLAY_NAME;
14+
collapsed = 1;
15+
16+
class Attributes {
17+
class GVAR(3DENComments) {
18+
displayName = STR_DISPLAY_NAME;
19+
property = QGVAR(3DENComments);
20+
control = QGVAR(hiddenAttribute);
21+
tooltip = "";
22+
defaultValue = "[]";
23+
expression = "";
24+
wikiType = "[[Array]]";
25+
};
26+
};
27+
};
28+
};
29+
};
30+
};
31+
32+
class EventHandlers {
33+
class ADDON {
34+
// Arguments are for debugging
35+
onMissionSave = QUOTE(['onMissionSave'] call FUNC(save3DENComments));
36+
onMissionAutosave = QUOTE(['onMissionAutosave'] call FUNC(save3DENComments));
37+
onBeforeMissionPreview = QUOTE(['onBeforeMissionPreview'] call FUNC(save3DENComments));
38+
};
39+
};
40+
41+
class Comment {
42+
class AttributeCategories {
43+
class ADDON {
44+
displayName = ECSTRING(main,DisplayName);
45+
collapsed = 0;
46+
47+
class Attributes {
48+
class GVAR(showComment) {
49+
displayName = CSTRING(ShowCommentInZeus);
50+
tooltip = CSTRING(ShowCommentInZeus_Description);
51+
property = QGVAR(showComment);
52+
control = "CheckboxState";
53+
defaultValue = "true";
54+
expression = "";
55+
wikiType = "[[Bool]]";
56+
};
57+
};
58+
};
59+
};
60+
};
61+
};

addons/comments/CfgContext.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class EGVAR(context_menu,actions) {
2+
class GVAR(createComment) {
3+
displayName = STR_CREATE_COMMENT;
4+
icon = COMMENT_ICON;
5+
condition = QGVAR(enabled);
6+
statement = QUOTE([_position] call FUNC(openDialog));
7+
priority = 35;
8+
};
9+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Extended_PreStart_EventHandlers {
2+
class ADDON {
3+
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
4+
};
5+
};
6+
7+
class Extended_PreInit_EventHandlers {
8+
class ADDON {
9+
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
10+
};
11+
};
12+
13+
class Extended_PostInit_EventHandlers {
14+
class ADDON {
15+
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
16+
};
17+
};

addons/comments/XEH_PREP.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PREP(addDrawEventHandler);
2+
PREP(createComment);
3+
PREP(createIcon);
4+
PREP(deleteComment);
5+
PREP(deleteIcon);
6+
PREP(drawComments);
7+
PREP(is3DENComment);
8+
PREP(moveComment);
9+
PREP(onCommentCreated);
10+
PREP(onCommentDeleted);
11+
PREP(onCommentUpdated);
12+
PREP(onDraw);
13+
PREP(onDraw3D);
14+
PREP(onKeyDown);
15+
PREP(onMouseButtonDown);
16+
PREP(onMouseButtonUp);
17+
PREP(onMouseDblClick);
18+
PREP(onMouseMoving);
19+
PREP(onUnload);
20+
PREP(openDialog);
21+
PREP(save3DENComments);
22+
PREP(updateComment);
23+
PREP(updateIcon);

addons/comments/XEH_postInit.sqf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "script_component.hpp"
2+
3+
if (isServer) then {
4+
[QGVAR(createComment), LINKFUNC(createComment)] call CBA_fnc_addEventHandler;
5+
[QGVAR(deleteComment), LINKFUNC(deleteComment)] call CBA_fnc_addEventHandler;
6+
[QGVAR(updateComment), LINKFUNC(updateComment)] call CBA_fnc_addEventHandler;
7+
};
8+
9+
if (hasInterface) then {
10+
GVAR(comments) = createHashMapFromArray getMissionConfigValue [QGVAR(3DENComments), []];
11+
TRACE_1("Loaded 3DEN Comments from mission",GVAR(comments));
12+
13+
[QGVAR(commentCreated), LINKFUNC(onCommentCreated)] call CBA_fnc_addEventHandler;
14+
[QGVAR(commentDeleted), LINKFUNC(onCommentDeleted)] call CBA_fnc_addEventHandler;
15+
[QGVAR(commentUpdated), LINKFUNC(onCommentUpdated)] call CBA_fnc_addEventHandler;
16+
17+
["zen_curatorDisplayLoaded", LINKFUNC(addDrawEventHandler)] call CBA_fnc_addEventHandler;
18+
["zen_curatorDisplayUnloaded", LINKFUNC(onUnload)] call CBA_fnc_addEventHandler;
19+
};

addons/comments/XEH_preInit.sqf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "script_component.hpp"
2+
3+
ADDON = false;
4+
5+
PREP_RECOMPILE_START;
6+
#include "XEH_PREP.hpp"
7+
PREP_RECOMPILE_END;
8+
9+
if (isServer) then {
10+
// Unique ID for creating comments
11+
GVAR(nextID) = 0;
12+
};
13+
14+
if (hasInterface) then {
15+
// Map of all comments
16+
// Keys are comment IDs and values are the data
17+
GVAR(comments) = createHashMap;
18+
GVAR(icons) = createHashMap;
19+
20+
GVAR(draw3DAdded) = false;
21+
22+
GVAR(movingComment) = [];
23+
};
24+
25+
#include "initSettings.inc.sqf"
26+
27+
ADDON = true;

addons/comments/XEH_preStart.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "script_component.hpp"
2+
3+
#include "XEH_PREP.hpp"

0 commit comments

Comments
 (0)