DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
UIManager.c
См. документацию.
2{
4 proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent);
5 proto native UIScriptedMenu CreateScriptedMenu(int id, UIMenuPanel parent);
6
7 proto native void EnterServerBrowser(UIMenuPanel parentMenu);
8
10 proto native void HideScriptedMenu(UIScriptedMenu menu);
11
13 proto native bool IsDialogVisible();
15 proto native bool IsDialogHiding();
16 proto native bool IsModalVisible();
17 proto native void CloseSpecificDialog(int id);
18 proto native void CloseDialog();
19 proto native void HideDialog();
20
45 proto native void ShowDialog(string caption, string text, int id, int butts /*DBT_*/, int def/*DBB_*/, int type /*DMT_*/, UIScriptedMenu handler);
47 proto native bool ShowCursor(bool visible);
48 proto native bool IsCursorVisible();
49 proto native bool IsDialogQueued();
50 proto native bool ShowQueuedDialog();
51 proto native int GetLoginQueuePosition();
52 proto native bool ScreenFadeVisible();
53 proto native void ScreenFadeIn(float duration, string text, int backgroundColor, int textColor);
54 proto native void ScreenFadeOut(float duration);
55 proto native bool IsScaledMode();
56 proto native void SetScaledMode(bool enabled);
57
59 proto native UIScriptedMenu GetMenu();
60
62 bool Back()
63 {
64 if (IsDialogVisible() == false)
65 {
66 UIMenuPanel menu = GetMenu();
67 if (menu)
68 {
69 menu.Close();
70 return true;
71 }
72 }
73
74 return false;
75 }
76
78 bool CloseAll()
79 {
80 UIMenuPanel menu = GetMenu();
81 while (menu)
82 {
83 if (menu.GetParentMenu())
84 {
85 menu = menu.GetParentMenu();
86 }
87 else
88 {
89 menu.Close();
90 return true;
91 }
92 }
93
94 return false;
95 }
96
99 {
100 UIMenuPanel menu = GetMenu();
101
102 while (menu && menu.GetParentMenu() && menu.GetParentMenu().GetParentMenu())
103 {
104 menu = menu.GetParentMenu();
105 }
106
107 if (menu && menu.GetParentMenu())
108 {
109 menu.Close();
110 return true;
111 }
112
113 return false;
114 }
115
117 bool CloseMenu(int id)
118 {
119 UIMenuPanel menu = GetMenu();
120
121 while (menu)
122 {
123 if (menu.GetID() == id)
124 {
125 menu.Close();
126 return true;
127 }
128
129 menu = menu.GetParentMenu();
130 }
131
132 return false;
133 }
134
135 bool HideMenu(int id)
136 {
137 UIScriptedMenu menu = GetMenu();
138
139 while (menu)
140 {
141 if (menu.GetID() == id)
142 {
143 HideScriptedMenu( menu );
144 return true;
145 }
146
147 menu = UIScriptedMenu.Cast( menu.GetParentMenu() );
148 }
149
150 return false;
151 }
152
154 bool IsMenuOpen(int id)
155 {
156 return FindMenu(id) != null;
157 }
158
161 {
162 UIScriptedMenu menu = GetMenu();
163
164 while (menu)
165 {
166 if (menu.GetID() == id)
167 {
168 return menu;
169 }
170
171 menu = UIScriptedMenu.Cast( menu.GetParentMenu() );
172 }
173
174 return NULL;
175 }
176
177 //Window management
178 void OpenWindow( int id )
179 {
181
182 //if window is already opened, close it
183 if ( window )
184 {
185 CloseWindow( id );
186
187 return;
188 }
189
190 //create new window
191 switch( id )
192 {
194 window = GetGame().GetMission().CreateScriptedWindow( id );
195 break;
196
197 default: {};
198 }
199
200 if ( window )
201 {
202 window.Init();
203
204 //add to active windows
206 }
207 }
208
209 void CloseWindow( int id )
210 {
212
213 if ( window )
214 {
216 window.HideWindow();
217
218 //delete window;
220 /*
221 wtf? leak
222 Timer delete_timer = new Timer ( CALL_CATEGORY_SYSTEM );
223 Param1<UIScriptedWindow> params = new Param1<UIScriptedWindow>( window );
224 delete_timer.Run( 0.5, this, "DeleteWindow", params, false );*/
225
226 }
227 }
228
230 {
231 delete window;
232 }
233
234 bool IsWindowOpened( int id )
235 {
236 if ( UIScriptedWindow.GetWindow( id ) )
237 {
238 return true;
239 }
240
241 return false;
242 }
243
244 void ShowUICursor( bool visible )
245 {
246 g_Game.SetMouseCursorDesiredVisibility(visible);
247 }
248};
249
252{
253 const string images[] = {"{655A1BF79F5B291}Gui/textures/loading_screens/loading_screen_1_co.edds", "{84BE5F7442BD4B}Gui/textures/loading_screens/loading_screen_2_co.edds"};
254 Math.Randomize(-1);
255 int index = Math.RandomInt(0, 100) % 2;
256 return images[index];
257}
DayZGame g_Game
Определения DayZGame.c:3868
string GetRandomLoadingBackground()
Returns random loading background texture path.
Определения UIManager.c:251
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native Mission GetMission()
Определения EnMath.c:7
UIScriptedWindow CreateScriptedWindow(int id)
Определения gameplay.c:738
proto void Call(func fn, 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)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
void DeleteWindow(UIScriptedWindow window)
Определения UIManager.c:229
void OpenWindow(int id)
Определения UIManager.c:178
proto native bool IsScaledMode()
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)
Shows message dialog.
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native bool IsDialogVisible()
proto native bool IsModalVisible()
proto native void ScreenFadeOut(float duration)
proto native bool ShowCursor(bool visible)
natively checks game focus on cursor hiding
bool IsWindowOpened(int id)
Определения UIManager.c:234
proto native bool IsCursorVisible()
proto native void CloseSpecificDialog(int id)
bool CloseAllSubmenus()
Close all opened menus except first menu.
Определения UIManager.c:98
bool CloseMenu(int id)
Close menu with specific ID (see MenuID)
Определения UIManager.c:117
proto native bool ScreenFadeVisible()
proto native int GetLoginQueuePosition()
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
proto native void EnterServerBrowser(UIMenuPanel parentMenu)
void ShowUICursor(bool visible)
Определения UIManager.c:244
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
Определения UIManager.c:160
proto native bool IsDialogHiding()
Returns true for a single frame whenever a dialog is hidden.
proto native bool ShowQueuedDialog()
bool IsMenuOpen(int id)
Returns true if menu with specific ID is opened (see MenuID)
Определения UIManager.c:154
bool HideMenu(int id)
Определения UIManager.c:135
bool Back()
Close top window on windows stack, returns true when any window is closed.
Определения UIManager.c:62
void CloseWindow(int id)
Определения UIManager.c:209
bool CloseAll()
Close all opened menus.
Определения UIManager.c:78
proto native UIScriptedMenu CreateScriptedMenu(int id, UIMenuPanel parent)
proto native bool IsDialogQueued()
proto native Widget GetWidgetUnderCursor()
proto native void HideDialog()
proto native void CloseDialog()
proto native UIScriptedMenu ShowScriptedMenu(UIScriptedMenu menu, UIMenuPanel parent)
proto native void HideScriptedMenu(UIScriptedMenu menu)
proto native void SetScaledMode(bool enabled)
proto native void ScreenFadeIn(float duration, string text, int backgroundColor, int textColor)
Определения UIManager.c:2
int GetID()
Returns MenuID.
Определения UIScriptedMenu.c:53
proto native UIMenuPanel GetParentMenu()
proto native void Close()
Safe way to close window, using this function can even window safely close itself.
Part of main menu hierarchy to create custom menus from script.
Определения UIScriptedMenu.c:3
Определения DayZGame.c:64
Widget Init()
Определения UIScriptedWindow.c:60
void HideWindow()
Определения UIScriptedWindow.c:69
static void RemoveFromActiveWindows(int id)
Определения UIScriptedWindow.c:19
static UIScriptedWindow GetWindow(int id)
Определения UIScriptedWindow.c:27
static void AddToActiveWindows(int id, UIScriptedWindow window)
Определения UIScriptedWindow.c:9
Определения EnWidgets.c:190
proto native CGame GetGame()
static proto int Randomize(int seed)
Sets the seed for the random number generator.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int GUI_WINDOW_MISSION_LOADER
Определения constants.c:218
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8