/// <summary> /// Mods the player's inventory when their pvp is turned on. /// Resets their inventory to Terraria's defaults when their pvp is turned off. /// </summary> private void OnPvPToggled(object sender, TogglePvPArgs e) { if (!PvPModifier.Config.EnablePlugin) { return; } if (e.Hostile) { e.Player.InvTracker.StartForcePvPInventoryCheck = true; PvPUtils.SendCustomItems(e.Player); } if (!e.Hostile) { PvPUtils.RefreshInventory(e.Player); e.Player.InvTracker.Clear(); e.Player.InvTracker.StartForcePvPInventoryCheck = false; } }
/// <summary> /// Mods the player's inventory when their pvp is turned on. /// Resets their inventory to Terraria's defaults when their pvp is turned off. /// </summary> private void OnPvPToggled(object sender, TogglePvPArgs e) { //TSPlayer.All.SendMessage(e.Player.Name + " has enabled/disabled pvp (fix 1)", new Microsoft.Xna.Framework.Color(187, 144, 212)); if (!PvPModifier.Config.EnablePlugin) { return; } if (e.Hostile) { e.Player.InvTracker.StartForcePvPInventoryCheck = true; PvPUtils.SendCustomItems(e.Player); } if (!e.Hostile) { PvPUtils.RefreshInventory(e.Player); e.Player.InvTracker.Clear(); e.Player.InvTracker.StartForcePvPInventoryCheck = false; } }
/// <summary> /// Clears a person's interface when they toggle off pvp. /// This only activates if a person turns off pvp, not when /// they turn it on. /// </summary> /// <param Name="sender"></param> /// <param Name="e"></param> private void OnPvPToggled(object sender, TogglePvPArgs e) { Interface.ClearInterface(e.Player); }