Snapshot for release 2026.10.29.2 (internal 6c69cb8)
This commit is contained in:
parent
036ef594ed
commit
6c15f65e94
8 changed files with 41 additions and 8 deletions
|
|
@ -48,10 +48,11 @@ internal sealed record BarSlot(
|
|||
/// <summary>
|
||||
/// The bar as drawn. Independent: every slot is RynthDefective's own (DefSettings.IndependentBar).
|
||||
/// Spells: the character's spells, A-Z, for "Put a spell here..." (empty when they can't be read);
|
||||
/// CanCast: the engine casts for plugins.
|
||||
/// CanCast: the engine casts for plugins. WeaponsButton: the title shows the Weapons button
|
||||
/// (DefSettings.WeaponsButtonOnBar).
|
||||
/// </summary>
|
||||
internal sealed record BarSnapshot(BarSlot[] Slots, bool Ready, int IconSize, bool Independent = false,
|
||||
IReadOnlyList<SpellInfo>? Spells = null, bool CanCast = false)
|
||||
IReadOnlyList<SpellInfo>? Spells = null, bool CanCast = false, bool WeaponsButton = false)
|
||||
{
|
||||
public static readonly BarSnapshot NotReady = new(Array.Empty<BarSlot>(), false, 36);
|
||||
|
||||
|
|
@ -98,7 +99,7 @@ internal sealed class BarSnapshotBuilder
|
|||
// Every slot is RynthDefective's own: AC's toolbar isn't read or shown (BarMapping).
|
||||
var own = new BarSlot[st.BarSlots];
|
||||
for (int n = 1; n <= st.BarSlots; n++) own[n - 1] = Own(n, BarMapping.OwnSlot(n, true), true, session, items, spells, _host);
|
||||
return new BarSnapshot(own, true, st.ButtonSize, true, spells, canCast);
|
||||
return new BarSnapshot(own, true, st.ButtonSize, true, spells, canCast, st.WeaponsButtonOnBar);
|
||||
}
|
||||
if (_host.GetShortcuts(_ids, _spells) == 0) return BarSnapshot.NotReady;
|
||||
RefreshKeys(now);
|
||||
|
|
@ -108,7 +109,7 @@ internal sealed class BarSnapshotBuilder
|
|||
var slots = new BarSlot[st.BarSlots];
|
||||
for (int n = 1; n <= st.BarSlots; n++)
|
||||
slots[n - 1] = BarMapping.IsRetail(n, false) ? Retail(n, byId) : Own(n, BarMapping.OwnSlot(n, false), false, session, items, spells, _host);
|
||||
return new BarSnapshot(slots, true, st.ButtonSize, false, spells, canCast);
|
||||
return new BarSnapshot(slots, true, st.ButtonSize, false, spells, canCast, st.WeaponsButtonOnBar);
|
||||
}
|
||||
|
||||
private BarSlot Retail(int n, Dictionary<uint, CarriedItem> byId)
|
||||
|
|
|
|||
|
|
@ -184,7 +184,8 @@ internal sealed class ShortcutBarWindow
|
|||
private float Header(ImDrawListPtr dl, BarSnapshot view, float x0, float y, float w)
|
||||
{
|
||||
float h = Px(HeaderH), chip = Px(ChipSize);
|
||||
const int chips = 4;
|
||||
// The Weapons button only when the settings ask for it (DefSettings.WeaponsButtonOnBar).
|
||||
int chips = view.WeaponsButton ? 4 : 3;
|
||||
float chipsW = chips * chip + (chips - 1) * Px(1);
|
||||
|
||||
ImGui.SetCursorScreenPos(new Vector2(x0, y));
|
||||
|
|
@ -207,9 +208,12 @@ internal sealed class ShortcutBarWindow
|
|||
_edit ? "Done editing." : "Edit: the slot numbers, and - / + to take a slot off or add one.", _edit))
|
||||
_edit = !_edit;
|
||||
cx += chip + Px(1);
|
||||
if (Chip("##sb_weapons", RynthIcons.Sword, new Vector2(cx, cy), _faint, "Weapons: every weapon and wand you carry, wield one with a click."))
|
||||
_act.ShowWeapons();
|
||||
cx += chip + Px(1);
|
||||
if (view.WeaponsButton)
|
||||
{
|
||||
if (Chip("##sb_weapons", RynthIcons.Sword, new Vector2(cx, cy), _faint, "Weapons: every weapon and wand you carry, wield one with a click."))
|
||||
_act.ShowWeapons();
|
||||
cx += chip + Px(1);
|
||||
}
|
||||
if (Chip("##sb_settings", RynthIcons.Gear, new Vector2(cx, cy), _faint,
|
||||
"Settings (/rdef settings): weapon swaps under RynthAi, a bar independent of the game's toolbar,\nand showing the Game Panels buttons and the Selection window."))
|
||||
_act.ShowSettings();
|
||||
|
|
|
|||
Loading…
Reference in a new issue