Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TutorialNavigation5.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_CompassTool;
11  //------------------------------------------------------------------------------------------------
12  override protected void Setup()
13  {
14  SCR_MapEntity.GetOnMapOpen().Remove(OnMapOpened);
15  SCR_MapEntity.GetOnMapClose().Remove(OnMapClosed);
16  SCR_MapEntity.GetOnMapOpen().Insert(OnMapOpened);
17  SCR_MapEntity.GetOnMapClose().Insert(OnMapClosed);
18 
19  if (!m_TutorialComponent.GetIsMapOpen())
20  OnMapClosed(null);
21 
22  SCR_HintManagerComponent.ShowHint(m_TutorialHintList.GetHint(m_TutorialComponent.GetStage()));
23 
24  HighlightIcon();
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  protected void HighlightIcon()
29  {
30  SCR_MapEntity mapEnt = SCR_MapEntity.GetMapInstance();
31  if (!mapEnt)
32  return;
33 
34  SCR_MapToolMenuUI toolMenuUI = SCR_MapToolMenuUI.Cast(mapEnt.GetMapUIComponent(SCR_MapToolMenuUI));
35  if (!toolMenuUI)
36  return;
37 
38  array<ref SCR_MapToolEntry> tools = toolMenuUI.GetMenuEntries();
39 
40  Widget toolButton;
41  foreach (int i, SCR_MapToolEntry tool : tools)
42  {
43  if (tool.m_sIconQuad == "compass")
44  {
45  toolButton = GetGame().GetWorkspace().FindAnyWidget("ToolMenuButton"+i);
46  m_CompassTool = tool;
47  }
48  }
49 
50  if (m_CompassTool)
51  m_wHighlight = SCR_WidgetHighlightUIComponent.CreateHighlight(toolButton, "{D574871D2C37B255}UI/layouts/Common/WidgetHighlight.layout");
52  }
53 
54  //------------------------------------------------------------------------------------------------
55  protected void OnMapClosed(MapConfiguration config)
56  {
57  GetGame().GetCallqueue().Remove(HighlightIcon);
58  }
59 
60  //------------------------------------------------------------------------------------------------
61  protected void OnMapOpened(MapConfiguration config)
62  {
63  //Delayed call, so all map widgets are properly initialized
64  GetGame().GetCallqueue().CallLater(HighlightIcon, 100);
65  }
66 
67  //------------------------------------------------------------------------------------------------
68  override protected bool GetIsFinished()
69  {
70  if (!m_CompassTool)
71  return false;
72 
73  return m_CompassTool.IsEntryActive();
74  }
75 
76  //------------------------------------------------------------------------------------------------
78  {
79  delete m_wHighlight;
80  }
81 };
SCR_BaseCampaignTutorialArlandStage
Definition: SCR_BaseCampaignTutorialArlandStage.c:7
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_TutorialNavigation5
Definition: SCR_TutorialNavigation5.c:7
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
SCR_TutorialNavigation5Class
Definition: SCR_TutorialNavigation5.c:2
SCR_BaseCampaignTutorialArlandStageClass
Definition: SCR_BaseCampaignTutorialArlandStage.c:2
SCR_WidgetHighlightUIComponent
Definition: SCR_WidgetHighlightUIComponent.c:1
SCR_MapToolMenuUI
void SCR_MapToolMenuUI()
Definition: SCR_MapToolMenuUI.c:389