(5154265e6) Don't round ItemLabel text positions to the nearest pixel (causes weird looking "jitter" when the sub moves)
This commit is contained in:
@@ -26,6 +26,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public bool Wrap;
|
public bool Wrap;
|
||||||
|
|
||||||
|
public bool RoundToNearestPixel = true;
|
||||||
|
|
||||||
private bool overflowClipActive;
|
private bool overflowClipActive;
|
||||||
public bool OverflowClip;
|
public bool OverflowClip;
|
||||||
|
|
||||||
@@ -329,8 +331,11 @@ namespace Barotrauma
|
|||||||
if (!string.IsNullOrEmpty(text))
|
if (!string.IsNullOrEmpty(text))
|
||||||
{
|
{
|
||||||
Vector2 pos = rect.Location.ToVector2() + textPos + TextOffset;
|
Vector2 pos = rect.Location.ToVector2() + textPos + TextOffset;
|
||||||
pos.X = (int)pos.X;
|
if (RoundToNearestPixel)
|
||||||
pos.Y = (int)pos.Y;
|
{
|
||||||
|
pos.X = (int)pos.X;
|
||||||
|
pos.Y = (int)pos.Y;
|
||||||
|
}
|
||||||
|
|
||||||
Font.DrawString(spriteBatch,
|
Font.DrawString(spriteBatch,
|
||||||
Wrap ? wrappedText : text,
|
Wrap ? wrappedText : text,
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ namespace Barotrauma.Items.Components
|
|||||||
textBlock = new GUITextBlock(new RectTransform(item.Rect.Size), "",
|
textBlock = new GUITextBlock(new RectTransform(item.Rect.Size), "",
|
||||||
textColor: textColor, font: GUI.UnscaledSmallFont, textAlignment: Alignment.Center, wrap: true, style: null)
|
textColor: textColor, font: GUI.UnscaledSmallFont, textAlignment: Alignment.Center, wrap: true, style: null)
|
||||||
{
|
{
|
||||||
TextDepth = item.SpriteDepth - 0.0001f,
|
TextDepth = item.SpriteDepth - 0.00001f,
|
||||||
|
RoundToNearestPixel = false,
|
||||||
TextScale = TextScale
|
TextScale = TextScale
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -821,6 +821,54 @@ namespace Barotrauma
|
|||||||
VoiceSetting = voiceSetting;
|
VoiceSetting = voiceSetting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!SelectedContentPackages.Any())
|
||||||
|
{
|
||||||
|
var availablePackage = ContentPackage.List.FirstOrDefault(cp => cp.IsCompatible() && cp.CorePackage);
|
||||||
|
if (availablePackage != null)
|
||||||
|
{
|
||||||
|
SelectedContentPackages.Add(availablePackage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//save to get rid of the invalid selected packages in the config file
|
||||||
|
if (missingPackagePaths.Count > 0 || incompatiblePackages.Count > 0) { SaveNewPlayerConfig(); }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Save DefaultConfig
|
||||||
|
private void SaveNewDefaultConfig()
|
||||||
|
{
|
||||||
|
XDocument doc = new XDocument();
|
||||||
|
|
||||||
|
if (doc.Root == null)
|
||||||
|
{
|
||||||
|
doc.Add(new XElement("config"));
|
||||||
|
}
|
||||||
|
|
||||||
|
doc.Root.Add(
|
||||||
|
new XAttribute("language", TextManager.Language),
|
||||||
|
new XAttribute("masterserverurl", MasterServerUrl),
|
||||||
|
new XAttribute("autocheckupdates", AutoCheckUpdates),
|
||||||
|
new XAttribute("musicvolume", musicVolume),
|
||||||
|
new XAttribute("soundvolume", soundVolume),
|
||||||
|
new XAttribute("voicechatvolume", voiceChatVolume),
|
||||||
|
new XAttribute("verboselogging", VerboseLogging),
|
||||||
|
new XAttribute("savedebugconsolelogs", SaveDebugConsoleLogs),
|
||||||
|
new XAttribute("enablesplashscreen", EnableSplashScreen),
|
||||||
|
new XAttribute("usesteammatchmaking", useSteamMatchmaking),
|
||||||
|
new XAttribute("quickstartsub", QuickStartSubmarineName),
|
||||||
|
new XAttribute("requiresteamauthentication", requireSteamAuthentication),
|
||||||
|
new XAttribute("aimassistamount", aimAssistAmount));
|
||||||
|
|
||||||
|
if (!ShowUserStatisticsPrompt)
|
||||||
|
{
|
||||||
|
doc.Root.Add(new XAttribute("senduserstatistics", sendUserStatistics));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WasGameUpdated)
|
||||||
|
{
|
||||||
|
doc.Root.Add(new XAttribute("wasgameupdated", true));
|
||||||
|
}
|
||||||
|
|
||||||
useSteamMatchmaking = doc.Root.GetAttributeBool("usesteammatchmaking", useSteamMatchmaking);
|
useSteamMatchmaking = doc.Root.GetAttributeBool("usesteammatchmaking", useSteamMatchmaking);
|
||||||
requireSteamAuthentication = doc.Root.GetAttributeBool("requiresteamauthentication", requireSteamAuthentication);
|
requireSteamAuthentication = doc.Root.GetAttributeBool("requiresteamauthentication", requireSteamAuthentication);
|
||||||
|
|||||||
Reference in New Issue
Block a user