DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ContentDLCStorePrompt.c
См. документацию.
1
3{
4 protected static ref ContentDLCStorePrompt m_Instance;
5
6 protected EDLCId m_DLCId;
7 protected int m_DialogId;
8
13 static void WarnAndOpenStore(EDLCId dlcId)
14 {
15 if (!ContentDLC.IsValidDLCID(dlcId))
16 return;
17
18 // A previous warning may still be pending, in that case reuse its handler
19 if (!m_Instance)
21
22 m_Instance.ShowWarning(dlcId);
23 }
24
25 protected void ShowWarning(EDLCId dlcId)
26 {
27 m_DLCId = dlcId;
28 m_DialogId = ErrorModuleHandler.CreateError(ErrorCategory.ConnectErrorClient, EConnectErrorClient.DLC_CHECK_FAILED);
29
30 string name = g_Game.GetContentDLCService().GetLocalizedName(dlcId);
31 string message = ErrorModuleHandler.GetClientMessage(ErrorCategory.ConnectErrorClient, EConnectErrorClient.DLC_CHECK_FAILED, name);
32 string header = string.Format("%1 (%2)", "#server_browser_connecting_failed", ErrorModuleHandler.GetErrorHex(m_DialogId));
33
34 g_Game.GetUIManager().ShowDialog(header, message, m_DialogId, DBT_OK, DBB_OK, DMT_EXCLAMATION, this);
35 }
36
38 protected static void OpenStore(EDLCId dlcId)
39 {
40 g_Game.GetContentDLCService().BuyDLC(dlcId);
41
42 m_Instance = null;
43 }
44
45 override bool OnModalResult(Widget w, int x, int y, int code, int result)
46 {
47 super.OnModalResult(w, x, y, code, result);
48
49 // Any way of closing the dialog means the player has been told about the missing DLC
50 if (code == m_DialogId)
51 g_Game.GetCallQueue(CALL_CATEGORY_GUI).Call(OpenStore, m_DLCId);
52
53 return true;
54 }
55}
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EConnectErrorClient
Определения ConnectErrorClientModule.c:2
EDLCId
Определения ContentDLC.c:4
DayZGame g_Game
Определения DayZGame.c:4074
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
Определения ErrorModuleHandler.c:5
Icon x
Icon y
static proto native bool IsValidDLCID(EDLCId dlcId)
Check if a DLC ID is valid.
ContentDLC is for query installed DLC (only as entitlement keys, not content)
Определения ContentDLC.c:19
EDLCId m_DLCId
Определения ContentDLCStorePrompt.c:6
void ShowWarning(EDLCId dlcId)
Определения ContentDLCStorePrompt.c:25
override bool OnModalResult(Widget w, int x, int y, int code, int result)
Определения ContentDLCStorePrompt.c:45
static ref ContentDLCStorePrompt m_Instance
Определения ContentDLCStorePrompt.c:4
static void WarnAndOpenStore(EDLCId dlcId)
Определения ContentDLCStorePrompt.c:13
static void OpenStore(EDLCId dlcId)
Runs from the call queue, so the prompt is released outside of the modal callback.
Определения ContentDLCStorePrompt.c:38
Informs the player that a DLC is missing and opens the platform store once the warning has been confi...
Определения ContentDLCStorePrompt.c:3
static proto int CreateError(ErrorCategory category, int code)
Creates full error code.
static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo="")
Gets the Client Message for specified error.
static proto 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
Определения DayZGame.c:64
Определения EnWidgets.c:190
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.
const int CALL_CATEGORY_GUI
Определения 3_Game/DayZ/tools/tools.c:9