DayZ 1.24
Loading...
Searching...
No Matches
MissionLoader.c File Reference

Go to the source code of this file.

Classes

class  JsonMissionLoaderData
 

Functions

override Widget Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
override bool OnClick (Widget w, int x, int y, int button)
 
override bool OnDoubleClick (Widget w, int x, int y, int button)
 
override bool OnKeyDown (Widget w, int x, int y, int key)
 

Variables

class JsonMissionLoaderData m_WgtLstMsnList
 
ButtonWidget m_WgtBtnMsnPlay
 
ButtonWidget m_WgtBtnMsnClose
 
ref TStringArray m_ListMissionsNames
 
ref JsonMissionLoaderData m_MissionData
 

Function Documentation

◆ Init()

override Widget Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

Definition at line 43 of file MissionLoader.c.

44 {
46
47 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_mission_loader.layout");
48
49 m_WgtLstMsnList = TextListboxWidget.Cast(layoutRoot.FindAnyWidget("wgt_lst_missions"));
50 m_WgtBtnMsnPlay = ButtonWidget.Cast(layoutRoot.FindAnyWidget("wgt_btn_mission_play"));
51 m_WgtBtnMsnClose = ButtonWidget.Cast(layoutRoot.FindAnyWidget("wgt_btn_mission_close"));
52
53 foreach (string path: m_MissionData.MissionPaths)
54 m_WgtLstMsnList.AddItem(path, NULL, 0);
55
56 return layoutRoot;
57 }
ref JsonMissionLoaderData m_MissionData
ButtonWidget m_WgtBtnMsnPlay
ButtonWidget m_WgtBtnMsnClose
class JsonMissionLoaderData m_WgtLstMsnList
static JsonMissionLoaderData GetData()
proto native CGame GetGame()

References JsonMissionLoaderData::GetData(), GetGame(), m_MissionData, m_WgtBtnMsnClose, m_WgtBtnMsnPlay, m_WgtLstMsnList, and path.

◆ OnClick()

override bool OnClick ( Widget w,
int x,
int y,
int button )
protected

Definition at line 59 of file MissionLoader.c.

60 {
61 super.OnClick(w, x, y, button);
62
63 if (w == m_WgtBtnMsnClose)
64 {
65 Close();
66
67 return true;
68 }
69 else if (w == m_WgtBtnMsnPlay)
70 {
71 int rowIndex = m_WgtLstMsnList.GetSelectedRow();
72 string missionPath = m_MissionData.MissionPaths.Get(rowIndex);
73 GetGame().PlayMission(missionPath);
74 return true;
75 }
76 return false;
77 }
Icon x
Icon y
void Close()

References Close(), GetGame(), m_MissionData, m_WgtBtnMsnClose, m_WgtBtnMsnPlay, m_WgtLstMsnList, x, and y.

◆ OnDoubleClick()

override bool OnDoubleClick ( Widget w,
int x,
int y,
int button )
protected

Definition at line 80 of file MissionLoader.c.

81 {
82 super.OnClick(w, x, y, button);
83
84 if (w == m_WgtLstMsnList)
85 {
86 int rowIndex = m_WgtLstMsnList.GetSelectedRow();
87 string missionPath = m_MissionData.MissionPaths.Get(rowIndex);
88 GetGame().PlayMission(missionPath);
89 }
90 return false;
91 }

References GetGame(), m_MissionData, m_WgtLstMsnList, x, and y.

◆ OnKeyDown()

override bool OnKeyDown ( Widget w,
int x,
int y,
int key )
protected

Definition at line 93 of file MissionLoader.c.

94 {
95 super.OnKeyDown(w, x, y, key);
96 switch (key)
97 {
98 case KeyCode.KC_ESCAPE:
99 {
100 Close();
101 return true;
102 }
103 }
104 return false;
105 }
KeyCode
Definition EnSystem.c:157

References Close(), x, and y.

Variable Documentation

◆ m_ListMissionsNames

ref TStringArray m_ListMissionsNames
protected

Definition at line 40 of file MissionLoader.c.

◆ m_MissionData

ref JsonMissionLoaderData m_MissionData
protected

Definition at line 41 of file MissionLoader.c.

Referenced by Init(), OnClick(), and OnDoubleClick().

◆ m_WgtBtnMsnClose

ButtonWidget m_WgtBtnMsnClose
protected

Definition at line 39 of file MissionLoader.c.

Referenced by Init(), and OnClick().

◆ m_WgtBtnMsnPlay

ButtonWidget m_WgtBtnMsnPlay
protected

Definition at line 38 of file MissionLoader.c.

Referenced by Init(), and OnClick().

◆ m_WgtLstMsnList

class JsonMissionLoaderData m_WgtLstMsnList

Referenced by Init(), OnClick(), and OnDoubleClick().