Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
ErrorDialogUI.c
Go to the documentation of this file.
1/*
2Extend error dialog class for simple dialog to parse messages
3*/
4
5//------------------------------------------------------------------------------------------------
7{
9
10 //------------------------------------------------------------------------------------------------
11 override void OnMenuOpen()
12 {
13 super.OnMenuOpen();
14
15 // Find data component
17 }
18
19 //------------------------------------------------------------------------------------------------
20 // Set dialog texts based on ids of title and message
21 void DisplayError(string title, string msg)
22 {
23 // Get texts
24 FindTextsInMsgConfig(title, msg);
25
26 // Set texts
27 this.SetTitle(title);
28 this.SetMessage(msg);
29 }
30
31 //------------------------------------------------------------------------------------------------
32 // Pass localized names if given names of title - message match to group - entry names
33 protected void FindTextsInMsgConfig(out string title, out string msg)
34 {
35 // Check error data
37 return;
38
39 // Check message config
40 SCR_ErrorDialogMessages errorMessages = m_ErrorDialogData.m_ErrorDialogMessages;
41 if (!errorMessages)
42 return;
43
44 ref array<ref SCR_ErrorDialogMessageGroup> groups = errorMessages.m_aKickCauseGroups;
45
46 // Go through groups
47 foreach (SCR_ErrorDialogMessageGroup group : groups)
48 {
49 // Check group
50 if (group.m_sName != title)
51 continue;
52
53 // Set localized title
54 title = group.m_sNameLocalized;
55
56 // Get entries
57 ref array<ref SCR_ErrorDialogMessageEntry> entries = group.m_aKickCauseEntries;
58
59 // Go through entries
60 foreach (SCR_ErrorDialogMessageEntry entry : entries)
61 {
62 // Set localized msg
63 if (entry.m_sName == msg)
64 msg = entry.m_sNameLocalized;
65 }
66
67 }
68 }
69};
Widget GetRootWidget()
void SetMessage(string text)
Definition DialogUI.c:159
void SetTitle(string text)
Definition DialogUI.c:143
void DisplayError(string title, string msg)
SCR_ErrorDialogDataComponent m_ErrorDialogData
void FindTextsInMsgConfig(out string title, out string msg)
override void OnMenuOpen()