Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cargocontainerrow.c
Go to the documentation of this file.
2 {
3  protected int m_NumberRow;
4  protected int m_NumberColumnFocused;
5  protected int m_Width;
6  protected int m_MaxColumns;
7 
8  protected EntityAI m_Entity;
9 
10  protected CargoContainer m_ParentContainer;
11  protected ref SizeToChild m_Resizer1;
12  protected ref SizeToParent m_Resizer2;
13 
14  void CargoContainerRow( LayoutHolder parent )
15  {
16  m_ParentContainer = CargoContainer.Cast( parent );
17  #ifdef PLATFORM_CONSOLE
18  m_MaxColumns = 5;
19  #else
20  m_MaxColumns = 10;
21  #endif
22 
23  for ( int i = 0; i < m_MaxColumns; i++ )
24  {
25  Widget iconWidget = GetMainWidget().FindAnyWidget( "Icon" + i );
26 
27  iconWidget.SetUserID(i);
28 
29  WidgetEventHandler.GetInstance().RegisterOnDropReceived( iconWidget, this, "DropReceived" );
30  WidgetEventHandler.GetInstance().RegisterOnDraggingOver( iconWidget, this, "DraggingOver" );
31  }
32 
33  m_RootWidget.GetScript( m_Resizer1 );
34  m_RootWidget.FindAnyWidget( "SpacerTop" ).GetScript( m_Resizer2 );
35  }
36 
37  void UnfocusAll()
38  {
39  for ( int i = 0; i < m_MaxColumns; i++ )
40  {
41  //GetMainWidget().FindAnyWidget( "Cursor" + i ).Show( false );
42  #ifdef PLATFORM_WINDOWS
43  #ifndef PLATFORM_CONSOLE
44  #ifndef SERVER_FOR_CONSOLE
45  CargoGrid grid = CargoGrid.Cast(m_Entity.GetInventory().GetCargo());
46  if(grid)
47  {
48 
49  EntityAI entity = grid.FindEntityInCargoOn( m_NumberRow, i );
50  if( entity )
51  {
52  Icon icon = m_ParentContainer.GetIcon( entity );
53 
54  if( icon )
55  {
56  icon.SetActive( false );
57  }
58  }
59  else
60  {
61  GetMainWidget().FindAnyWidget( "Cursor" + i ).Show( false );
62  }
63  }
64  #endif
65  #endif
66  #endif
67  }
68 
69  m_NumberColumnFocused = 0;
70  }
71 
72  void SetFocus( int column )
73  {
74  m_NumberColumnFocused = column;
75 
76  //GetMainWidget().FindAnyWidget( "Cursor" + column ).Show( true );
77 
78  // Show selector
79  #ifdef PLATFORM_WINDOWS
80  #ifndef PLATFORM_CONSOLE
81  #ifndef SERVER_FOR_CONSOLE
82  CargoGrid grid = CargoGrid.Cast(m_Entity.GetInventory().GetCargo());
83  if(grid)
84  {
85  EntityAI focused_item_new = grid.FindEntityInCargoOn( m_NumberRow, m_NumberColumnFocused );
86  if( focused_item_new )
87  {
88  Icon icon = m_ParentContainer.GetIcon( focused_item_new );
89 
90  if( icon )
91  {
92  icon.SetActive( true );
93  }
94  }
95  else
96  {
97  GetMainWidget().FindAnyWidget( "Cursor" + column ).Show( true );
98  }
99  }
100  #endif
101  #endif
102  #endif
103  }
104 
105  bool GetIconSize(int row, int column, out int width, out int height)
106  {
107  #ifdef PLATFORM_WINDOWS
108  #ifndef PLATFORM_CONSOLE
109  #ifndef SERVER_FOR_CONSOLE
110  CargoGrid grid = CargoGrid.Cast(m_Entity.GetInventory().GetCargo());
111  if(grid)
112  {
113  EntityAI focused_item_new = grid.FindEntityInCargoOn( row, column );
114  if( focused_item_new )
115  {
116  Icon icon = m_ParentContainer.GetIcon( focused_item_new );
117 
118  if( icon )
119  {
120  width = icon.GetSizeX();
121  height = icon.GetSizeY();
122 
123  return true;
124  }
125  }
126  }
127  #endif
128  #endif
129  #endif
130 
131  return false;
132  }
133 
134  int GetFocusedColumn()
135  {
136  return m_NumberColumnFocused;
137  }
138 
139  override void SetLayoutName()
140  {
141  #ifdef PLATFORM_CONSOLE
142  m_LayoutName = WidgetLayoutName.CargoContainerRowXbox;
143  #else
144  switch( InventoryMenu.GetWidthType() )
145  {
146  case ScreenWidthType.NARROW:
147  {
148  m_LayoutName = WidgetLayoutName.CargoContainerRowNarrow;
149  break;
150  }
151  case ScreenWidthType.MEDIUM:
152  {
153  m_LayoutName = WidgetLayoutName.CargoContainerRowMedium;
154  break;
155  }
156  case ScreenWidthType.WIDE:
157  {
158  m_LayoutName = WidgetLayoutName.CargoContainerRowWide;
159 
160  break;
161  }
162  }
163  #endif
164 
165  }
166 
167  void SetEntity( EntityAI entity )
168  {
169  m_Entity = entity;
170  }
171 
172  void DropReceived( Widget w, int x, int y, Widget receiver )
173  {
174  if ( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
175  {
176  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, receiver.GetUserID() );
177  }
178  else if ( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
179  {
180  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, receiver.GetUserID(), m_ParentContainer );
181  }
182  else if ( m_Parent.m_Parent.IsInherited( HandsContainer ) )
183  {
184  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, receiver.GetUserID(), m_ParentContainer );
185  }
186  else if ( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
187  {
188  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, receiver.GetUserID(), m_ParentContainer );
189  }
190  }
191 
192  void DraggingOver( Widget w, int x, int y, Widget receiver )
193  {
194  if ( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
195  {
196  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, receiver.GetUserID(), null );
197  }
198  else if ( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
199  {
200  ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, receiver.GetUserID(), null, m_ParentContainer );
201  }
202  else if ( m_Parent.m_Parent.IsInherited( HandsContainer ) )
203  {
204  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, receiver.GetUserID(), null, m_ParentContainer );
205  }
206  else if ( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
207  {
208  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, receiver.GetUserID(), null, m_ParentContainer );
209  }
210  }
211 
212  //NOT used - obsolete (all ColumnOnDraggingOver and Column methods)
214  void ColumnOnDraggingOver0( Widget w )
215  {
216  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
217  {
218  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 0, null );
219  }
220  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
221  {
222  ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 0, null, m_ParentContainer );
223  }
224  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
225  {
226  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 0, null, m_ParentContainer );
227  }
228  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
229  {
230  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 0, null, m_ParentContainer );
231  }
232  }
233 
234  void ColumnOnDraggingOver1( Widget w )
235  {
236  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
237  {
238  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 1, null );
239  }
240  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
241  {
242  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 1, null, m_ParentContainer );
243  }
244  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
245  {
246  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 1, null, m_ParentContainer );
247  }
248  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
249  {
250  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 1, null, m_ParentContainer );
251  }
252  }
253 
254  void ColumnOnDraggingOver2( Widget w )
255  {
256  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
257  {
258  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 2, null );
259  }
260  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
261  {
262  ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 2, null, m_ParentContainer );
263  }
264  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
265  {
266  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 2, null, m_ParentContainer );
267  }
268  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
269  {
270  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 2, null, m_ParentContainer );
271  }
272  }
273 
274  void ColumnOnDraggingOver3( Widget w )
275  {
276  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
277  {
278  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 3, null );
279  }
280  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
281  {
282  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 3, null, m_ParentContainer );
283  }
284  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
285  {
286  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 3, null, m_ParentContainer );
287  }
288  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
289  {
290  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 3, null, m_ParentContainer );
291  }
292  }
293 
294  void ColumnOnDraggingOver4( Widget w )
295  {
296  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
297  {
298  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 4, null );
299  }
300  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
301  {
302  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 4, null, m_ParentContainer );
303  }
304  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
305  {
306  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 4, null, m_ParentContainer );
307  }
308  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
309  {
310  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 4, null, m_ParentContainer );
311  }
312  }
313 
314  void ColumnOnDraggingOver5( Widget w )
315  {
316  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
317  {
318  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 5, null );
319  }
320  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
321  {
322  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 5, null, m_ParentContainer );
323  }
324  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
325  {
326  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 5, null, m_ParentContainer );
327  }
328  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
329  {
330  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 5, null, m_ParentContainer );
331  }
332  }
333 
334  void ColumnOnDraggingOver6( Widget w )
335  {
336  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
337  {
338  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 6, null );
339  }
340  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
341  {
342  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 6, null, m_ParentContainer );
343  }
344  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
345  {
346  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 6, null, m_ParentContainer );
347  }
348  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
349  {
350  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 6, null, m_ParentContainer );
351  }
352  }
353 
354  void ColumnOnDraggingOver7( Widget w )
355  {
356  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
357  {
358  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 7, null );
359  }
360  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
361  {
362  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 7, null, m_ParentContainer );
363  }
364  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
365  {
366  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 7, null, m_ParentContainer );
367  }
368  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
369  {
370  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 7, null, m_ParentContainer );
371  }
372  }
373 
374  void ColumnOnDraggingOver8( Widget w )
375  {
376  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
377  {
378  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 8, null );
379  }
380  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
381  {
382  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 8, null, m_ParentContainer );
383  }
384  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
385  {
386  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 8, null, m_ParentContainer );
387  }
388  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
389  {
390  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 8, null, m_ParentContainer );
391  }
392  }
393 
394  void ColumnOnDraggingOver9( Widget w )
395  {
396  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
397  {
398  ContainerWithCargo.Cast( m_Parent.m_Parent ).DraggingOverGrid( w, m_NumberRow, 9, null );
399  }
400  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
401  {
402  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 9, null, m_ParentContainer );
403  }
404  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
405  {
406  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 9, null, m_ParentContainer );
407  }
408  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
409  {
410  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DraggingOverGrid( w, m_NumberRow, 9, null, m_ParentContainer );
411  }
412  }
413 
414  void Column0( Widget w )
415  {
416  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
417  {
418  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 0 );
419  }
420  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
421  {
422  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 0, m_ParentContainer );
423  }
424  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
425  {
426  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 0, m_ParentContainer );
427  }
428  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
429  {
430  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 0, m_ParentContainer );
431  }
432  }
433 
434  void Column1( Widget w )
435  {
436  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
437  {
438  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 1 );
439  }
440  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
441  {
442  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 1, m_ParentContainer );
443  }
444  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
445  {
446  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 1, m_ParentContainer );
447  }
448  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
449  {
450  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 1, m_ParentContainer );
451  }
452  }
453 
454  void Column2( Widget w )
455  {
456  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
457  {
458  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 2 );
459  }
460  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
461  {
462  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 2, m_ParentContainer );
463  }
464  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
465  {
466  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 2, m_ParentContainer );
467  }
468  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
469  {
470  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 2, m_ParentContainer );
471  }
472  }
473 
474  void Column3( Widget w )
475  {
476  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
477  {
478  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 3 );
479  }
480  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
481  {
482  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 3, m_ParentContainer );
483  }
484  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
485  {
486  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 3, m_ParentContainer );
487  }
488  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
489  {
490  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 3, m_ParentContainer );
491  }
492  }
493 
494  void Column4( Widget w )
495  {
496  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
497  {
498  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 4 );
499  }
500  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
501  {
502  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 4, m_ParentContainer );
503  }
504  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
505  {
506  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 4, m_ParentContainer );
507  }
508  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
509  {
510  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 4, m_ParentContainer );
511  }
512  }
513 
514  void Column5( Widget w )
515  {
516  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
517  {
518  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 5 );
519  }
520  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
521  {
522  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 5, m_ParentContainer );
523  }
524  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
525  {
526  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 5, m_ParentContainer );
527  }
528  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
529  {
530  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 5, m_ParentContainer );
531  }
532  }
533 
534  void Column6( Widget w )
535  {
536  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
537  {
538  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 6 );
539  }
540  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
541  {
542  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 6, m_ParentContainer );
543  }
544  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
545  {
546  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 6, m_ParentContainer );
547  }
548  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
549  {
550  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 6, m_ParentContainer );
551  }
552  }
553 
554  void Column7( Widget w )
555  {
556  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
557  {
558  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 7 );
559  }
560  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
561  {
562  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 7, m_ParentContainer );
563  }
564  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
565  {
566  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 7, m_ParentContainer );
567  }
568  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
569  {
570  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 7, m_ParentContainer );
571  }
572  }
573 
574  void Column8( Widget w )
575  {
576  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
577  {
578  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 8 );
579  }
580  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
581  {
582  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 8, m_ParentContainer );
583  }
584  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
585  {
586  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 8, m_ParentContainer );
587  }
588  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
589  {
590  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 8, m_ParentContainer );
591  }
592  }
593 
594  void Column9( Widget w )
595  {
596  if( m_Parent.m_Parent.IsInherited( ContainerWithCargo ) )
597  {
598  ( ContainerWithCargo.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 9 );
599  }
600  else if( m_Parent.m_Parent.IsInherited( ContainerWithCargoAndAttachments ) )
601  {
602  ( ContainerWithCargoAndAttachments.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 9, m_ParentContainer );
603  }
604  else if( m_Parent.m_Parent.IsInherited( HandsContainer ) )
605  {
606  ( HandsContainer.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 9, m_ParentContainer );
607  }
608  else if( m_Parent.m_Parent.IsInherited( AttachmentCategoriesRow ) )
609  {
610  ( AttachmentCategoriesRow.Cast( m_Parent.m_Parent ) ).DropReceived( w, m_NumberRow, 9, m_ParentContainer );
611  }
612  }
614 
615  override void OnShow()
616  {
617  GetRootWidget().Show( true );
618  }
619 
620  override void OnHide()
621  {
622  GetRootWidget().Show( false );
623  }
624 
625  void SetNumber( int number )
626  {
627  m_NumberRow = number;
628  }
629 
630  int GetWidth()
631  {
632  return m_Width;
633  }
634 
635  void SetWidth( int width, bool immedUpdate = true )
636  {
637  m_Width = width;
638  int i;
639 
640  for ( i = width; i < m_MaxColumns; i++ )
641  {
642  GetMainWidget().FindAnyWidget( "Icon" + i ).Show( false, false );
643  GetMainWidget().FindAnyWidget( "Spacer" + i ).Show( false, false );
644  }
645 
646  GetMainWidget().FindAnyWidget( "Spacer10" ).Show( m_Width != 0, false );
647 
648  if (immedUpdate)
649  {
650  m_Resizer2.Refresh();
651  GetMainWidget().Update();
652  }
653 
654  m_Resizer1.ResizeParentToChild();
655  }
656 }
LayoutHolder
Definition: container.c:1
m_RootWidget
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition: pluginremoteplayerdebugclient.c:14
CargoGrid
Definition: cargo.c:168
y
Icon y
WidgetLayoutName
Definition: widgetlayoutname.c:1
m_Parent
protected Widget m_Parent
Definition: sizetochild.c:92
AttachmentCategoriesRow
Definition: attachmentcategoriesrow.c:1
CargoContainerRow
Definition: cargocontainerrow.c:1
ScreenWidthType
ScreenWidthType
Definition: inventorymenu.c:1
x
Icon x
Icon
Definition: icon.c:1
InventoryMenu
void InventoryMenu()
Definition: inventorymenu.c:20
Widget
Definition: enwidgets.c:189
EntityAI
Definition: building.c:5
m_Entity
EntityAI m_Entity
Definition: actiondebug.c:11
HandsContainer
Definition: handscontainer.c:1
WidgetEventHandler
Definition: widgeteventhandler.c:1