From f0e05b178a1ce0d06ff19ace102098ed0adbeac1 Mon Sep 17 00:00:00 2001 From: Eduardo <6845999+eduardosmaniotto@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:57:29 -0300 Subject: [PATCH 1/4] fix: removing entry from plugin timetable updates in real-time --- .../Components/Form/ValueListWrapper.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Web/Shared/Components/Form/ValueListWrapper.cs b/src/Web/Shared/Components/Form/ValueListWrapper.cs index e06407816..860abc01e 100644 --- a/src/Web/Shared/Components/Form/ValueListWrapper.cs +++ b/src/Web/Shared/Components/Form/ValueListWrapper.cs @@ -64,25 +64,28 @@ public void CopyTo(TValue[] array, int arrayIndex) /// public bool Remove(TValue item) { - if (this._innerList.Remove(item)) + var wrapperIndex = this.FindIndex(v => Equals(v.Value, item)); + if (wrapperIndex >= 0) { - var wrapperIndex = this.FindIndex(v => Equals(v.Value, item)); - if (wrapperIndex >= 0) - { - this[wrapperIndex].PropertyChanged -= this.OnValueChanged; - this.RemoveAt(wrapperIndex); - for (int i = wrapperIndex; i < this._innerList.Count; i++) - { - this[i].Index = i; - } - } - + this.RemoveAt(wrapperIndex); return true; } return false; } + /// + public new void RemoveAt(int index) + { + this._innerList.RemoveAt(index); + this[index].PropertyChanged -= this.OnValueChanged; + base.RemoveAt(index); + for (int i = index; i < this._innerList.Count; i++) + { + this[i].Index = i; + } + } + /// public bool IsReadOnly => this._innerList.IsReadOnly; From 121816ae23d841dd5253307398d1cb9e321b67cc Mon Sep 17 00:00:00 2001 From: Eduardo <6845999+eduardosmaniotto@users.noreply.github.com> Date: Wed, 4 Mar 2026 22:12:26 -0300 Subject: [PATCH 2/4] code review: fix gemini-code-assist warnings --- src/Web/Shared/Components/Form/ValueListWrapper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Web/Shared/Components/Form/ValueListWrapper.cs b/src/Web/Shared/Components/Form/ValueListWrapper.cs index 860abc01e..242b7ef38 100644 --- a/src/Web/Shared/Components/Form/ValueListWrapper.cs +++ b/src/Web/Shared/Components/Form/ValueListWrapper.cs @@ -77,10 +77,10 @@ public bool Remove(TValue item) /// public new void RemoveAt(int index) { - this._innerList.RemoveAt(index); this[index].PropertyChanged -= this.OnValueChanged; base.RemoveAt(index); - for (int i = index; i < this._innerList.Count; i++) + this._innerList.RemoveAt(index); + for (int i = index; i < this.Count; i++) { this[i].Index = i; } From 8713cc6c1350c7ba66af00eee8d80ac9946a4bbf Mon Sep 17 00:00:00 2001 From: Eduardo <6845999+eduardosmaniotto@users.noreply.github.com> Date: Thu, 5 Mar 2026 00:03:54 -0300 Subject: [PATCH 3/4] fix: create attribute in account page --- src/AttributeSystem/StatAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AttributeSystem/StatAttribute.cs b/src/AttributeSystem/StatAttribute.cs index 4d53cdbff..3f5982035 100644 --- a/src/AttributeSystem/StatAttribute.cs +++ b/src/AttributeSystem/StatAttribute.cs @@ -40,7 +40,7 @@ public StatAttribute(AttributeDefinition definition, float baseValue) { get { - if (this.Definition.MaximumValue.HasValue) + if (this.Definition?.MaximumValue.HasValue is true) { return Math.Min(this.Definition.MaximumValue.Value, this._statValue); } From ede4b5c37218d6de28736d39699105a1fa39f71a Mon Sep 17 00:00:00 2001 From: Eduardo <6845999+eduardosmaniotto@users.noreply.github.com> Date: Mon, 9 Mar 2026 23:40:37 -0300 Subject: [PATCH 4/4] feature: duplicate item on ItemStorageField --- .../Components/Form/ItemStorageField.razor | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Web/Shared/Components/Form/ItemStorageField.razor b/src/Web/Shared/Components/Form/ItemStorageField.razor index 9f7f87b60..c493d47e3 100644 --- a/src/Web/Shared/Components/Form/ItemStorageField.razor +++ b/src/Web/Shared/Components/Form/ItemStorageField.razor @@ -70,10 +70,12 @@ @if (this._selectedItem is null) { + } else { + } @@ -192,4 +194,25 @@ this._selectedItem = item; } } + + private void OnDuplicateItemClickAsync() + { + if (this._selectedItem is null || this.Value is not { } itemStorage) + { + return; + } + + var duplicate = this.PersistenceContext.CreateNew(); + duplicate.AssignValues(this._selectedItem); + + // Place the duplicate in the next available slot after the source item + var occupiedSlots = itemStorage.Items.Select(i => i.ItemSlot).ToHashSet(); + var nextSlot = Enumerable.Range(this._selectedItem.ItemSlot + 1, byte.MaxValue - this._selectedItem.ItemSlot) + .Select(i => (byte)i) + .FirstOrDefault(s => !occupiedSlots.Contains(s)); + duplicate.ItemSlot = nextSlot; + + itemStorage.Items.Add(duplicate); + this._selectedItem = duplicate; + } }