Unstable 0.1500.7.0 (No edition)
This commit is contained in:
@@ -444,9 +444,9 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public virtual void DrawHUD(SpriteBatch spriteBatch, Character character) { }
|
||||
|
||||
public virtual void AddToGUIUpdateList()
|
||||
public virtual void AddToGUIUpdateList(int order = 0)
|
||||
{
|
||||
GuiFrame?.AddToGUIUpdateList();
|
||||
GuiFrame?.AddToGUIUpdateList(order: order);
|
||||
}
|
||||
|
||||
public virtual void UpdateHUD(Character character, float deltaTime, Camera cam) { }
|
||||
|
||||
@@ -410,13 +410,13 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
public override void AddToGUIUpdateList(int order = 0)
|
||||
{
|
||||
base.AddToGUIUpdateList();
|
||||
hullInfoFrame.AddToGUIUpdateList(order: 1);
|
||||
base.AddToGUIUpdateList(order);
|
||||
hullInfoFrame.AddToGUIUpdateList(order: order + 1);
|
||||
if (currentMode == MiniMapMode.ItemFinder && searchBar.Selected)
|
||||
{
|
||||
searchAutoComplete.AddToGUIUpdateList(order: 1);
|
||||
searchAutoComplete.AddToGUIUpdateList(order: order + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace Barotrauma.Items.Components
|
||||
currentTarget?.UpdateHUD(cam, character,deltaTime);
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
public override void AddToGUIUpdateList(int order = 0)
|
||||
{
|
||||
currentTarget?.AddToGUIUpdateList();
|
||||
currentTarget?.AddToGUIUpdateList(order: -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +88,6 @@ namespace Barotrauma.Items.Components
|
||||
return character == Character.Controlled && character == user && character.SelectedConstruction == item;
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
{
|
||||
GuiFrame?.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
public override void UpdateHUD(Character character, float deltaTime, Camera cam)
|
||||
{
|
||||
if (character != Character.Controlled || character != user || character.SelectedConstruction != item) { return; }
|
||||
|
||||
@@ -118,9 +118,9 @@ namespace Barotrauma.Items.Components
|
||||
// This method is overrided instead of the UpdateHUD method because this ensures the input box is selected
|
||||
// even when the terminal component is selected for the very first time. Doing the input box selection in the
|
||||
// UpdateHUD method only selects the input box on every terminal selection except for the very first time.
|
||||
public override void AddToGUIUpdateList()
|
||||
public override void AddToGUIUpdateList(int order = 0)
|
||||
{
|
||||
base.AddToGUIUpdateList();
|
||||
base.AddToGUIUpdateList(order: order);
|
||||
if (shouldSelectInputBox)
|
||||
{
|
||||
inputBox.Select();
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Wearable
|
||||
{
|
||||
private void GetDamageModifierText(ref string description, float damageMultiplier, string afflictionIdentifier)
|
||||
private void GetDamageModifierText(ref string description, DamageModifier damageModifier, string afflictionIdentifier)
|
||||
{
|
||||
int roundedValue = (int)Math.Round((1 - damageMultiplier) * 100);
|
||||
int roundedValue = (int)Math.Round((1 - damageModifier.DamageMultiplier * damageModifier.ProbabilityMultiplier) * 100);
|
||||
if (roundedValue == 0) { return; }
|
||||
string colorStr = XMLExtensions.ColorToString(GUI.Style.Green);
|
||||
description += $"\n ‖color:{colorStr}‖{roundedValue.ToString("-0;+#")}%‖color:end‖ {AfflictionPrefab.List.FirstOrDefault(ap => ap.Identifier.Equals(afflictionIdentifier, StringComparison.OrdinalIgnoreCase))?.Name ?? afflictionIdentifier}";
|
||||
@@ -15,7 +15,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void AddTooltipInfo(ref string name, ref string description)
|
||||
{
|
||||
if (damageModifiers.Any(d => !MathUtils.NearlyEqual(d.DamageMultiplier, 1f)) || SkillModifiers.Any())
|
||||
if (damageModifiers.Any(d => !MathUtils.NearlyEqual(d.DamageMultiplier, 1f) || !MathUtils.NearlyEqual(d.ProbabilityMultiplier, 1f)) || SkillModifiers.Any())
|
||||
{
|
||||
description += "\n";
|
||||
}
|
||||
@@ -31,11 +31,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
foreach (string afflictionIdentifier in damageModifier.ParsedAfflictionIdentifiers)
|
||||
{
|
||||
GetDamageModifierText(ref description, damageModifier.DamageMultiplier, afflictionIdentifier);
|
||||
GetDamageModifierText(ref description, damageModifier, afflictionIdentifier);
|
||||
}
|
||||
foreach (string afflictionIdentifier in damageModifier.ParsedAfflictionTypes)
|
||||
{
|
||||
GetDamageModifierText(ref description, damageModifier.DamageMultiplier, afflictionIdentifier);
|
||||
GetDamageModifierText(ref description, damageModifier, afflictionIdentifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +601,10 @@ namespace Barotrauma
|
||||
{
|
||||
var slotRef = new SlotReference(this, slot, slotIndex, isSubSlot, slots[slotIndex].FirstOrDefault()?.GetComponent<ItemContainer>()?.Inventory);
|
||||
if (Screen.Selected is SubEditorScreen editor && !editor.WiringMode && slotRef.ParentInventory is CharacterInventory) { return; }
|
||||
selectedSlot = slotRef;
|
||||
if (CanSelectSlot(slotRef))
|
||||
{
|
||||
selectedSlot = slotRef;
|
||||
}
|
||||
}
|
||||
|
||||
if (!DraggingItems.Any())
|
||||
@@ -1302,39 +1305,46 @@ namespace Barotrauma
|
||||
DraggingItems.Clear();
|
||||
}
|
||||
|
||||
if (selectedSlot != null)
|
||||
if (selectedSlot != null && !CanSelectSlot(selectedSlot))
|
||||
{
|
||||
if (!selectedSlot.Slot.MouseOn())
|
||||
selectedSlot = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CanSelectSlot(SlotReference selectedSlot)
|
||||
{
|
||||
if (!selectedSlot.Slot.MouseOn())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var rootOwner = (selectedSlot.ParentInventory?.Owner as Item)?.GetRootInventoryOwner();
|
||||
if (selectedSlot.ParentInventory?.Owner != Character.Controlled &&
|
||||
selectedSlot.ParentInventory?.Owner != Character.Controlled.SelectedCharacter &&
|
||||
selectedSlot.ParentInventory?.Owner != Character.Controlled.SelectedConstruction &&
|
||||
!(Character.Controlled.SelectedConstruction?.linkedTo.Contains(selectedSlot.ParentInventory?.Owner) ?? false) &&
|
||||
rootOwner != Character.Controlled &&
|
||||
rootOwner != Character.Controlled.SelectedCharacter &&
|
||||
rootOwner != Character.Controlled.SelectedConstruction &&
|
||||
!(Character.Controlled.SelectedConstruction?.linkedTo.Contains(rootOwner) ?? false))
|
||||
{
|
||||
selectedSlot = null;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
var parentItem = (selectedSlot?.ParentInventory?.Owner as Item) ?? selectedSlot?.Item;
|
||||
if ((parentItem?.GetRootInventoryOwner() is Character ownerCharacter) &&
|
||||
ownerCharacter == Character.Controlled &&
|
||||
CharacterHealth.OpenHealthWindow?.Character != ownerCharacter &&
|
||||
ownerCharacter.Inventory.IsInLimbSlot(parentItem, InvSlotType.HealthInterface))
|
||||
{
|
||||
var rootOwner = (selectedSlot.ParentInventory?.Owner as Item)?.GetRootInventoryOwner();
|
||||
if (selectedSlot.ParentInventory?.Owner != Character.Controlled &&
|
||||
selectedSlot.ParentInventory?.Owner != Character.Controlled.SelectedCharacter &&
|
||||
selectedSlot.ParentInventory?.Owner != Character.Controlled.SelectedConstruction &&
|
||||
!(Character.Controlled.SelectedConstruction?.linkedTo.Contains(selectedSlot.ParentInventory?.Owner) ?? false) &&
|
||||
rootOwner != Character.Controlled &&
|
||||
rootOwner != Character.Controlled.SelectedCharacter &&
|
||||
rootOwner != Character.Controlled.SelectedConstruction &&
|
||||
!(Character.Controlled.SelectedConstruction?.linkedTo.Contains(rootOwner) ?? false))
|
||||
{
|
||||
selectedSlot = null;
|
||||
}
|
||||
var parentItem = (selectedSlot?.ParentInventory?.Owner as Item) ?? selectedSlot?.Item;
|
||||
if ((parentItem?.GetRootInventoryOwner() is Character ownerCharacter) &&
|
||||
ownerCharacter == Character.Controlled &&
|
||||
CharacterHealth.OpenHealthWindow?.Character != ownerCharacter &&
|
||||
ownerCharacter.Inventory.IsInLimbSlot(parentItem, InvSlotType.HealthInterface))
|
||||
{
|
||||
highlightedSubInventorySlots.RemoveWhere(s => s.Item == parentItem);
|
||||
selectedSlot = null;
|
||||
}
|
||||
highlightedSubInventorySlots.RemoveWhere(s => s.Item == parentItem);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected static Rectangle GetSubInventoryHoverArea(SlotReference subSlot)
|
||||
{
|
||||
Rectangle hoverArea;
|
||||
@@ -1548,7 +1558,7 @@ namespace Barotrauma
|
||||
var indicatorStyle = GUI.Style.GetComponentStyle("ContainedStateIndicator.Default");
|
||||
Sprite indicatorSprite = indicatorStyle?.GetDefaultSprite();
|
||||
Sprite emptyIndicatorSprite = indicatorStyle?.GetSprite(GUIComponent.ComponentState.Hover);
|
||||
DrawItemStateIndicator(spriteBatch, inventory, indicatorSprite, emptyIndicatorSprite, conditionIndicatorArea, item.Condition / item.MaxCondition);
|
||||
DrawItemStateIndicator(spriteBatch, inventory, indicatorSprite, emptyIndicatorSprite, conditionIndicatorArea, item.Condition / item.MaxCondition);
|
||||
}
|
||||
|
||||
if (itemContainer != null && itemContainer.ShowContainedStateIndicator)
|
||||
@@ -1591,6 +1601,19 @@ namespace Barotrauma
|
||||
DrawItemStateIndicator(spriteBatch, inventory, indicatorSprite, emptyIndicatorSprite, containedIndicatorArea, containedState,
|
||||
pulsate: !usingDefaultSprite && containedState >= 0.0f && containedState < 0.25f && inventory == Character.Controlled?.Inventory && Character.Controlled.HasEquippedItem(item));
|
||||
}
|
||||
|
||||
if (item.Quality != 0)
|
||||
{
|
||||
var style = GUI.Style.GetComponentStyle("InnerGlowSmall");
|
||||
if (style == null)
|
||||
{
|
||||
GUI.DrawRectangle(spriteBatch, rect, GUI.Style.GetQualityColor(item.Quality) * 0.7f);
|
||||
}
|
||||
else
|
||||
{
|
||||
style.Sprites[GUIComponent.ComponentState.None].FirstOrDefault()?.Draw(spriteBatch, rect, GUI.Style.GetQualityColor(item.Quality) * 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1199,7 +1199,7 @@ namespace Barotrauma
|
||||
return texts;
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
public override void AddToGUIUpdateList(int order = 0)
|
||||
{
|
||||
if (Screen.Selected is SubEditorScreen)
|
||||
{
|
||||
@@ -1231,7 +1231,7 @@ namespace Barotrauma
|
||||
bool wasUsingAlternativeLayout = ic.UseAlternativeLayout;
|
||||
ic.UseAlternativeLayout = useAlternativeLayout;
|
||||
needsLayoutUpdate |= ic.UseAlternativeLayout != wasUsingAlternativeLayout;
|
||||
ic.AddToGUIUpdateList();
|
||||
ic.AddToGUIUpdateList(order);
|
||||
}
|
||||
|
||||
if (itemInUseWarning != null && itemInUseWarning.Visible)
|
||||
|
||||
Reference in New Issue
Block a user