Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
errorproperties.c
Go to the documentation of this file.
1
3{
4 const string EP_HEADER_FORMAT_STRING = "%1 (%2)";
5 const string EP_MESSAGE_FORMAT_STRING = "%1\n(%2)";
6
7 protected string m_Message;
8 protected string m_ServerMessage;
9
10 void ErrorProperties(string message, string serverMessage)
11 {
12 m_Message = message;
13 m_ServerMessage = serverMessage;
14 }
15
16 void HandleError(int errorCode, string additionalInfo = "") {}
17
18 string GetClientMessage(string additionalInfo = "")
19 {
20 if ( additionalInfo != "" )
21 return string.Format(EP_MESSAGE_FORMAT_STRING, m_Message, additionalInfo);
22 else
23 return m_Message;
24 }
25
26 string GetServerMessage(string additionalInfo = "")
27 {
28 if ( additionalInfo != "" )
29 return string.Format(EP_MESSAGE_FORMAT_STRING, m_ServerMessage, additionalInfo);
30 else
31 return m_ServerMessage;
32 }
33}
34
37{
38 protected string m_Header;
39 protected int m_DialogButtonType;
40 protected int m_DefaultButton;
41 protected int m_DialogMeaningType;
44
45 void DialogueErrorProperties(string message, string serverMessage, string header, UIScriptedMenu handler = null, int dialogButtonType = DBT_OK, int defaultButton = DBB_OK, int dialogMeaningType = DMT_EXCLAMATION, bool displayAdditionalInfo = true)
46 {
47 m_Header = header;
48 m_DialogButtonType = dialogButtonType;
49 m_DefaultButton = defaultButton;
50 m_DialogMeaningType = dialogMeaningType;
51 m_Handler = handler;
52 m_DisplayAdditionalInfo = displayAdditionalInfo;
53 }
54
55 override void HandleError(int errorCode, string additionalInfo = "")
56 {
57#ifdef NO_GUI
58 return; //do not display error if GUI is disabled
59#endif
60
61#ifdef SERVER
62 return;
63#else
64 string message;
65 if (m_DisplayAdditionalInfo && additionalInfo != "")
66 message = string.Format(EP_MESSAGE_FORMAT_STRING, m_Message, additionalInfo);
67 else
68 message = m_Message;
69
70 GetGame().GetUIManager().ShowDialog(
71 string.Format(EP_HEADER_FORMAT_STRING, m_Header, ErrorModuleHandler.GetErrorHex(errorCode)),
73#endif
74 }
75
76 string GetHeader() { return m_Message; }
81}
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Class which holds the properties and handling of an error.
string m_ServerMessage
Message which will appear on Server.
string GetClientMessage(string additionalInfo="")
void HandleError(int errorCode, string additionalInfo="")
string GetServerMessage(string additionalInfo="")
string m_Message
Message which will appear on Client.
void ErrorProperties(string message, string serverMessage)
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
int GetDialogButtonType()
int m_DialogButtonType
string GetHeader()
int GetDialogMeaningType()
void DialogueErrorProperties(string message, string serverMessage, string header, UIScriptedMenu handler=null, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
int m_DialogMeaningType
UIScriptedMenu GetHandler()
class ErrorProperties m_Header
Error which shows a generic Dialogue UI.
int m_DefaultButton
int GetDefaultButton()
UIScriptedMenu m_Handler
bool m_DisplayAdditionalInfo
proto native CGame GetGame()