Release 1.8.6.2 - Calm Before the Storm
This commit is contained in:
@@ -911,6 +911,11 @@ namespace Barotrauma
|
||||
PauseMenu.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
foreach (var openAccordion in GUIComponent.OpenAccordionPopups)
|
||||
{
|
||||
openAccordion.AddToGUIUpdateList(order: 1);
|
||||
}
|
||||
|
||||
SocialOverlay.Instance?.AddToGuiUpdateList();
|
||||
|
||||
GUIContextMenu.AddActiveToGUIUpdateList();
|
||||
|
||||
@@ -1127,7 +1127,7 @@ namespace Barotrauma
|
||||
component = LoadGUIImage(element, parent);
|
||||
break;
|
||||
case "accordion":
|
||||
return LoadAccordion(element, parent);
|
||||
return LoadAccordion(element, parent, openOnTop: element.GetAttributeBool("openontop", false));
|
||||
case "gridtext":
|
||||
LoadGridText(element, parent);
|
||||
return null;
|
||||
@@ -1147,6 +1147,19 @@ namespace Barotrauma
|
||||
|
||||
component.toolTip = element.GetAttributeString("tooltip", string.Empty);
|
||||
|
||||
GUITextBlock textBlock = component as GUITextBlock ?? (component as GUIButton)?.TextBlock;
|
||||
if (textBlock != null)
|
||||
{
|
||||
if (element.GetAttributeBool("autoscalevertical", false))
|
||||
{
|
||||
textBlock.AutoScaleVertical = true;
|
||||
}
|
||||
if (element.GetAttributeBool("autoscalehorizontal", false))
|
||||
{
|
||||
textBlock.AutoScaleHorizontal = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (element.GetAttributeBool("resizetofitchildren", false))
|
||||
{
|
||||
Vector2 relativeResizeScale = element.GetAttributeVector2("relativeresizescale", Vector2.One);
|
||||
@@ -1209,6 +1222,10 @@ namespace Barotrauma
|
||||
var maxVersion = new Version(attribute.Value);
|
||||
if (GameMain.Version > maxVersion) { return false; }
|
||||
break;
|
||||
case "identifierdismissed":
|
||||
Identifier identifier = element.GetAttributeIdentifier(attribute.Name.ToString(), Identifier.Empty);
|
||||
if (MainMenuScreen.DismissedNotifications.Contains(identifier)) { return false; }
|
||||
break;
|
||||
case "buildconfiguration":
|
||||
switch (attribute.Value.ToString().ToLowerInvariant())
|
||||
{
|
||||
@@ -1286,12 +1303,18 @@ namespace Barotrauma
|
||||
|
||||
private static GUIButton LoadLink(XElement element, RectTransform parent)
|
||||
{
|
||||
Identifier identifier = element.GetAttributeIdentifier("identifier", Identifier.Empty);
|
||||
|
||||
var button = LoadGUIButton(element, parent);
|
||||
string url = element.GetAttributeString("url", "");
|
||||
button.OnClicked = (btn, userdata) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!identifier.IsEmpty)
|
||||
{
|
||||
MainMenuScreen.AddDismissedNotification(identifier);
|
||||
}
|
||||
if (SteamManager.IsInitialized)
|
||||
{
|
||||
SteamManager.OverlayCustomUrl(url);
|
||||
@@ -1348,6 +1371,8 @@ namespace Barotrauma
|
||||
|
||||
private static GUIButton LoadGUIButton(XElement element, RectTransform parent)
|
||||
{
|
||||
Identifier identifier = element.GetAttributeIdentifier("identifier", Identifier.Empty);
|
||||
|
||||
string style = element.GetAttributeString("style", "");
|
||||
if (style == "null") { style = null; }
|
||||
|
||||
@@ -1359,10 +1384,19 @@ namespace Barotrauma
|
||||
element.GetAttributeString("text", "");
|
||||
text = text.Replace(@"\n", "\n");
|
||||
|
||||
return new GUIButton(RectTransform.Load(element, parent),
|
||||
var button = new GUIButton(RectTransform.Load(element, parent),
|
||||
text: text,
|
||||
textAlignment: textAlignment,
|
||||
style: style);
|
||||
button.OnClicked = (btn, userdata) =>
|
||||
{
|
||||
if (!identifier.IsEmpty)
|
||||
{
|
||||
MainMenuScreen.AddDismissedNotification(identifier);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
return button;
|
||||
}
|
||||
|
||||
private static GUIListBox LoadGUIListBox(XElement element, RectTransform parent)
|
||||
@@ -1415,11 +1449,14 @@ namespace Barotrauma
|
||||
{
|
||||
sprite = new Sprite(element);
|
||||
}
|
||||
|
||||
return new GUIImage(RectTransform.Load(element, parent), sprite, scaleToFit: true);
|
||||
var scaleToFit = element.GetAttributeEnum("scaletofit", GUIImage.ScalingMode.ScaleToFitSmallestExtent);
|
||||
return new GUIImage(RectTransform.Load(element, parent), sprite, scaleToFit: scaleToFit);
|
||||
}
|
||||
|
||||
private static GUIButton LoadAccordion(ContentXElement element, RectTransform parent)
|
||||
public static readonly List<GUIComponent> OpenAccordionPopups = new List<GUIComponent>();
|
||||
|
||||
/// <param name="openOnTop">Should the contents of the accordion be forced to open on top of other UI elements?</param>
|
||||
private static GUIButton LoadAccordion(ContentXElement element, RectTransform parent, bool openOnTop)
|
||||
{
|
||||
var button = LoadGUIButton(element, parent);
|
||||
List<GUIComponent> content = new List<GUIComponent>();
|
||||
@@ -1431,6 +1468,7 @@ namespace Barotrauma
|
||||
contentElement.Visible = false;
|
||||
contentElement.IgnoreLayoutGroups = true;
|
||||
content.Add(contentElement);
|
||||
contentElement.UserData = (contentElement.RectTransform.Anchor, contentElement.RectTransform.Pivot);
|
||||
}
|
||||
}
|
||||
button.OnClicked = (btn, userdata) =>
|
||||
@@ -1438,8 +1476,32 @@ namespace Barotrauma
|
||||
bool visible = content.FirstOrDefault()?.Visible ?? true;
|
||||
foreach (GUIComponent contentElement in content)
|
||||
{
|
||||
contentElement.Visible = !visible;
|
||||
contentElement.IgnoreLayoutGroups = !contentElement.Visible;
|
||||
if (openOnTop)
|
||||
{
|
||||
contentElement.rectTransform.Parent = null;
|
||||
//the element is drawn in screen space over anything (no longer a child of the original parent),
|
||||
//we need to calculate the screen space position manually
|
||||
contentElement.rectTransform.SetPosition(Anchor.TopLeft);
|
||||
(Anchor anchor, Pivot pivot) = ((Anchor anchor, Pivot pivot))contentElement.UserData;
|
||||
contentElement.rectTransform.ScreenSpaceOffset =
|
||||
RectTransform.CalculateAnchorPoint(anchor, button.Rect) +
|
||||
RectTransform.CalculatePivotOffset(pivot, contentElement.Rect.Size);
|
||||
contentElement.Visible = true;
|
||||
if (OpenAccordionPopups.Contains(contentElement))
|
||||
{
|
||||
OpenAccordionPopups.Remove(contentElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenAccordionPopups.Clear();
|
||||
OpenAccordionPopups.Add(contentElement);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
contentElement.Visible = !visible;
|
||||
contentElement.IgnoreLayoutGroups = !contentElement.Visible;
|
||||
}
|
||||
}
|
||||
if (button.Parent is GUILayoutGroup layoutGroup)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -14,6 +13,24 @@ namespace Barotrauma
|
||||
|
||||
private static bool loadingTextures;
|
||||
|
||||
public enum ScalingMode
|
||||
{
|
||||
/// <summary>
|
||||
/// No automatic scaling, the image is drawn using <see cref="Scale"/>
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// Automatically scales the image so it fits the smallest extent of the component
|
||||
/// (leaving empty space around the image if its aspect ratio is different than that of the GUIImage)
|
||||
/// </summary>
|
||||
ScaleToFitSmallestExtent,
|
||||
/// <summary>
|
||||
/// Automatically scales the image so it fits the largest extent of the component,
|
||||
/// cutting out the parts that go outside the bounds of the component.
|
||||
/// </summary>
|
||||
ScaleToFitLargestExtent,
|
||||
}
|
||||
|
||||
public static bool LoadingTextures
|
||||
{
|
||||
get
|
||||
@@ -30,7 +47,7 @@ namespace Barotrauma
|
||||
|
||||
private bool crop;
|
||||
|
||||
private readonly bool scaleToFit;
|
||||
private readonly ScalingMode scaleToFit;
|
||||
|
||||
private bool lazyLoaded, loading;
|
||||
|
||||
@@ -89,7 +106,7 @@ namespace Barotrauma
|
||||
sprite = value;
|
||||
sourceRect = value == null ? Rectangle.Empty : value.SourceRect;
|
||||
origin = value == null ? Vector2.Zero : value.size / 2;
|
||||
if (scaleToFit) { RecalculateScale(); }
|
||||
if (scaleToFit != ScalingMode.None) { RecalculateScale(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,17 +114,27 @@ namespace Barotrauma
|
||||
|
||||
public ComponentState? OverrideState = null;
|
||||
|
||||
public GUIImage(RectTransform rectT, string style, bool scaleToFit = false)
|
||||
public GUIImage(RectTransform rectT, string style, bool scaleToFit)
|
||||
: this(rectT, null, null, scaleToFit ? ScalingMode.ScaleToFitSmallestExtent : ScalingMode.None, style)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIImage(RectTransform rectT, string style, ScalingMode scaleToFit = ScalingMode.None)
|
||||
: this(rectT, null, null, scaleToFit, style)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIImage(RectTransform rectT, Sprite sprite, Rectangle? sourceRect = null, bool scaleToFit = false)
|
||||
public GUIImage(RectTransform rectT, Sprite sprite, bool scaleToFit, Rectangle? sourceRect = null)
|
||||
: this(rectT, sprite, sourceRect, scaleToFit ? ScalingMode.ScaleToFitSmallestExtent : ScalingMode.None, null)
|
||||
{
|
||||
}
|
||||
|
||||
public GUIImage(RectTransform rectT, Sprite sprite, Rectangle? sourceRect = null, ScalingMode scaleToFit = ScalingMode.None)
|
||||
: this(rectT, sprite, sourceRect, scaleToFit, null)
|
||||
{
|
||||
}
|
||||
|
||||
private GUIImage(RectTransform rectT, Sprite sprite, Rectangle? sourceRect, bool scaleToFit, string style) : base(style, rectT)
|
||||
private GUIImage(RectTransform rectT, Sprite sprite, Rectangle? sourceRect, ScalingMode scaleToFit, string style) : base(style, rectT)
|
||||
{
|
||||
this.scaleToFit = scaleToFit;
|
||||
Sprite = sprite;
|
||||
@@ -123,7 +150,7 @@ namespace Barotrauma
|
||||
{
|
||||
color = hoverColor = selectedColor = pressedColor = disabledColor = Color.White;
|
||||
}
|
||||
if (!scaleToFit)
|
||||
if (scaleToFit == ScalingMode.None)
|
||||
{
|
||||
Scale = 1.0f;
|
||||
}
|
||||
@@ -176,9 +203,11 @@ namespace Barotrauma
|
||||
|
||||
Color currentColor = GetColor(State);
|
||||
|
||||
if (BlendState != null)
|
||||
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
|
||||
if (BlendState != null || scaleToFit == ScalingMode.ScaleToFitLargestExtent)
|
||||
{
|
||||
spriteBatch.End();
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = Rectangle.Intersect(prevScissorRect, Rect);
|
||||
spriteBatch.Begin(blendState: BlendState, samplerState: GUI.SamplerState, rasterizerState: GameMain.ScissorTestEnable);
|
||||
}
|
||||
|
||||
@@ -205,9 +234,10 @@ namespace Barotrauma
|
||||
Scale, SpriteEffects, 0.0f);
|
||||
}
|
||||
|
||||
if (BlendState != null)
|
||||
if (BlendState != null || scaleToFit == ScalingMode.ScaleToFitLargestExtent)
|
||||
{
|
||||
spriteBatch.End();
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = prevScissorRect;
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, samplerState: GUI.SamplerState, rasterizerState: GameMain.ScissorTestEnable);
|
||||
}
|
||||
}
|
||||
@@ -219,9 +249,18 @@ namespace Barotrauma
|
||||
sourceRect = sprite.SourceRect;
|
||||
}
|
||||
|
||||
Scale = sprite == null || sprite.SourceRect.Width == 0 || sprite.SourceRect.Height == 0 ?
|
||||
1.0f :
|
||||
Math.Min(RectTransform.Rect.Width / (float)sprite.SourceRect.Width, RectTransform.Rect.Height / (float)sprite.SourceRect.Height);
|
||||
if (sprite == null || sprite.SourceRect.Width == 0 || sprite.SourceRect.Height == 0)
|
||||
{
|
||||
Scale = 1.0f;
|
||||
}
|
||||
else if (scaleToFit == ScalingMode.ScaleToFitLargestExtent)
|
||||
{
|
||||
Scale = Math.Max(RectTransform.Rect.Width / (float)sprite.SourceRect.Width, RectTransform.Rect.Height / (float)sprite.SourceRect.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
Scale = Math.Min(RectTransform.Rect.Width / (float)sprite.SourceRect.Width, RectTransform.Rect.Height / (float)sprite.SourceRect.Height);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> LoadTextureAsync()
|
||||
|
||||
@@ -749,8 +749,8 @@ namespace Barotrauma
|
||||
/// </summary>
|
||||
private bool ActiveServiceFull()
|
||||
{
|
||||
return (PendingHires.Count(ci => ci.BotStatus == BotStatus.PendingHireToActiveService) + campaign.CrewManager.GetCharacterInfos().Count())
|
||||
>= CrewManager.MaxCrewSize;
|
||||
int pendingHireCount = PendingHires?.Count(ci => ci.BotStatus == BotStatus.PendingHireToActiveService) ?? 0;
|
||||
return pendingHireCount + campaign.CrewManager.GetCharacterInfos().Count() >= CrewManager.MaxCrewSize;
|
||||
}
|
||||
|
||||
private bool EnoughReputationToHire(CharacterInfo characterInfo)
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace Barotrauma
|
||||
private Video currSplashScreen;
|
||||
private DateTime videoStartTime;
|
||||
|
||||
private bool mirrorBackground;
|
||||
|
||||
public struct PendingSplashScreen
|
||||
{
|
||||
public string Filename;
|
||||
@@ -108,8 +106,7 @@ namespace Barotrauma
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, samplerState: GUI.SamplerState);
|
||||
|
||||
GUI.DrawBackgroundSprite(spriteBatch, currentBackgroundTexture, Color.White, drawArea,
|
||||
spriteEffects: mirrorBackground ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
|
||||
GUI.DrawBackgroundSprite(spriteBatch, currentBackgroundTexture, Color.White, drawArea);
|
||||
overlay.Draw(spriteBatch, Vector2.Zero, scale: overlayScale);
|
||||
|
||||
double noiseT = Timing.TotalTime * 0.02f;
|
||||
@@ -386,7 +383,6 @@ namespace Barotrauma
|
||||
{
|
||||
currentBackgroundTexture = missions.Where(m => m.Prefab.HasPortraits).First().Prefab.GetPortrait(Rand.Int(int.MaxValue));
|
||||
}
|
||||
mirrorBackground = Rand.Range(0.0f, 1.0f) < 0.5f;
|
||||
|
||||
while (!drawn)
|
||||
{
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace Barotrauma
|
||||
pageIndicators = new GUIImage[pageCount];
|
||||
for (int i = 0; i < pageCount; i++)
|
||||
{
|
||||
pageIndicators[i] = new GUIImage(new RectTransform(indicatorSize, pageIndicatorHolder.RectTransform) { AbsoluteOffset = new Point(xPos, yPos) }, pageIndicator, null, true);
|
||||
pageIndicators[i] = new GUIImage(new RectTransform(indicatorSize, pageIndicatorHolder.RectTransform) { AbsoluteOffset = new Point(xPos, yPos) }, pageIndicator, scaleToFit: true);
|
||||
xPos += indicatorSize.X + HUDLayoutSettings.Padding;
|
||||
}
|
||||
|
||||
|
||||
@@ -799,8 +799,6 @@ namespace Barotrauma
|
||||
|
||||
customizeTabOpen = !hasUpgradeModules && hasSwappableItems;
|
||||
|
||||
customizeTabOpen = false;
|
||||
|
||||
GUIComponent[] categoryFrames = GetFrames(category);
|
||||
foreach (GUIComponent itemFrame in itemPreviews.Values)
|
||||
{
|
||||
|
||||
@@ -467,7 +467,7 @@ namespace Barotrauma
|
||||
};
|
||||
if (icon != null)
|
||||
{
|
||||
missionIcon = new GUIImage(new RectTransform(new Point(iconSize), content.RectTransform), icon, null, true)
|
||||
missionIcon = new GUIImage(new RectTransform(new Point(iconSize), content.RectTransform), icon, scaleToFit: true)
|
||||
{
|
||||
Color = iconColor,
|
||||
HoverColor = iconColor,
|
||||
|
||||
@@ -86,6 +86,9 @@ namespace Barotrauma.Items.Components
|
||||
[Serialize(true, IsPropertySaveable.No)]
|
||||
public bool ShowAvailableOnlyTickBox { get; set; }
|
||||
|
||||
[Serialize(true, IsPropertySaveable.No)]
|
||||
public bool ShowCategoryButtons { get; set; }
|
||||
|
||||
public override bool RecreateGUIOnResolutionChange => true;
|
||||
|
||||
protected override void OnResolutionChanged()
|
||||
@@ -120,7 +123,7 @@ namespace Barotrauma.Items.Components
|
||||
itemCategoryButtons.Clear();
|
||||
|
||||
//only create category buttons if there's more than one category in addition to "All"
|
||||
if (itemCategories.Count > 2)
|
||||
if (ShowCategoryButtons && itemCategories.Count > 2)
|
||||
{
|
||||
// === Item category buttons ===
|
||||
var categoryButtonContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.05f, 1.0f), innerArea.RectTransform))
|
||||
@@ -887,7 +890,7 @@ namespace Barotrauma.Items.Components
|
||||
itemIcon.Draw(
|
||||
spriteBatch,
|
||||
slotRect.Center.ToVector2(),
|
||||
color: targetItem.TargetItem.InventoryIconColor * 0.4f,
|
||||
color: Color.Lerp(targetItem.TargetItem.InventoryIconColor, Color.TransparentBlack, 0.5f),
|
||||
scale: Math.Min(slotRect.Width / itemIcon.size.X, slotRect.Height / itemIcon.size.Y) * 0.9f);
|
||||
}
|
||||
}
|
||||
@@ -1259,6 +1262,15 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (!IsActive)
|
||||
{
|
||||
if (outputContainer != null && outputContainer.Inventory.AllItems.Any())
|
||||
{
|
||||
if (outputContainer.Inventory.visualSlots is { } visualSlots && visualSlots.Any() &&
|
||||
visualSlots[0].HighlightTimer <= 0.0f)
|
||||
{
|
||||
visualSlots[0].ShowBorderHighlight(GUIStyle.Green, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedItem != null && displayingForCharacter != character)
|
||||
{
|
||||
//reselect to recreate the info based on the new user's skills
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
float playStyleBannerAspectRatio = (float)playStyleBannerSprite.SourceRect.Width / (float)playStyleBannerSprite.SourceRect.Height;
|
||||
playStyleBanner = new GUIImage(new RectTransform(new Vector2(1.0f, 1.0f / playStyleBannerAspectRatio), frame.RectTransform, scaleBasis: ScaleBasis.BothWidth),
|
||||
playStyleBannerSprite, null, true);
|
||||
playStyleBannerSprite, scaleToFit: true);
|
||||
playStyleBannerColor = playStyleBannerSprite.SourceElement.GetAttributeColor("bannercolor", Color.Black);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace Barotrauma
|
||||
{
|
||||
sealed class MainMenuScreen : Screen
|
||||
{
|
||||
public static HashSet<Identifier> DismissedNotifications = new HashSet<Identifier>();
|
||||
|
||||
private enum Tab
|
||||
{
|
||||
NewGame = 0,
|
||||
@@ -588,6 +590,12 @@ namespace Barotrauma
|
||||
SelectTab(Tab.Empty);
|
||||
}
|
||||
|
||||
public static void AddDismissedNotification(Identifier id)
|
||||
{
|
||||
DismissedNotifications.Add(id);
|
||||
GameSettings.SaveCurrentConfig();
|
||||
}
|
||||
|
||||
private void SetMenuTabPositioning()
|
||||
{
|
||||
foreach (GUIFrame menuTab in menuTabs.Values)
|
||||
@@ -616,7 +624,7 @@ namespace Barotrauma
|
||||
};
|
||||
var tutorialPreview = new GUILayoutGroup(new RectTransform(new Vector2(0.6f, 1.0f), tutorialContent.RectTransform)) { RelativeSpacing = 0.05f, Stretch = true };
|
||||
var imageContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.5f), tutorialPreview.RectTransform), style: "InnerFrame");
|
||||
tutorialBanner = new GUIImage(new RectTransform(Vector2.One, imageContainer.RectTransform), style: null, scaleToFit: true);
|
||||
tutorialBanner = new GUIImage(new RectTransform(Vector2.One, imageContainer.RectTransform), style: null, scaleToFit: GUIImage.ScalingMode.ScaleToFitSmallestExtent);
|
||||
|
||||
var infoContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.5f), tutorialPreview.RectTransform), style: "GUIFrameListBox");
|
||||
var infoContent = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 0.9f), infoContainer.RectTransform, Anchor.Center), childAnchor: Anchor.TopLeft)
|
||||
@@ -1382,7 +1390,7 @@ namespace Barotrauma
|
||||
var playstyleContainer = new GUIFrame(new RectTransform(new Vector2(1.35f, 0.1f), parent.RectTransform), style: null, color: Color.Black);
|
||||
|
||||
playstyleBanner = new GUIImage(new RectTransform(new Vector2(1.0f, 0.1f), playstyleContainer.RectTransform),
|
||||
GUIStyle.GetComponentStyle($"PlayStyleBanner.{PlayStyle.Serious}").GetSprite(GUIComponent.ComponentState.None), scaleToFit: true)
|
||||
GUIStyle.GetComponentStyle($"PlayStyleBanner.{PlayStyle.Serious}").GetSprite(GUIComponent.ComponentState.None), scaleToFit: GUIImage.ScalingMode.ScaleToFitSmallestExtent)
|
||||
{
|
||||
UserData = PlayStyle.Serious
|
||||
};
|
||||
|
||||
@@ -477,10 +477,20 @@ namespace Barotrauma
|
||||
AbsoluteSpacing = GUI.IntScale(5)
|
||||
};
|
||||
|
||||
Favorite = new GUITickBox(new RectTransform(new Vector2(0.5f, 0.5f), serverInfoContent.RectTransform, Anchor.TopRight, scaleBasis: ScaleBasis.BothHeight),
|
||||
|
||||
var topRightContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 0.5f), serverInfoContent.RectTransform, Anchor.TopRight),
|
||||
isHorizontal: true, childAnchor: Anchor.TopRight)
|
||||
{
|
||||
AbsoluteSpacing = GUI.IntScale(5),
|
||||
CanBeFocused = true
|
||||
};
|
||||
|
||||
SettingsButton = new GUIButton(new RectTransform(new Vector2(0.4f, 1.0f), topRightContainer.RectTransform, Anchor.TopRight),
|
||||
TextManager.Get("ServerSettingsButton"), style: "GUIButtonFreeScale");
|
||||
|
||||
Favorite = new GUITickBox(new RectTransform(Vector2.One, topRightContainer.RectTransform, Anchor.TopRight, scaleBasis: ScaleBasis.BothHeight),
|
||||
"", null, "GUIServerListFavoriteTickBox")
|
||||
{
|
||||
IgnoreLayoutGroups = true,
|
||||
Selected = false,
|
||||
ToolTip = TextManager.Get("addtofavorites"),
|
||||
OnSelected = (tickbox) =>
|
||||
@@ -500,8 +510,6 @@ namespace Barotrauma
|
||||
}
|
||||
};
|
||||
|
||||
SettingsButton = new GUIButton(new RectTransform(new Vector2(0.25f, 0.4f), serverInfoContent.RectTransform, Anchor.TopRight),
|
||||
TextManager.Get("ServerSettingsButton"), style: "GUIButtonFreeScale");
|
||||
}
|
||||
|
||||
private void CreateServerMessagePopup(string serverName, string message)
|
||||
|
||||
Reference in New Issue
Block a user