mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-13 20:03:19 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
744720d922 | ||
|
|
b5ba67430f | ||
|
|
c261d4b0ab | ||
|
|
3aa6a256a5 | ||
|
|
95c510b3ac | ||
|
|
da5a1efea1 |
@@ -65,6 +65,19 @@ public class PhysicsAndAssetsTests
|
|||||||
Assert.Equal(125, physics.VMax);
|
Assert.Equal(125, physics.VMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_dot_in_the_model_name_is_part_of_the_name()
|
||||||
|
{
|
||||||
|
// As in the game: cd/9-107_v1 holds 9-107.13.fiz, 9-107.6.fiz and more.
|
||||||
|
var installation = new TestInstallation(new InMemoryFileSystem()
|
||||||
|
.WithFile(Fiz("cd", "9-107_v1", "9-107.13"), "Load: LoadAccepted=coal MaxLoad=58")
|
||||||
|
.WithFile(Fiz("cd", "9-107_v1", "9-107.6"), "Load: LoadAccepted=coal MaxLoad=55"));
|
||||||
|
|
||||||
|
Assert.Equal(58, installation.Physics.For("cd/9-107_v1/", "9-107.13")!.MaxLoad);
|
||||||
|
Assert.Equal(55, installation.Physics.For("cd/9-107_v1/", "9-107.6")!.MaxLoad);
|
||||||
|
Assert.Equal(58, installation.Physics.For("cd/9-107_v1/", "9-107.13.e3d")!.MaxLoad);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void A_dumb_variant_stands_in_when_the_model_has_no_fiz_of_its_own()
|
public void A_dumb_variant_stands_in_when_the_model_has_no_fiz_of_its_own()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ public static class AppInfo
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
text += " (DEBUG)";
|
text += " (DEBUG)";
|
||||||
#endif
|
#endif
|
||||||
return text + " public beta";
|
return text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public sealed class FizPhysicsRepository : IPhysicsRepository
|
|||||||
if (string.IsNullOrEmpty(model))
|
if (string.IsNullOrEmpty(model))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
string name = Path.GetFileNameWithoutExtension(model);
|
string name = Path.GetFileName(model);
|
||||||
if (name.Length == 0)
|
if (name.Length == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -60,7 +60,10 @@ public sealed class FizPhysicsRepository : IPhysicsRepository
|
|||||||
if (_cache.TryGetValue(key, out var cached))
|
if (_cache.TryGetValue(key, out var cached))
|
||||||
return cached;
|
return cached;
|
||||||
|
|
||||||
var physics = Read(folder, name);
|
// The name as written first: in 9-107.13 the dot is part of the name, not an extension.
|
||||||
|
string bare = Path.GetFileNameWithoutExtension(name);
|
||||||
|
var physics = Read(folder, name)
|
||||||
|
?? (bare.Length > 0 && bare != name ? Read(folder, bare) : null);
|
||||||
_cache[key] = physics;
|
_cache[key] = physics;
|
||||||
return physics;
|
return physics;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
// The top bar lets the version go first when it runs short of room, which at the usual widths it does;
|
||||||
|
// the title has room for it at any width.
|
||||||
|
Title = $"{Title} {AppInfo.Version}";
|
||||||
|
|
||||||
ExtendClientAreaToDecorationsHint = true;
|
ExtendClientAreaToDecorationsHint = true;
|
||||||
ExtendClientAreaTitleBarHeightHint = TitleBarHeight;
|
ExtendClientAreaTitleBarHeightHint = TitleBarHeight;
|
||||||
|
|||||||
Reference in New Issue
Block a user