RynthSuite as of 2026-11-10 (internal 4b4d024): release 2026.11.10.1
This commit is contained in:
parent
81de36a2e5
commit
16b6531ede
4 changed files with 27 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ namespace RynthCore.Plugin.RynthLua;
|
|||
/// views.Huds.GetIconTexture / GetObjectIconTexture / GetSpellIconTexture (LibraryIcons.cs).
|
||||
/// The imgui module is in LibraryImGui.cs.
|
||||
///
|
||||
/// hud (§1.2): Name, LastError, IsDisposed (read-only); Title, Visible, ShowInBar,
|
||||
/// hud (§1.2): Name, LastError, IsDisposed (read-only); Title, Visible, ShowInBar, NoPopOut,
|
||||
/// WindowSettings, Chrome, DefaultSize, RefreshRate (read/write); OnPreRender / OnRender /
|
||||
/// OnShow / OnHide (events with Add / Once / Until / Remove); Dispose(). ImGui calls only
|
||||
/// record into the hud's display list during its render pass (ScriptWindows.cs); results
|
||||
|
|
@ -77,6 +77,7 @@ public sealed partial class RynthLuaPlugin
|
|||
"Title" => DynValue.NewString(hud.Title),
|
||||
"Visible" => DynValue.NewBoolean(hud.Visible),
|
||||
"ShowInBar" => DynValue.NewBoolean(hud.ShowInBar),
|
||||
"NoPopOut" => DynValue.NewBoolean(hud.NoPopOut),
|
||||
"WindowSettings" => DynValue.NewNumber(hud.WindowSettings),
|
||||
"Chrome" => DynValue.NewString(hud.ChromeNone ? "none" : "standard"),
|
||||
"DefaultSize" => LibraryImGuiValues.NewVec2(s, hud.DefaultSize.X, hud.DefaultSize.Y),
|
||||
|
|
@ -106,6 +107,13 @@ public sealed partial class RynthLuaPlugin
|
|||
if (hud.ShowInBar != show) { hud.ShowInBar = show; hud.PropsDirty = true; }
|
||||
break;
|
||||
}
|
||||
case "NoPopOut":
|
||||
{
|
||||
// No ↗ for this window; set while it is popped out, it goes back into the game window.
|
||||
bool no = v.CastToBool();
|
||||
if (hud.NoPopOut != no) { hud.NoPopOut = no; hud.PropsDirty = true; }
|
||||
break;
|
||||
}
|
||||
case "WindowSettings":
|
||||
SetHudWindowSettings(hud, WindowSettingsArg(v));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ internal sealed class ScriptHud
|
|||
public bool NoBackground = false;
|
||||
public bool NoScrollbar = false;
|
||||
public bool NoScrollWithMouse = false;
|
||||
/// <summary>No ↗: the window can't pop out of the game window (a bare, Chrome "none", one never can).</summary>
|
||||
public bool NoPopOut = false;
|
||||
/// <summary>Panel logical units; 0 = the engine's default. Persistent.</summary>
|
||||
public Vector2 DefaultSize = Vector2.Zero;
|
||||
public Vector2 MinSize = Vector2.Zero;
|
||||
|
|
@ -148,6 +150,7 @@ internal sealed class ScriptHud
|
|||
if (NoBackground) f |= HudFormat.FlagNoBackground;
|
||||
if (NoScrollbar) f |= HudFormat.FlagNoScrollbar;
|
||||
if (NoScrollWithMouse) f |= HudFormat.FlagNoScrollWithMouse;
|
||||
if (NoPopOut) f |= HudFormat.FlagNoPopOut;
|
||||
if (LastError != null) f |= HudFormat.FlagHasError;
|
||||
if (PosIsDefault && !HudFormat.IsNone(RequestPos)) f |= HudFormat.FlagPosIsDefault;
|
||||
return f;
|
||||
|
|
@ -278,6 +281,7 @@ internal static class HudFormat
|
|||
public const uint FlagNoBackground = 1u << 4;
|
||||
public const uint FlagNoScrollbar = 1u << 5;
|
||||
public const uint FlagNoScrollWithMouse = 1u << 6;
|
||||
public const uint FlagNoPopOut = 1u << 8;
|
||||
public const uint FlagHasError = 1u << 9;
|
||||
public const uint FlagPosIsDefault = 1u << 10;
|
||||
|
||||
|
|
|
|||
|
|
@ -2556,6 +2556,7 @@ Vector4 = {}
|
|||
---@field Title string The header text (default, and nil: the name).
|
||||
---@field Visible boolean Starts as the player's last choice for this hud on this character, else false. Set by the script, it isn't remembered.
|
||||
---@field ShowInBar boolean Listed in the bar's Scripts menu (default true).
|
||||
---@field NoPopOut boolean No ↗: the window can't pop out of the game window (default false; bare windows never do).
|
||||
---@field WindowSettings ImGuiWindowFlags|integer The whole flag set (0 to 4294967295; nil = 0). Honoured: NoTitleBar, NoInputs/NoMouseInputs, NoBackground, NoScrollbar, NoScrollWithMouse.
|
||||
---@field Chrome RynthLua.HudChrome "standard" (the RynthCore frame) or "none" (no header or grip).
|
||||
---@field DefaultSize Vector2 Size while nothing is saved for the window; nil = the engine default. Also takes {x, y}.
|
||||
|
|
|
|||
|
|
@ -1643,6 +1643,19 @@ namespace RynthLua.ScriptWindowsTests
|
|||
r.Do("hud.ShowInBar = false");
|
||||
Check(!h.ShowInBar && h.PropsDirty && (h.HeaderFlags() & HudFormat.FlagShowInBar) == 0, "ShowInBar false clears the header bit");
|
||||
|
||||
// NoPopOut (header bit8: no ↗; the engine redocks a popped-out window when it turns on).
|
||||
Check(!r.Eval("hud.NoPopOut").CastToBool() && (h.HeaderFlags() & HudFormat.FlagNoPopOut) == 0, "NoPopOut starts false");
|
||||
h.PropsDirty = false;
|
||||
r.Do("hud.NoPopOut = true");
|
||||
Check(h.NoPopOut && h.PropsDirty && (h.HeaderFlags() & HudFormat.FlagNoPopOut) != 0 && r.Eval("hud.NoPopOut").CastToBool(), "NoPopOut true sets the header bit");
|
||||
int rcPop = Parse(new[] { h }, out var wPop, out string errPop, out _);
|
||||
Check(rcPop == 0 && (wPop[0].Flags & WindowFlags.NoPopOut) != 0 && HudFormat.FlagNoPopOut == WindowFlags.NoPopOut, "the engine reads NoPopOut " + errPop);
|
||||
h.PropsDirty = false;
|
||||
r.Do("hud.NoPopOut = true");
|
||||
Check(!h.PropsDirty, "setting the same NoPopOut again changes nothing");
|
||||
r.Do("hud.NoPopOut = false");
|
||||
Check(!h.NoPopOut && h.PropsDirty && (h.HeaderFlags() & HudFormat.FlagNoPopOut) == 0, "NoPopOut false clears it");
|
||||
|
||||
// Read-only members and the script's own fields.
|
||||
LuaFails(r, "hud.Name = 'x'", "read-only");
|
||||
LuaFails(r, "hud.LastError = 'x'", "read-only");
|
||||
|
|
|
|||
Loading…
Reference in a new issue