(965c31410a) Unstable v0.10.4.0
This commit is contained in:
@@ -20,9 +20,6 @@ namespace Barotrauma
|
||||
/// </summary>
|
||||
const float CharacterWaitOnSwitch = 10.0f;
|
||||
|
||||
private readonly List<CharacterInfo> characterInfos = new List<CharacterInfo>();
|
||||
private readonly List<Character> characters = new List<Character>();
|
||||
|
||||
private Point screenResolution;
|
||||
|
||||
#region UI
|
||||
@@ -30,6 +27,7 @@ namespace Barotrauma
|
||||
public GUIComponent ReportButtonFrame { get; set; }
|
||||
|
||||
private GUIFrame guiFrame;
|
||||
private GUIComponent crewAreaWithButtons;
|
||||
private GUIFrame crewArea;
|
||||
private GUIListBox crewList;
|
||||
private GUIButton commandButton, toggleCrewButton;
|
||||
@@ -72,19 +70,7 @@ namespace Barotrauma
|
||||
public CrewManager(XElement element, bool isSinglePlayer)
|
||||
: this(isSinglePlayer)
|
||||
{
|
||||
foreach (XElement subElement in element.Elements())
|
||||
{
|
||||
if (!subElement.Name.ToString().Equals("character", StringComparison.OrdinalIgnoreCase)) { continue; }
|
||||
|
||||
var characterInfo = new CharacterInfo(subElement);
|
||||
characterInfos.Add(characterInfo);
|
||||
foreach (XElement invElement in subElement.Elements())
|
||||
{
|
||||
if (!invElement.Name.ToString().Equals("inventory", StringComparison.OrdinalIgnoreCase)) { continue; }
|
||||
characterInfo.InventoryData = invElement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
AddCharacterElements(element);
|
||||
}
|
||||
|
||||
partial void InitProjectSpecific()
|
||||
@@ -96,7 +82,7 @@ namespace Barotrauma
|
||||
|
||||
#region Crew Area
|
||||
|
||||
var crewAreaWithButtons = new GUIFrame(
|
||||
crewAreaWithButtons = new GUIFrame(
|
||||
HUDLayoutSettings.ToRectTransform(HUDLayoutSettings.CrewArea, guiFrame.RectTransform),
|
||||
style: null,
|
||||
color: Color.Transparent)
|
||||
@@ -326,43 +312,6 @@ namespace Barotrauma
|
||||
return characterInfos;
|
||||
}
|
||||
|
||||
public void AddCharacter(Character character)
|
||||
{
|
||||
if (character.Removed)
|
||||
{
|
||||
DebugConsole.ThrowError("Tried to add a removed character to CrewManager!\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
if (character.IsDead)
|
||||
{
|
||||
DebugConsole.ThrowError("Tried to add a dead character to CrewManager!\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!characters.Contains(character))
|
||||
{
|
||||
characters.Add(character);
|
||||
}
|
||||
if (!characterInfos.Contains(character.Info))
|
||||
{
|
||||
characterInfos.Add(character.Info);
|
||||
}
|
||||
|
||||
AddCharacterToCrewList(character);
|
||||
DisplayCharacterOrder(character, character.CurrentOrder, character.CurrentOrderOption);
|
||||
}
|
||||
|
||||
public void AddCharacterInfo(CharacterInfo characterInfo)
|
||||
{
|
||||
if (characterInfos.Contains(characterInfo))
|
||||
{
|
||||
DebugConsole.ThrowError("Tried to add the same character info to CrewManager twice.\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
|
||||
characterInfos.Add(characterInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the character from the crew (and crew menus).
|
||||
/// </summary>
|
||||
@@ -379,15 +328,6 @@ namespace Barotrauma
|
||||
if (removeInfo) { characterInfos.Remove(character.Info); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove info of a selected character. The character will not be visible in any menus or the round summary.
|
||||
/// </summary>
|
||||
/// <param name="characterInfo"></param>
|
||||
public void RemoveCharacterInfo(CharacterInfo characterInfo)
|
||||
{
|
||||
characterInfos.Remove(characterInfo);
|
||||
}
|
||||
|
||||
private void AddCharacterToCrewList(Character character)
|
||||
{
|
||||
if (character == null) { return; }
|
||||
@@ -516,7 +456,7 @@ namespace Barotrauma
|
||||
};
|
||||
new GUIImage(
|
||||
new RectTransform(Vector2.One, soundIcons.RectTransform),
|
||||
GUI.Style.GetComponentStyle("GUISoundIcon").Sprites[GUIComponent.ComponentState.None].FirstOrDefault().Sprite,
|
||||
GUI.Style.GetComponentStyle("GUISoundIcon").GetDefaultSprite(),
|
||||
scaleToFit: true)
|
||||
{
|
||||
CanBeFocused = false,
|
||||
@@ -630,6 +570,22 @@ namespace Barotrauma
|
||||
ChatBox.AddMessage(ChatMessage.Create(senderName, text, messageType, sender));
|
||||
}
|
||||
|
||||
public void AddSinglePlayerChatMessage(ChatMessage message)
|
||||
{
|
||||
if (!IsSinglePlayer)
|
||||
{
|
||||
DebugConsole.ThrowError("Cannot add messages to single player chat box in multiplayer mode!\n" + Environment.StackTrace);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(message.Text)) { return; }
|
||||
|
||||
if (message.Sender != null)
|
||||
{
|
||||
GameMain.GameSession.CrewManager.SetCharacterSpeaking(message.Sender);
|
||||
}
|
||||
ChatBox.AddMessage(message);
|
||||
}
|
||||
|
||||
private WifiComponent GetHeadset(Character character, bool requireEquipped)
|
||||
{
|
||||
if (character?.Inventory == null) return null;
|
||||
@@ -861,27 +817,6 @@ namespace Barotrauma
|
||||
return characterComponent?.FindChild(c => c?.UserData is OrderInfo orderInfo && orderInfo.ComponentIdentifier == "previousorder");
|
||||
}
|
||||
|
||||
private struct OrderInfo
|
||||
{
|
||||
public string ComponentIdentifier { get; set; }
|
||||
public Order Order { get; private set; }
|
||||
public string OrderOption { get; private set; }
|
||||
|
||||
public OrderInfo(Order order, string orderOption)
|
||||
{
|
||||
ComponentIdentifier = "currentorder";
|
||||
Order = order;
|
||||
OrderOption = orderOption;
|
||||
}
|
||||
|
||||
public OrderInfo(OrderInfo orderInfo)
|
||||
{
|
||||
ComponentIdentifier = "previousorder";
|
||||
Order = orderInfo.Order;
|
||||
OrderOption = orderInfo.OrderOption;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Updating and drawing the UI
|
||||
@@ -1123,6 +1058,7 @@ namespace Barotrauma
|
||||
public void AddToGUIUpdateList()
|
||||
{
|
||||
if (GUI.DisableHUD) { return; }
|
||||
if (CoroutineManager.IsCoroutineRunning("LevelTransition") || CoroutineManager.IsCoroutineRunning("SubmarineTransition")) { return; }
|
||||
|
||||
commandFrame?.AddToGUIUpdateList();
|
||||
|
||||
@@ -1145,6 +1081,8 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
crewAreaWithButtons.Visible = !(GameMain.GameSession?.GameMode is CampaignMode campaign) || (!campaign.ForceMapUI && !campaign.ShowCampaignUI);
|
||||
|
||||
guiFrame.AddToGUIUpdateList();
|
||||
contextMenu?.AddToGUIUpdateList(false, 1);
|
||||
subContextMenu?.AddToGUIUpdateList(false, 1);
|
||||
@@ -1170,6 +1108,7 @@ namespace Barotrauma
|
||||
|
||||
private void SelectCharacter(Character character)
|
||||
{
|
||||
if (ConversationAction.IsDialogOpen) { return; }
|
||||
if (!AllowCharacterSwitch) { return; }
|
||||
//make the previously selected character wait in place for some time
|
||||
//(so they don't immediately start idling and walking away from their station)
|
||||
@@ -1256,7 +1195,7 @@ namespace Barotrauma
|
||||
WasCommandInterfaceDisabledThisUpdate = false;
|
||||
|
||||
if (PlayerInput.KeyDown(InputType.Command) && (GUI.KeyboardDispatcher.Subscriber == null || GUI.KeyboardDispatcher.Subscriber == crewList) &&
|
||||
commandFrame == null && !clicklessSelectionActive && CanIssueOrders)
|
||||
commandFrame == null && !clicklessSelectionActive && CanIssueOrders && !(GameMain.GameSession?.Campaign?.ShowCampaignUI ?? false))
|
||||
{
|
||||
if (PlayerInput.KeyDown(Keys.LeftShift) || PlayerInput.KeyDown(Keys.RightShift))
|
||||
{
|
||||
@@ -1574,32 +1513,32 @@ namespace Barotrauma
|
||||
get
|
||||
{
|
||||
#if DEBUG
|
||||
return Character.Controlled == null || Character.Controlled.Info != null && Character.Controlled.SpeechImpediment < 100.0f;
|
||||
#else
|
||||
return Character.Controlled?.Info != null && Character.Controlled.SpeechImpediment < 100.0f;
|
||||
if (Character.Controlled == null) { return true; }
|
||||
#endif
|
||||
return Character.Controlled?.Info != null && Character.Controlled.SpeechImpediment < 100.0f;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanSomeoneHearCharacter()
|
||||
{
|
||||
#if DEBUG
|
||||
return true;
|
||||
#else
|
||||
return Character.Controlled != null && characters.Any(c => c != Character.Controlled && c.CanHearCharacter(Character.Controlled));
|
||||
if (Character.Controlled == null) { return true; }
|
||||
#endif
|
||||
return Character.Controlled != null && characters.Any(c => c != Character.Controlled && c.CanHearCharacter(Character.Controlled));
|
||||
}
|
||||
|
||||
private Entity FindEntityContext()
|
||||
{
|
||||
if (Character.Controlled?.FocusedCharacter != null)
|
||||
if (Character.Controlled?.FocusedCharacter is Character focusedCharacter && !focusedCharacter.IsDead &&
|
||||
HumanAIController.IsFriendly(Character.Controlled, focusedCharacter) && Character.Controlled.TeamID == focusedCharacter.TeamID)
|
||||
{
|
||||
if (Character.Controlled?.FocusedItem != null)
|
||||
{
|
||||
Vector2 mousePos = GameMain.GameScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||
if (Vector2.Distance(mousePos, Character.Controlled.FocusedCharacter.WorldPosition) < Vector2.Distance(mousePos, Character.Controlled.FocusedItem.WorldPosition))
|
||||
if (Vector2.Distance(mousePos, focusedCharacter.WorldPosition) < Vector2.Distance(mousePos, Character.Controlled.FocusedItem.WorldPosition))
|
||||
{
|
||||
return Character.Controlled.FocusedCharacter;
|
||||
return focusedCharacter;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1608,7 +1547,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
return Character.Controlled.FocusedCharacter;
|
||||
return focusedCharacter;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1677,24 +1616,22 @@ namespace Barotrauma
|
||||
"CommandNodeContainer",
|
||||
scaleToFit: true)
|
||||
{
|
||||
Color = characterContext.Info.Job.Prefab.UIColor * nodeColorMultiplier,
|
||||
HoverColor = characterContext.Info.Job.Prefab.UIColor,
|
||||
Color = characterContext.Info?.Job?.Prefab != null ? characterContext.Info.Job.Prefab.UIColor * nodeColorMultiplier : Color.White,
|
||||
HoverColor = characterContext.Info?.Job?.Prefab != null ? characterContext.Info.Job.Prefab.UIColor : Color.White,
|
||||
UserData = "colorsource"
|
||||
};
|
||||
// Character icon
|
||||
new GUICustomComponent(
|
||||
var characterIcon = new GUICustomComponent(
|
||||
new RectTransform(Vector2.One, startNode.RectTransform, anchor: Anchor.Center),
|
||||
(spriteBatch, _) =>
|
||||
{
|
||||
if (!(entityContext is Character character)) { return; }
|
||||
if (!(entityContext is Character character) || character?.Info == null) { return; }
|
||||
var node = startNode;
|
||||
character.Info.DrawJobIcon(spriteBatch,
|
||||
new Rectangle((int)(node.Rect.X + node.Rect.Width * 0.5f), (int)(node.Rect.Y + node.Rect.Height * 0.1f), (int)(node.Rect.Width * 0.6f), (int)(node.Rect.Height * 0.8f)));
|
||||
character.Info.DrawIcon(spriteBatch, new Vector2(node.Rect.X + node.Rect.Width * 0.35f, node.Center.Y), node.Rect.Size.ToVector2() * 0.7f);
|
||||
})
|
||||
{
|
||||
ToolTip = characterContext.Info.DisplayName + " (" + characterContext.Info.Job.Name + ")"
|
||||
};
|
||||
});
|
||||
SetCharacterTooltip(characterIcon, entityContext as Character);
|
||||
}
|
||||
SetCenterNode(startNode);
|
||||
|
||||
@@ -1934,7 +1871,7 @@ namespace Barotrauma
|
||||
c.HoverColor = c.Color;
|
||||
c.PressedColor = c.Color;
|
||||
c.SelectedColor = c.Color;
|
||||
c.ToolTip = characterContext != null ? characterContext.Info.DisplayName + " (" + characterContext.Info.Job.Name + ")" : null;
|
||||
SetCharacterTooltip(c, characterContext);
|
||||
}
|
||||
node.OnClicked = null;
|
||||
centerNode = node;
|
||||
@@ -2040,7 +1977,7 @@ namespace Barotrauma
|
||||
var reactorOutput = -reactor.CurrPowerConsumption;
|
||||
// If player is not an engineer AND the reactor is not powered up AND nobody is using the reactor
|
||||
// ---> Create shortcut node for "Operate Reactor" order's "Power Up" option
|
||||
if ((Character.Controlled == null || Character.Controlled.Info.Job.Prefab != JobPrefab.Get("engineer")) &&
|
||||
if ((Character.Controlled == null || Character.Controlled.Info?.Job?.Prefab != JobPrefab.Get("engineer")) &&
|
||||
reactorOutput < float.Epsilon && characters.None(c => c.SelectedConstruction == reactor.Item))
|
||||
{
|
||||
var order = new Order(Order.GetPrefab("operatereactor"), reactor.Item, reactor, Character.Controlled);
|
||||
@@ -2053,7 +1990,7 @@ namespace Barotrauma
|
||||
// TODO: Reconsider the conditions as bot captain can have the nav term selected without operating it
|
||||
// If player is not a captain AND nobody is using the nav terminal AND the nav terminal is powered up
|
||||
// --> Create shortcut node for Steer order
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info.Job.Prefab != JobPrefab.Get("captain")) &&
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info?.Job?.Prefab != JobPrefab.Get("captain")) &&
|
||||
sub.GetItems(false).Find(i => i.HasTag("navterminal") && !i.NonInteractable) is Item nav && characters.None(c => c.SelectedConstruction == nav) &&
|
||||
nav.GetComponent<Steering>() is Steering steering && steering.Voltage > steering.MinVoltage)
|
||||
{
|
||||
@@ -2063,7 +2000,7 @@ namespace Barotrauma
|
||||
|
||||
// If player is not a security officer AND invaders are reported
|
||||
// --> Create shorcut node for Fight Intruders order
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info.Job.Prefab != JobPrefab.Get("securityofficer")) &&
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info?.Job?.Prefab != JobPrefab.Get("securityofficer")) &&
|
||||
(Order.GetPrefab("reportintruders") is Order reportIntruders && ActiveOrders.Any(o => o.First.Prefab == reportIntruders)))
|
||||
{
|
||||
shortcutNodes.Add(
|
||||
@@ -2072,7 +2009,7 @@ namespace Barotrauma
|
||||
|
||||
// If player is not a mechanic AND a breach has been reported
|
||||
// --> Create shorcut node for Fix Leaks order
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info.Job.Prefab != JobPrefab.Get("mechanic")) &&
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info?.Job?.Prefab != JobPrefab.Get("mechanic")) &&
|
||||
(Order.GetPrefab("reportbreach") is Order reportBreach && ActiveOrders.Any(o => o.First.Prefab == reportBreach)))
|
||||
{
|
||||
shortcutNodes.Add(
|
||||
@@ -2081,7 +2018,7 @@ namespace Barotrauma
|
||||
|
||||
// If player is not an engineer AND broken devices have been reported
|
||||
// --> Create shortcut node for Repair Damaged Systems order
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info.Job.Prefab != JobPrefab.Get("engineer")) &&
|
||||
if (shortcutNodes.Count < maxShorcutNodeCount && (Character.Controlled == null || Character.Controlled.Info?.Job?.Prefab != JobPrefab.Get("engineer")) &&
|
||||
(Order.GetPrefab("reportbrokendevices") is Order reportBrokenDevices && ActiveOrders.Any(o => o.First.Prefab == reportBrokenDevices)))
|
||||
{
|
||||
shortcutNodes.Add(
|
||||
@@ -2741,11 +2678,11 @@ namespace Barotrauma
|
||||
};
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
bool canHear = true;
|
||||
#else
|
||||
bool canHear = character.CanHearCharacter(Character.Controlled);
|
||||
#if DEBUG
|
||||
if (Character.Controlled == null) { canHear = true; }
|
||||
#endif
|
||||
|
||||
if (!canHear)
|
||||
{
|
||||
node.CanBeFocused = orderIcon.CanBeFocused = false;
|
||||
@@ -2904,18 +2841,29 @@ namespace Barotrauma
|
||||
return sub;
|
||||
}
|
||||
|
||||
private void SetCharacterTooltip(GUIComponent component, Character character)
|
||||
{
|
||||
if (component == null) { return; }
|
||||
var tooltip = character?.Info != null ? characterContext.Info.DisplayName : null;
|
||||
if (string.IsNullOrWhiteSpace(tooltip)) { component.ToolTip = tooltip; return; }
|
||||
if (character.Info?.Job != null && !string.IsNullOrWhiteSpace(characterContext.Info.Job.Name)) { tooltip += " (" + characterContext.Info.Job.Name + ")"; }
|
||||
component.ToolTip = tooltip;
|
||||
}
|
||||
|
||||
#region Crew Member Assignment Logic
|
||||
|
||||
private Character GetCharacterForQuickAssignment(Order order)
|
||||
{
|
||||
var controllingCharacter = Character.Controlled != null;
|
||||
#if !DEBUG
|
||||
if (Character.Controlled == null) { return null; }
|
||||
if (!controllingCharacter) { return null; }
|
||||
#endif
|
||||
if (order.Category == OrderCategory.Operate && HumanAIController.IsItemOperatedByAnother(null, order.TargetItemComponent, out Character operatingCharacter))
|
||||
if (order.Category == OrderCategory.Operate && HumanAIController.IsItemOperatedByAnother(null, order.TargetItemComponent, out Character operatingCharacter) &&
|
||||
(!controllingCharacter || operatingCharacter.CanHearCharacter(Character.Controlled)))
|
||||
{
|
||||
return operatingCharacter;
|
||||
}
|
||||
return GetCharactersSortedForOrder(order, false).FirstOrDefault() ?? Character.Controlled;
|
||||
return GetCharactersSortedForOrder(order, false).FirstOrDefault(c => !controllingCharacter || c.CanHearCharacter(Character.Controlled)) ?? Character.Controlled;
|
||||
}
|
||||
|
||||
private List<Character> GetCharactersForManualAssignment(Order order)
|
||||
@@ -2934,11 +2882,17 @@ namespace Barotrauma
|
||||
private IEnumerable<Character> GetCharactersSortedForOrder(Order order, bool includeSelf)
|
||||
{
|
||||
return characters.FindAll(c => Character.Controlled == null || ((includeSelf || c != Character.Controlled) && c.TeamID == Character.Controlled.TeamID))
|
||||
// 1. Prioritize those who are already ordered to operate the item target of the new 'operate' order
|
||||
.OrderByDescending(c => c.CurrentOrder != null && order.Category == OrderCategory.Operate && c.CurrentOrder.Identifier == order.Identifier && c.CurrentOrder.TargetEntity == order.TargetEntity)
|
||||
// 2. Prioritize those who are currently dismissed
|
||||
.ThenByDescending(c => c.CurrentOrder == null || c.CurrentOrder.Identifier == dismissedOrderPrefab.Identifier)
|
||||
// 3. Prioritize those who are not currently assigned with the same type of order (for example, when giving a 'Fix Leak' order, prioritize those who have a different order)
|
||||
.ThenBy(c => c.CurrentOrder != null && c.CurrentOrder.Identifier == order.Identifier && c.CurrentOrder.TargetEntity == order.TargetEntity)
|
||||
// 4. Prioritize those with the appropriate job for the order
|
||||
.ThenByDescending(c => order.HasAppropriateJob(c))
|
||||
// 5. Prioritize those with the lowest "weight" of the current order
|
||||
.ThenBy(c => c.CurrentOrder?.Weight)
|
||||
// 6. Prioritize those with the best skill for the order
|
||||
.ThenByDescending(c => c.GetSkillLevel(order.AppropriateSkill));
|
||||
}
|
||||
|
||||
@@ -3013,40 +2967,7 @@ namespace Barotrauma
|
||||
public void InitSinglePlayerRound()
|
||||
{
|
||||
crewList.ClearChildren();
|
||||
characters.Clear();
|
||||
|
||||
WayPoint[] waypoints = WayPoint.SelectCrewSpawnPoints(characterInfos, Submarine.MainSub);
|
||||
|
||||
for (int i = 0; i < waypoints.Length; i++)
|
||||
{
|
||||
Character character;
|
||||
character = Character.Create(characterInfos[i], waypoints[i].WorldPosition, characterInfos[i].Name);
|
||||
|
||||
if (character.Info != null)
|
||||
{
|
||||
if (!character.Info.StartItemsGiven && character.Info.InventoryData != null)
|
||||
{
|
||||
DebugConsole.ThrowError($"Error when initializing a single player round: character \"{character.Name}\" has not been given their initial items but has saved inventory data. Using the saved inventory data instead of giving the character new items.");
|
||||
}
|
||||
if (character.Info.InventoryData != null)
|
||||
{
|
||||
character.Info.SpawnInventoryItems(character.Inventory, character.Info.InventoryData);
|
||||
}
|
||||
else if (!character.Info.StartItemsGiven)
|
||||
{
|
||||
character.GiveJobItems(waypoints[i]);
|
||||
}
|
||||
character.Info.StartItemsGiven = true;
|
||||
}
|
||||
|
||||
AddCharacter(character);
|
||||
if (i == 0)
|
||||
{
|
||||
Character.Controlled = character;
|
||||
}
|
||||
}
|
||||
|
||||
conversationTimer = Rand.Range(5.0f, 10.0f);
|
||||
InitRound();
|
||||
}
|
||||
|
||||
public void EndRound()
|
||||
@@ -3072,10 +2993,9 @@ namespace Barotrauma
|
||||
foreach (CharacterInfo ci in characterInfos)
|
||||
{
|
||||
var infoElement = ci.Save(element);
|
||||
if (ci.InventoryData != null)
|
||||
{
|
||||
infoElement.Add(ci.InventoryData);
|
||||
}
|
||||
if (ci.InventoryData != null) { infoElement.Add(ci.InventoryData); }
|
||||
if (ci.HealthData != null) { infoElement.Add(ci.HealthData); }
|
||||
if (ci.LastControlled) { infoElement.Add(new XAttribute("lastcontrolled", true)); }
|
||||
}
|
||||
parentElement.Add(element);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user