Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TutorialNavigation6.c
Go to the documentation of this file.
1 [EntityEditorProps(insertable: false)]
3 {
4 };
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  Widget m_wHighlight;
10  SCR_MapToolEntry m_RulerTool;
11  //------------------------------------------------------------------------------------------------
12  override protected void Setup()
13  {
14  SCR_HintManagerComponent.HideHint();
15  SCR_HintManagerComponent.ClearLatestHint();
16 
17  SCR_MapEntity.GetOnMapOpen().Remove(OnMapOpened);
18  SCR_MapEntity.GetOnMapClose().Remove(OnMapClosed);
19  SCR_MapEntity.GetOnMapOpen().Insert(OnMapOpened);
20  SCR_MapEntity.GetOnMapClose().Insert(OnMapClosed);
21 
22  HighlightIcon();
23  PlaySoundSystem("Navigation_CompassSelected");
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  protected void SkipTimer()
28  {
29  m_fDuration = 0;
30 
31  if (m_RulerTool)
32  m_RulerTool.m_OnClick.Remove(SkipTimer);
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  protected void HighlightIcon()
37  {
38  SCR_MapEntity mapEnt = SCR_MapEntity.GetMapInstance();
39  if (!mapEnt)
40  return;
41 
42  SCR_MapToolMenuUI toolMenuUI = SCR_MapToolMenuUI.Cast(mapEnt.GetMapUIComponent(SCR_MapToolMenuUI));
43  if (!toolMenuUI)
44  return;
45 
46  array<ref SCR_MapToolEntry> tools = toolMenuUI.GetMenuEntries();
47 
48  Widget toolButton;
49  foreach (int i, SCR_MapToolEntry tool : tools)
50  {
51  if (tool.m_sIconQuad == "ruler")
52  {
53  toolButton = GetGame().GetWorkspace().FindAnyWidget("ToolMenuButton"+i);
54  m_RulerTool = tool;
55  }
56  }
57 
58  if (!m_RulerTool)
59  return;
60 
61  m_wHighlight = SCR_WidgetHighlightUIComponent.CreateHighlight(toolButton, "{D574871D2C37B255}UI/layouts/Common/WidgetHighlight.layout");
62  m_RulerTool.m_OnClick.Insert(SkipTimer);
63  }
64 
65  //------------------------------------------------------------------------------------------------
66  protected void OnMapClosed(MapConfiguration config)
67  {
68  GetGame().GetCallqueue().Remove(HighlightIcon);
69  }
70 
71  //------------------------------------------------------------------------------------------------
72  protected void OnMapOpened(MapConfiguration config)
73  {
74  //Delayed call, so all map widgets are properly initialized
75  GetGame().GetCallqueue().CallLater(HighlightIcon, 100);
76  }
77 
78  //------------------------------------------------------------------------------------------------
79  override protected bool GetIsFinished()
80  {
81  if (!m_TutorialComponent.GetIsMapOpen())
82  return true;
83 
84  return m_RulerTool.IsEntryActive() || !m_TutorialComponent.GetVoiceSystem().IsPlaying();
85  }
86 
87  //------------------------------------------------------------------------------------------------
89  {
90  if (m_RulerTool)
91  m_RulerTool.m_OnClick.Remove(SkipTimer);
92 
93  delete m_wHighlight;
94  }
95 };
SCR_BaseCampaignTutorialArlandStage
Definition: SCR_BaseCampaignTutorialArlandStage.c:7
m_fDuration
float m_fDuration
Definition: SendGoalMessage.c:437
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_MapToolEntry
Map tool menu entry data class.
Definition: SCR_MapToolMenuUI.c:2
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
SCR_BaseCampaignTutorialArlandStageClass
Definition: SCR_BaseCampaignTutorialArlandStage.c:2
SCR_TutorialNavigation6
Definition: SCR_TutorialNavigation6.c:7
SCR_WidgetHighlightUIComponent
Definition: SCR_WidgetHighlightUIComponent.c:1
SCR_TutorialNavigation6Class
Definition: SCR_TutorialNavigation6.c:2
SCR_MapToolMenuUI
void SCR_MapToolMenuUI()
Definition: SCR_MapToolMenuUI.c:389