Snapshot for release 2026.10.28.1 (internal decb3ab)

This commit is contained in:
Tom Bohar 2026-10-28 06:36:39 -04:00
commit b23cabc338
38 changed files with 2801 additions and 127 deletions

View file

@ -2,7 +2,7 @@ using System;
namespace RynthCore.Plugin.RynthDefective.Model;
internal enum DefVerb { Toggle, Help, Use, Set, Clear, Bind, Unbind, Weapons, Favourite, Slots, List, Status, Error, Panels, Selection }
internal enum DefVerb { Toggle, Help, Use, Set, Clear, Bind, Unbind, Weapons, Favourite, Slots, List, Status, Error, Panels, Selection, Settings }
/// <summary>A parsed "/rdef ..." line. Use: <see cref="Slot"/> (1-based) or <see cref="Text"/> (an item name).</summary>
internal sealed record DefCommand(DefVerb Verb, int Slot = 0, string Text = "", string Error = "");
@ -11,7 +11,7 @@ internal static class DefCommandParser
{
public const string Usage =
"/rdef [use <slot or item name> | set <slot> [item name] | clear <slot> | bind <slot> <key> | unbind <slot> | "
+ "weapons [search] | fav | slots <count> | list | status | panels (the game panel buttons) | selection]";
+ "weapons [search] | fav | slots <count> | list | status | settings | panels (the game panel buttons) | selection]";
/// <summary>Parses the arguments after "/rdef" (blank = show or hide the bar).</summary>
public static DefCommand Parse(string? args)
@ -28,6 +28,7 @@ internal static class DefCommandParser
case "list": case "ls": return new DefCommand(DefVerb.List);
case "status": return new DefCommand(DefVerb.Status);
case "panels": case "panel": return new DefCommand(DefVerb.Panels);
case "settings": case "options": case "setup": return new DefCommand(DefVerb.Settings);
case "selection": case "target":
// "/rdef selection 0x80001234": select that object (a test hook for the Selection window).
return new DefCommand(DefVerb.Selection, Text: rest);
@ -56,9 +57,9 @@ internal static class DefCommandParser
case "unbind":
return TrySlot(rest, out int us) ? new DefCommand(DefVerb.Unbind, us) : Fail("Which slot? e.g. /rdef unbind 3");
case "slots":
return int.TryParse(rest, out int count) && count >= DefSettings.SlotsMin && count <= DefSettings.SlotsMax
return int.TryParse(rest, out int count) && count >= DefSettings.SlotsMin && count <= DefSettings.SlotCountMax
? new DefCommand(DefVerb.Slots, count)
: Fail($"How many slots? {DefSettings.SlotsMin} to {DefSettings.SlotsMax}, e.g. /rdef slots 10");
: Fail($"How many slots? {DefSettings.SlotsMin} to {DefSettings.SlotCountMax}, e.g. /rdef slots 10");
default:
// "/rdef Stamina Kit" is a shorthand for use.
return new DefCommand(DefVerb.Use, Text: a);

View file

@ -52,17 +52,34 @@ internal enum KindFilter { All, Melee, Missile, War, Void }
/// <summary>RynthDefective's settings for one character.</summary>
internal sealed class DefSettings
{
public const int SlotsMin = 1, SlotsMax = 24, PerRowMin = 1, PerRowMax = 12, ButtonMin = 20, ButtonMax = 64,
PickerIconMin = 20, PickerIconMax = 48;
/// <summary>
/// The shortcut bar (2026-10-22, plugin API v90): its first 18 slots are AC's own (the retail
/// toolbar's, its keys AC's keymap), the rest this plugin's own slots (Slots, keys the engine's
/// hotkeys). The player picks how many it shows.
/// hotkeys). The player picks how many it shows. With <see cref="IndependentBar"/> every slot
/// is this plugin's own (ShortcutBar/BarMapping.cs).
/// </summary>
public const int RetailSlots = 18, BarSlotsMin = 1, BarSlotsMax = RetailSlots + SlotsMax;
public const int RetailSlots = 18, BarSlotsMin = 1, BarSlotsMax = 42;
/// <summary>
/// RynthDefective's own slots (DefData.Slots, "/rdef use 1..42"): as many as the bar can show, so
/// an independent bar is as long as the usual one (which shows own slots 1-24 after the game's 18).
/// The old script-window bar shows the first <see cref="SlotCountMax"/> of them.
/// </summary>
public const int SlotsMin = 1, SlotsMax = BarSlotsMax, SlotCountMax = 24, PerRowMin = 1, PerRowMax = 12, ButtonMin = 20, ButtonMax = 64,
PickerIconMin = 20, PickerIconMax = 48;
public int BarSlots = RetailSlots;
/// <summary>
/// The shortcut bar is independent of AC's toolbar (2026-10-27): AC's 18 slots are not on it, every
/// slot is RynthDefective's own (bar slot N = own slot N, clicks through the use controller, keys
/// the engine's hotkeys running /rdef use N). Per character, like the slots it decides about: AC
/// keeps its 18 shortcut slots per character on the server, and the own slots are per character
/// here, so one character can keep the game's toolbar on the bar while another goes independent.
/// Off (the default, and what a file from before reads as): slots 1-18 are AC's.
/// </summary>
public bool IndependentBar;
/// <summary>The old script-window bar's slot count (engines without the shortcut bar).</summary>
public int SlotCount = 8;
public int SlotsPerRow = 8;
/// <summary>Icon size of the slot buttons, in logical units.</summary>
@ -81,7 +98,7 @@ internal sealed class DefSettings
public void Clamp()
{
SlotCount = Math.Clamp(SlotCount, SlotsMin, SlotsMax);
SlotCount = Math.Clamp(SlotCount, SlotsMin, SlotCountMax);
BarSlots = Math.Clamp(BarSlots, BarSlotsMin, BarSlotsMax);
SlotsPerRow = Math.Clamp(SlotsPerRow, PerRowMin, PerRowMax);
ButtonSize = Math.Clamp(ButtonSize, ButtonMin, ButtonMax);

View file

@ -66,6 +66,7 @@ internal sealed class DefStore
st.ShowCounts = Bool(s, "showCounts", st.ShowCounts);
st.PreferredKind = (KindFilter)Int(s, "preferredKind", (int)st.PreferredKind);
st.SwapWhileBotRuns = Bool(s, "swapWhileBotRuns", st.SwapWhileBotRuns);
st.IndependentBar = Bool(s, "independentBar", st.IndependentBar); // missing (a file from before 2026-10-27): off
st.BarOpen = Bool(s, "barOpen", st.BarOpen);
st.PickerOpen = Bool(s, "pickerOpen", st.PickerOpen);
st.Clamp();
@ -156,6 +157,7 @@ internal sealed class DefStore
w.WriteBoolean("showCounts", s.ShowCounts);
w.WriteNumber("preferredKind", (int)s.PreferredKind);
w.WriteBoolean("swapWhileBotRuns", s.SwapWhileBotRuns);
w.WriteBoolean("independentBar", s.IndependentBar);
w.WriteBoolean("barOpen", s.BarOpen);
w.WriteBoolean("pickerOpen", s.PickerOpen);
w.WriteEndObject();