File tree 2 files changed +24
-5
lines changed
2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 15
15
IDC_RSCDISPLAYCURATOR_CREATE_UNITS_CIV,
16
16
IDC_RSCDISPLAYCURATOR_CREATE_UNITS_EMPTY
17
17
];
18
+
19
+ // Need special handling for recent tree since items in the tree are not always objects
20
+ private _ctrlTreeRecent = _display displayCtrl IDC_RSCDISPLAYCURATOR_CREATE_RECENT;
21
+ _ctrlTreeRecent ctrlAddEventHandler [" TreeSelChanged" , {
22
+ params [" _ctrlTreeRecent" , " _selectedPath" ];
23
+
24
+ private _objectType = _ctrlTreeRecent tvData _selectedPath ;
25
+
26
+ if (! isClass (configFile >> " CfgVehicles" >> _objectType )) then {
27
+ _objectType = " " ;
28
+ };
29
+
30
+ [_objectType ] call FUNC(setupPreview);
31
+ }];
18
32
}] call CBA_fnc_addEventHandler ;
19
33
20
34
[" zen_curatorDisplayUnloaded" , {
Original file line number Diff line number Diff line change 6
6
* Arguments:
7
7
* 0: Display <DISPLAY>
8
8
* 1: Mode <NUMBER>
9
- * 2: Side <NUMBER>
10
9
*
11
10
* Return Value:
12
11
* None
13
12
*
14
13
* Example:
15
- * [DISPLAY, 0, 0 ] call zen_placement_fnc_handleTreeChange
14
+ * [DISPLAY, 0] call zen_placement_fnc_handleTreeChange
16
15
*
17
16
* Public: No
18
17
*/
19
18
20
19
if (! GVAR(enabled)) exitWith {};
21
20
22
- params [" _display" , " _mode" , " _side " ];
21
+ params [" _display" , " _mode" ];
23
22
24
23
// Setup the preview with if object placement is active
25
24
// Otherwise delete the current preview
26
- private _objectType = if (_mode == 0 && {call EFUNC(common,isPlacementActive)}) then {
25
+ private _objectType = if (_mode in [ 0 , 4 ] && {call EFUNC(common,isPlacementActive)}) then {
27
26
private _ctrlTree = call EFUNC(common,getActiveTree);
28
- _ctrlTree tvData tvCurSel _ctrlTree
27
+ private _data = _ctrlTree tvData tvCurSel _ctrlTree ;
28
+
29
+ if (_mode == 4 && {! isClass (configFile >> " CfgVehicles" >> _data )}) then {
30
+ _data = " " ;
31
+ };
32
+
33
+ _data
29
34
} else {
30
35
" "
31
36
};
You can’t perform that action at this time.
0 commit comments