Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
errorproperties.c
Go to the documentation of this file.
1
2
class
ErrorProperties
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
36
class
DialogueErrorProperties
:
ErrorProperties
37
{
38
protected
string
m_Header
;
39
protected
int
m_DialogButtonType
;
40
protected
int
m_DefaultButton
;
41
protected
int
m_DialogMeaningType
;
42
protected
UIScriptedMenu
m_Handler
;
43
protected
bool
m_DisplayAdditionalInfo
;
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
g_Game
.GetUIManager().ShowDialog(
71
string
.Format(EP_HEADER_FORMAT_STRING,
m_Header
,
ErrorModuleHandler
.
GetErrorHex
(errorCode)),
72
message, errorCode,
m_DialogButtonType
,
m_DefaultButton
,
m_DialogMeaningType
,
m_Handler
);
73
#endif
74
}
75
76
string
GetHeader
() {
return
m_Message; }
77
int
GetDialogButtonType
() {
return
m_DialogButtonType
; }
78
int
GetDefaultButton
() {
return
m_DefaultButton
; }
79
int
GetDialogMeaningType
() {
return
m_DialogMeaningType
; }
80
UIScriptedMenu
GetHandler
() {
return
m_Handler
; }
81
}
ErrorModuleHandler
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Definition
errormodulehandler.c:29
ErrorModuleHandler::GetErrorHex
static proto string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
ErrorProperties
Class which holds the properties and handling of an error.
Definition
errorproperties.c:3
ErrorProperties::ErrorProperties
void ErrorProperties(string message, string serverMessage)
Definition
errorproperties.c:10
ErrorProperties::m_Message
string m_Message
Message which will appear on Client.
Definition
errorproperties.c:7
ErrorProperties::EP_HEADER_FORMAT_STRING
const string EP_HEADER_FORMAT_STRING
Formating for header (%1 = Header; %2 = ErrorCode).
Definition
errorproperties.c:4
ErrorProperties::HandleError
void HandleError(int errorCode, string additionalInfo="")
Definition
errorproperties.c:16
ErrorProperties::GetClientMessage
string GetClientMessage(string additionalInfo="")
Definition
errorproperties.c:18
ErrorProperties::GetServerMessage
string GetServerMessage(string additionalInfo="")
Definition
errorproperties.c:26
ErrorProperties::m_ServerMessage
string m_ServerMessage
Message which will appear on Server.
Definition
errorproperties.c:8
ErrorProperties::EP_MESSAGE_FORMAT_STRING
const string EP_MESSAGE_FORMAT_STRING
Formating for message (%1 = Message; %2 = AdditionalInfo).
Definition
errorproperties.c:5
UIScriptedMenu
Xbox menu.
Definition
dayzgame.c:64
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
m_Header
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
GetDialogButtonType
int GetDialogButtonType()
Definition
errorproperties.c:77
m_DialogButtonType
int m_DialogButtonType
Definition
errorproperties.c:39
GetHeader
string GetHeader()
Definition
errorproperties.c:76
GetDialogMeaningType
int GetDialogMeaningType()
Definition
errorproperties.c:79
DialogueErrorProperties
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)
Definition
errorproperties.c:45
m_DialogMeaningType
int m_DialogMeaningType
Definition
errorproperties.c:41
GetHandler
UIScriptedMenu GetHandler()
Definition
errorproperties.c:80
m_DefaultButton
int m_DefaultButton
Definition
errorproperties.c:40
GetDefaultButton
int GetDefaultButton()
Definition
errorproperties.c:78
m_Handler
UIScriptedMenu m_Handler
Definition
errorproperties.c:42
m_DisplayAdditionalInfo
bool m_DisplayAdditionalInfo
Definition
errorproperties.c:43
string::Format
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.
Games
Dayz
scripts
3_game
global
errormodulehandler
errorproperties.c
Generated by
1.17.0