RynthSuite as of 2026-12-02 (internal 152e13d): release 2026.12.1.1

This commit is contained in:
Tom Bohar 2026-12-02 06:45:07 -05:00
commit 6b5a9c7e99
65 changed files with 3920 additions and 237 deletions

View file

@ -7,6 +7,10 @@
// Plugins/Shared/DerethClock.cs has the math; RynthCore hosts the frameless
// window (plugin API v90) and remembers where it is.
//
// A clear background by default (2026-12-01: no box, the sun or moon and the text shadowed, so it
// can sit on the radar or under the arrow without taking room); /rdef daynight box brings the
// dark box back (DefSettings.DayNightBox). While hovered a faint box shows where to grab it.
//
// anywhere drag to move; Ctrl+wheel: bigger or smaller (30-250%);
// right-click: hide it (/rdef daynight, the bar button, or
// Settings > Interface > In The Retail Toolbar's Place show it again).
@ -64,10 +68,12 @@ internal sealed class DayNightWindow
private const float Pad = 5, RowH = 16, Mark = 14, Gap = 4, Radius = 4;
private static readonly uint SunColor = Argb(0xFFF2C14E), MoonColor = Argb(0xFFB8C7F0);
private static readonly uint ShadowColor = Argb(0xD8000000); // under the text and icon on a clear background
private static uint A(uint c, float alpha) => WithAlpha(c, (uint)Math.Clamp(MathF.Round(alpha * 255f), 0f, 255f));
/// <summary>Draws the timer into the host's window; returns the height it needs (pixels). Render thread.</summary>
public float Draw(DayNightView v)
/// <summary>Draws the timer into the host's window; returns the height it needs (pixels).
/// <paramref name="box"/>: the dark box; false = a clear background, the text shadowed. Render thread.</summary>
public float Draw(DayNightView v, bool box = false)
{
Scale();
uint bg = Color(RynthUiColor.Background), line = Color(RynthUiColor.Hairline);
@ -81,8 +87,11 @@ internal sealed class DayNightWindow
if (width < 30) return height;
ImDrawListPtr dl = ImGui.GetWindowDrawList();
Vector2 max = origin + new Vector2(width, height);
dl.AddRectFilled(origin, max, A(bg, 0.94f), Px(Radius));
dl.AddRect(origin, max, line, Px(Radius));
if (box)
{
dl.AddRectFilled(origin, max, A(bg, 0.94f), Px(Radius));
dl.AddRect(origin, max, line, Px(Radius));
}
// The whole window is the drag surface.
ImGui.SetCursorScreenPos(origin);
@ -90,6 +99,8 @@ internal sealed class DayNightWindow
_host.PanelDragWithLastItem();
if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) _host.SetPanelOpen(Title, RynthPanelOpen.Close);
bool hot = ImGui.IsItemHovered();
if (!box && hot) dl.AddRectFilled(origin, max, A(bg, 0.45f), Px(Radius)); // where to grab it
Vector2 sh = new(MathF.Max(1f, MathF.Round(Px(1))), MathF.Max(1f, MathF.Round(Px(1)))); // the shadow's offset
long nowMs = Environment.TickCount64;
double left = v.Ready ? v.SecondsLeft(nowMs) : 0;
@ -99,12 +110,15 @@ internal sealed class DayNightWindow
Vector2 at = origin + new Vector2(pad, pad);
string icon = !v.Ready || v.Now.IsDay ? RynthIcons.Sun : HasGlyph(RynthIcons.Moon) ? RynthIcons.Moon : RynthIcons.Star;
uint iconColor = !v.Ready ? faint : v.Now.IsDay ? SunColor : MoonColor;
if (!box) PanelButtonsWindow.DrawIcon(dl, icon, at + sh, new Vector2(Px(Mark), rowH), Px(13), ShadowColor);
PanelButtonsWindow.DrawIcon(dl, icon, at, new Vector2(Px(Mark), rowH), Px(13), iconColor);
ImFontPtr nf = Font(RynthUiFont.NarrowBold11), sf = Font(RynthUiFont.Narrow9);
float tx = at.X + Px(Mark) + Px(Gap), right = origin.X + width - pad;
float lw = nf.CalcTextSizeA(Fs(nf), float.MaxValue, 0f, label).X;
dl.AddText(nf, Fs(nf), new Vector2(MathF.Round(tx), MathF.Round(at.Y + (rowH - Fs(nf)) * 0.5f)), v.Ready ? text : faint, label);
Vector2 labelAt = new(MathF.Round(tx), MathF.Round(at.Y + (rowH - Fs(nf)) * 0.5f));
if (!box) dl.AddText(nf, Fs(nf), labelAt + sh, ShadowColor, label);
dl.AddText(nf, Fs(nf), labelAt, v.Ready ? text : faint, label);
// The hour's name, right-aligned, only when it fits whole.
if (v.Ready)
@ -112,7 +126,11 @@ internal sealed class DayNightWindow
string hour = v.Now.HourName;
float hw = sf.CalcTextSizeA(Fs(sf), float.MaxValue, 0f, hour).X;
if (tx + lw + Px(8) + hw <= right)
dl.AddText(sf, Fs(sf), new Vector2(MathF.Round(right - hw), MathF.Round(at.Y + (rowH - Fs(sf)) * 0.5f)), faint, hour);
{
Vector2 hourAt = new(MathF.Round(right - hw), MathF.Round(at.Y + (rowH - Fs(sf)) * 0.5f));
if (!box) dl.AddText(sf, Fs(sf), hourAt + sh, ShadowColor, hour);
dl.AddText(sf, Fs(sf), hourAt, box ? faint : A(text, 0.8f), hour);
}
}
if (hot) SafeImGui.SetItemTooltip(Tip(v, left));
@ -139,7 +157,8 @@ internal sealed class DayNightWindow
internal static string Tip(DayNightView v, double left)
{
const string help = "A Dereth day is 2 h 7 min of real time: 63.5 minutes of day, then 63.5 of night.\n"
+ "Drag to move; Ctrl+wheel: bigger or smaller; right-click: hide (/rdef daynight).";
+ "Drag to move; Ctrl+wheel: bigger or smaller; right-click: hide (/rdef daynight).\n"
+ "/rdef daynight box: the dark box; /rdef daynight clear: no background.";
if (!v.Ready) return "Day or night in Dereth, and the real minutes until it changes. Shown once you're in the world.\n" + help;
TimeSpan t = TimeSpan.FromSeconds(Math.Ceiling(left));
string until = t.TotalMinutes >= 1 ? $"{(int)t.TotalMinutes} min {t.Seconds} s" : $"{t.Seconds} s";

View file

@ -21,9 +21,9 @@ internal static class DefCommandParser
"/rdef [use <slot or item name> | set <slot> [item name] | spell <slot> <spell name> | clear <slot> | bind <slot> <key> | unbind <slot> | "
+ "weapons [search] | fav | slots <count> | list | status | settings | panels (the game panel buttons) | selection | appraisal [pin|unpin|again|popout|dock] | corpses [clear] | "
+ "bars [add | remove <bar> | slots <bar> <count> | show <bar>] | shortcuts clearbusy [on|off] | "
+ "qty [number|max|half] | split [number] [into <pack>] | give [number] | buy [number] [item name] | daynight [show|hide]]";
+ "qty [number|max|half] | split [number] [into <pack>] | give [number] | buy [number] [item name] | daynight [show|hide|clear|box]]";
public const string DayNightUsage = "Usage: /rdef daynight [show|hide], e.g. /rdef daynight show (the Day/Night timer: real minutes to the next dawn or dusk)";
public const string DayNightUsage = "Usage: /rdef daynight [show|hide|clear|box], e.g. /rdef daynight show (the Day/Night timer: real minutes to the next dawn or dusk; clear = no background, box = its dark box)";
public const string ClearBusyUsage =
"Usage: /rdef shortcuts clearbusy on|off, e.g. /rdef shortcuts clearbusy on (a press held only by a stuck busy count clears it first; off by default)";
@ -59,14 +59,16 @@ internal static class DefCommandParser
case "selection": case "target":
// "/rdef selection 0x80001234": select that object (a test hook for the Selection window).
return new DefCommand(DefVerb.Selection, Text: rest);
// The Day/Night timer (2026-11-04): Text "show", "hide" or "" (toggle).
// The Day/Night timer (2026-11-04): Text "show", "hide" or "" (toggle); "clear" or "box" (2026-12-01) its background.
case "daynight":
return rest.ToLowerInvariant() switch
{
"" or "toggle" => new DefCommand(DefVerb.DayNight),
"show" or "on" or "open" => new DefCommand(DefVerb.DayNight, Text: "show"),
"hide" or "off" or "close" => new DefCommand(DefVerb.DayNight, Text: "hide"),
_ => Fail($"'{rest}' isn't show or hide. {DayNightUsage}"),
"clear" or "transparent" or "nobox" => new DefCommand(DefVerb.DayNight, Text: "clear"),
"box" or "background" => new DefCommand(DefVerb.DayNight, Text: "box"),
_ => Fail($"'{rest}' isn't show, hide, clear or box. {DayNightUsage}"),
};
case "fav": case "favourite": case "favorite": return new DefCommand(DefVerb.Favourite);
case "weapons": case "weapon": case "picker": return new DefCommand(DefVerb.Weapons, Text: rest);

View file

@ -118,6 +118,13 @@ internal sealed class DefSettings
/// </summary>
public bool QuantityBox = true;
/// <summary>
/// The Day/Night timer's dark box (2026-12-01: a clear background, so it takes no
/// room of its own). Off (the default, and what a file from before reads as): the timer
/// is drawn on a clear background, its sun or moon and text shadowed so they read over the radar,
/// the arrow or the world. On: the dark box as before. /rdef daynight clear | box.
/// </summary>
public bool DayNightBox;
/// <summary>
/// Shortcuts clear a stuck busy state (2026-11-04, a player's ask): a press held only by the client's
/// busy count (nothing of ours or RynthAi's in flight, no gesture, no "You're too busy" just now) resets
/// the count as RynthAi's /ra clearbusy does (the engine's ForceResetBusyCount), then goes, once per

View file

@ -41,6 +41,11 @@ internal static class DefReplies
: (true, CommandReply.Shown("Day/Night timer", state == 1) + time);
}
/// <summary>/rdef daynight clear | box: the timer's background after it.</summary>
public static (bool Ok, string Text) DayNightLook(bool box) => (true, box
? "Day/Night timer: on its dark box (/rdef daynight clear for no background)."
: "Day/Night timer: on a clear background (/rdef daynight box brings the dark box back).");
/// <summary>A slot's use started (the result shows on the bar; a problem is said in chat).</summary>
public static string UseSlot(DefSlot slot, int number) => slot.IsSpell
? $"Casting {slot.SpellLabel} (slot {number})."

