Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBaseTask.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2//class SCR_CampaignBaseTaskClass: SCR_TaskClass
3//{
4//};
5
6//------------------------------------------------------------------------------------------------
9//class SCR_CampaignBaseTask : SCR_Task
10//{
11//
12// const int MIN_OFFSET = 3;
13// const int MAX_OFFSET = 80;
14// //**************************//
15// //PROTECTED MEMBER VARIABLES//
16// //**************************//
17//
18// protected SCR_CampaignMilitaryBaseComponent m_TargetBase = null;
19// protected int m_iTargetBaseId = -1;
20//
21// //*********************//
22// //PUBLIC MEMBER METHODS//
23// //*********************//
24//
25// //------------------------------------------------------------------------------------------------
26// int GetTargetBaseId()
27// {
28// return m_iTargetBaseId;
29// }
30//
31// //------------------------------------------------------------------------------------------------
32// //! Sets the base that is marked as the target of this task.
33// //! For capture, target base should be the base to be captured.
34// //! For defend, target base should be the base to be defended.
35// //! For recon, target base should be the base around which recon should be done.
36// void SetTargetBase(notnull SCR_CampaignMilitaryBaseComponent targetBase)
37// {
38// if (SCR_MapEntity.GetMapInstance())
39// {
40// SCR_MapEntity.GetOnMapZoom().Insert(OnMapZoom);
41// SCR_MapEntity.GetOnMapOpen().Insert(OnMapOpenCallback);
42// }
43//
44// m_TargetBase = targetBase;
45//
46// SetOrigin(m_TargetBase.GetOwner().GetOrigin());
47//
48// if (RplSession.Mode() != RplMode.Dedicated)
49// {
50// CreateMapUIIcon();
51// UpdateMapInfo();
52// SetHUDIcon();
53// }
54// }
55//
56// //------------------------------------------------------------------------------------------------
57// void OnMapOpenCallback(MapConfiguration config)
58// {
59// SetOffset();
60// }
61//
62// //------------------------------------------------------------------------------------------------
63// void OnMapZoom(float pixelPerUnit)
64// {
65// SetOffset();
66// }
67//
68// //------------------------------------------------------------------------------------------------
69// // Temporary method to set offset of task marker from base marker. Once we have a proper solution for the map, this can be deleted.
70// void SetOffset()
71// {
72// vector newPos = m_TargetBase.GetOwner().GetOrigin();
73// newPos[0] = newPos[0] + CalculateOffset() / 2.5;
74// newPos[2] = newPos[2] - CalculateOffset() / 5;
75// SetOrigin(newPos);
76// }
77//
78// //------------------------------------------------------------------------------------------------
79// // Temporary method to set offset of task marker from base marker. Once we have a proper solution for the map, this can be deleted.
80// float CalculateOffset()
81// {
82// float pixelPerUnit = SCR_MapEntity.GetMapInstance().GetCurrentZoom();
83// int max_offset = MAX_OFFSET;
84// int min_offset = MIN_OFFSET;
85// float min_zoom = SCR_MapConstants.MAX_PIX_PER_METER;
86// float max_zoom = SCR_MapEntity.GetMapInstance().GetMinZoom();
87//
88// float a = max_offset * min_offset * (max_zoom - min_zoom) / (min_offset - max_offset);
89// float b = min_zoom - a / min_offset;
90//
91// return b + a / pixelPerUnit;
92// }
93//
94// //------------------------------------------------------------------------------------------------
95// string GetBaseNameWithCallsign()
96// {
97// if (m_TargetBase.GetType() == SCR_ECampaignBaseType.RELAY)
98// return m_TargetBase.GetBaseNameUpperCase();
99// return string.Format("%1 (%2)", m_TargetBase.GetBaseNameUpperCase(), m_TargetBase.GetCallsignDisplayNameOnlyUC());
100// }
101//
102// //------------------------------------------------------------------------------------------------
103// //! Returns the base that is marked as target of this task.
104// //! For capture, target base should be the base to be captured.
105// //! For defend, target base should be the base to be defended.
106// //! For recon, target base should be the base around which recon should be done.
107// SCR_CampaignMilitaryBaseComponent GetTargetBase()
108// {
109// return m_TargetBase;
110// }
111//
112// //******************************//
113// //PUBLIC OVERRIDE MEMBER METHODS//
114// //******************************//
115//
116// //------------------------------------------------------------------------------------------------
117// override void Deserialize(ScriptBitReader reader)
118// {
119// super.Deserialize(reader);
120//
121// int baseID;
122// reader.ReadInt(baseID);
123//
124// SCR_CampaignMilitaryBaseComponent base = SCR_GameModeCampaign.GetInstance().GetBaseManager().FindBaseByCallsign(baseID);
125//
126// if (!base)
127// {
128// m_iTargetBaseId = baseID;
129// return;
130// }
131//
132// if (base.GetFaction() == GetTargetFaction())
133// return;
134//
135// SetTargetBase(base);
136// }
137//
138// //------------------------------------------------------------------------------------------------
139// override void Serialize(ScriptBitWriter writer)
140// {
141// super.Serialize(writer);
142//
143// int baseID = -1;
144// SCR_CampaignMilitaryBaseComponent base = GetTargetBase();
145// if (base)
146// baseID = base.GetCallsign();
147//
148// writer.WriteInt(baseID);
149// }
150//
151// //------------------------------------------------------------------------------------------------
152// protected override void UpdateMapInfo()
153// {
154// //Insert task icon into base's map UI
155// //m_TargetBase cannot be null here
156// }
157//};