public override string GetLocalizedInfo() { Localization localization = GreenHellGame.Instance.GetLocalization(); string text = localization.Get("MudChallenge_Collect", true); for (int i = 0; i < this.m_RequredItemNames.Count; i++) { if (!InventoryBackpack.Get().Contains((ItemID)this.m_RequredItemIDs[i])) { text += "\n"; text += localization.Get(this.m_RequredItemNames[i].ToString(), true); } } if (this.m_RequireArmorOnAllLimbs != ArmorType.None) { bool flag = true; for (int j = 0; j < 4; j++) { if (!PlayerArmorModule.Get().IsArmorActive((Limb)j, this.m_RequireArmorOnAllLimbs)) { flag = false; break; } } if (!flag) { text += "\n"; text += localization.Get("MudChallenge_Armor", true); text += "\n"; text += localization.Get(this.m_RequireArmorOnAllLimbs.ToString().ToLower() + "_armor", true); } } return(text); }
protected override void Start() { base.Start(); Light[] componentsInChildren = base.GetComponentsInChildren <Light>(true); for (int i = 0; i < componentsInChildren.Length; i++) { TorchLightData torchLightData = new TorchLightData(); torchLightData.m_Light = componentsInChildren[i]; torchLightData.m_Light.gameObject.SetActive(false); torchLightData.m_DefaultRange = torchLightData.m_Light.range; torchLightData.m_DefaultIntensity = torchLightData.m_Light.intensity; this.m_Lights.Add(torchLightData); } ParticleSystem[] componentsInChildren2 = base.GetComponentsInChildren <ParticleSystem>(); for (int j = 0; j < componentsInChildren2.Length; j++) { this.m_Particles.Add(componentsInChildren2[j]); this.m_ParticlesRenderers.Add(componentsInChildren2[j].GetComponent <ParticleSystemRenderer>()); if (!this.m_ParticlesParent) { this.m_ParticlesParent = componentsInChildren2[j].transform.parent; this.m_ParticlesParentLocPos = this.m_ParticlesParent.localPosition; this.m_ParticlesParent.parent = null; } } this.m_WasInBackPackLastFrame = InventoryBackpack.Get().Contains(this); this.SetupEffects(); if (this.m_DebugIgniteOnStart) { this.m_Fuel = 1f; this.StartBurning(); } }
private void UpdateColor() { float a = this.m_Text.color.a; if (InventoryBackpack.Get().IsMaxOverload()) { this.m_Text.color = Color.red; } else if (InventoryBackpack.Get().IsCriticalOverload()) { float num = Mathf.Abs(Mathf.Sin(Time.time * 2f)); Color white = Color.white; white.g = num; white.b = num; this.m_Text.color = white; } else { this.m_Text.color = Color.white; } Color color = this.m_Text.color; color.a = a; this.m_Text.color = color; }
public void OnInsertItem(ItemSlot slot) { if (this.m_TargetContainerSlot == slot) { ((LiquidContainer)slot.m_Item).Spill(-1f); this.m_TargetContainerInfo = (LiquidContainerInfo)slot.m_Item.m_Info; this.m_TargetContainerInfo.m_LiquidType = LiquidType.Water; HUDProcess.Get().RegisterProcess(slot.m_Item, slot.m_Item.GetIconName(), this, false); return; } if (slot.m_Item.m_Info.IsLiquidContainer()) { Item item = slot.m_Item; this.Fill((LiquidContainerInfo)item.m_Info); slot.RemoveItem(); if (InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true) != InsertResult.Ok) { DebugUtils.Assert("Tomuś, do something with this situation!", true, DebugUtils.AssertType.Info); } if (Inventory3DManager.Get().isActiveAndEnabled) { Inventory3DManager.Get().OnLiquidTransfer(); } } }
public virtual void OnExecute(TriggerAction.TYPE action) { if (this.m_RequiredItems.Count > 0 && this.m_DestroyRequiredItemsOnExecute) { foreach (ItemID item_id in this.m_RequiredItems) { Item item = InventoryBackpack.Get().FindItem(item_id); if (item) { if (item.m_InventorySlot && item.m_InventorySlot.m_Items.Count > 0) { UnityEngine.Object.Destroy(item.m_InventorySlot.m_Items[0].gameObject); } else { UnityEngine.Object.Destroy(item.gameObject); } } } } if (!this.m_WasTriggered) { this.m_WasTriggered = true; this.m_FirstTriggerTime = MainLevel.Instance.m_TODSky.Cycle.GameTime; } if (this.m_Owner != null) { this.m_Owner.OnExecute(this, action); return; } this.TryPlayExecuteSound(); }
public static void SetupObjects() { SaveGame.m_Objects.Clear(); SaveGame.m_Objects.Add(DifficultySettings.Get()); SaveGame.m_Objects.Add(DialogsManager.Get()); SaveGame.m_Objects.Add(AIManager.Get()); SaveGame.m_Objects.Add(EnemyAISpawnManager.Get()); SaveGame.m_Objects.Add(TriggersManager.Get()); SaveGame.m_Objects.Add(ItemsManager.Get()); SaveGame.m_Objects.Add(SensorManager.Get()); SaveGame.m_Objects.Add(ConstructionGhostManager.Get()); SaveGame.m_Objects.Add(StaticObjectsManager.Get()); SaveGame.m_Objects.Add(Player.Get()); SaveGame.m_Objects.Add(PlayerConditionModule.Get()); SaveGame.m_Objects.Add(PlayerInjuryModule.Get()); SaveGame.m_Objects.Add(PlayerDiseasesModule.Get()); SaveGame.m_Objects.Add(StatsManager.Get()); SaveGame.m_Objects.Add(HintsManager.Get()); SaveGame.m_Objects.Add(ObjectivesManager.Get()); SaveGame.m_Objects.Add(StoryObjectivesManager.Get()); SaveGame.m_Objects.Add(HUDObjectives.Get()); SaveGame.m_Objects.Add(MenuNotepad.Get()); SaveGame.m_Objects.Add(MapTab.Get()); SaveGame.m_Objects.Add(Music.Get()); SaveGame.m_Objects.Add(RainManager.Get()); SaveGame.m_Objects.Add(SleepController.Get()); SaveGame.m_Objects.Add(MainLevel.Instance); SaveGame.m_Objects.Add(ScenarioManager.Get()); SaveGame.m_Objects.Add(InventoryBackpack.Get()); SaveGame.m_Objects.Add(ReplicatedSessionState.Get()); }
private void SetupName() { Trigger trigger = this.GetTrigger(); if (trigger) { this.m_Name.text = trigger.GetTriggerInfoLocalized(); this.m_Name.gameObject.SetActive(true); if (trigger.IsItem() && Inventory3DManager.Get().gameObject.activeSelf) { Item item = (Item)trigger; if (item.m_InInventory) { int itemsCount = InventoryBackpack.Get().GetItemsCount(item.GetInfoID()); Text name = this.m_Name; string text = name.text; name.text = string.Concat(new object[] { text, " (", itemsCount, ")" }); } } } else { this.m_Name.gameObject.SetActive(false); } }
public void Craft() { if (this.m_Result == ItemID.None) { DebugUtils.Assert("ERROR - Missing result ItemID! Can't craft item!", true, DebugUtils.AssertType.Info); return; } Item item = this.CreateItem(this.m_Result); ItemsManager.Get().OnCrafted(this.m_Result); this.m_Result = ItemID.None; InventoryBackpack.InsertResult insertResult = InventoryBackpack.Get().InsertItem(item, null, null, true, false, true, true, true); if (insertResult != InventoryBackpack.InsertResult.Ok) { this.AddItem(item, true); } else { item.OnTake(); } InventoryBackpack.Get().SetupPocket(item.m_Info.m_BackpackPocket); Inventory3DManager.Get().SetNewCraftedItem(item); this.CheckResult(); HUDCrafting.Get().Setup(); }
public override bool CanTrigger() { if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying()) { return(false); } if (this.m_StoredItemId == ItemID.None) { return(false); } if (ItemsManager.Get().IsHeavyObject(this.m_StoredItemId)) { Item currentItem = Player.Get().GetCurrentItem(Hand.Right); if ((currentItem == null && this.m_NumItems > 0) || (currentItem != null && (!ItemsManager.Get().IsHeavyObject(currentItem.m_Info.m_ID) || currentItem.m_Info.m_ID == this.m_StoredItemId))) { return(true); } } else { if (this.m_NumItems < this.m_Vis.Count - 1 && InventoryBackpack.Get().Contains(this.m_StoredItemId)) { return(true); } if (this.m_NumItems > 0) { return(true); } } return(false); }
private void RemoveItemFromBackpack() { Item item = InventoryBackpack.Get().FindItem(this.m_StoredItemId); if (item == null) { return; } if (CraftingManager.Get().gameObject.activeSelf&& CraftingManager.Get().ContainsItem(item)) { CraftingManager.Get().RemoveItem(item, false); } if (!item.m_CurrentSlot && item.m_InventorySlot && item.m_InventorySlot.m_Items.Count > 0) { item.m_InventorySlot.RemoveItem(item, false); } else if (item.m_CurrentSlot && item.m_CurrentSlot.m_InventoryStackSlot) { item.m_CurrentSlot.RemoveItem(item, false); } if (InventoryBackpack.Get().m_EquippedItem == item) { InventoryBackpack.Get().m_EquippedItem = null; } InventoryBackpack.Get().RemoveItem(item, false); UnityEngine.Object.Destroy(item.gameObject); }
public void OnInsertItem(ItemSlot slot) { if (slot == this.m_GetFromContainerSlot) { Item item = slot.m_Item; this.TransferLiquids(LiquidType.Water, this.m_ContainerData, (LiquidContainer)item); slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); return; } if (slot == this.m_GetFromCollectorSlot) { Item item2 = slot.m_Item; this.TransferLiquids(this.m_CollectorLiquidType, this.m_CollectorData, (LiquidContainer)item2); slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item2, null, null, true, true, true, true, true); return; } if (slot == this.m_PourToCollectorSlot) { Item item3 = slot.m_Item; this.TransferLiquids(this.m_CollectorLiquidType, (LiquidContainer)item3, this.m_CollectorData); slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item3, null, null, true, true, true, true, true); } }
public override bool Take() { if (this.m_Hallucination) { base.Disappear(true); return(false); } Item item = ItemsManager.Get().CreateItem(this.m_ReplaceInfoName, false); if (InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true) != InsertResult.Ok) { UnityEngine.Object.Destroy(item.gameObject); return(false); } this.UpdateChildrenItems(); EventsManager.OnEvent(Enums.Event.TakeItem, 1, (int)item.m_Info.m_ID); if (base.m_CurrentSlot) { base.m_CurrentSlot.RemoveItem(); } Player.Get().GetComponent <PlayerAudioModule>().PlayItemSound(item.m_Info.m_GrabSound); base.AddItemsCountMessage(item); if (item.m_Info != null && item.m_Info.IsHeavyObject()) { PlayerAudioModule.Get().PlayHOPickupSound(); } if (!this.m_IsThisUnlimited) { UnityEngine.Object.Destroy(base.gameObject); } return(true); }
public void OnInsertItem(ItemSlot slot) { if (slot == this.m_WaterSlot) { Item item = slot.m_Item; LiquidContainerInfo liquidContainerInfo = (LiquidContainerInfo)item.m_Info; float waterAmount = this.m_WaterAmount; this.m_WaterAmount += liquidContainerInfo.m_Amount; this.m_WaterAmount = Mathf.Min(this.m_WaterAmount, this.m_RequiredWaterAmount); float num = this.m_WaterAmount - waterAmount; liquidContainerInfo.m_Amount -= num; slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); if (this.m_WaterAmount >= this.m_RequiredWaterAmount) { this.SetState(MudMixer.State.Full); } if (num > 0f) { PlayerAudioModule.Get().PlayWaterSpillSound(1f, false); return; } } else if (slot == this.m_AshSlot) { UnityEngine.Object.Destroy(slot.m_Item.gameObject); this.SetState(MudMixer.State.WaitingForWater); } }
public override void Update() { base.Update(); int i = 0; while (i < this.m_RequredItemIDs.Count) { if (InventoryBackpack.Get().Contains((ItemID)this.m_RequredItemIDs[i])) { this.m_RequredItemIDs.RemoveAt(i); this.m_RequredItemNames.RemoveAt(i); } else { i++; } } if (this.m_RequireArmorOnAllLimbs != ArmorType.None) { for (int j = 0; j < 4; j++) { if (!PlayerArmorModule.Get().IsArmorActive((Limb)j, this.m_RequireArmorOnAllLimbs)) { return; } } } if (this.m_RequredItemIDs.Count == 0) { this.Success(); } }
public override void OnInputAction(InputsManager.InputAction action) { base.OnInputAction(action); if (LoadingScreen.Get().m_Active) { return; } if (InventoryBackpack.Get().IsCriticalOverload()) { return; } if (action == InputsManager.InputAction.Jump && HUDMovie.Get().GetMovieType() == MovieType.None && (this.m_CollisionFlags & CollisionFlags.Below) != CollisionFlags.None) { if (InputsManager.Get().IsActionActive(InputsManager.InputAction.DodgeLeft) && !InputsManager.Get().IsActionActive(InputsManager.InputAction.DodgeForward)) { this.Dodge(Direction.Left); } else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.DodgeRight) && !InputsManager.Get().IsActionActive(InputsManager.InputAction.DodgeForward)) { this.Dodge(Direction.Right); } else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.DodgeBackward)) { this.Dodge(Direction.Backward); } else { this.Jump(); } } }
public override void OnExecute(TriggerAction.TYPE action) { base.OnExecute(action); if (action == TriggerAction.TYPE.Insert) { Item currentItem = Player.Get().GetCurrentItem(Hand.Right); if (currentItem && this.m_ItemID == currentItem.GetInfoID() && currentItem.m_Info.IsHeavyObject()) { HeavyObject heavyObject = (HeavyObject)currentItem; if (heavyObject.m_Attached.Count > 0) { this.Fulfill(false); heavyObject.DetachHeavyObject(0, true); return; } HeavyObjectController.Get().InsertToGhostSlot(this); return; } else { this.Fulfill(false); InventoryBackpack.Get().RemoveItem(this.m_ItemID, 1); } } }
public void Deactivate() { if (!base.gameObject.activeSelf) { return; } while (this.m_Items.Count > 0) { Item item = this.m_Items[0]; this.m_Items.Remove(item); item.StaticPhxRequestRemove(); item.m_OnCraftingTable = false; item.UpdatePhx(); item.UpdateLayer(); item.UpdateScale(false); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); } this.m_Items.Clear(); this.m_Results.Clear(); this.m_PossibleResults.Clear(); this.m_Table.SetActive(false); base.gameObject.SetActive(false); if (!CraftingController.Get().BlockInventoryInputs()) { Player.Get().StopController(PlayerControllerType.Crafting); if (Player.Get().m_ControllerToStart != PlayerControllerType.Unknown) { Player.Get().StartControllerInternal(); } } this.UpdateHints(); InventoryBackpack.Get().CalculateCurrentWeight(); }
public void AddItem(Item item, bool setup_pos) { item.StaticPhxRequestAdd(); item.m_OnCraftingTable = true; this.m_Items.Add(item); item.UpdateScale(false); item.UpdatePhx(); item.UpdateLayer(); if (setup_pos) { item.gameObject.transform.rotation = Quaternion.identity; Vector3 position = this.m_Table.transform.position + item.transform.up * item.m_BoxCollider.size.y * item.transform.localScale.y * 0.5f; item.gameObject.transform.position = position; Matrix4x4 identity = Matrix4x4.identity; Vector3 vector = -this.m_TableCollider.transform.forward; identity.SetColumn(1, vector); Vector3 v = Vector3.Cross(this.m_TableCollider.transform.up, vector); identity.SetColumn(0, v); identity.SetColumn(2, Vector3.Cross(identity.GetColumn(1), identity.GetColumn(0))); identity.SetColumn(0, Vector3.Cross(identity.GetColumn(1), identity.GetColumn(2))); Quaternion rotation = CJTools.Math.QuaternionFromMatrix(identity); item.gameObject.transform.rotation = rotation; if (item.m_Info.m_InventoryRotated) { item.transform.RotateAround(item.m_BoxCollider.bounds.center, item.transform.up, 90f); } } this.CheckResult(); HUDCrafting.Get().Setup(); InventoryBackpack.Get().CalculateCurrentWeight(); }
public void Deactivate() { if (!base.gameObject.activeSelf) { return; } for (int i = 0; i < this.m_Items.Count; i++) { Item item = this.m_Items[i]; item.StaticPhxRequestRemove(); item.m_OnCraftingTable = false; InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); } this.m_Items.Clear(); this.m_Results.Clear(); this.m_PossibleResults.Clear(); this.m_Table.SetActive(false); base.gameObject.SetActive(false); Player.Get().StopController(PlayerControllerType.Crafting); if (Player.Get().m_ControllerToStart != PlayerControllerType.Unknown) { Player.Get().StartControllerInternal(); } this.UpdateHints(); }
public void Deactivate() { if (this.m_CarriedItem && !this.m_CarriedItem.m_CurrentSlot) { this.OnLMouseUp(); } this.BlockPlayerRotation(false); if (!Player.Get().m_BodyInspectionController.IsActive()) { Player.Get().StopController(PlayerControllerType.Inventory); } this.m_Camera.enabled = false; this.m_Canvas.gameObject.SetActive(false); CursorManager.Get().ShowCursor(false); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); HUDManager.Get().SetActiveGroup(HUDManager.HUDGroup.Game); if (CraftingManager.Get().gameObject.activeSelf) { CraftingManager.Get().Deactivate(); } if (HUDItem.Get().m_Active) { HUDItem.Get().Deactivate(); } this.ResetNewCraftedItem(); this.m_SelectedSlot = null; this.m_SelectedGroup = null; this.m_MouseOverCraftTable = false; this.m_MouseOverBackpack = false; InventoryBackpack.Get().OnCloseBackpack(); base.gameObject.SetActive(false); this.m_DeactivationTime = Time.time; this.m_ActivityChanged = true; }
public bool InsertItem(Item item, ItemSlot slot, InventoryCellsGroup group, bool can_stack, bool can_auto_select_group, Storage storage = null) { if (item.m_Info.m_FakeItem) { return(true); } if (slot) { if (slot.CanInsertItem(item)) { if (slot.IsStack() && slot.m_ItemParent && slot.m_ItemParent.m_Info.m_InventoryRotated != item.m_Info.m_InventoryRotated) { Inventory3DManager.Get().RotateItem(item, true); } slot.InsertItem(item); return(true); } if (!slot.IsOccupied()) { return(false); } } if (group == null) { if (can_stack) { List <Item> list = storage ? storage.m_Items : InventoryBackpack.Get().m_Items; for (int i = 0; i < list.Count; i++) { Item item2 = list[i]; if (item2.m_InventorySlot && !item2.m_CurrentSlot && item2.m_InventorySlot.CanInsertItem(item)) { if (item2.m_Info.m_InventoryRotated != item.m_Info.m_InventoryRotated) { Inventory3DManager.Get().RotateItem(item, true); } item2.m_InventorySlot.InsertItem(item); return(true); } } } if (can_auto_select_group) { group = this.FindFreeGroup(item); if (group != null && group.IsFree()) { group.Insert(item, this.m_Grid); return(true); } } return(false); } if (group.IsFree()) { group.Insert(item, this.m_Grid); return(true); } return(false); }
public override void Update() { base.Update(); if (InventoryBackpack.Get().Contains(this.m_ItemID)) { this.Success(); } }
protected override void Update() { base.Update(); this.CheckRain(); this.UpdateBurning(); this.UpdateLightNoise(); this.m_WasInBackPackLastFrame = InventoryBackpack.Get().Contains(this); }
public override void ControllerUpdate() { base.ControllerUpdate(); this.UpdateState(); bool value = !Inventory3DManager.Get().IsActive() || InventoryBackpack.Get().m_ActivePocket != BackpackPocket.Left; this.m_Animator.SetBool(this.m_BackpackRodInHandHash, value); }
protected override void OnDisable() { base.OnDisable(); this.m_Animator.SetBool(this.m_BWalkieTalkie, false); Item currentItem = this.m_Player.GetCurrentItem(Hand.Right); InventoryBackpack.Get().InsertItem(currentItem, null, null, true, true, true, true, true); this.m_Player.SetWantedItem(Hand.Right, this.m_RHandItemToRestore, true); }
public override void Eat() { if (this.m_Hallucination) { base.Disappear(true); return; } base.Eat(); if (base.transform.parent != null) { DestroyIfNoChildren component = base.transform.parent.GetComponent <DestroyIfNoChildren>(); if (component) { component.OnObjectDestroyed(); } } Player.Get().GetComponent <EatingController>().Eat(this.m_FInfo); UnityEngine.Object.Destroy(base.gameObject); bool flag = InventoryBackpack.Get().Contains(this); List <ItemID> eatingResultItems = ((FoodInfo)this.m_Info).m_EatingResultItems; for (int i = 0; i < eatingResultItems.Count; i++) { ItemID item_id = eatingResultItems[i]; if (flag) { Item item = ItemsManager.Get().CreateItem(item_id, false, Vector3.zero, Quaternion.identity); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, false); } else if (this.m_Storage != null) { Item item2 = ItemsManager.Get().CreateItem(item_id, false, Vector3.zero, Quaternion.identity); InventoryCellsGroup inventoryCellsGroup = this.m_Info.m_InventoryCellsGroup; Storage storage = this.m_Storage; storage.RemoveItem(this, false); storage.InsertItem(item2, base.m_CurrentSlot, inventoryCellsGroup, true, true); item2.gameObject.SetActive(true); } else { GameObject prefab = GreenHellGame.Instance.GetPrefab(item_id.ToString()); if (!prefab) { DebugUtils.Assert("[Item:Harvest] Can't find prefab - " + item_id.ToString(), true, DebugUtils.AssertType.Info); } else { UnityEngine.Object.Instantiate <GameObject>(prefab, base.transform.position, base.transform.rotation); } } } if (this.m_Acre) { this.m_Acre.OnEat(this); } }
private void OnLMouseUp() { if (!this.m_CarriedItem) { return; } if (this.CanInsertCarriedItemToBackpack()) { InventoryBackpack.InsertResult insertResult = InventoryBackpack.Get().InsertItem(this.m_CarriedItem, this.m_SelectedSlot, this.m_SelectedGroup, false, false, false, false, true); if (insertResult != InventoryBackpack.InsertResult.Ok) { insertResult = InventoryBackpack.Get().InsertItem(this.m_CarriedItem, this.m_CarriedItem.m_PrevSlot, this.m_CarriedItem.m_Info.m_PrevInventoryCellsGroup, false, true, true, false, true); } if (insertResult == InventoryBackpack.InsertResult.Ok) { this.m_CarriedItem.m_ShownInInventory = true; this.PlayDropSound(); } } else if (CraftingManager.Get().gameObject.activeSelf&& this.m_MouseOverCraftTable) { CraftingManager.Get().AddItem(this.m_CarriedItem, false); this.PlayDropSound(); } else if (this.m_CarriedItem.m_Info.m_CanBeRemovedFromInventory) { if (BodyInspectionController.Get().IsActive()) { if (this.m_SelectedSlot && this.m_SelectedSlot.IsBIWoundSlot()) { this.m_SelectedSlot.InsertItem(this.m_CarriedItem); } else { this.DropItem(this.m_CarriedItem); } this.PlayDropSound(); } else if (this.m_SelectedSlot) { this.m_SelectedSlot.InsertItem(this.m_CarriedItem); this.PlayDropSound(); } else if (this.m_MouseOverBackpack) { InventoryBackpack.Get().InsertItem(this.m_CarriedItem, null, null, true, true, true, true, true); this.PlayDropSound(); } else { this.DropItem(this.m_CarriedItem); this.PlayDropSound(); } } this.SetCarriedItem(null); }
public virtual void OnInsertItem(ItemSlot slot) { if (slot == this.m_GetSlot) { Item item = slot.m_Item; this.TransferLiquids((LiquidContainer)item); slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); } }
public void OnSetSelectedGroup(InventoryCellsGroup group) { InventoryCell[,] cells = this.m_Cells; int upperBound = cells.GetUpperBound(0); int upperBound2 = cells.GetUpperBound(1); for (int i = cells.GetLowerBound(0); i <= upperBound; i++) { for (int j = cells.GetLowerBound(1); j <= upperBound2; j++) { cells[i, j].m_Renderer.enabled = false; } } if (group == null) { return; } for (int k = 0; k < (int)this.m_GridSize.y; k++) { for (int l = 0; l < (int)this.m_GridSize.x; l++) { this.m_Cells[l, k].m_Renderer.material.color = Color.white; } } if (group.IsFree()) { for (int m = 0; m < group.m_Cells.Count; m++) { group.m_Cells[m].m_Renderer.enabled = true; group.m_Cells[m].m_Renderer.material.color = InventoryBackpack.Get().m_FreeColor; } return; } for (int n = 0; n < group.m_Cells.Count; n++) { group.m_Cells[n].m_Renderer.enabled = true; group.m_Cells[n].m_Renderer.material.color = InventoryBackpack.Get().m_OccupiedColor; if (group.m_Cells[n].m_Items.Count > 0) { for (int num = 0; num < group.m_Cells[n].m_Items.Count; num++) { InventoryCellsGroup inventoryCellsGroup = group.m_Cells[n].m_Items[num].m_Info.m_InventoryCellsGroup; if (this.m_Pocked != BackpackPocket.Storage || !group.m_Cells[n].m_Items[num].m_Storage || !(group.m_Cells[n].m_Items[num].m_Storage != Storage3D.Get().m_Storage)) { for (int num2 = 0; num2 < inventoryCellsGroup.m_Cells.Count; num2++) { inventoryCellsGroup.m_Cells[num2].m_Renderer.enabled = true; inventoryCellsGroup.m_Cells[num2].m_Renderer.material.color = InventoryBackpack.Get().m_OccupiedColor; } } } } } }
public virtual void OnInsertItem(ItemSlot slot) { if (slot == this.m_ItemSlot) { Item item = slot.m_Item; this.FillWithLiquid(item); slot.RemoveItem(); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); PlayerAudioModule.Get().PlayWaterSpillSound(1f, false); } }