Advertisement
Hird194

Unexpected end of file found after '{' at line 6

Oct 23rd, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.84 KB | None | 0 0
  1. /*
  2. Copyright © CD Projekt RED 2015
  3. */
  4.  
  5. class W3InventoryItemContext extends W3UIContext
  6. {
  7. protected var currentItemId : SItemUniqueId;
  8. protected var currentSlot : EEquipmentSlots;
  9.  
  10. protected var invMenuRef : CR4InventoryMenu;
  11. protected var invComponentRef : CInventoryComponent;
  12. protected var invSecondComponentRef : CInventoryComponent;
  13. protected var contextMenuPosition_x : float;
  14. protected var contextMenuPosition_y : float;
  15.  
  16. public function Init(ownerManager:W3ContextManager)
  17. {
  18. super.Init(ownerManager);
  19. invComponentRef = invMenuRef.GetCurrentInventory(GetInvalidUniqueId());
  20. }
  21.  
  22. public function SetSecondInventoryComponentRef(ref : CInventoryComponent):void
  23. {
  24. invSecondComponentRef = ref;
  25. }
  26.  
  27. public function SetInventoryRef(TargetInvMenu : CR4InventoryMenu):void
  28. {
  29. invMenuRef = TargetInvMenu;
  30. }
  31.  
  32. public function SetContextMenuData(posX:float, posY:float):void
  33. {
  34. contextMenuPosition_x = posX;
  35. contextMenuPosition_y = posY;
  36. }
  37.  
  38. public function SetCurrentSlot(TargetSlot : EEquipmentSlots):void
  39. {
  40. currentSlot = TargetSlot;
  41. }
  42.  
  43. public function SetCurrentItem(TargetItemId : SItemUniqueId):void
  44. {
  45. if (currentItemId != TargetItemId)
  46. {
  47. currentItemId = TargetItemId;
  48.  
  49. updateInputFeedback();
  50. }
  51.  
  52.  
  53. }
  54.  
  55. protected function triggerTooltip():void
  56. {
  57. if (invComponentRef.IsIdValid(currentItemId))
  58. {
  59. invMenuRef.ShowItemTooltip(currentItemId, currentSlot);
  60. }
  61. else if (currentSlot > 0)
  62. {
  63.  
  64. }
  65. else
  66. {
  67. invMenuRef.HideItemTooltip();
  68. }
  69. }
  70.  
  71. protected function ShowContextMenu():void
  72. {
  73. var contextMenuData:W3ContextMenu;
  74. if (m_inputBindings.Size() > 0 && invMenuRef)
  75. {
  76. contextMenuData = new W3ContextMenu in this;
  77. contextMenuData.positionX = contextMenuPosition_x;
  78. contextMenuData.positionY = contextMenuPosition_y;
  79. contextMenuData.contextRef = this;
  80. contextMenuData.actionsList = m_contextBindings;
  81. invMenuRef.RequestSubMenu('PopupMenu', contextMenuData);
  82. }
  83. }
  84.  
  85. public function HandleUserFeedback(keyName:string):void
  86. {
  87. var itemsCount : int;
  88. var itemCategory : name;
  89. var isItemValid : bool;
  90. var isSchematic : bool;
  91. var playerInv : W3GuiBaseInventoryComponent;
  92. var notificationText : string;
  93. var language : string;
  94. var audioLanguage : string;
  95. // modCustomLocalizationFix++
  96. var invMenuNameString : string;
  97. // modCustomLocalizationFix--
  98.  
  99. isItemValid = invComponentRef.IsIdValid(currentItemId);
  100.  
  101. if (!isItemValid && invSecondComponentRef && invSecondComponentRef.IsIdValid(currentItemId))
  102. {
  103. isItemValid = true;
  104. }
  105.  
  106. if (!isItemValid)
  107. {
  108. return;
  109. }
  110. super.HandleUserFeedback(keyName);
  111. itemsCount = invComponentRef.GetItemQuantity( currentItemId );
  112. if (keyName == "gamepad_X")
  113. {
  114. if ((( invComponentRef.ItemHasTag(currentItemId, 'Edibles')) || (invComponentRef.ItemHasTag(currentItemId, 'Drinks')) ) )
  115. {
  116. // CA
  117. if (thePlayer.GetCurrentStateName() == 'Swimming') {
  118. CAHudNotify(GetLocStringByKeyExt( "menu_cannot_perform_action_here" ));
  119. return;
  120. }
  121. if (!CAAllowAnimsInCombat() && thePlayer.IsInCombat()) {
  122. invMenuRef.OnConsumeItem(currentItemId);
  123. return;
  124. }
  125. if(invComponentRef.ItemHasTag(currentItemId, 'Edibles') && CAInvAnimOn()) {
  126. thePlayer.completeAnims.SetItemToConsume ( currentItemId );
  127. if ( invComponentRef.ItemHasTag(currentItemId, 'Drinks')) {
  128. if (CADrinkAnimOn()) {
  129. thePlayer.completeAnims.DrinkAnim('CAConsume');
  130. } else {
  131. invMenuRef.OnConsumeItem(currentItemId);
  132. }
  133. } else {
  134. if (CAEatAnimOn()) {
  135. thePlayer.completeAnims.EatAnim();
  136. } else {
  137. invMenuRef.OnConsumeItem(currentItemId);
  138. }
  139. }
  140. } else {
  141. invMenuRef.OnConsumeItem(currentItemId);
  142. }
  143. // CA
  144. } else
  145. if (invComponentRef.ItemHasTag(currentItemId, 'Potion'))
  146. {
  147. if (GetWitcherPlayer().ToxicityLowEnoughToDrinkPotion(EES_Potion1,currentItemId))
  148. {
  149. // CA
  150. if (!CAAllowAnimsInCombat() && thePlayer.IsInCombat()) {
  151. GetWitcherPlayer().DrinkPreparedPotion(EES_Potion1,currentItemId);
  152. return;
  153. }
  154. if (CADrinkAnimOn() && CAInvAnimOn()) {
  155. thePlayer.completeAnims.SetSlotToConsume( EES_Potion1, currentItemId );
  156. thePlayer.completeAnims.DrinkAnim('CADrinkPotionInv');
  157. } else {
  158. GetWitcherPlayer().DrinkPreparedPotion(EES_Potion1,currentItemId);
  159. }
  160. // CA
  161. invMenuRef.InventoryUpdateItem(currentItemId);
  162.  
  163.  
  164. if(thePlayer.inv.GetItemName(currentItemId) == 'Mutagen 3')
  165. {
  166. invMenuRef.PaperdollUpdateAll();
  167. invMenuRef.PopulateTabData(InventoryMenuTab_Potions);
  168. }
  169. }
  170. else
  171. {
  172. notificationText = GetLocStringByKeyExt("menu_cannot_perform_action_now") + "<br/>" + GetLocStringByKeyExt("panel_common_statistics_tooltip_current_toxicity");
  173. theGame.GetGameLanguageName(audioLanguage,language);
  174. if (language == "AR")
  175. {
  176. notificationText += (int)(thePlayer.abilityManager.GetStat(BCS_Toxicity, false)) + " / " + (int)(thePlayer.abilityManager.GetStatMax(BCS_Toxicity)) + " :";
  177. }
  178. else
  179. {
  180. notificationText += ": " + (int)(thePlayer.abilityManager.GetStat(BCS_Toxicity, false)) + " / " + (int)(thePlayer.abilityManager.GetStatMax(BCS_Toxicity));
  181. }
  182. theSound.SoundEvent("gui_global_denied");
  183. invMenuRef.showNotification(notificationText);
  184. }
  185. }
  186.  
  187. updateInputFeedback();
  188. }
  189. else
  190. if (keyName == "enter-gamepad_A")
  191. {
  192. if (!theInput.LastUsedPCInput() || IsPadBindingExist(keyName))
  193. {
  194. execurePrimaryAction();
  195. }
  196. }
  197. else
  198. if (keyName == "gamepad_Y")
  199. {
  200. invMenuRef.OnDropItem(currentItemId, itemsCount);
  201.  
  202.  
  203. }
  204. else
  205. if (keyName == "gamepad_L2")
  206. {
  207. itemCategory = invComponentRef.GetItemCategory(currentItemId);
  208. isSchematic = itemCategory == 'alchemy_recipe' || itemCategory == 'crafting_schematic';
  209. if (isSchematic)
  210. {
  211. playerInv = invMenuRef.GetCurrentInventoryComponent();
  212. if (playerInv)
  213. {
  214. invMenuRef.ShowBookPopup( GetLocStringByKeyExt ( invComponentRef.GetItemLocalizedNameByUniqueID( currentItemId ) ), playerInv.GetBookText( currentItemId ), currentItemId, true );
  215. invMenuRef.ShowBookPopup(GetLocStringByKeyExt(invComponentRef.GetItemLocalizedNameByUniqueID(currentItemId)), playerInv.GetBookText(currentItemId));
  216. // modCustomLocalizationFix++
  217. invMenuNameString = GetLocStringByKeyExt(invComponentRef.GetItemLocalizedNameByUniqueID(currentItemId));
  218. if (invMenuNameString == "")
  219. invMenuNameString = invComponentRef.GetItemLocalizedNameByUniqueID(currentItemId);
  220. invMenuRef.ShowBookPopup(invMenuNameString, playerInv.GetBookText(currentItemId), currentItemId, true);
  221. // modCustomLocalizationFix--
  222. }
  223. }
  224. }
  225. }
  226.  
  227. protected function IsHorseItem(currentItemId : SItemUniqueId) : bool
  228. {
  229. if ((invComponentRef.ItemHasTag(currentItemId, 'Saddle')) ||
  230. (invComponentRef.ItemHasTag(currentItemId, 'HorseBag')) ||
  231. (invComponentRef.ItemHasTag(currentItemId, 'Trophy')) ||
  232. (invComponentRef.ItemHasTag(currentItemId, 'Blinders')))
  233. {
  234. return true;
  235. }
  236. return false;
  237. }
  238.  
  239.  
  240. protected function updateInputFeedback():void {}
  241. protected function execurePrimaryAction():void {}
  242. }
  243.  
  244. class W3InventoryGridContext extends W3InventoryItemContext
  245. {
  246. protected function updateInputFeedback():void
  247. {
  248. var currentInventoryState : EInventoryMenuState;
  249. var canDrop : bool;
  250. var isBodkinBolt : bool;
  251. var isQuestItem : bool;
  252. var curEquipedItem : SItemUniqueId;
  253. var cantUse : bool;
  254.  
  255. var buttonLabel : string;
  256.  
  257. LogChannel('CONTEXT'," updateInputFeedback "+invMenuRef+"; "+invComponentRef);
  258. m_inputBindings.Clear();
  259. m_contextBindings.Clear();
  260. if (!invMenuRef || !invComponentRef)
  261. {
  262. return;
  263. }
  264. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  265.  
  266. if (invComponentRef.IsIdValid(currentItemId))
  267. {
  268. canDrop = !invComponentRef.ItemHasTag(currentItemId, 'NoDrop');
  269. isQuestItem = invComponentRef.ItemHasTag(currentItemId,'Quest');
  270. isBodkinBolt = invComponentRef.GetItemName(currentItemId) == 'Bodkin Bolt';
  271.  
  272.  
  273.  
  274. cantUse = FactsQuerySum("tut_forced_preparation") > 0 && invComponentRef.GetItemName(currentItemId) == 'Thunderbolt 1';
  275. if(canDrop && cantUse)
  276. {
  277. canDrop = false;
  278. }
  279.  
  280. switch (currentInventoryState)
  281. {
  282. case IMS_Player:
  283.  
  284. if (invComponentRef.ItemHasTag(currentItemId, 'ReadableItem'))
  285. {
  286. AddInputBinding("panel_button_inventory_read", "enter-gamepad_A", IK_E, true);
  287. }
  288. else if ((invComponentRef.ItemHasTag(currentItemId, 'Edibles')) ||
  289. (invComponentRef.ItemHasTag(currentItemId, 'Drinks')) ||
  290. (invComponentRef.ItemHasTag(currentItemId, 'Potion')))
  291. {
  292. if (invComponentRef.IsItemSingletonItem(currentItemId) && thePlayer.inv.SingletonItemGetAmmo(currentItemId) == 0)
  293. {
  294. cantUse = true;
  295. }
  296.  
  297. if (!cantUse)
  298. {
  299. AddInputBinding("panel_button_inventory_consume", "gamepad_X", IK_E, true);
  300. }
  301. if ( invComponentRef.GetItemName( currentItemId ) != 'q111_imlerith_acorn' && !invComponentRef.ItemHasTag( currentItemId, 'NoEquip' ) )
  302. {
  303. AddInputBinding("panel_button_inventory_equip", "enter-gamepad_A", IK_Space, true);
  304. }
  305. }
  306. else if (invComponentRef.ItemHasTag(currentItemId, 'Upgrade'))
  307. {
  308. AddInputBinding("panel_button_inventory_put_in_socket", "enter-gamepad_A", IK_E, true);
  309. }
  310. else if ((invComponentRef.ItemHasTag(currentItemId, 'SteelOil') && GetWitcherPlayer().GetItemEquippedOnSlot(EES_SteelSword, curEquipedItem)) ||
  311. (invComponentRef.ItemHasTag(currentItemId, 'SilverOil') && GetWitcherPlayer().GetItemEquippedOnSlot(EES_SilverSword, curEquipedItem)))
  312. {
  313.  
  314. AddInputBinding("panel_button_inventory_upgrade", "enter-gamepad_A", IK_E, true);
  315. }
  316. else if (invComponentRef.GetSlotForItemId(currentItemId) != EES_InvalidSlot)
  317. {
  318. AddInputBinding("panel_button_inventory_equip", "enter-gamepad_A", IK_Space, true);
  319. }
  320. else if ( invComponentRef.ItemHasTag(currentItemId, 'ArmorReapairKit') )
  321. {
  322. if ( GetWitcherPlayer().HasRepairAbleGearEquiped() )
  323. {
  324. AddInputBinding("panel_button_hud_interaction_useitem", "enter-gamepad_A", IK_E, true);
  325. }
  326. }
  327. else if ( invComponentRef.ItemHasTag(currentItemId, 'WeaponReapairKit') )
  328. {
  329. if ( GetWitcherPlayer().HasRepairAbleWaponEquiped() )
  330. {
  331. AddInputBinding("panel_button_hud_interaction_useitem", "enter-gamepad_A", IK_E, true);
  332. }
  333. }
  334. break;
  335. case IMS_Shop:
  336. if (!isBodkinBolt)
  337. {
  338. AddInputBinding("panel_inventory_quantity_popup_sell", "enter-gamepad_A", IK_Space, true);
  339. }
  340. break;
  341. case IMS_Container:
  342. AddInputBinding("panel_button_inventory_transfer", "enter-gamepad_A", IK_Space, true);
  343. break;
  344. case IMS_HorseInventory:
  345. if (IsHorseItem(currentItemId))
  346. {
  347. AddInputBinding("panel_button_inventory_equip", "enter-gamepad_A", IK_Space, true);
  348. }
  349. else
  350. {
  351. AddInputBinding("panel_button_inventory_transfer", "enter-gamepad_A", IK_Space, true);
  352. }
  353. break;
  354. case IMS_Stash:
  355. AddInputBinding("panel_button_inventory_transfer", "enter-gamepad_A", IK_Space, true);
  356. break;
  357. default:
  358. break;
  359. }
  360. if (canDrop && !isQuestItem && !isBodkinBolt && currentInventoryState != IMS_Shop)
  361. {
  362. AddInputBinding("panel_button_common_drop", "gamepad_Y", IK_R, true);
  363. }
  364. if (invComponentRef.CanBeCompared(currentItemId))
  365. {
  366. buttonLabel = GetHoldLabel() + " " + GetLocStringByKeyExt("panel_common_compare");
  367. AddInputBinding(buttonLabel, "gamepad_L2", -1, true, true);
  368. }
  369. }
  370.  
  371. m_managerRef.updateInputFeedback();
  372. }
  373.  
  374. protected function execurePrimaryAction():void
  375. {
  376. var currentInventoryState : EInventoryMenuState;
  377. var itemsCount : int;
  378. var newId : SItemUniqueId;
  379.  
  380. if ( invComponentRef.IsIdValid(currentItemId) )
  381. {
  382. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  383. itemsCount = invComponentRef.GetItemQuantity( currentItemId );
  384.  
  385. switch (currentInventoryState)
  386. {
  387. case IMS_Player:
  388. if (invComponentRef.ItemHasTag(currentItemId, 'ReadableItem'))
  389. {
  390. invMenuRef.OnReadBook(currentItemId);
  391. }
  392. else if (invComponentRef.ItemHasTag(currentItemId, 'Upgrade'))
  393. {
  394. invMenuRef.OnPutInSocket(currentItemId);
  395. }
  396. else if (invComponentRef.ItemHasTag(currentItemId, 'WeaponReapairKit') ||
  397. invComponentRef.ItemHasTag(currentItemId, 'ArmorReapairKit'))
  398. {
  399. invMenuRef.OnRepairItem(currentItemId);
  400. }
  401. else if (invComponentRef.ItemHasTag(currentItemId, 'SteelOil') ||
  402. invComponentRef.ItemHasTag(currentItemId, 'SilverOil'))
  403. {
  404. invMenuRef.ShowApplyOilMode(currentItemId);
  405. }
  406. else if (!invMenuRef.TryEquipToPockets(currentItemId, currentSlot))
  407. {
  408. invMenuRef.OnEquipItem(currentItemId, currentSlot, itemsCount);
  409. }
  410. break;
  411. case IMS_Shop:
  412. invMenuRef.OnSellItem(currentItemId, itemsCount);
  413. break;
  414. case IMS_Container:
  415. invMenuRef.OnTransferItem(currentItemId, itemsCount, -1);
  416. break;
  417. case IMS_HorseInventory:
  418.  
  419. if (IsHorseItem(currentItemId))
  420. {
  421. newId = GetWitcherPlayer().GetHorseManager().MoveItemToHorse(currentItemId, itemsCount);
  422. GetWitcherPlayer().GetHorseManager().EquipItem(newId);
  423. invMenuRef.UpdateHorsePaperdoll();
  424. invMenuRef.PopulateTabData(invMenuRef.getTabFromItem(currentItemId));
  425. }
  426. else
  427. {
  428. GetWitcherPlayer().GetHorseManager().MoveItemToHorse(currentItemId, itemsCount);
  429. invMenuRef.UpdateHorseInventory();
  430. invMenuRef.PopulateTabData(invMenuRef.getTabFromItem(currentItemId));
  431. }
  432. break;
  433. case IMS_Stash:
  434. invMenuRef.MoveToStash(currentItemId);
  435. break;
  436. default:
  437. break;
  438. }
  439. }
  440. }
  441. }
  442.  
  443. class W3ExternalGridContext extends W3InventoryItemContext
  444. {
  445. protected function updateInputFeedback():void
  446. {
  447. var currentInventoryState : EInventoryMenuState;
  448. var itemCategory : name;
  449. var canCompare : bool;
  450. var isSchematic : bool;
  451. var buttonLabel : string;
  452.  
  453. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  454.  
  455. m_inputBindings.Clear();
  456. m_contextBindings.Clear();
  457.  
  458. if (currentInventoryState == IMS_Stash)
  459. {
  460. AddInputBinding("panel_button_inventory_transfer", "enter-gamepad_A", IK_Space, true);
  461. }
  462. else
  463. {
  464. if (!invMenuRef || !invComponentRef)
  465. {
  466. return;
  467. }
  468.  
  469. if (invComponentRef.IsIdValid(currentItemId))
  470. {
  471. switch (currentInventoryState)
  472. {
  473. case IMS_Shop:
  474. AddInputBinding("panel_inventory_quantity_popup_buy", "enter-gamepad_A", IK_Space, true);
  475. break;
  476. case IMS_Container:
  477. case IMS_HorseInventory:
  478. case IMS_Stash:
  479. AddInputBinding("panel_button_inventory_transfer", "enter-gamepad_A", IK_Space, true);
  480. break;
  481. }
  482. itemCategory = invComponentRef.GetItemCategory(currentItemId);
  483. isSchematic = itemCategory == 'alchemy_recipe' || itemCategory == 'crafting_schematic';
  484. if (invComponentRef.CanBeCompared(currentItemId))
  485. {
  486. buttonLabel = GetHoldLabel() + " " + GetLocStringByKeyExt("panel_common_compare");
  487. AddInputBinding(buttonLabel, "gamepad_L2", -1, true, true);
  488. }
  489. else
  490. if (isSchematic)
  491. {
  492. AddInputBinding("panel_button_inventory_item_info", "gamepad_L2", IK_I, true);
  493. }
  494. }
  495. }
  496. m_managerRef.updateInputFeedback();
  497. }
  498.  
  499. public function HandleUserFeedback(keyName:string):void
  500. {
  501. var currentInventoryState : EInventoryMenuState;
  502.  
  503. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  504.  
  505. if (currentInventoryState == IMS_Stash)
  506. {
  507. if (keyName == "enter-gamepad_A")
  508. {
  509. if (!theInput.LastUsedPCInput() || IsPadBindingExist(keyName))
  510. {
  511. execurePrimaryAction();
  512. }
  513. }
  514. }
  515. else
  516. {
  517. super.HandleUserFeedback(keyName);
  518. }
  519. }
  520.  
  521. protected function execurePrimaryAction():void
  522. {
  523. var currentInventoryState : EInventoryMenuState;
  524. var itemsCount:int;
  525.  
  526. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  527. itemsCount = invComponentRef.GetItemQuantity( currentItemId );
  528. switch (currentInventoryState)
  529. {
  530. case IMS_Shop:
  531. invMenuRef.OnBuyItem(currentItemId, itemsCount, -1);
  532. break;
  533. case IMS_Container:
  534. invMenuRef.OnTransferItem(currentItemId, itemsCount, -1);
  535. break;
  536. case IMS_HorseInventory:
  537. GetWitcherPlayer().GetHorseManager().MoveItemFromHorse(currentItemId, itemsCount);
  538. invMenuRef.UpdateInventoryFilter(IFT_AllExceptHorseItem);
  539. invMenuRef.UpdateHorseInventory();
  540. invMenuRef.PopulateTabData(invMenuRef.getTabFromItem(currentItemId));
  541. break;
  542. case IMS_Stash:
  543. invMenuRef.TakeItemFromStash(currentItemId);
  544. break;
  545. }
  546. }
  547. }
  548.  
  549. class W3InventoryPaperdollContext extends W3InventoryItemContext
  550. {
  551. protected function updateInputFeedback():void
  552. {
  553. var horsePaperdollInv : W3GuiHorseInventoryComponent;
  554. var currentInventoryState : EInventoryMenuState;
  555.  
  556. var isBodkinBolt : bool;
  557. var canDrop : bool;
  558. var isQuestItem : bool;
  559. var isSingletonItem : bool;
  560. var isHorseItem : bool;
  561.  
  562. m_inputBindings.Clear();
  563. m_contextBindings.Clear();
  564. if (!invMenuRef || !invComponentRef)
  565. {
  566. return;
  567. }
  568.  
  569. currentInventoryState = invMenuRef.GetCurrentInventoryState();
  570. isBodkinBolt = invComponentRef.GetItemName(currentItemId) == 'Bodkin Bolt';
  571. canDrop = !invComponentRef.ItemHasTag(currentItemId, 'NoDrop');
  572. isQuestItem = invComponentRef.ItemHasTag(currentItemId,'Quest');
  573. isSingletonItem = invComponentRef.ItemHasTag(currentItemId, 'SingletonItem');
  574.  
  575. horsePaperdollInv = (W3GuiHorseInventoryComponent)invMenuRef.GetCurrentInventoryComponent();
  576. if (horsePaperdollInv && horsePaperdollInv.GetInventoryComponent().IsIdValid(currentItemId) && horsePaperdollInv.isHorseItem(currentItemId))
  577. {
  578. isHorseItem = true;
  579. }
  580. else
  581. {
  582. isHorseItem = false;
  583. }
  584.  
  585. if (invComponentRef.IsIdValid(currentItemId) && !isBodkinBolt )
  586. {
  587. if ( canDrop && !isQuestItem && !isSingletonItem && !isHorseItem && !IsMultipleSlot(currentSlot) && currentSlot != EES_Bolt ) AddInputBinding("panel_button_common_drop", "gamepad_Y", IK_R, true);
  588. AddInputBinding("panel_button_inventory_unequip", "enter-gamepad_A", IK_Space, true);
  589. }
  590. else if (invSecondComponentRef && invSecondComponentRef.IsIdValid(currentItemId))
  591. {
  592. AddInputBinding("panel_button_inventory_unequip", "enter-gamepad_A", IK_Space, true);
  593. }
  594.  
  595. m_managerRef.updateInputFeedback();
  596. }
  597.  
  598. public function HandleUserFeedback(keyName:string):void
  599. {
  600. super.HandleUserFeedback(keyName);
  601. }
  602.  
  603. protected function execurePrimaryAction():void
  604. {
  605. if (invMenuRef.GetCurrentInventoryState() != IMS_HorseInventory)
  606. {
  607. invMenuRef.OnUnequipItem(currentItemId, -1);
  608. }
  609. else
  610. {
  611. GetWitcherPlayer().GetHorseManager().UnequipItem(currentSlot);
  612. invMenuRef.UpdateInventoryFilter(IFT_HorseItems);
  613. invMenuRef.UpdateHorsePaperdoll();
  614. invMenuRef.PopulateTabData(invMenuRef.getTabFromItem(currentItemId));
  615. }
  616. }
  617. }
  618.  
  619. class W3PlayerStatsContext extends W3UIContext
  620. {
  621. protected var invMenuRef : CR4InventoryMenu;
  622. protected var statName : name;
  623.  
  624. public function SetInventoryRef(TargetInvMenu : CR4InventoryMenu):void
  625. {
  626. invMenuRef = TargetInvMenu;
  627. }
  628.  
  629. public function SetStatName(value:name):void
  630. {
  631. statName = value;
  632. invMenuRef.ShowStatTooltip(statName);
  633. }
  634.  
  635. protected function updateInputFeedback():void
  636. {
  637. m_inputBindings.Clear();
  638. m_contextBindings.Clear();
  639. m_managerRef.updateInputFeedback();
  640. invMenuRef.ShowStatTooltip(statName);
  641. }
  642. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement