Snapshot for release 2026.10.19.1 (internal f0bdcf8)
This commit is contained in:
parent
5419838250
commit
39de36d3af
131 changed files with 11266 additions and 520 deletions
|
|
@ -66,6 +66,21 @@ public static unsafe class PluginExports
|
|||
try { if (utf8 != IntPtr.Zero) Runtime.Plugin?.EnqueueCommand(Marshal.PtrToStringUTF8(utf8)); } catch { }
|
||||
}
|
||||
|
||||
// Commands from other plugins (host SendPluginCommand): action "rsort", value an /rsort
|
||||
// command without the "/rsort" ("now", "status"); RynthAi sends ub-IT's /ub packsort this way.
|
||||
[UnmanagedCallersOnly(EntryPoint = "RynthPluginApplyRemoteCommand", CallConvs = new[] { typeof(CallConvCdecl) })]
|
||||
public static void ApplyRemoteCommand(IntPtr actionAnsi, IntPtr valueAnsi)
|
||||
{
|
||||
try
|
||||
{
|
||||
string action = actionAnsi != IntPtr.Zero ? Marshal.PtrToStringAnsi(actionAnsi) ?? "" : "";
|
||||
string value = valueAnsi != IntPtr.Zero ? Marshal.PtrToStringAnsi(valueAnsi) ?? "" : "";
|
||||
string? arg = RynthSortPlugin.RemoteSortArgument(action, value);
|
||||
if (arg != null) Runtime.Plugin?.EnqueueCommand(arg);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "RynthPluginOnVendorClose", CallConvs = new[] { typeof(CallConvCdecl) })]
|
||||
public static void OnVendorClose(uint vendorId) => Runtime.OnVendorClose(vendorId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,13 @@ public sealed class RynthSortPlugin : RynthPluginBase
|
|||
/// <summary>For the engine's dashboard toggle (RynthSortAutoState): -1 not logged in yet, 0 auto-sort off, 1 on. Any thread.</summary>
|
||||
public int AutoState => _autoState;
|
||||
|
||||
/// <summary>
|
||||
/// A command from another plugin (RynthPluginApplyRemoteCommand): the /rsort argument when
|
||||
/// <paramref name="action"/> is "rsort" (value "now", "status"...), else null (not ours).
|
||||
/// </summary>
|
||||
internal static string? RemoteSortArgument(string? action, string? value)
|
||||
=> string.Equals(action, "rsort", StringComparison.OrdinalIgnoreCase) ? value ?? string.Empty : null;
|
||||
|
||||
/// <summary>An /rsort command from the engine (RynthSortCommand), without "/rsort". Any thread; runs on the tick.</summary>
|
||||
public void EnqueueCommand(string? arg)
|
||||
{
|
||||
|
|
@ -77,9 +84,12 @@ public sealed class RynthSortPlugin : RynthPluginBase
|
|||
Warnings = () => _warnings,
|
||||
Character = () => _identityKnown ? _character : string.Empty,
|
||||
};
|
||||
// No bar button of its own: opened from the engine Inventory window's Sort button, the
|
||||
// Scripts menu or /rsort.
|
||||
_window = _ui.Add(new UiWindow("RynthSort/Main", "RynthSort")
|
||||
{
|
||||
DefaultWidth = 360f, DefaultHeight = 420f, MinWidth = 300f, MinHeight = 200f,
|
||||
BarButton = false,
|
||||
});
|
||||
Host.Log($"[RynthSort] {Version} initialized. /rsort shows or hides the window; /rsort on|off|now|tidy|clean|unpack. Files: {_store.Root}");
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue