Unstable 0.15.11.0 + the last 2 unstables I missed
This commit is contained in:
@@ -1113,7 +1113,7 @@ namespace Barotrauma
|
||||
}
|
||||
if (wearableItemComponent.AllowedSlots.Contains(InvSlotType.Bag))
|
||||
{
|
||||
depth -= depthStep * 2;
|
||||
depth -= depthStep * 4;
|
||||
}
|
||||
wearableColor = wearableItemComponent.Item.GetSpriteColor();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Barotrauma
|
||||
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
ushort targetItemCount = msg.ReadUInt16();
|
||||
for (int i = 0; i < targetItemCount; i++)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
existingTargets.Clear();
|
||||
spawnedTargets.Clear();
|
||||
allTargets.Clear();
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class BeaconMission : Mission
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ namespace Barotrauma
|
||||
}
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
items.Clear();
|
||||
ushort itemCount = msg.ReadUInt16();
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
|
||||
@@ -20,10 +20,5 @@ namespace Barotrauma
|
||||
return descriptions[GameMain.Client.Character.TeamID == CharacterTeamType.Team1 ? 1 : 2];
|
||||
}
|
||||
}
|
||||
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
|
||||
byte characterCount = msg.ReadByte();
|
||||
|
||||
for (int i = 0; i < characterCount; i++)
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
byte caveCount = msg.ReadByte();
|
||||
for (int i = 0; i < caveCount; i++)
|
||||
{
|
||||
|
||||
@@ -102,6 +102,9 @@ namespace Barotrauma
|
||||
State = msg.ReadInt16();
|
||||
}
|
||||
|
||||
public abstract void ClientReadInitial(IReadMessage msg);
|
||||
public virtual void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
state = msg.ReadInt16();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
byte monsterCount = msg.ReadByte();
|
||||
for (int i = 0; i < monsterCount; i++)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
byte selectedCaveIndex = msg.ReadByte();
|
||||
nestPosition = new Vector2(
|
||||
msg.ReadSingle(),
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
// duplicate code from escortmission, should possibly be combined, though additional loot items might be added so maybe not
|
||||
byte characterCount = msg.ReadByte();
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
bool usedExistingItem = msg.ReadBoolean();
|
||||
if (usedExistingItem)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Barotrauma
|
||||
|
||||
public override void ClientReadInitial(IReadMessage msg)
|
||||
{
|
||||
base.ClientReadInitial(msg);
|
||||
startingItems.Clear();
|
||||
ushort itemCount = msg.ReadUInt16();
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
|
||||
@@ -1287,9 +1287,11 @@ namespace Barotrauma
|
||||
GUITextBlock traitBlock = new GUITextBlock(new RectTransform(Vector2.One, nameLayout.RectTransform), traitString, font: GUI.SmallFont);
|
||||
traitBlock.RectTransform.NonScaledSize = traitSize.Pad(traitBlock.Padding).ToPoint();
|
||||
|
||||
GUIFrame endocrineFrame = new GUIFrame(new RectTransform(new Vector2(1f, 0.35f), nameLayout.RectTransform, Anchor.BottomCenter), style: null);
|
||||
|
||||
if (!(GameMain.NetworkMember is null))
|
||||
{
|
||||
GUIButton newCharacterBox = new GUIButton(new RectTransform(Vector2.One, nameLayout.RectTransform, Anchor.BottomCenter), text: GameMain.NetLobbyScreen.CampaignCharacterDiscarded ? TextManager.Get("settings") : TextManager.Get("createnew"))
|
||||
GUIButton newCharacterBox = new GUIButton(new RectTransform(new Vector2(0.675f, 1f), endocrineFrame.RectTransform, Anchor.TopLeft), text: GameMain.NetLobbyScreen.CampaignCharacterDiscarded ? TextManager.Get("settings") : TextManager.Get("createnew"))
|
||||
{
|
||||
IgnoreLayoutGroups = true
|
||||
};
|
||||
@@ -1336,6 +1338,16 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<TalentPrefab> endocrineTalents = info.GetEndocrineTalents().Select(e => TalentPrefab.TalentPrefabs.Find(c => c.Identifier.Equals(e, StringComparison.OrdinalIgnoreCase)));
|
||||
|
||||
if (endocrineTalents.Count() > 0)
|
||||
{
|
||||
GUIImage endocrineIcon = new GUIImage(new RectTransform(new Vector2(0.275f, 1f), endocrineFrame.RectTransform, anchor: Anchor.TopRight, scaleBasis: ScaleBasis.Normal), style: "EndocrineReminderIcon")
|
||||
{
|
||||
ToolTip = $"{TextManager.Get("afflictionname.endocrineboost")}\n\n{string.Join(", ", endocrineTalents.Select(e => e.DisplayName))}"
|
||||
};
|
||||
}
|
||||
|
||||
GUILayoutGroup skillLayout = new GUILayoutGroup(new RectTransform(new Vector2(0.45f, 1f), talentInfoLayoutGroup.RectTransform)) { Stretch = true };
|
||||
|
||||
string skillString = TextManager.Get("skills");
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadKeyBinds(XElement element)
|
||||
private void LoadKeyBinds(XElement element, Version gameVersion)
|
||||
{
|
||||
foreach (XAttribute attribute in element.Attributes())
|
||||
{
|
||||
@@ -183,7 +183,6 @@ namespace Barotrauma
|
||||
keyMapping[(int)InputType.TakeHalfFromInventorySlot] = new KeyOrMouse(Keys.LeftShift);
|
||||
keyMapping[(int)InputType.TakeOneFromInventorySlot] = new KeyOrMouse(Keys.LeftControl);
|
||||
}
|
||||
|
||||
if (!Enum.TryParse(attribute.Name.ToString(), true, out InputType inputType)) { continue; }
|
||||
|
||||
if (int.TryParse(attribute.Value.ToString(), out int mouseButtonInt))
|
||||
@@ -199,6 +198,13 @@ namespace Barotrauma
|
||||
keyMapping[(int)inputType] = new KeyOrMouse(key);
|
||||
}
|
||||
}
|
||||
//v0.15 added creature attacks that can be used with a character capable of speaking (with mudraptor or spineling genes),
|
||||
//which causes the previous attack keybind R to conflict with the radio keybind
|
||||
// -> automatically change it to F
|
||||
if (gameVersion < new Version(0, 15, 0, 0))
|
||||
{
|
||||
keyMapping[(int)InputType.Attack] = new KeyOrMouse(Keys.F);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadInventoryKeybinds(XElement element)
|
||||
@@ -223,10 +229,12 @@ namespace Barotrauma
|
||||
|
||||
private void LoadControls(XDocument doc)
|
||||
{
|
||||
var gameVersion = new Version(doc.Root.GetAttributeString("gameversion", "0.0.0.0"));
|
||||
|
||||
XElement keyMapping = doc.Root.Element("keymapping");
|
||||
if (keyMapping != null)
|
||||
{
|
||||
LoadKeyBinds(keyMapping);
|
||||
LoadKeyBinds(keyMapping, gameVersion);
|
||||
}
|
||||
|
||||
XElement inventoryKeyMapping = doc.Root.Element("inventorykeymapping");
|
||||
|
||||
@@ -147,14 +147,14 @@ namespace Barotrauma.Items.Components
|
||||
private GUIFrame submarineContainer;
|
||||
|
||||
private GUIFrame hullInfoFrame;
|
||||
private GUIScissorComponent scissorComponent;
|
||||
private GUIComponent miniMapContainer;
|
||||
private GUIScissorComponent? scissorComponent;
|
||||
private GUIComponent? miniMapContainer;
|
||||
private GUIComponent miniMapFrame;
|
||||
private GUIComponent electricalFrame;
|
||||
private GUILayoutGroup reportFrame;
|
||||
private GUILayoutGroup searchBarFrame;
|
||||
private GUITextBox searchBar;
|
||||
private GUIComponent searchAutoComplete;
|
||||
private GUIComponent? searchAutoComplete;
|
||||
|
||||
private ItemPrefab? searchedPrefab;
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace Barotrauma.Items.Components
|
||||
private ImmutableDictionary<MiniMapGUIComponent, GUIComponent> electricalChildren;
|
||||
private ImmutableDictionary<MiniMapGUIComponent, GUIComponent> doorChildren;
|
||||
|
||||
private ImmutableHashSet<ItemPrefab> itemsFoundOnSub;
|
||||
private ImmutableHashSet<ItemPrefab>? itemsFoundOnSub;
|
||||
|
||||
private ImmutableHashSet<Vector2>? MiniMapBlips;
|
||||
private float blipState;
|
||||
@@ -416,7 +416,7 @@ namespace Barotrauma.Items.Components
|
||||
hullInfoFrame.AddToGUIUpdateList(order: order + 1);
|
||||
if (currentMode == MiniMapMode.ItemFinder && searchBar.Selected)
|
||||
{
|
||||
searchAutoComplete.AddToGUIUpdateList(order: order + 1);
|
||||
searchAutoComplete?.AddToGUIUpdateList(order: order + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private void ControlSearchTooltip(GUITextBox sender, Keys key)
|
||||
{
|
||||
if (!searchAutoComplete.Visible) { return; }
|
||||
if (searchAutoComplete is null || !searchAutoComplete.Visible) { return; }
|
||||
GUIListBox listBox = searchAutoComplete.GetChild<GUIListBox>();
|
||||
if (listBox is null) { return; }
|
||||
|
||||
@@ -705,15 +705,17 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private bool UpdateSearchTooltip(GUITextBox box, string text)
|
||||
private bool UpdateSearchTooltip(GUITextBox box, string? text)
|
||||
{
|
||||
if (text is null || itemsFoundOnSub is null || searchAutoComplete is null) { return false; }
|
||||
|
||||
MiniMapBlips = null;
|
||||
searchedPrefab = null;
|
||||
searchAutoComplete.Visible = true;
|
||||
SetAutoCompletePosition(searchAutoComplete, box);
|
||||
|
||||
GUIListBox listBox = searchAutoComplete.GetChild<GUIListBox>();
|
||||
if (listBox is null) { return false; }
|
||||
GUIListBox? listBox = searchAutoComplete.GetChild<GUIListBox>();
|
||||
if (listBox?.Content is null) { return false; }
|
||||
|
||||
bool first = true;
|
||||
|
||||
@@ -722,9 +724,9 @@ namespace Barotrauma.Items.Components
|
||||
foreach (GUIComponent component in listBox.Content.Children)
|
||||
{
|
||||
component.Visible = false;
|
||||
if (component.UserData is ItemPrefab prefab && itemsFoundOnSub.Contains(prefab))
|
||||
if (component.UserData is ItemPrefab { Name: { } prefabName} prefab && itemsFoundOnSub.Contains(prefab))
|
||||
{
|
||||
component.Visible = prefab.Name.ToLower().Contains(text.ToLower());
|
||||
component.Visible = prefabName.ToLower().Contains(text.ToLower());
|
||||
|
||||
if (component.Visible && first)
|
||||
{
|
||||
@@ -828,6 +830,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
MiniMapBlips = positions.ToImmutableHashSet();
|
||||
|
||||
if (searchAutoComplete is null) { return; }
|
||||
searchAutoComplete.Visible = false;
|
||||
}
|
||||
|
||||
@@ -1021,7 +1024,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (Voltage < MinVoltage || !miniMapGuiComponent.RectComponent.Visible) { continue; }
|
||||
|
||||
int durability = (int)(it.Condition / it.MaxCondition * 100f);
|
||||
int durability = (int)(it.Condition / (it.MaxCondition / it.MaxRepairConditionMultiplier) * 100f);
|
||||
Color color = ToolBox.GradientLerp(durability / 100f, GUI.Style.Red, GUI.Style.Orange, GUI.Style.Green, GUI.Style.Green);
|
||||
|
||||
if (GUI.MouseOn == component)
|
||||
@@ -1188,7 +1191,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
|
||||
spriteBatch.End();
|
||||
if (submarinePreview is { } texture)
|
||||
if (submarinePreview is { } texture && miniMapContainer is { } mapContainer)
|
||||
{
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, samplerState: GUI.SamplerState, blendState: BlendState.NonPremultiplied, effect: GameMain.GameScreen.BlueprintEffect, rasterizerState: GameMain.ScissorTestEnable);
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = submarineContainer.Rect;
|
||||
@@ -1200,7 +1203,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f);
|
||||
float scale = currentMode == MiniMapMode.HullStatus ? 1.0f : Zoom;
|
||||
spriteBatch.Draw(texture, miniMapContainer.Center, null, blueprintBlue, 0f, origin, scale, SpriteEffects.None, 0f);
|
||||
spriteBatch.Draw(texture, mapContainer.Center, null, blueprintBlue, 0f, origin, scale, SpriteEffects.None, 0f);
|
||||
|
||||
spriteBatch.End();
|
||||
}
|
||||
|
||||
@@ -52,8 +52,24 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override bool ShouldDrawHUD(Character character)
|
||||
{
|
||||
if (!HasRequiredItems(character, false) || character.SelectedConstruction != item) return false;
|
||||
return item.ConditionPercentage < RepairThreshold || character.IsTraitor && item.ConditionPercentage > MinSabotageCondition || (CurrentFixer == character && (!item.IsFullCondition || (character.IsTraitor && item.ConditionPercentage > MinSabotageCondition))) || IsTinkerable(character);
|
||||
if (!HasRequiredItems(character, false) || character.SelectedConstruction != item) { return false; }
|
||||
if (character.IsTraitor && item.ConditionPercentage > MinSabotageCondition) { return true; }
|
||||
|
||||
float maxRepairConditionMultiplier = GetMaxRepairConditionMultiplier(character);
|
||||
if (item.Condition / maxRepairConditionMultiplier < RepairThreshold) { return true; }
|
||||
|
||||
if (CurrentFixer == character)
|
||||
{
|
||||
float condition = item.Condition / item.MaxRepairConditionMultiplier;
|
||||
float maxCondition = item.MaxCondition / item.MaxRepairConditionMultiplier;
|
||||
if (condition < maxCondition * maxRepairConditionMultiplier)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (IsTinkerable(character)) { return true; }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
partial void InitProjSpecific(XElement element)
|
||||
@@ -344,6 +360,7 @@ namespace Barotrauma.Items.Components
|
||||
ushort currentFixerID = msg.ReadUInt16();
|
||||
currentFixerAction = (FixActions)msg.ReadRangedInteger(0, 2);
|
||||
CurrentFixer = currentFixerID != 0 ? Entity.FindEntityByID(currentFixerID) as Character : null;
|
||||
item.MaxRepairConditionMultiplier = GetMaxRepairConditionMultiplier(CurrentFixer);
|
||||
}
|
||||
|
||||
public void ClientWrite(IWriteMessage msg, object[] extraData = null)
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace Barotrauma.Items.Components
|
||||
public void Draw(SpriteBatch spriteBatch, bool editing, float itemDepth = -1)
|
||||
{
|
||||
if (target == null || target.Removed) { return; }
|
||||
if (target.ParentInventory != null) { return; }
|
||||
|
||||
Vector2 startPos = GetSourcePos();
|
||||
startPos.Y = -startPos.Y;
|
||||
|
||||
@@ -177,6 +177,10 @@ namespace Barotrauma.Items.Components
|
||||
partial void LaunchProjSpecific()
|
||||
{
|
||||
recoilTimer = RetractionTime;
|
||||
if (user != null)
|
||||
{
|
||||
recoilTimer /= 1 + user.GetStatValue(StatTypes.TurretAttackSpeed);
|
||||
}
|
||||
PlaySound(ActionType.OnUse);
|
||||
Vector2 particlePos = GetRelativeFiringPosition(UseFiringOffsetForMuzzleFlash);
|
||||
foreach (ParticleEmitter emitter in particleEmitters)
|
||||
|
||||
@@ -378,6 +378,7 @@ namespace Barotrauma.Particles
|
||||
handleCollision(gapFound, collisionNormal);
|
||||
}
|
||||
|
||||
collisionNormal = Vector2.Zero;
|
||||
if (velocity.X < 0.0f && position.X - prefab.CollisionRadius * size.X < hullRect.X)
|
||||
{
|
||||
if (prefab.DeleteOnCollision) { return UpdateResult.Delete; }
|
||||
|
||||
Reference in New Issue
Block a user