mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-29 04:18:49 -04:00
Triforce v0.8.5
A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
@@ -71,7 +71,7 @@ static partial class Tests
|
||||
Equal(3, saves.Slots(game).Count(s => s.Used), "three files now");
|
||||
Check(!Directory.Exists(Path.Combine(game, "user", "save-tx", Saves.TriforceUid)), "the old save's transaction removed");
|
||||
Check(File.Exists(Path.Combine(game, "user", "save.lock")), "the game's lock was taken across the copy");
|
||||
Check(!Directory.Exists(saves.TriforceFolder(game) + ".partial") && !Directory.Exists(saves.TriforceFolder(game) + ".old"), "no partial left");
|
||||
Check(!Directory.Exists(saves.TriforceFolder(game) + Partial.Suffix) && !Directory.Exists(saves.TriforceFolder(game) + Partial.Aside), "no partial left");
|
||||
// (out: a waiting commit is the newest save)
|
||||
var ready = Path.Combine(game, "user", "save-tx", Saves.TriforceUid, "ready-2");
|
||||
MakeSave(ready, "ready", 2);
|
||||
@@ -86,6 +86,20 @@ static partial class Tests
|
||||
await ThrowsAsync<InvalidOperationException>(() => saves.ExportAsync(game, Saves.Describe("lab", Path.Combine(LabGame, "user", "save", Saves.TriforceUid))), "a test run writes no save outside its root");
|
||||
Equal(navi, Saves.FindIn(Path.Combine(root, "Local", "Programs", "NX2navi", "game")), "a chosen NX2navi game folder");
|
||||
Equal(eden, Saves.FindIn(Path.Combine(root, "Roaming", "eden")), "a chosen emulator folder, searched down");
|
||||
// ((Triforce, 11-26) in again with a commit still waiting: that newest save is backed up too, before it is taken away)
|
||||
Check(Directory.Exists(ready), "the waiting commit is still there");
|
||||
var b3 = await saves.ImportAsync(found.First(f => f.Name == "Eden"), game);
|
||||
var newest = Directory.GetDirectories(ctx.SaveBackupsFolder, "*-newest").SingleOrDefault();
|
||||
Check(newest != null && File.ReadAllText(Path.Combine(newest, "option.sav")) == "ready", "the waiting commit backed up: " + newest);
|
||||
Check(b3 != null && File.ReadAllText(Path.Combine(b3, "option.sav")) == "eden", "and the save folder as before");
|
||||
Check(!Directory.Exists(ready), "then taken away, as the game would put it over the copy");
|
||||
// (one save folder inside the other: refused)
|
||||
Throws<InvalidOperationException>(() => saves.Copy(eden, Path.Combine(eden, "inner"), ctx.SaveBackupsFolder, "x"), "into a folder inside the source");
|
||||
// (a player's own "<save>.old" beside the save folder is theirs: a copy does not touch it)
|
||||
var mine = saves.TriforceFolder(game) + ".old";
|
||||
MakeSave(mine, "my own backup", 1);
|
||||
await saves.ImportAsync(found.First(f => f.Name == "Eden"), game);
|
||||
Equal("my own backup", File.ReadAllText(Path.Combine(mine, "option.sav")), "the player's .old folder kept");
|
||||
}
|
||||
|
||||
// ---- mods ----
|
||||
@@ -280,11 +294,17 @@ static partial class Tests
|
||||
// (switched off, then updated: the new one takes its place and its switch)
|
||||
mm.SetOn(mods, mm.List(mods).First(m => m.Name == "Fancy Hat"), false);
|
||||
s.Add("/dl/2", ZipBytes(z => Put(z, "romfs/UI/hat2.bntx", "hat2")));
|
||||
await inst.InstallAsync(http, mod, file with { Url = s.Url + "/dl/2", Added = 1800000000 }, game, null, CancellationToken.None);
|
||||
var now = mm.List(mods).Where(m => m.Info?.GameBananaId == 101).ToList();
|
||||
// ((Triforce, 11-26) a work in progress with the same number is another thing on GameBanana: the update leaves it alone)
|
||||
MakeMod(mods, "05-Wip hat", ("romfs/w", "w"), ("triforce_mod.json", "{\"name\":\"Wip hat\",\"gamebanana_id\":101,\"gamebanana_model\":\"Wip\"}"));
|
||||
var upd = await inst.InstallAsync(http, mod, file with { Url = s.Url + "/dl/2", Added = 1800000000 }, game, null, CancellationToken.None);
|
||||
var now = mm.List(mods).Where(m => m.Info?.GameBananaId == 101 && m.Info?.Wip == false).ToList();
|
||||
Equal(1, now.Count, "one folder for the mod after its update");
|
||||
Check(now[0].Folder.StartsWith("_02-") && !now[0].On, "its place and its off kept: " + now[0].Folder);
|
||||
Equal("ui/hat2.bntx", now[0].Files.Single(), "the new files");
|
||||
Check(Directory.Exists(Path.Combine(mods, "05-Wip hat")), "the work in progress of the same number is not touched");
|
||||
Check(Directory.EnumerateDirectories(Path.Combine(mods, Mods.Removed)).Any(d => ModManager.ReadInfo(d) is { GameBananaId: 101, Wip: false }) &&
|
||||
upd.Contains(Mods.Removed), "the version before is kept in mods\\.removed, and said: " + upd);
|
||||
await ThrowsAsync<IOException>(() => inst.InstallAsync(http, mod with { Id = 7 }, file with { Url = "http://example.invalid/hat.zip" }, game, null, CancellationToken.None), "a download address that is not https");
|
||||
s.Add("/dl/3", ZipBytes(z => Put(z, "docs/readme.txt", "x")));
|
||||
await ThrowsAsync<ModsException>(() => inst.InstallAsync(http, mod with { Id = 5 }, file with { Url = s.Url + "/dl/3" }, game, null, CancellationToken.None), "no romfs: refused");
|
||||
// (bare game folders, no romfs above them: wrapped)
|
||||
|
||||
Reference in New Issue
Block a user