DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ErrorProperties.c
См. документацию.
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
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()
Определения ErrorProperties.c:77
int m_DialogButtonType
Определения ErrorProperties.c:39
string GetHeader()
Определения ErrorProperties.c:76
int GetDialogMeaningType()
Определения ErrorProperties.c:79
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)
Определения ErrorProperties.c:45
int m_DialogMeaningType
Определения ErrorProperties.c:41
UIScriptedMenu GetHandler()
Определения ErrorProperties.c:80
int m_DefaultButton
Определения ErrorProperties.c:40
int GetDefaultButton()
Определения ErrorProperties.c:78
UIScriptedMenu m_Handler
Определения ErrorProperties.c:42
bool m_DisplayAdditionalInfo
Определения ErrorProperties.c:43
proto native UIManager GetUIManager()
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Определения ErrorModuleHandler.c:29
const string EP_MESSAGE_FORMAT_STRING
Formating for message (%1 = Message; %2 = AdditionalInfo)
Определения ErrorProperties.c:5
string m_ServerMessage
Message which will appear on Server.
Определения ErrorProperties.c:8
string GetClientMessage(string additionalInfo="")
Определения ErrorProperties.c:18
void HandleError(int errorCode, string additionalInfo="")
Определения ErrorProperties.c:16
string GetServerMessage(string additionalInfo="")
Определения ErrorProperties.c:26
string m_Message
Message which will appear on Client.
Определения ErrorProperties.c:7
void ErrorProperties(string message, string serverMessage)
Определения ErrorProperties.c:10
const string EP_HEADER_FORMAT_STRING
Formating for header (%1 = Header; %2 = ErrorCode)
Определения ErrorProperties.c:4
Class which holds the properties and handling of an error.
Определения ErrorProperties.c:3
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)
Shows message dialog.
Определения DayZGame.c:64
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.