attachments.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. const int ITEMS_IN_ROW = 8;
  2. class Attachments
  3. {
  4. protected Container m_Parent;
  5. protected EntityAI m_Entity;
  6. protected ref AttachmentsWrapper m_AttachmentsContainer;
  7. protected ref array<string> m_AttachmentSlotNames;
  8. protected ref array<string> m_AttachmentSlotDisplayable;
  9. protected ref map<int, SlotsIcon> m_AttachmentSlots;
  10. protected ref array<int> m_AttachmentIDOrdered;
  11. protected int m_RowIndex;
  12. protected int m_AttachmentSlotID = -1;
  13. void Attachments( Container parent, EntityAI entity )
  14. {
  15. m_Parent = parent;
  16. m_Entity = entity;
  17. m_AttachmentSlots = new map<int, SlotsIcon>;
  18. m_AttachmentIDOrdered = new array<int>;
  19. m_AttachmentSlotNames = GetItemSlots( entity );
  20. m_AttachmentSlotDisplayable = new array<string>;
  21. m_Entity.GetOnItemAttached().Insert( AttachmentAdded );
  22. m_Entity.GetOnItemDetached().Insert( AttachmentRemoved );
  23. m_Entity.GetOnAttachmentSetLock().Insert( OnAttachmentReservationSet );
  24. m_Entity.GetOnAttachmentReleaseLock().Insert( OnAttachmentReservationRelease );
  25. }
  26. void ~Attachments()
  27. {
  28. if( m_Entity )
  29. {
  30. m_Entity.GetOnItemAttached().Remove( AttachmentAdded );
  31. m_Entity.GetOnItemDetached().Remove( AttachmentRemoved );
  32. m_Entity.GetOnAttachmentSetLock().Remove( OnAttachmentReservationSet );
  33. m_Entity.GetOnAttachmentReleaseLock().Remove( OnAttachmentReservationRelease );
  34. }
  35. delete m_AttachmentsContainer;
  36. }
  37. AttachmentsWrapper GetWrapper()
  38. {
  39. return m_AttachmentsContainer;
  40. }
  41. bool IsEmpty()
  42. {
  43. return m_AttachmentsContainer.IsEmpty();
  44. }
  45. bool IsItemActive()
  46. {
  47. ItemBase item = ItemBase.Cast( GetFocusedItem() );
  48. if( !item )
  49. {
  50. return false;
  51. }
  52. return !IsEmpty() && ( !QuantityConversions.HasItemQuantity( item ) || ( QuantityConversions.HasItemQuantity( item ) && !item.CanBeSplit() ) );
  53. }
  54. bool IsItemWithQuantityActive()
  55. {
  56. ItemBase item = ItemBase.Cast( GetFocusedItem() );
  57. if( !item )
  58. {
  59. return false;
  60. }
  61. return !IsEmpty() && QuantityConversions.HasItemQuantity( item ) && item.CanBeSplit();
  62. }
  63. void UnfocusAll()
  64. {
  65. m_AttachmentsContainer.UnfocusAll();
  66. }
  67. void SetDefaultFocus( bool while_micromanagment_mode = false )
  68. {
  69. m_AttachmentsContainer.SetDefaultFocus(while_micromanagment_mode);
  70. }
  71. void SetLastActive()
  72. {
  73. m_AttachmentsContainer.SetLastActive();
  74. }
  75. void SetActive( bool active )
  76. {
  77. m_AttachmentsContainer.SetActive(active);
  78. }
  79. void SelFirstActive()
  80. {
  81. m_AttachmentsContainer.SetFirstActive();
  82. }
  83. SlotsIcon GetFocusedSlotsIcon()
  84. {
  85. return m_AttachmentsContainer.GetFocusedSlotsIcon();
  86. }
  87. EntityAI GetFocusedItem()
  88. {
  89. return m_AttachmentsContainer.GetFocusedItem();
  90. }
  91. int GetFocusedSlot()
  92. {
  93. SlotsIcon icon = m_AttachmentsContainer.GetFocusedSlotsIcon();
  94. if (icon)
  95. return icon.GetSlotID();
  96. return -1;
  97. }
  98. bool SelectItem()
  99. {
  100. ItemBase item = ItemBase.Cast( GetFocusedItem() );
  101. SlotsIcon icon = GetFocusedSlotsIcon();
  102. if (icon && !icon.IsOutOfReach())
  103. {
  104. if (item && item.CanPutIntoHands(null))
  105. {
  106. ItemManager.GetInstance().SetSelectedItemEx(item, null, icon);
  107. }
  108. else
  109. {
  110. ItemManager.GetInstance().SetSelectedItemEx(null, null, icon);
  111. }
  112. return true;
  113. }
  114. return false;
  115. }
  116. bool Select()
  117. {
  118. SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
  119. EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
  120. SlotsIcon focused_slot = GetFocusedSlotsIcon();
  121. EntityAI focused_item = GetFocusedItem();
  122. Man player = GetGame().GetPlayer();
  123. if( focused_slot.IsReserved() || focused_item != selected_item && !(selected_slot && selected_slot.IsOutOfReach() ) )
  124. {
  125. if( selected_item )
  126. {
  127. if( selected_item.GetInventory().CanRemoveEntity() )
  128. {
  129. if( m_Entity.GetInventory().CanAddAttachmentEx( selected_item, focused_slot.GetSlotID() ) )
  130. {
  131. player.PredictiveTakeEntityToTargetAttachmentEx( m_Entity, selected_item, focused_slot.GetSlotID() );
  132. ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
  133. return true;
  134. }
  135. else if( m_Entity.GetInventory().CanAddAttachment( selected_item ) )
  136. {
  137. player.PredictiveTakeEntityToTargetAttachment(m_Entity, selected_item);
  138. ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
  139. return true;
  140. }
  141. }
  142. }
  143. else
  144. {
  145. if ( focused_item && !focused_slot.IsOutOfReach() )
  146. {
  147. EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
  148. InventoryLocation il = new InventoryLocation;
  149. focused_item.GetInventory().GetCurrentInventoryLocation( il );
  150. bool reachable = AttachmentsOutOfReach.IsAttachmentReachable( m_Entity, "", il.GetSlot() );
  151. if( reachable && focused_item.GetInventory().CanRemoveEntity() )
  152. {
  153. if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
  154. {
  155. if( GameInventory.CanSwapEntitiesEx( item_in_hands, focused_item ) )
  156. {
  157. player.PredictiveSwapEntities( item_in_hands, focused_item );
  158. return true;
  159. }
  160. }
  161. else
  162. {
  163. if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
  164. {
  165. player.PredictiveTakeEntityToHands( focused_item );
  166. return true;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. return false;
  174. }
  175. int GetRecipeCount( bool recipe_anywhere, EntityAI entity1, EntityAI entity2 )
  176. {
  177. PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast( GetPlugin( PluginRecipesManager ) );
  178. return plugin_recipes_manager.GetValidRecipes( ItemBase.Cast( entity1 ), ItemBase.Cast( entity2 ), null, PlayerBase.Cast( GetGame().GetPlayer() ) );
  179. }
  180. bool CanCombine()
  181. {
  182. ItemBase ent = ItemBase.Cast( GetFocusedItem() );
  183. ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
  184. return ( ItemManager.GetCombinationFlags( item_in_hands, ent ) != 0 );
  185. }
  186. bool CanCombineAmmo()
  187. {
  188. PlayerBase m_player = PlayerBase.Cast( GetGame().GetPlayer() );
  189. ItemBase ent = ItemBase.Cast( GetFocusedItem() );
  190. ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
  191. ActionManagerClient amc;
  192. Class.CastTo(amc, m_player.GetActionManager());
  193. return ( amc.CanPerformActionFromInventory( item_in_hands, ent ) );
  194. }
  195. bool CanEquip()
  196. {
  197. EntityAI entity = ItemBase.Cast( GetFocusedItem() );
  198. InventoryLocation il = new InventoryLocation;
  199. if( !entity || entity.IsInherited( Magazine ) )
  200. {
  201. return false;
  202. }
  203. return GetGame().GetPlayer().GetInventory().FindFreeLocationFor( entity, FindInventoryLocationType.ATTACHMENT, il );
  204. }
  205. bool Combine()
  206. {
  207. ItemBase ent = ItemBase.Cast( GetFocusedItem() );
  208. ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
  209. Icon hands_icon = ItemManager.GetInstance().GetHandsPreview().GetIcon();
  210. if ( item_in_hands && ent && hands_icon )
  211. {
  212. return hands_icon.CombineItems( item_in_hands, ent );
  213. }
  214. return false;
  215. }
  216. bool SplitItem()
  217. {
  218. ItemBase entity = ItemBase.Cast( GetFocusedItem() );
  219. if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
  220. {
  221. if( entity.HasQuantity() )
  222. {
  223. entity.OnRightClick();
  224. return true;
  225. }
  226. }
  227. return false;
  228. }
  229. bool EquipItem()
  230. {
  231. ItemBase entity = ItemBase.Cast( GetFocusedItem() );
  232. if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
  233. {
  234. GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.ATTACHMENT, entity );
  235. return true;
  236. }
  237. return false;
  238. }
  239. bool TransferItem()
  240. {
  241. EntityAI entity = GetFocusedItem();
  242. if( entity && !GetFocusedSlotsIcon().IsOutOfReach() )
  243. {
  244. GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.CARGO, entity );
  245. return true;
  246. }
  247. return false;
  248. }
  249. bool InspectItem()
  250. {
  251. EntityAI entity = GetFocusedItem();
  252. if( entity )
  253. {
  254. m_Parent.InspectItem( entity );
  255. return true;
  256. }
  257. return false;
  258. }
  259. bool TransferItemToVicinity()
  260. {
  261. ItemBase item = ItemBase.Cast(GetFocusedItem());
  262. PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer());
  263. if (item && !GetFocusedSlotsIcon().IsOutOfReach() )
  264. {
  265. if (item.GetTargetQuantityMax() < item.GetQuantity())
  266. item.SplitIntoStackMaxClient( null, -1 );
  267. else
  268. player.PhysicalPredictiveDropItem(item);
  269. return true;
  270. }
  271. return false;
  272. }
  273. bool IsActive()
  274. {
  275. return m_Parent.GetMainWidget().FindAnyWidget("AttachmentsWrapper").GetAlpha() > 0;
  276. }
  277. int GetAttachmentHeight()
  278. {
  279. return m_AttachmentsContainer.Count();
  280. }
  281. void UpdateInterval()
  282. {
  283. SlotsIcon icon;
  284. int slot_id;
  285. m_AttachmentSlotDisplayable.Clear();
  286. int i = 0;
  287. for (i = m_AttachmentSlotNames.Count() - 1; i >=0; --i)
  288. {
  289. slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotNames[i] );
  290. if (m_Entity.CanDisplayAttachmentSlot(slot_id))
  291. {
  292. m_AttachmentSlotDisplayable.Insert(m_AttachmentSlotNames[i]);
  293. }
  294. else
  295. {
  296. icon = m_AttachmentSlots.Get( slot_id );
  297. if (icon)
  298. {
  299. icon.GetMainWidget().Show( false );
  300. if( GetFocusedSlotsIcon() == icon )
  301. {
  302. SetDefaultFocus();
  303. }
  304. // radial icon (collabsable icon handling)
  305. icon.UpdateInterval();
  306. }
  307. }
  308. }
  309. if ( m_AttachmentSlotDisplayable.Count() == 0 )
  310. {
  311. if (m_Parent)
  312. {
  313. m_Parent.UpdateRadialIcon();
  314. //m_Parent.Close();
  315. }
  316. }
  317. for (i = 0; i < m_AttachmentSlotDisplayable.Count(); ++i)
  318. {
  319. slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotDisplayable[i] );
  320. icon = m_AttachmentSlots.Get( slot_id );
  321. EntityAI item = icon.GetEntity();
  322. icon.GetMainWidget().Show( true );
  323. icon.UpdateInterval();
  324. if ( item )
  325. {
  326. bool draggable = true;
  327. if(icon.IsReserved())
  328. {
  329. draggable = false;
  330. }
  331. if( m_Entity.GetInventory().GetSlotLock( slot_id ) && ItemManager.GetInstance().GetDraggedItem() != item )
  332. {
  333. icon.GetMountedWidget().Show( true );
  334. draggable = false;
  335. }
  336. else
  337. {
  338. icon.GetMountedWidget().Show( false );
  339. }
  340. PlayerBase p = PlayerBase.Cast( GetGame().GetPlayer() );
  341. bool in_hands_condition = m_Entity.GetHierarchyRoot() && item.GetInventory().CanRemoveEntity();
  342. bool in_vicinity_condition = !m_Entity.GetHierarchyRoot() && AttachmentsOutOfReach.IsAttachmentReachable( m_Entity, m_AttachmentSlotDisplayable[i] );
  343. if( in_hands_condition || in_vicinity_condition )
  344. {
  345. icon.GetOutOfReachWidget().Show( false );
  346. }
  347. else
  348. {
  349. icon.GetOutOfReachWidget().Show( true );
  350. draggable = false;
  351. }
  352. if( draggable )
  353. {
  354. icon.GetPanelWidget().SetFlags( WidgetFlags.DRAGGABLE );
  355. }
  356. else
  357. {
  358. icon.GetPanelWidget().ClearFlags( WidgetFlags.DRAGGABLE );
  359. }
  360. }
  361. }
  362. m_AttachmentsContainer.GetRootWidget().Update();
  363. }
  364. array<int> GetSlotsSorted()
  365. {
  366. return m_AttachmentIDOrdered;
  367. }
  368. void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
  369. {
  370. int slot_id = InventorySlots.GetSlotIdFromString(slot);
  371. SlotsIcon icon = m_AttachmentSlots.Get(slot_id);
  372. if (icon)
  373. {
  374. icon.SetSlotID(slot_id);
  375. icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
  376. if (item)
  377. {
  378. icon.Init(item);
  379. }
  380. }
  381. }
  382. void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
  383. {
  384. int slot_id = InventorySlots.GetSlotIdFromString(slot);
  385. SlotsIcon icon = m_AttachmentSlots.Get(slot_id);
  386. if (icon)
  387. {
  388. icon.Clear();
  389. }
  390. }
  391. void OnAttachmentReservationSet( EntityAI item, int slot_id )
  392. {
  393. SlotsIcon icon = m_AttachmentSlots.Get( slot_id );
  394. if (item)
  395. {
  396. icon.Init( item, true );
  397. }
  398. }
  399. void OnAttachmentReservationRelease( EntityAI item, int slot_id )
  400. {
  401. SlotsIcon icon = m_AttachmentSlots.Get( slot_id );
  402. icon.Clear();
  403. }
  404. void InitAttachmentGrid( int att_row_index )
  405. {
  406. SlotsIcon icon;
  407. int i;
  408. m_RowIndex = att_row_index;
  409. int number_of_rows = Math.Ceil( m_AttachmentSlotNames.Count() / ITEMS_IN_ROW );
  410. string name = m_Entity.GetDisplayName();
  411. name.ToUpper();
  412. m_AttachmentsContainer = new AttachmentsWrapper( m_Parent );
  413. m_AttachmentsContainer.SetParent( this );
  414. m_AttachmentsContainer.SetFalseAttachmentsHeaderText(name);
  415. m_AttachmentsContainer.GetRootWidget().SetSort( att_row_index );
  416. m_Parent.Insert( m_AttachmentsContainer, att_row_index );
  417. for ( i = 0; i < number_of_rows; i++ )
  418. {
  419. SlotsContainer ic = new SlotsContainer( m_AttachmentsContainer, m_Entity );
  420. m_AttachmentsContainer.Insert( ic );
  421. if( i == ( number_of_rows - 1 ) && m_AttachmentSlotNames.Count() % ITEMS_IN_ROW != 0 )
  422. {
  423. ic.SetColumnCount( m_AttachmentSlotNames.Count() % ITEMS_IN_ROW );
  424. }
  425. else
  426. {
  427. ic.SetColumnCount( ITEMS_IN_ROW );
  428. }
  429. for( int j = 0; j < ITEMS_IN_ROW; j++ )
  430. {
  431. icon = ic.GetSlotIcon( j );
  432. WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetMainWidget(), m_Parent, "OnDropReceivedFromHeader2" );
  433. WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetGhostSlot(), m_Parent, "OnDropReceivedFromHeader2" );
  434. WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetPanelWidget(), m_Parent, "OnDropReceivedFromHeader2" );
  435. WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetMainWidget(), m_Parent, "DraggingOverHeader" );
  436. WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetGhostSlot(), m_Parent, "DraggingOverHeader" );
  437. WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetPanelWidget(), m_Parent, "DraggingOverHeader" );
  438. WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetMainWidget(), m_Parent, "MouseClick2" );
  439. WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetGhostSlot(), m_Parent, "MouseClick2" );
  440. WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetPanelWidget(), m_Parent, "MouseClick2" );
  441. }
  442. }
  443. for ( i = 0; i < m_AttachmentSlotNames.Count(); i++ )
  444. {
  445. icon = SlotsContainer.Cast( m_AttachmentsContainer.Get( ( i / ITEMS_IN_ROW ) ) ).GetSlotIcon( i % ITEMS_IN_ROW );
  446. WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.GetPanelWidget(), m_Parent, "DoubleClick" );
  447. string path = "CfgSlots" + " Slot_" + m_AttachmentSlotNames[i];
  448. //Show different magazine icon for firearms and pistols
  449. if ( m_AttachmentSlotNames[i] == "magazine" )
  450. {
  451. if ( !m_Entity.IsInherited( Pistol_Base ) )
  452. path = "CfgSlots" + " Slot_" + "magazine2";
  453. }
  454. string icon_name = ""; //icon_name must be in format "set:<setname> image:<imagename>"
  455. if( GetGame().ConfigGetText( path + " ghostIcon", icon_name ) && icon_name != "" )
  456. icon.GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,icon_name) );
  457. int slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotNames[i] );
  458. m_AttachmentSlots.Insert( slot_id, icon );
  459. m_AttachmentIDOrdered.Insert(slot_id);
  460. icon.SetSlotID(slot_id);
  461. icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
  462. EntityAI item = m_Entity.GetInventory().FindAttachment( slot_id );
  463. if( item )
  464. AttachmentAdded( item, m_AttachmentSlotNames[i], m_Entity );
  465. else
  466. icon.Clear();
  467. if (m_Entity.CanDisplayAttachmentSlot(slot_id))
  468. {
  469. icon.GetMainWidget().Show( true );
  470. }
  471. else
  472. {
  473. icon.GetMainWidget().Show( false );
  474. }
  475. }
  476. if( m_AttachmentSlotNames.Count() > 0 )
  477. {
  478. int row_index = number_of_rows - 1;
  479. SlotsContainer row_last = SlotsContainer.Cast( m_AttachmentsContainer.Get( row_index ) );
  480. if( row_last )
  481. {
  482. for( int k = ((m_AttachmentSlotNames.Count() - 1) % ITEMS_IN_ROW) + 1; k < ITEMS_IN_ROW; k++ )
  483. {
  484. row_last.GetSlotIcon( k ).GetMainWidget().Show( false );
  485. }
  486. row_last.GetRootWidget().Update();
  487. row_last.GetRootWidget().GetParent().Update();
  488. }
  489. }
  490. m_AttachmentsContainer.RecomputeOpenedContainers();
  491. }
  492. array<string> GetItemSlots( EntityAI e )
  493. {
  494. TStringArray searching_in = new TStringArray;
  495. searching_in.Insert( CFG_VEHICLESPATH );
  496. searching_in.Insert( CFG_WEAPONSPATH );
  497. searching_in.Insert( CFG_MAGAZINESPATH );
  498. array<string> attachments_slots = new array<string>;
  499. int i = 0;
  500. for ( int s = 0; s < searching_in.Count(); ++s )
  501. {
  502. string cfg_name = searching_in.Get( s );
  503. string path = cfg_name + " " + e.GetType();
  504. if ( GetGame().ConfigIsExisting( path ) )
  505. {
  506. GetGame().ConfigGetTextArray( path + " attachments", attachments_slots );
  507. if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
  508. {
  509. attachments_slots.Insert( "magazine" );
  510. }
  511. return attachments_slots;
  512. }
  513. }
  514. if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
  515. {
  516. attachments_slots.Insert( "magazine" );
  517. }
  518. return attachments_slots;
  519. }
  520. void ShowFalseAttachmentsHeader(bool show)
  521. {
  522. m_AttachmentsContainer.ShowFalseAttachmentsHeader(show);
  523. }
  524. void SetFalseAttachmentsHeaderText(string text)
  525. {
  526. m_AttachmentsContainer.SetFalseAttachmentsHeaderText(text);
  527. }
  528. TextWidget GetFalseHeaderTextWidget()
  529. {
  530. return m_AttachmentsContainer.GetFalseHeaderTextWidget();
  531. }
  532. void SetAttachmentSlotID(int slotID)
  533. {
  534. m_AttachmentSlotID = slotID;
  535. }
  536. int GetAttachmentSlotID()
  537. {
  538. return m_AttachmentSlotID;
  539. }
  540. }