(33abbb810) Fixed: Interfaces that were too small on 4k by removing the use of maxsize & adding scale related multipliers to absolute values

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:24:54 +03:00
parent 73bfd8d4a4
commit 75b88e0c18
18 changed files with 106 additions and 85 deletions
@@ -146,7 +146,7 @@ namespace Barotrauma
{
bool isDifferentTarget = Vector2.DistanceSquared(target, currentTarget) > 1;
//find a new path if one hasn't been found yet or the target is different from the current target
if (currentPath == null || isDifferentTarget || findPathTimer < -1.0f)
if (currentPath == null || Vector2.DistanceSquared(target, currentTarget) > 1.0f || findPathTimer < -1.0f)
{
IsPathDirty = true;
@@ -163,11 +163,7 @@ namespace Barotrauma
}
}
var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
if (currentPath == null || isDifferentTarget || newPath.Cost < currentPath.Cost)
{
currentPath = newPath;
}
currentPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
findPathTimer = Rand.Range(1.0f, 1.2f);
@@ -175,7 +175,7 @@ namespace Barotrauma
{
if (character.CanInteractWith(item, out _, checkLinked: false)) { isCompleted = true; }
}
else if (Target is Character targetCharacter && !FollowControlledCharacter)
else if (Target is Character targetCharacter)
{
if (character.CanInteractWith(targetCharacter, CloseEnough)) { isCompleted = true; }
}
@@ -230,6 +230,13 @@ namespace Barotrauma
//if searching for a path inside the sub, make sure the waypoint is visible
if (insideSubmarine)
{
// Doesn't seem to work
//var body = Submarine.CheckVisibility(end, node.Waypoint.SimPosition);
//if (body != null && body.UserData is Structure)
//{
// continue;
//}
var body = Submarine.PickBody(end, node.Waypoint.SimPosition, null,
Physics.CollisionWall | Physics.CollisionLevel | Physics.CollisionStairs );
@@ -415,17 +415,6 @@ namespace Barotrauma
}
}
#region Load DefaultConfig
private void LoadDefaultConfig(bool setLanguage = true)
{
XDocument doc = XMLExtensions.TryLoadXml(savePath);
if (setLanguage || string.IsNullOrEmpty(Language))
{
Language = doc.Root.GetAttributeString("language", "English");
}
}
#region Load DefaultConfig
private void LoadDefaultConfig()
{
@@ -443,26 +432,6 @@ namespace Barotrauma
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
if (doc == null)
{
GraphicsWidth = 1024;
@@ -848,6 +817,58 @@ namespace Barotrauma
{
VoiceSetting = voiceSetting;
}
foreach (ContentFile file in contentPackage.Files)
{
ToolBox.IsProperFilenameCase(file.Path);
}
}
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);
@@ -602,7 +602,7 @@ namespace Barotrauma
if (ladderItem != null) Ladders = ladderItem.GetComponent<Ladder>();
}
Body pickedBody = Submarine.PickBody(SimPosition, SimPosition - Vector2.UnitY * 2.0f, null, Physics.CollisionStairs);
Body pickedBody = Submarine.PickBody(SimPosition, SimPosition - Vector2.UnitY * 2.0f, null, Physics.CollisionWall | Physics.CollisionStairs);
if (pickedBody != null && pickedBody.UserData is Structure)
{
Structure structure = (Structure)pickedBody.UserData;