Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ offers two ways to get LocalExile:
| [Node.js](https://nodejs.org/en/download) | The bundle-decompression dependency |
| Your own standalone PoE **3.29.3c** client | A separate copy in the checkout's `Client` folder; Steam layout and other builds are unsupported |

Frida (`pip install frida`) is optional: it is needed for walk maps, the console, live mod control and the item crafter's Give
item, not for ordinary play. The crafter offers to install it.
Frida (`pip install frida`) is optional: it is needed for walk maps, the console and live mod control, not for ordinary play.
The item crafter's Give item uses the Waypoint Tools mod instead, which it offers to install.

1. Download `Waypoint.exe` from the latest release on this repository's **Releases** page.
2. Put it anywhere and start it.
Expand Down Expand Up @@ -72,8 +72,7 @@ them), the item crafter, the tray and the appearance editor.

On a release install some sections do less, because a release has no source, Frida or per-service control: **Console** copies
commands for you to paste into the game's chat, **Mods** installs a mod's release but cannot build one from source, **Control** starts and stops
everything together, and **Tools** needs a source checkout: **Get the item crafter…** sets one up beside your release and can bring
your characters. When a newer LocalExile release is out, a green card offers to install it.
everything together, and the item crafter's **Give item** goes through the Waypoint Tools mod, which it offers to install. When a newer LocalExile release is out, a green card offers to install it.
Nothing changes until you accept and the game is closed. Your saves are copied first, and `data\` and `Client\` are kept.
**Settings → Keep LocalExile up to date** turns the prompt off.

Expand Down
65 changes: 37 additions & 28 deletions docs/launcher.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Launcher.Core/GameSystems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static string Normal(string path)
return value;
}
static string Id(string path) => Normal(path).Split('/')[^1];
static IEnumerable<string> Manifests(string folder, string manifest)
internal static IEnumerable<string> Manifests(string folder, string manifest)
{
if (!Directory.Exists(folder)) yield break;
var pending = new Stack<(string Folder, int Depth)>(); pending.Push((folder, 0)); int count = 0;
Expand Down
28 changes: 27 additions & 1 deletion src/Launcher.Core/ModCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ string Text(string name, string fallback) => Field(name).ValueKind == JsonValueK
return new(id, Text("version", "0"), kind, dependencies, assembly, enabled.ValueKind != JsonValueKind.False,
Text("name", ""), Text("description", ""), Text("author", ""), ClientCompatibility.Read(Field(ClientCompatibility.Field)));
}
/// <summary>The ids of the checkout's modules (<c>Modules/**/module.json</c>, as Game Systems reads them), which a mod may
/// depend on beside other mods. None when they cannot be read.</summary>
internal static HashSet<string> ModuleIds(string root)
{
var ids = new HashSet<string>(StringComparer.Ordinal);
try
{
foreach (string file in GameSystems.Manifests(Path.Combine(root, "Modules"), "module.json"))
{
try
{
using var json = JsonDocument.Parse(File.ReadAllText(file));
ids.Add(json.RootElement.TryGetProperty("id", out var id) && id.ValueKind == JsonValueKind.String
? id.GetString()! : Path.GetFileName(Path.GetDirectoryName(file)!));
}
catch (Exception e) when (e is IOException or UnauthorizedAccessException or JsonException) { }
}
}
catch (Exception e) when (e is IOException or UnauthorizedAccessException) { }
return ids;
}

public static ModEntry[] Read(RuntimeSnapshot snapshot)
{
var environment = snapshot.ModEnvironment;
Expand Down Expand Up @@ -162,11 +184,15 @@ public static ModEntry[] Read(RuntimeSnapshot snapshot)
}
}
var runtime = ParseRuntimeReport(environment.RuntimeReport);
var modules = ModuleIds(snapshot.Root);
foreach (var original in entries.Values.ToArray())
{
var entry = original with { Enabled = choices.GetValueOrDefault(original.Id, original.Enabled) };
if (entry.Status.StartsWith("Invalid", StringComparison.Ordinal) || entry.Status == "Missing DLL") continue;
string[] missing = entry.Depends.Where(id => !entries.TryGetValue(id, out var dep) || !dep.Enabled || dep.Status is "Missing DLL" or "Not built" || dep.Status.StartsWith("Invalid", StringComparison.Ordinal)).ToArray();
// A dependency is another mod or, as the Gateway's ModHost.Dependency has it, one of the modules (the Game module).
string[] missing = entry.Depends.Where(id => entries.TryGetValue(id, out var dep)
? !dep.Enabled || dep.Status is "Missing DLL" or "Not built" || dep.Status.StartsWith("Invalid", StringComparison.Ordinal)
: !modules.Contains(id)).ToArray();
string status = !environment.Enabled ? "Mods disabled globally" : !entry.Enabled ? "Disabled" : entry.Status == "Not built" ? "Not built"
: missing.Length > 0 ? "Dependency blocked" : snapshot.Services.Any(s => s.Name == "Gateway" && s.IsRunning) ? "Not checked" : "Gateway stopped";
string detail = missing.Length > 0 ? "Needs: " + string.Join(", ", missing) : entry.Detail;
Expand Down
Loading
Loading