File tree 3 files changed +22
-24
lines changed
3 files changed +22
-24
lines changed Original file line number Diff line number Diff line change 1
- /**
2
- Helper class with staic functions to enable and disable visiblity of units
3
- */
4
-
1
+ //------------------------------------------------------------------------------------------------
2
+ //! Helper class with staic functions to enable and disable visiblity of units
5
3
class GME_VisibilityHelper
6
4
{
5
+ //------------------------------------------------------------------------------------------------
7
6
static void SetVisibility (GenericEntity entity , bool visible )
8
7
{
9
8
// casting to possible supported types, if not null we found our match and change visibility and return
@@ -22,9 +21,9 @@ class GME_VisibilityHelper
22
21
}
23
22
}
24
23
24
+ //------------------------------------------------------------------------------------------------
25
25
static bool GetVisibility (IEntity entity )
26
26
{
27
- int visible = entity .GetFlags () & EntityFlags .VISIBLE ;
28
- return visible ;
27
+ return entity .GetFlags () & EntityFlags .VISIBLE ;
29
28
}
30
29
}
Original file line number Diff line number Diff line change @@ -29,19 +29,19 @@ modded class SCR_ChimeraCharacter : ChimeraCharacter
29
29
}
30
30
31
31
//------------------------------------------------------------------------------------------------
32
- void GME_OnVisibilityValueUpdated ( )
32
+ void GME_SetVisibility ( bool visible )
33
33
{
34
- if (m_bGME_isVisible )
35
- this .SetFlags (EntityFlags .VISIBLE |EntityFlags .TRACEABLE , m_bGME_isVisible );
36
- else
37
- this .ClearFlags (EntityFlags .VISIBLE |EntityFlags .TRACEABLE );
34
+ m_bGME_isVisible = visible ;
35
+ Replication .BumpMe ();
36
+ GME_OnVisibilityValueUpdated ();
38
37
}
39
38
40
39
//------------------------------------------------------------------------------------------------
41
- void GME_SetVisibility (bool visible )
42
- {
43
- m_bGME_isVisible = visible ;
44
- Replication .BumpMe ();
45
- this .GME_OnVisibilityValueUpdated ();
40
+ protected void GME_OnVisibilityValueUpdated ()
41
+ {
42
+ if (m_bGME_isVisible )
43
+ SetFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE );
44
+ else
45
+ ClearFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE );
46
46
}
47
47
}
Original file line number Diff line number Diff line change 1
-
2
-
3
1
//------------------------------------------------------------------------------------------------
4
2
modded class Vehicle : BaseVehicle
5
3
{
6
4
[RplProp (onRplName : "GME_OnVisibilityValueUpdated" )]
7
5
protected bool m_bGME_isVisible = true;
8
6
7
+ //------------------------------------------------------------------------------------------------
9
8
void GME_SetVisibility (bool visible )
10
- {
9
+ {
11
10
m_bGME_isVisible = visible ;
12
11
Replication .BumpMe ();
13
- this . GME_OnVisibilityValueUpdated ();
12
+ GME_OnVisibilityValueUpdated ();
14
13
}
15
14
16
-
17
- void GME_OnVisibilityValueUpdated ()
15
+ //------------------------------------------------------------------------------------------------
16
+ protected void GME_OnVisibilityValueUpdated ()
18
17
{
19
18
if (m_bGME_isVisible )
20
- this . SetFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE , m_bGME_isVisible );
19
+ SetFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE );
21
20
else
22
- this . ClearFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE );
21
+ ClearFlags (EntityFlags .VISIBLE | EntityFlags .TRACEABLE );
23
22
}
24
23
};
You can’t perform that action at this time.
0 commit comments