Advertisement
Guest User

Untitled

a guest
Aug 13th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.53 KB | None | 0 0
  1. /***********************************************************************/
  2. /** © 2015 CD PROJEKT S.A. All rights reserved.
  3. /** THE WITCHER® is a trademark of CD PROJEKT S. A.
  4. /** The Witcher game is based on the prose of Andrzej Sapkowski.
  5. /***********************************************************************/
  6.  
  7. {enum HudItemInfoBinding
  8. {
  9. HudItemInfoBinding_item1 = 0,
  10. HudItemInfoBinding_potion1 = 1,
  11. HudItemInfoBinding_potion2 = 2,
  12. HudItemInfoBinding_potion3 = 3,
  13. HudItemInfoBinding_potion4 = 4
  14. } ;
  15.  
  16. struct SHudItemInfo
  17. {
  18. var m_icon : string;
  19. var m_category : string;
  20. var m_itemName : string;
  21. var m_ammoStr : string;
  22. var m_btn : int;
  23. var m_pcBtn : int;
  24. };
  25.  
  26. class CR4HudModuleItemInfo extends CR4HudModuleBase
  27. {
  28. private var m_currentItemSelected : SItemUniqueId;
  29. private var m_currentItemOnSlot1 : SItemUniqueId;
  30. private var m_currentItemOnSlot2 : SItemUniqueId;
  31. private var m_currentItemOnSlot3 : SItemUniqueId;
  32. private var m_currentItemOnSlot4 : SItemUniqueId;
  33.  
  34. private var m_lastBoltItem : SItemUniqueId;
  35.  
  36. private var m_currentItemSelectedAmmo : int;
  37. private var m_currentItemOnSlot1Ammo : int;
  38. private var m_currentItemOnSlot2Ammo : int;
  39. private var m_currentItemOnSlot3Ammo : int;
  40. private var m_currentItemOnSlot4Ammo : int;
  41.  
  42. private var m_fxEnableSFF : CScriptedFlashFunction;
  43. private var m_fxUpdateElementSFF : CScriptedFlashFunction;
  44. public var m_fxHideSlotsSFF : CScriptedFlashFunction; // -= WMK:modQuickSlots =-
  45. private var m_fxSetAlwaysDisplayed : CScriptedFlashFunction;
  46. private var m_flashValueStorage : CScriptedFlashValueStorage;
  47. public var m_fxSetItemInfo : CScriptedFlashFunction; // -= WMK:modQuickSlots =-
  48. private var m_fxSwitchAnimation : CScriptedFlashFunction;
  49. private var m_fxShowButtonHints : CScriptedFlashFunction;
  50. private var m_IsPlayerCiri : bool;
  51. default m_IsPlayerCiri = false;
  52.  
  53. private var m_runword6Applied : bool;
  54.  
  55. private var m_previousShowButtonHints : int; default m_previousShowButtonHints = -1;
  56. private var m_previousSetItemInfo : array< SHudItemInfo >;
  57.  
  58. event OnConfigUI()
  59. {
  60. var flashModule : CScriptedFlashSprite;
  61. var hud : CR4ScriptedHud;
  62.  
  63. m_anchorName = "mcAnchorItemInfo";
  64. m_flashValueStorage = GetModuleFlashValueStorage();
  65. super.OnConfigUI();
  66.  
  67. flashModule = GetModuleFlash();
  68. m_fxEnableSFF = flashModule.GetMemberFlashFunction( "EnableElement" );
  69. m_fxUpdateElementSFF = flashModule.GetMemberFlashFunction( "UpdateElement" );
  70. m_fxHideSlotsSFF = flashModule.GetMemberFlashFunction( "HideSlots" );
  71. m_fxSetAlwaysDisplayed = flashModule.GetMemberFlashFunction( "setAlwaysDisplayed" );
  72. m_fxSetItemInfo = flashModule.GetMemberFlashFunction( "setItemInfo" );
  73. m_fxSwitchAnimation = flashModule.GetMemberFlashFunction( "animatePotionSwitch" );
  74. m_fxShowButtonHints = flashModule.GetMemberFlashFunction( "showButtonHints" );
  75.  
  76. m_previousSetItemInfo.Resize( EnumGetMax( 'HudItemInfoBinding' ) + 1 );
  77.  
  78. ClearItems();
  79.  
  80. SetTickInterval( 0.25 );
  81.  
  82. hud = (CR4ScriptedHud)theGame.GetHud();
  83.  
  84. if (hud)
  85. {
  86. hud.UpdateHudConfig('ItemInfoModule', true);
  87. }
  88.  
  89. m_runword6Applied = GetWitcherPlayer().HasRunewordActive('Runeword 6 _Stats');
  90. }
  91.  
  92. event OnTick( timeDelta : float )
  93. {
  94. var item0, item1, item2 : SItemUniqueId;
  95. var alterItem1, alterItem2 : SItemUniqueId;
  96. var switchAnimation : int;
  97. var playerInv : CInventoryComponent;
  98. var witcherPlayer : W3PlayerWitcher;
  99.  
  100. var runword6Applied : bool;
  101. var forcedIconUpdate : bool;
  102.  
  103. if ( !CanTick( timeDelta ) )
  104. {
  105. // -= WMK:modQuickSlots =-
  106. if (WmkGetQuickSlotsInstance().OnItemInfoModuleTick(timeDelta, false)) {
  107. m_tickCounter = m_tickInterval;
  108. } else {
  109. return true;
  110. }
  111. // -= WMK:modQuickSlots =-
  112. }
  113.  
  114. witcherPlayer = GetWitcherPlayer();
  115.  
  116. if( m_IsPlayerCiri != thePlayer.IsCiri() )
  117. {
  118. m_IsPlayerCiri = thePlayer.IsCiri();
  119. if( m_IsPlayerCiri )
  120. {
  121. ClearItems();
  122. }
  123. m_fxHideSlotsSFF.InvokeSelfOneArg(FlashArgBool(!m_IsPlayerCiri));
  124. }
  125.  
  126. if( m_IsPlayerCiri )
  127. {
  128. item0 = GetCiriItem();
  129. UpdateItem( item0, m_currentItemSelected, m_currentItemSelectedAmmo, HudItemInfoBinding_item1, 0 );
  130. }
  131. else
  132. {
  133. item0 = witcherPlayer.GetSelectedItemId();
  134.  
  135. if ( theInput.LastUsedGamepad() && WmkGetQuickSlotsInstance().CanFlipEquippedItems() ) // -= WMK:modQuickSlots =-
  136. {
  137. witcherPlayer.GetItemEquippedOnSlot( witcherPlayer.GetSelectedPotionSlotUpper(), item1 );
  138. witcherPlayer.GetItemEquippedOnSlot( witcherPlayer.GetSelectedPotionSlotLower(), item2 );
  139.  
  140. if ( witcherPlayer.GetSelectedPotionSlotUpper() == EES_Potion1)
  141. {
  142. witcherPlayer.GetItemEquippedOnSlot( EES_Potion3, alterItem1 );
  143. }
  144. else
  145. {
  146. witcherPlayer.GetItemEquippedOnSlot( EES_Potion1, alterItem1 );
  147. }
  148.  
  149. if ( witcherPlayer.GetSelectedPotionSlotLower() == EES_Potion2)
  150. {
  151. witcherPlayer.GetItemEquippedOnSlot( EES_Potion4, alterItem2 );
  152. }
  153. else
  154. {
  155. witcherPlayer.GetItemEquippedOnSlot( EES_Potion2, alterItem2 );
  156. }
  157.  
  158. playerInv = thePlayer.GetInventory();
  159.  
  160. if ( !playerInv.IsIdValid(item1) && playerInv.IsIdValid( alterItem1 ) )
  161. {
  162. witcherPlayer.FlipSelectedPotion( true );
  163. }
  164. else if ( !playerInv.IsIdValid(item2) && playerInv.IsIdValid( alterItem2 ) )
  165. {
  166. witcherPlayer.FlipSelectedPotion( false );
  167. }
  168. else if ( m_currentItemOnSlot1 == alterItem1 )
  169. {
  170. switchAnimation = 1;
  171. }
  172. else if ( m_currentItemOnSlot2 == alterItem2 )
  173. {
  174. switchAnimation = 2;
  175. }
  176. else
  177. {
  178. switchAnimation = -1;
  179. }
  180. }
  181. else
  182. {
  183. // ---=== modE3 ===---
  184. witcherPlayer.GetItemEquippedOnSlot( witcherPlayer.GetSelectedPotionSlotUpper(), item1 );
  185. witcherPlayer.GetItemEquippedOnSlot( witcherPlayer.GetSelectedPotionSlotLower(), item2 );
  186.  
  187. if ( witcherPlayer.GetSelectedPotionSlotUpper() == EES_Potion1)
  188. {
  189. witcherPlayer.GetItemEquippedOnSlot( EES_Potion3, alterItem1 );
  190. }
  191. else
  192. {
  193. witcherPlayer.GetItemEquippedOnSlot( EES_Potion1, alterItem1 );
  194. }
  195.  
  196. if ( witcherPlayer.GetSelectedPotionSlotLower() == EES_Potion2)
  197. {
  198. witcherPlayer.GetItemEquippedOnSlot( EES_Potion4, alterItem2 );
  199. }
  200. else
  201. {
  202. witcherPlayer.GetItemEquippedOnSlot( EES_Potion2, alterItem2 );
  203. }
  204.  
  205. playerInv = thePlayer.GetInventory();
  206.  
  207. if ( !playerInv.IsIdValid(item1) && playerInv.IsIdValid( alterItem1 ) )
  208. {
  209. witcherPlayer.FlipSelectedPotion( true );
  210. }
  211. else if ( !playerInv.IsIdValid(item2) && playerInv.IsIdValid( alterItem2 ) )
  212. {
  213. witcherPlayer.FlipSelectedPotion( false );
  214. }
  215. else if ( m_currentItemOnSlot1 == alterItem1 )
  216. {
  217. switchAnimation = 1;
  218. }
  219. else if ( m_currentItemOnSlot2 == alterItem2 )
  220. {
  221. switchAnimation = 2;
  222. }
  223. else
  224. {
  225. switchAnimation = -1;
  226. }
  227.  
  228.  
  229. /*
  230. switchAnimation = -1;
  231. witcherPlayer.GetItemEquippedOnSlot( EES_Potion1, item1 );
  232. witcherPlayer.GetItemEquippedOnSlot( EES_Potion2, item2 );
  233. witcherPlayer.GetItemEquippedOnSlot( EES_Potion3, alterItem1 );
  234. witcherPlayer.GetItemEquippedOnSlot( EES_Potion4, alterItem2 );
  235. */
  236. // ---=== modE3 ===---
  237.  
  238.  
  239.  
  240. }
  241.  
  242. runword6Applied = witcherPlayer.HasRunewordActive('Runeword 6 _Stats');
  243.  
  244. if (m_runword6Applied != runword6Applied)
  245. {
  246. m_runword6Applied = runword6Applied;
  247. forcedIconUpdate = true;
  248. }
  249. else
  250. {
  251. forcedIconUpdate = false;
  252. }
  253.  
  254. forcedIconUpdate = forcedIconUpdate || WmkGetQuickSlotsInstance().m_forceUpdateAllStdSlots; // -= WMK:modQuickSlots =-
  255.  
  256. UpdateItem( item0, m_currentItemSelected, m_currentItemSelectedAmmo, HudItemInfoBinding_item1, 0, forcedIconUpdate );
  257. UpdateItem( item1, m_currentItemOnSlot1, m_currentItemOnSlot1Ammo, HudItemInfoBinding_potion1, 1, forcedIconUpdate );
  258. UpdateItem( item2, m_currentItemOnSlot2, m_currentItemOnSlot2Ammo, HudItemInfoBinding_potion2, 2, forcedIconUpdate );
  259. UpdateItem( alterItem1, m_currentItemOnSlot3, m_currentItemOnSlot3Ammo, HudItemInfoBinding_potion3, 3, forcedIconUpdate );
  260. UpdateItem( alterItem2, m_currentItemOnSlot4, m_currentItemOnSlot4Ammo, HudItemInfoBinding_potion4, 4, forcedIconUpdate );
  261.  
  262. if ( switchAnimation != -1 )
  263. {
  264. m_fxSwitchAnimation.InvokeSelfOneArg( FlashArgInt( switchAnimation ) );
  265. }
  266. }
  267.  
  268.  
  269. if ( thePlayer.IsCombatMusicEnabled() || thePlayer.GetHealthPercents() < 1.f )
  270. SetAlwaysDisplayed( true );
  271. else
  272. SetAlwaysDisplayed( false );
  273.  
  274. WmkGetQuickSlotsInstance().OnItemInfoModuleTick(0, true); // -= WMK:modQuickSlots =-
  275. }
  276.  
  277. function GetCiriItem() : SItemUniqueId
  278. {
  279. var dummy : SItemUniqueId;
  280. var ret : array<SItemUniqueId>;
  281.  
  282. ret = thePlayer.GetInventory().GetItemsByName('q403_ciri_meteor');
  283.  
  284. if ( ret.Size() )
  285. {
  286. return ret[0];
  287. }
  288. return dummy;
  289. }
  290.  
  291. public function ResetItems()
  292. {
  293. var dummy : SItemUniqueId;
  294.  
  295. m_currentItemSelected = dummy;
  296. m_currentItemOnSlot1 = dummy;
  297. m_currentItemOnSlot2 = dummy;
  298. m_currentItemOnSlot3 = dummy;
  299. m_currentItemOnSlot4 = dummy;
  300. }
  301.  
  302. public function UpdateItem( out currItem : SItemUniqueId, out prevItem : SItemUniqueId, out prevItemAmmo : int, bindingID : HudItemInfoBinding, slotId : int, optional forceUpdate:bool )
  303. {
  304. var updateItem : bool;
  305. var ammo : int;
  306. var tempItem : SItemUniqueId;
  307. var dummy : SItemUniqueId;
  308.  
  309. updateItem = false;
  310. ammo = 0;
  311.  
  312. if ( prevItem != currItem || forceUpdate)
  313. {
  314. updateItem = true;
  315. prevItem = currItem;
  316. }
  317. if ( thePlayer.GetInventory().IsIdValid( currItem ) )
  318. {
  319. if ( thePlayer.GetInventory().IsItemSingletonItem( currItem ) )
  320. {
  321. ammo = thePlayer.inv.SingletonItemGetAmmo( currItem );
  322. if ( prevItemAmmo != ammo )
  323. {
  324. updateItem = true;
  325. prevItemAmmo = ammo;
  326. }
  327. }
  328. else if( thePlayer.GetInventory().IsItemCrossbow( currItem ) )
  329. {
  330. GetWitcherPlayer().GetItemEquippedOnSlot(EES_Bolt, tempItem);
  331. ammo = thePlayer.GetInventory().GetItemQuantity( tempItem );
  332. if ( prevItemAmmo != ammo )
  333. {
  334. updateItem = true;
  335. prevItemAmmo = ammo;
  336.  
  337. }
  338.  
  339. if (!updateItem && m_lastBoltItem != tempItem)
  340. {
  341. updateItem = true;
  342. }
  343.  
  344. m_lastBoltItem = tempItem;
  345. }
  346. else if( thePlayer.GetInventory().ItemHasTag( currItem, 'Edibles' ) )
  347. {
  348. ammo = thePlayer.GetInventory().GetItemQuantity( currItem );
  349. if ( prevItemAmmo != ammo )
  350. {
  351. updateItem = true;
  352. prevItemAmmo = ammo;
  353. }
  354. }
  355. else
  356. {
  357. prevItemAmmo = -1;
  358. if ( slotId == 1 ) UpdateItemData( dummy, HudItemInfoBinding_potion1 );
  359. if ( slotId == 2 ) UpdateItemData( dummy, HudItemInfoBinding_potion2 );
  360. if ( slotId == 3 ) UpdateItemData( dummy, HudItemInfoBinding_potion3 );
  361. if ( slotId == 4 ) UpdateItemData( dummy, HudItemInfoBinding_potion4 );
  362. }
  363. }
  364. else
  365. {
  366. prevItemAmmo = -1;
  367. if ( slotId == 1 ) UpdateItemData( dummy, HudItemInfoBinding_potion1 );
  368. if ( slotId == 2 ) UpdateItemData( dummy, HudItemInfoBinding_potion2 );
  369. if ( slotId == 3 ) UpdateItemData( dummy, HudItemInfoBinding_potion3 );
  370. if ( slotId == 4 ) UpdateItemData( dummy, HudItemInfoBinding_potion4 );
  371. }
  372. if ( updateItem )
  373. {
  374. UpdateItemData( currItem, bindingID );
  375. }
  376. }
  377.  
  378. public function ClearItems()
  379. {
  380. var dummy : SItemUniqueId;
  381.  
  382. UpdateItemData( dummy, HudItemInfoBinding_item1 );
  383. UpdateItemData( dummy, HudItemInfoBinding_potion1 );
  384. UpdateItemData( dummy, HudItemInfoBinding_potion2 );
  385. UpdateItemData( dummy, HudItemInfoBinding_potion3 );
  386. UpdateItemData( dummy, HudItemInfoBinding_potion4 );
  387. m_currentItemSelected = dummy;
  388. m_currentItemOnSlot1 = dummy;
  389. m_currentItemOnSlot2 = dummy;
  390. }
  391.  
  392. public function UpdateItemData(item : SItemUniqueId, bindingID : HudItemInfoBinding)
  393. {
  394. var maxAmmo : int;
  395. var ammo : int;
  396. var ammoStr : string;
  397. var itemName : string;
  398. var boltItem : SItemUniqueId;
  399. var boltName: string;
  400. var fontColor : string;
  401. var icon : string;
  402. var category : string;
  403. var btn:int;
  404. var pcBtn : int;
  405. var inventory : CInventoryComponent;
  406. var currentShowButtonHints : bool;
  407. var itemInfo : SHudItemInfo;
  408.  
  409. if( !thePlayer.GetInventory().IsIdValid( item ) )
  410. {
  411. icon = "";
  412. category = "";
  413. itemName = "";
  414. ammoStr = "";
  415. btn = 0;
  416. pcBtn = -1;
  417. }
  418. else
  419. {
  420. inventory = thePlayer.GetInventory();
  421.  
  422.  
  423.  
  424. icon = inventory.GetItemIconPathByUniqueID(item);
  425. category = inventory.GetItemCategory(item);
  426.  
  427. itemName = inventory.GetItemLocalizedNameByUniqueID( item );
  428. itemName = GetLocStringByKeyExt( itemName );
  429. fontColor = "<font color=\"#9b8570\">";
  430.  
  431. if( inventory.ItemHasTag(item, 'Edibles' ) )
  432. {
  433. if (GetWitcherPlayer().HasRunewordActive('Runeword 6 _Stats') )
  434. {
  435. icon = "icons/inventory/food/food_dumpling_64x64.png";
  436. }
  437.  
  438. if( inventory.ItemHasTag(item, 'InfiniteUse') )
  439. {
  440. ammoStr = fontColor + "∞" + "</font>";
  441. }
  442. else
  443. {
  444. ammo = thePlayer.inv.GetItemQuantity(item);
  445. ammoStr = fontColor + ammo + "</font>";
  446. }
  447. }
  448. else if( inventory.IsItemSingletonItem(item) )
  449. {
  450. maxAmmo = thePlayer.inv.SingletonItemGetMaxAmmo(item);
  451. ammo = thePlayer.inv.SingletonItemGetAmmo(item);
  452.  
  453. if (maxAmmo > 0)
  454. {
  455. if( ammo == 0 )
  456. {
  457. fontColor = "<font color=\"#FF0000\">"; // ---=== modE3 ===--- if ammo is 0, both ammo counter and item name are red
  458. }
  459. ammoStr = fontColor + ammo + "/" + maxAmmo + "</font>"; // ---=== modE3 ===--- : this shows the max ammo of the item. eg: 3 / 3 Swallow
  460. }
  461. else
  462. {
  463. ammoStr = "";
  464. }
  465. }
  466. else
  467. {
  468. if( inventory.IsItemCrossbow(item) )
  469. {
  470. GetWitcherPlayer().GetItemEquippedOnSlot(EES_Bolt, item);
  471. ammo = inventory.GetItemQuantity( item );
  472. itemName = inventory.GetItemLocalizedNameByUniqueID( item );
  473. itemName = GetLocStringByKeyExt( itemName );
  474. if( inventory.ItemHasTag(item, theGame.params.TAG_INFINITE_AMMO) )
  475. {
  476. ammoStr = fontColor + "∞" + "</font>";
  477. }
  478. else
  479. {
  480. if( ammo == 0 )
  481. {
  482. fontColor = "<font color=\"#FFFFFF\">";
  483. }
  484.  
  485. ammoStr = fontColor + ammo + "</font>";
  486. }
  487. }
  488. else
  489. {
  490. ammoStr = "";
  491. }
  492. }
  493.  
  494. itemName = fontColor+itemName + "</font>";
  495.  
  496. pcBtn = GetPCKeyByBinding( bindingID );
  497. btn = GetKeyByBinding( bindingID );
  498.  
  499. currentShowButtonHints = ( theInput.GetContext() == 'RadialMenu' );
  500. if ( m_previousShowButtonHints != (int)currentShowButtonHints )
  501. {
  502. m_previousShowButtonHints = (int)currentShowButtonHints;
  503. m_fxShowButtonHints.InvokeSelfOneArg( FlashArgBool( currentShowButtonHints ) );
  504. }
  505. }
  506.  
  507.  
  508. ammoStr = "<font size=\"18\">" + ammoStr + "</font>";
  509. itemName = "<font size=\"18\">" + itemName + "</font>";
  510.  
  511. itemInfo = m_previousSetItemInfo[ bindingID ];
  512. if ( itemInfo.m_icon != icon ||
  513. itemInfo.m_category != category ||
  514. itemInfo.m_itemName != itemName ||
  515. itemInfo.m_ammoStr != ammoStr ||
  516. itemInfo.m_btn != btn ||
  517. itemInfo.m_pcBtn != pcBtn )
  518. {
  519. m_previousSetItemInfo[ bindingID ].m_icon = icon;
  520. m_previousSetItemInfo[ bindingID ].m_category = category;
  521. m_previousSetItemInfo[ bindingID ].m_itemName = itemName;
  522. m_previousSetItemInfo[ bindingID ].m_ammoStr = ammoStr;
  523. m_previousSetItemInfo[ bindingID ].m_btn = btn;
  524. m_previousSetItemInfo[ bindingID ].m_pcBtn = pcBtn;
  525.  
  526. m_fxSetItemInfo.InvokeSelfSevenArgs(FlashArgInt(bindingID), FlashArgString(icon), FlashArgString(category), FlashArgString(itemName), FlashArgString(ammoStr), FlashArgInt(btn), FlashArgInt(pcBtn));
  527. }
  528. }
  529.  
  530. private function GetKeyByBinding(bindingName : HudItemInfoBinding) : int
  531. {
  532. var outKeys : array< EInputKey >;
  533.  
  534. // -= WMK:modQuickSlots =-
  535. if (WmkGetQuickSlotsInstance().GetKeyByBindingForStdSlot(bindingName, outKeys)) {
  536. return outKeys[0];
  537. }
  538. // -= WMK:modQuickSlots =-
  539.  
  540. switch(bindingName)
  541. {
  542. case HudItemInfoBinding_item1 :
  543. theInput.GetPadKeysForAction('ThrowItem',outKeys);
  544.  
  545. break;
  546. case HudItemInfoBinding_potion1 :
  547. theInput.GetPadKeysForAction('DrinkPotion1',outKeys);
  548.  
  549. break;
  550. case HudItemInfoBinding_potion2 :
  551. theInput.GetPadKeysForAction('DrinkPotion2',outKeys);
  552.  
  553. break;
  554. default:
  555. return -1;
  556. }
  557. return outKeys[0];
  558. }
  559.  
  560. private function GetPCKeyByBinding(bindingName : HudItemInfoBinding) : int
  561. {
  562. var outKeys : array< EInputKey >;
  563. switch(bindingName)
  564. {
  565. case HudItemInfoBinding_item1 :
  566. theInput.GetPCKeysForAction('ThrowItem',outKeys);
  567. break;
  568.  
  569. case HudItemInfoBinding_potion1 :
  570. theInput.GetPCKeysForAction('DrinkPotion1',outKeys);
  571. break;
  572. case HudItemInfoBinding_potion2 :
  573. theInput.GetPCKeysForAction('DrinkPotion2',outKeys);
  574. break;
  575. case HudItemInfoBinding_potion3 :
  576. theInput.GetPCKeysForAction('DrinkPotion3',outKeys);
  577. break;
  578. case HudItemInfoBinding_potion4 :
  579. theInput.GetPCKeysForAction('DrinkPotion4',outKeys);
  580. break;
  581.  
  582.  
  583.  
  584. default:
  585. return -1;
  586. }
  587. return outKeys[0];
  588. }
  589.  
  590. protected function UpdatePosition(anchorX:float, anchorY:float) : void
  591. {
  592. var l_flashModule : CScriptedFlashSprite;
  593. var tempX : float;
  594. var tempY : float;
  595.  
  596. l_flashModule = GetModuleFlash();
  597.  
  598.  
  599.  
  600.  
  601. tempX = anchorX + (300.0 * (1.0 - theGame.GetUIHorizontalFrameScale()));
  602. tempY = anchorY - (200.0 * (1.0 - theGame.GetUIVerticalFrameScale()));
  603.  
  604. l_flashModule.SetX( tempX );
  605. l_flashModule.SetY( tempY );
  606. }
  607.  
  608. public function ForceShowElement() : void
  609. {
  610. m_fxUpdateElementSFF.InvokeSelf();
  611. }
  612.  
  613. public function EnableElement( enable : bool ) : void
  614. {
  615.  
  616. }
  617.  
  618. public function ShowElementIgnoreState( show : bool, optional bImmediately : bool ) : void
  619. {
  620. if( m_bEnabled )
  621. {
  622. m_fxShowElementSFF.InvokeSelfThreeArgs( FlashArgBool( show ), FlashArgBool( bImmediately ), FlashArgBool( true ) );
  623. }
  624. }
  625.  
  626. public function SetAlwaysDisplayed( value : bool )
  627. {
  628. m_fxSetAlwaysDisplayed.InvokeSelfOneArg(FlashArgBool(value));
  629. }
  630. }
  631.  
  632. exec function eitem( enable : bool )
  633. {
  634. var hud : CR4ScriptedHud;
  635. var module : CR4HudModuleItemInfo;
  636.  
  637. hud = (CR4ScriptedHud)theGame.GetHud();
  638. if( hud )
  639. {
  640. module = (CR4HudModuleItemInfo)hud.GetHudModule("ItemInfoModule");
  641. module.EnableElement( enable );
  642. }
  643. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement