Snapshot for release 2026.10.28.2 (internal 48c46bd)
This commit is contained in:
parent
b23cabc338
commit
636adfcef2
41 changed files with 3402 additions and 120 deletions
|
|
@ -59,7 +59,7 @@ internal sealed class BarSettingsView
|
|||
if (st.IndependentBar && _s.CopyOffer > 0)
|
||||
{
|
||||
int n = _s.CopyOffer;
|
||||
w.TextColored(SlotText.Waiting, $"The game's 18 slots hold {n} item{(n == 1 ? "" : "s")}. Copy {(n == 1 ? "it" : "them")} into this bar's slots 1-18?");
|
||||
w.TextColored(SlotText.Waiting, $"The game's 18 slots hold {n} shortcut{(n == 1 ? "" : "s")} (items and spells). Copy {(n == 1 ? "it" : "them")} into this bar's slots 1-18?");
|
||||
w.TextWrapped("Your own slots move after them, to 19 and on, with their keys, so the bar looks as before. "
|
||||
+ "The game's toolbar and its keys stay as they are.");
|
||||
w.SmallButton("Copy them", "set.copy", () => Tell(_s.CopyRetailSlots()));
|
||||
|
|
|
|||
|
|
@ -121,6 +121,24 @@ internal sealed class BarView
|
|||
color = SlotText.Plain;
|
||||
bool icons = _s.Settings.ShowIcons && _s.IconsAvailable;
|
||||
|
||||
if (slot.IsSpell)
|
||||
{
|
||||
// A spell slot (set with /rdef spell or on the Shortcuts bar): its picture, or its initials.
|
||||
string spell = slot.SpellLabel;
|
||||
SpellInfo? info = SpellTable.TryGet(slot.SpellId, out SpellInfo si) ? si : null;
|
||||
bool casting = _s.Use.InvolvesSpell(slot.SpellId);
|
||||
if (icons) w.ImageButton(UiFormat.IconKindSpell, slot.SpellId, id, () => Press(number), size, size, 0xFFFFFFFFu, casting ? SlotText.Waiting : 0u);
|
||||
else
|
||||
{
|
||||
if (casting) w.PushStyleColor(UiFormat.ColButton, SlotText.Waiting);
|
||||
w.Button(SlotText.Abbreviation(spell), id, () => Press(number), size + 8f, size + 8f);
|
||||
if (casting) w.PopStyleColor();
|
||||
}
|
||||
w.Tooltip($"Slot {number}: {spell}, a spell.\nClick or press the key: {SpellTargeting.Describe(info)} (Magic mode first)."
|
||||
+ (keyFull != null ? "\nKey: " + keyFull : "\nNo key yet (Edit slots)."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (slot.Item == null)
|
||||
{
|
||||
w.Button("+", id, () => Choose(number), size + 8f, size + 8f);
|
||||
|
|
|
|||
|
|
@ -57,11 +57,12 @@ internal sealed class SlotEditor
|
|||
DefSlot slot = _s.Data.Slots[n - 1];
|
||||
int number = n;
|
||||
string? key = _s.KeyOfSlot(n);
|
||||
string name = slot.Item == null ? "(empty)" : slot.Item.FullName;
|
||||
string name = slot.Empty ? "(empty)" : slot.Label;
|
||||
if (icons)
|
||||
{
|
||||
CarriedItem? have = slot.Item == null ? null : ItemMatcher.Find(slot.Item, items, out _);
|
||||
if (have != null) w.Image(UiFormat.IconKindObject, have.Id, RowIcon, RowIcon);
|
||||
if (slot.IsSpell) w.Image(UiFormat.IconKindSpell, slot.SpellId, RowIcon, RowIcon);
|
||||
else if (have != null) w.Image(UiFormat.IconKindObject, have.Id, RowIcon, RowIcon);
|
||||
else if (slot.Item != null && slot.Item.Icon != 0) w.Image(UiFormat.IconKindIcon, slot.Item.Icon, RowIcon, RowIcon, UiFormat.Rgb(255, 255, 255, 90));
|
||||
else w.Dummy(RowIcon, RowIcon);
|
||||
w.SameLine();
|
||||
|
|
@ -78,7 +79,7 @@ internal sealed class SlotEditor
|
|||
{
|
||||
int n = _selected;
|
||||
DefSlot slot = _s.Data.Slots[n - 1];
|
||||
w.TextColored(UiColors.Gold, $"Slot {n}: " + (slot.Item == null ? "(empty)" : slot.Item.FullName));
|
||||
w.TextColored(UiColors.Gold, $"Slot {n}: " + (slot.Empty ? "(empty)" : slot.Label));
|
||||
|
||||
w.Button("Set from selected", "ed.set", () => Say(_s.SetFromSelected(n)));
|
||||
w.Tooltip("Select an item in the game (click it in your pack), then press this: it goes in this slot.");
|
||||
|
|
@ -99,6 +100,13 @@ internal sealed class SlotEditor
|
|||
|
||||
if (_picking) DrawPackPicker(w, items, n);
|
||||
|
||||
if (slot.IsSpell)
|
||||
{
|
||||
SpellInfo? info = SpellTable.TryGet(slot.SpellId, out SpellInfo si) ? si : null;
|
||||
w.TextDisabled($"A spell: pressing the slot has it {SpellTargeting.Describe(info)} (Magic mode first). /rdef spell {n} <name> puts another in.");
|
||||
DrawKey(w, n, slot);
|
||||
return;
|
||||
}
|
||||
if (slot.Item == null) return;
|
||||
|
||||
int mode = (int)slot.Mode;
|
||||
|
|
|
|||
Loading…
Reference in a new issue