Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TutorialInstructorComponent.c
Go to the documentation of this file.
4
5class SCR_TutorialInstructorComponent : ScriptComponent
6{
7 [Attribute(defvalue: "0", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(SCR_ETutorialCourses))]
8 protected SCR_ETutorialCourses m_eStageConfig;
9
10 protected SCR_TutorialGamemodeComponent m_TutorialComponent;
11 protected bool m_bIsEnabled = true;
12
13 //------------------------------------------------------------------------------------------------
14 bool IsEnabled()
15 {
16 return m_bIsEnabled;
17 }
18
19 //------------------------------------------------------------------------------------------------
20 void EnableCourse(bool enable)
21 {
22 m_bIsEnabled = enable;
23 }
24
25 //------------------------------------------------------------------------------------------------
27 {
28 return m_eStageConfig;
29 }
30
31 //------------------------------------------------------------------------------------------------
33 {
35 return string.Empty;
36
37 SCR_TutorialCoursesConfig coursesConfig = m_TutorialComponent.GetCoursesConfig();
38 if (!coursesConfig)
39 return string.Empty;
40
41 if (!m_eStageConfig)
42 return string.Empty;
43
44 SCR_TutorialCourse course = coursesConfig.GetCourse(m_eStageConfig);
45 if (!course)
46 return string.Empty;
47
48 return course.GetTaskTitle();
49 }
50
51 //------------------------------------------------------------------------------------------------
52 override void EOnInit(IEntity owner)
53 {
54 m_TutorialComponent = SCR_TutorialGamemodeComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_TutorialGamemodeComponent));
56 return;
57
59 m_TutorialComponent.RegisterInstructor(this);
60 }
61
62 //------------------------------------------------------------------------------------------------
63 override void OnPostInit(IEntity owner)
64 {
65 if (!GetGame().InPlayMode())
66 return;
67
68 SetEventMask(owner, EntityEvent.INIT);
69 }
70
71 //------------------------------------------------------------------------------------------------
73 {
75 m_TutorialComponent.UnregisterInstructor(this);
76 }
77}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_BaseGameMode GetGameMode()
SCR_ETutorialCourses
string GetAssignedCourseName()
void ~SCR_TutorialInstructorComponent()
void EnableCourse(bool enable)
SCR_TutorialGamemodeComponent m_TutorialComponent
SCR_ETutorialCourses GetCourseType()
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
void RegisterActor(notnull IEntity entity)
static SCR_VoiceoverSystem GetInstance()
void EOnInit(IEntity owner)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
int IsEnabled()
Returns true if the light is enabled.