View file

@ -121,7 +121,9 @@ number (the game gets no keys while the box has the keyboard) or pick 1, 10, 100
## The Day/Night timer
A one-row window (its RynthCore bar button is the sun; `/rdef daynight [show|hide]`; Settings > Interface > In The Retail Toolbar's Place >
A one-row window (its RynthCore bar button is the sun; `/rdef daynight [show|hide]`; on a clear background, the text
shadowed, so it can sit on the radar or under the arrow, and `/rdef daynight box` / `clear` puts its dark box back or
takes it away (per character, 2026-12-01); Settings > Interface > In The Retail Toolbar's Place >
*Day/Night timer*): a sun by day, a moon at night, and the **real** time until the next change, "Night in 23m",
"Day in 4m 10s" (seconds from 10 minutes down), with the Dereth hour's name when there is room. A Dereth day is
16 hours of 476.25 s, 2 h 7 min of real time: day (Dawnsong to Warmtide-and-Half) and night (Evensong to

View file

@ -34,7 +34,7 @@ public sealed partial class RynthDefectivePlugin
try
{
_dayNightWindow ??= new DayNightWindow(Host);
wantHeight = _dayNightWindow.Draw(_dayNightView);
wantHeight = _dayNightWindow.Draw(_dayNightView, _session.Settings.DayNightBox);
_dayNightFailures = 0;
return 1;
}

View file

@ -235,6 +235,14 @@ public sealed partial class RynthDefectivePlugin : RynthPluginBase
break;
case DefVerb.DayNight:
{
if (c.Text is "clear" or "box")
{
// The timer's background (2026-12-01): kept with the character's settings.
_session.Settings.DayNightBox = c.Text == "box";
RequestSave();
Answer(DefReplies.DayNightLook(_session.Settings.DayNightBox));
break;
}
// The window shown or hidden, and the time now in the reply (an engine without the window: the time only).
RynthPanelOpen mode = c.Text == "show" ? RynthPanelOpen.Open : c.Text == "hide" ? RynthPanelOpen.Close : RynthPanelOpen.Toggle;
int state = UsesShortcutBar ? Host.SetPanelOpen(Clock.DayNightWindow.Title, mode) : -1;