DayZ 1.24
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
15
16 void HandleError(int errorCode, string additionalInfo = "") {}
17
18 string GetClientMessage(string additionalInfo = "")
19 {
20 if (additionalInfo != "")
22 else
23 return m_Message;
24 }
25
26 string GetServerMessage(string additionalInfo = "")
27 {
28 if (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
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;
66 message = string.Format(EP_MESSAGE_FORMAT_STRING, m_Message, additionalInfo);
67 else
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}
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
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
Class which holds the properties and handling of an error.
const string EP_MESSAGE_FORMAT_STRING
Formating for message (%1 = Message; %2 = AdditionalInfo)
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)
const string EP_HEADER_FORMAT_STRING
Formating for header (%1 = Header; %2 = ErrorCode)
proto native CGame GetGame()
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.