Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_CurrentTaskUIComponent.c
Go to the documentation of this file.
1
class
SCR_CurrentTaskUIComponent
:
SCR_ScriptedWidgetComponent
2
{
3
[
Attribute
(
"#AR-Tasks_NoAssignedTaskTitle"
)]
4
protected
string
m_sNoAssignedTaskTitle
;
5
6
[
Attribute
(
"#AR-Tasks_NoAssignedTaskDescription"
)]
7
protected
string
m_sNoAssignedTaskDescription
;
8
9
protected
ref
SCR_CurrentTaskWidgets
m_Widgets
=
new
SCR_CurrentTaskWidgets
();
10
11
//------------------------------------------------------------------------------------------------
12
override
void
HandlerAttached
(
Widget
w)
13
{
14
super.HandlerAttached(w);
15
16
m_Widgets
.Init(w);
17
}
18
19
//------------------------------------------------------------------------------------------------
20
void
UpdateTask
(
SCR_Task
task
)
21
{
22
int
playerID =
SCR_PlayerController
.
GetLocalPlayerId
();
23
SCR_Faction
faction =
SCR_Faction
.Cast(
SCR_FactionManager
.SGetPlayerFaction(playerID));
24
if
(!faction)
25
return
;
26
27
if
(!
task
)
28
{
29
Color
color = faction.
GetOutlineFactionColor
();
30
if
(color)
31
{
32
m_Widgets
.m_wTaskIconSymbol.SetColor(color);
33
m_Widgets
.m_wTaskIconOutline.SetColor(color);
34
}
35
36
m_Widgets
.m_wTaskTitle.SetText(
m_sNoAssignedTaskTitle
);
37
m_Widgets
.m_wTaskDescription.SetText(
m_sNoAssignedTaskDescription
);
38
39
return
;
40
}
41
42
SCR_TaskSystem
taskSystem =
SCR_TaskSystem
.GetInstance();
43
if
(!taskSystem)
44
return
;
45
46
// Handle progression bar
47
if
(taskSystem.CanProgressBeShownForTask(
task
))
48
{
49
float
progress = taskSystem.GetTaskProgress(
task
);
50
m_Widgets
.m_wProgressBar.SetVisible(
true
);
51
m_Widgets
.m_ProgressBarComponent.SetValue(progress);
52
}
53
54
SCR_TaskUIInfo
info =
task
.GetTaskUIInfo();
55
if
(!info)
56
return
;
57
58
info.
SetNameTo
(
m_Widgets
.m_wTaskTitle);
59
info.
SetDescriptionTo
(
m_Widgets
.m_wTaskDescription);
60
info.SetIconTo(
m_Widgets
.m_wTaskIconSymbol);
61
62
Color
color = faction.
GetOutlineFactionColor
();
63
if
(color)
64
{
65
m_Widgets
.m_wTaskIcon.SetColor(color);
66
m_Widgets
.m_wTaskIconOutline.SetColor(color);
67
}
68
69
SCR_TaskExecutor
executor =
SCR_TaskExecutor
.FromPlayerID(playerID);
70
if
(!executor)
71
return
;
72
73
// Check if current controlled Entity is assigned to the task
74
if
(
task
.IsTaskAssignedTo(executor))
75
{
76
Color
factionColor = faction.GetFactionColor();
77
if
(factionColor)
78
m_Widgets
.m_wTaskIconBackground.SetColor(factionColor);
79
}
80
}
81
}
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
SCR_Task
void SCR_Task(IEntitySource src, IEntity parent)
Definition
SCR_Task.c:1938
task
from task
Definition
SCR_TaskNotificationConfigs.c:12
Color
Definition
Color.c:13
SCR_CurrentTaskUIComponent
Definition
SCR_CurrentTaskUIComponent.c:2
SCR_CurrentTaskUIComponent::m_sNoAssignedTaskTitle
string m_sNoAssignedTaskTitle
Definition
SCR_CurrentTaskUIComponent.c:4
SCR_CurrentTaskUIComponent::m_sNoAssignedTaskDescription
string m_sNoAssignedTaskDescription
Definition
SCR_CurrentTaskUIComponent.c:7
SCR_CurrentTaskUIComponent::UpdateTask
void UpdateTask(SCR_Task task)
Definition
SCR_CurrentTaskUIComponent.c:20
SCR_CurrentTaskUIComponent::m_Widgets
ref SCR_CurrentTaskWidgets m_Widgets
Definition
SCR_CurrentTaskUIComponent.c:9
SCR_CurrentTaskUIComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_CurrentTaskUIComponent.c:12
SCR_CurrentTaskWidgets
Definition
SCR_CurrentTaskWidgets.c:4
SCR_Faction
Definition
SCR_Faction.c:6
SCR_Faction::GetOutlineFactionColor
Color GetOutlineFactionColor()
Definition
SCR_Faction.c:306
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalPlayerId
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Definition
SCR_PlayerController.c:481
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_TaskExecutor
Definition
SCR_TaskExecutor.c:2
SCR_TaskSystem
Definition
SCR_TaskSystem.c:6
SCR_TaskUIInfo
Definition
SCR_TaskUIInfo.c:3
SCR_TaskUIInfo::SetDescriptionTo
override bool SetDescriptionTo(TextWidget textWidget)
Definition
SCR_TaskUIInfo.c:106
SCR_TaskUIInfo::SetNameTo
override bool SetNameTo(TextWidget textWidget)
Definition
SCR_TaskUIInfo.c:92
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Tasks
SCR_CurrentTaskUIComponent.c
Generated by
1.17.0