Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignTileComponent.c
Go to the documentation of this file.
2{
3 protected const string WIDGET_NAME_FINISHED = "Finished";
4 protected const string WIDGET_NAME_LOCKED = "LockedPanel";
5
6 protected Widget m_wFinished;
7 protected Widget m_wLocked;
8
9 protected bool m_bIsFinished;
10
11 //------------------------------------------------------------------------------------------------
12 override void HandlerAttached(Widget w)
13 {
14 super.HandlerAttached(w);
15
17 return;
18
19 m_wFinished = w.FindAnyWidget(WIDGET_NAME_FINISHED);
20 m_wFinished.SetVisible(false);
21
22 m_wLocked = m_wRoot.FindAnyWidget(WIDGET_NAME_LOCKED);
23 m_wLocked.SetVisible(false);
24 }
25
26 //------------------------------------------------------------------------------------------------
27 override bool OnFocus(Widget w, int x, int y)
28 {
30 return super.OnFocus(w, x, y);
31
32 m_bFocused = true;
33 float position[4] = {20.0, 0.0, 20.0, 25.0};
34
36 m_wDescription.SetVisible(true);
37 m_wBackground.SetVisible(true);
38
39 return super.OnFocus(w, x, y);
40 }
41
42 //------------------------------------------------------------------------------------------------
44 {
45 if (SCR_ScenarioSequenceProgress.IsScenarioLocked(m_Item))
47 else if (SCR_ScenarioSequenceProgress.IsNextScenarioLocked(m_Item))
48 SetFinished(true);
49 else if (CanPlay() || CanContinue())
50 {
52 return true;
53 }
54
55 return false;
56 }
57
58 //------------------------------------------------------------------------------------------------
61 override void ShowMission(notnull MissionWorkshopItem item, bool showRecommended = false)
62 {
63 super.ShowMission(item, showRecommended);
64
65 m_wFavoriteIcon.SetVisible(false);
66 m_wRecentIcon.SetVisible(false);
67 m_wNewIcon.SetVisible(false);
68 }
69
70 //------------------------------------------------------------------------------------------------
71 override void DisableTile()
72 {
73 super.DisableTile();
74
75 m_wLocked.SetVisible(true);
76 }
77
78 //------------------------------------------------------------------------------------------------
80 {
81 m_DisabledTileShadow.SetVisible(true);
82 m_DisabledTileShadow.SetOpacity(0.3);
83 }
84
85 //------------------------------------------------------------------------------------------------
86 bool CanPlay()
87 {
88 return m_Play.IsEnabled();
89 }
90
91 //------------------------------------------------------------------------------------------------
93 {
94 return m_Continue.IsEnabled();
95 }
96
97 //------------------------------------------------------------------------------------------------
99 {
100 return m_bIsFinished;
101 }
102
103 //------------------------------------------------------------------------------------------------
104 void SetFinished(bool state)
105 {
106 m_bIsFinished = state;
107
108 if (m_wFinished)
109 m_wFinished.SetVisible(true);
110 }
111}
112
vector position
static WidgetAnimationPadding Padding(Widget widget, float padding[4], float speed)
override bool OnFocus(Widget w, int x, int y)
override void ShowMission(notnull MissionWorkshopItem item, bool showRecommended=false)
override void HandlerAttached(Widget w)
static bool IsEditMode()
Definition Functions.c:1566
SCR_InputButtonComponent m_Play
SCR_InputButtonComponent m_Continue