void UpdateQuickInventory() { if (GameManager.isPaused) { return; } if (inventoryUI.IsOpen(InventoryUI.UIType.FullInventory)) { return; } if (inventoryUI.IsOpen(InventoryUI.UIType.FullTrade)) { return; } if (inventoryUI.IsOpen(InventoryUI.UIType.QuickInventory)) { return; } if (Player.instance.handsTogether) { StandardizedVRInput.MarkActionOccupied(quickInventoryToggle, SteamVR_Input_Sources.Any); if (!CheckHandForWristRadialOpen(SteamVR_Input_Sources.LeftHand)) { CheckHandForWristRadialOpen(SteamVR_Input_Sources.RightHand); } } else { StandardizedVRInput.MarkActionUnoccupied(quickInventoryToggle); } }
void OnInventoryUIOpen(InventoryUI.UIType type, UIElementHolder uiHolder) { SteamVR_Input_Sources hand; switch (type) { // quick inventory case InventoryUI.UIType.QuickInventory: hand = VRManager.Int2Hand(inventoryUI.quickInventoryInteractorID); StandardizedVRInput.MarkActionOccupied(QUICK_INVENTORY_CONSUME_ACTION, VRUIInput.GetUIHand()); StandardizedVRInput.instance.ShowHint(hand, QUICK_INVENTORY_CONSUME_ACTION, "Use"); TransformBehavior.AdjustTransform(uiHolder.baseObject.transform, Player.instance.GetHand(hand).transform, quickInventoryEquip, 0); VRUIInput.SetUIHand(hand); break; // full inventory case InventoryUI.UIType.FullInventory: StandardizedVRInput.MarkActionOccupied(FULL_INVENTORY_CONSUME_ACTION, SteamVR_Input_Sources.Any); StandardizedVRInput.MarkActionOccupied(FULL_INVENTORY_DROP_ACTION, SteamVR_Input_Sources.Any); // StandardizedVRInput.MarkActionOccupied(FULL_INVENTORY_FAVORITE_ACTION, SteamVR_Input_Sources.Any); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.RightHand, FULL_INVENTORY_CONSUME_ACTION, "Use Right Hand"); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.LeftHand, FULL_INVENTORY_CONSUME_ACTION, "Use Left Hand"); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.Any, FULL_INVENTORY_DROP_ACTION, "Drop"); // StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.Any, FULL_INVENTORY_FAVORITE_ACTION, "Favorite"); VRUIInput.SetUIHand(SteamVR_Input_Sources.Any); break; // quick trade case InventoryUI.UIType.QuickTrade: hand = VRManager.Int2Hand(inventoryUI.quickTradeInteractorID); StandardizedVRInput.MarkActionOccupied(QUICK_TRADE_SINGLE_TRADE_ACTION, hand); StandardizedVRInput.MarkActionOccupied(QUICK_TRADE_TRADE_ALL_ACTION, hand); StandardizedVRInput.MarkActionOccupied(QUICK_TRADE_SWITCH_TO_FULL_TRADE_ACTION, hand); StandardizedVRInput.instance.ShowHint(hand, QUICK_TRADE_SINGLE_TRADE_ACTION, "Take Item"); StandardizedVRInput.instance.ShowHint(hand, QUICK_TRADE_TRADE_ALL_ACTION, "Take All"); StandardizedVRInput.instance.ShowHint(hand, QUICK_TRADE_SWITCH_TO_FULL_TRADE_ACTION, "Open Trade"); TransformBehavior.AdjustTransform(uiHolder.baseObject.transform, Player.instance.GetHand(hand).transform, quickTradeEquip, 0); VRUIInput.SetUIHand(hand); break; // full trade case InventoryUI.UIType.FullTrade: StandardizedVRInput.MarkActionOccupied(FULL_TRADE_CONSUME_ACTION, SteamVR_Input_Sources.Any); StandardizedVRInput.MarkActionOccupied(FULL_TRADE_TRADE_ALL_ACTION, SteamVR_Input_Sources.Any); StandardizedVRInput.MarkActionOccupied(FULL_TRADE_SINGLE_TRADE_ACTION, SteamVR_Input_Sources.Any); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.RightHand, FULL_TRADE_CONSUME_ACTION, "Use Right Hand"); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.LeftHand, FULL_TRADE_CONSUME_ACTION, "Use Left Hand"); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.Any, FULL_TRADE_SINGLE_TRADE_ACTION, "Trade Item"); StandardizedVRInput.instance.ShowHint(SteamVR_Input_Sources.Any, FULL_TRADE_TRADE_ALL_ACTION, "Trade All"); VRUIInput.SetUIHand(SteamVR_Input_Sources.Any); break; } }