Unstable v0.19.1.0
This commit is contained in:
@@ -173,8 +173,8 @@ namespace Barotrauma
|
||||
{
|
||||
if (character.Info != null && !character.ShouldLockHud() && character.SelectedCharacter == null && Screen.Selected != GameMain.SubEditorScreen)
|
||||
{
|
||||
bool mouseOnPortrait = HUDLayoutSettings.BottomRightInfoArea.Contains(PlayerInput.MousePosition) && GUI.MouseOn == null;
|
||||
if (mouseOnPortrait && PlayerInput.PrimaryMouseButtonClicked())
|
||||
bool mouseOnPortrait = MouseOnCharacterPortrait() && GUI.MouseOn == null;
|
||||
if (mouseOnPortrait && PlayerInput.PrimaryMouseButtonClicked() && Inventory.DraggingItems.None())
|
||||
{
|
||||
CharacterHealth.OpenHealthWindow = character.CharacterHealth;
|
||||
}
|
||||
@@ -491,7 +491,7 @@ namespace Barotrauma
|
||||
character.Info.DrawPortrait(spriteBatch, HUDLayoutSettings.PortraitArea.Location.ToVector2(), new Vector2(-12 * GUI.Scale, yOffset), targetWidth: HUDLayoutSettings.PortraitArea.Width, true, character.Info.IsDisguisedAsAnother);
|
||||
character.Info.DrawForeground(spriteBatch);
|
||||
}
|
||||
mouseOnPortrait = HUDLayoutSettings.BottomRightInfoArea.Contains(PlayerInput.MousePosition) && !character.ShouldLockHud();
|
||||
mouseOnPortrait = MouseOnCharacterPortrait() && !character.ShouldLockHud();
|
||||
if (mouseOnPortrait)
|
||||
{
|
||||
GUIStyle.UIGlow.Draw(spriteBatch, HUDLayoutSettings.BottomRightInfoArea, GUIStyle.Green * 0.5f);
|
||||
@@ -538,6 +538,13 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public static bool MouseOnCharacterPortrait()
|
||||
{
|
||||
if (Character.Controlled == null) { return false; }
|
||||
if (CharacterHealth.OpenHealthWindow != null || Character.Controlled.SelectedCharacter != null) { return false; }
|
||||
return HUDLayoutSettings.BottomRightInfoArea.Contains(PlayerInput.MousePosition);
|
||||
}
|
||||
|
||||
private static void DrawCharacterHoverTexts(SpriteBatch spriteBatch, Camera cam, Character character)
|
||||
{
|
||||
var allItems = character.Inventory?.AllItems;
|
||||
|
||||
@@ -175,6 +175,11 @@ namespace Barotrauma
|
||||
|
||||
AnimController.Frozen = false;
|
||||
Enabled = true;
|
||||
//if we start receiving position updates, it means the character's no longer disabled
|
||||
if (DisabledByEvent && !Removed)
|
||||
{
|
||||
DisabledByEvent = false;
|
||||
}
|
||||
|
||||
UInt16 networkUpdateID = 0;
|
||||
if (msg.ReadBoolean())
|
||||
@@ -534,6 +539,7 @@ namespace Barotrauma
|
||||
Vector2 position = new Vector2(inc.ReadSingle(), inc.ReadSingle());
|
||||
|
||||
bool enabled = inc.ReadBoolean();
|
||||
bool disabledByEvent = inc.ReadBoolean();
|
||||
|
||||
DebugConsole.Log("Received spawn data for " + speciesName);
|
||||
|
||||
@@ -569,7 +575,7 @@ namespace Barotrauma
|
||||
CharacterInfo info = CharacterInfo.ClientRead(infoSpeciesName, inc);
|
||||
try
|
||||
{
|
||||
character = Create(speciesName, position, seed, characterInfo: info, id: id, isRemotePlayer: ownerId > 0 && GameMain.Client.ID != ownerId, hasAi: hasAi);
|
||||
character = Create(speciesName, position, seed, characterInfo: info, id: id, isRemotePlayer: ownerId > 0 && GameMain.Client.SessionId != ownerId, hasAi: hasAi);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -650,7 +656,7 @@ namespace Barotrauma
|
||||
GameMain.GameSession.CrewManager.AddCharacter(character);
|
||||
}
|
||||
|
||||
if (GameMain.Client.ID == ownerId)
|
||||
if (GameMain.Client.SessionId == ownerId)
|
||||
{
|
||||
GameMain.Client.HasSpawned = true;
|
||||
GameMain.Client.Character = character;
|
||||
@@ -667,7 +673,14 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
character.Enabled = Controlled == character || enabled;
|
||||
if (disabledByEvent)
|
||||
{
|
||||
character.DisabledByEvent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
character.Enabled = Controlled == character || enabled;
|
||||
}
|
||||
|
||||
return character;
|
||||
}
|
||||
|
||||
@@ -1461,7 +1461,7 @@ namespace Barotrauma
|
||||
|
||||
description.RectTransform.Resize(new Point(description.Rect.Width, (int)(description.TextSize.Y + 10)));
|
||||
|
||||
int vitalityDecrease = (int)affliction.GetVitalityDecrease(this);
|
||||
int vitalityDecrease = (int)GetVitalityDecreaseWithVitalityMultipliers(affliction);
|
||||
if (vitalityDecrease == 0)
|
||||
{
|
||||
vitality.Visible = false;
|
||||
@@ -1503,7 +1503,7 @@ namespace Barotrauma
|
||||
|
||||
foreach (Affliction affliction in afflictions)
|
||||
{
|
||||
float afflictionVitalityDecrease = affliction.GetVitalityDecrease(this);
|
||||
float afflictionVitalityDecrease = GetVitalityDecreaseWithVitalityMultipliers(affliction);
|
||||
Color afflictionEffectColor = Color.White;
|
||||
if (afflictionVitalityDecrease > 0.0f)
|
||||
{
|
||||
@@ -1586,7 +1586,7 @@ namespace Barotrauma
|
||||
affliction.Strength / affliction.Prefab.MaxStrength);
|
||||
|
||||
var vitalityText = labelContainer.GetChildByUserData("vitality") as GUITextBlock;
|
||||
int vitalityDecrease = (int)affliction.GetVitalityDecrease(this);
|
||||
int vitalityDecrease = (int)GetVitalityDecreaseWithVitalityMultipliers(affliction);
|
||||
if (vitalityDecrease == 0)
|
||||
{
|
||||
vitalityText.Visible = false;
|
||||
@@ -1604,7 +1604,7 @@ namespace Barotrauma
|
||||
{
|
||||
//items can be dropped outside the health window
|
||||
if (!ignoreMousePos &&
|
||||
!healthWindow.Rect.Contains(PlayerInput.MousePosition) )
|
||||
!healthWindow.Rect.Contains(PlayerInput.MousePosition))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1620,10 +1620,10 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
Limb targetLimb = Character.AnimController.Limbs.FirstOrDefault(l => l.HealthIndex == selectedLimbIndex);
|
||||
|
||||
Limb targetLimb =
|
||||
Character.AnimController.Limbs.FirstOrDefault(l => l.HealthIndex == selectedLimbIndex) ??
|
||||
Character.AnimController.MainLimb;
|
||||
item.ApplyTreatment(Character.Controlled, Character, targetLimb);
|
||||
|
||||
return true;
|
||||
}
|
||||
private void UpdateLimbIndicators(float deltaTime, Rectangle drawArea)
|
||||
@@ -1686,7 +1686,7 @@ namespace Barotrauma
|
||||
if (!affliction.ShouldShowIcon(Character)) { continue; }
|
||||
if (!affliction.Prefab.IsBuff)
|
||||
{
|
||||
negativeEffect += affliction.Strength;
|
||||
negativeEffect += affliction.Strength * GetVitalityMultiplier(affliction, limbHealth);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user