Projectile handling
This commit is contained in:
@@ -586,11 +586,12 @@
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="label">Animation</label>
|
||||
<select name="animationId" class="input" required>
|
||||
<input type="text" id="animationSearch" class="input mb-2" placeholder="Type to search animations..." oninput="filterAnimations()" autocomplete="off" />
|
||||
<select name="animationId" id="animationSelect" class="input" required size="10" style="height: auto;">
|
||||
<option value="">Select an animation...</option>
|
||||
@foreach (var anim in Model.AllAnimations)
|
||||
{
|
||||
<option value="@anim.Id">[@(anim.SpriteSheet?.Name ?? "?")] @anim.Key - @anim.FrameSequence (@anim.Fps fps)</option>
|
||||
<option value="@anim.Id" data-search-text="[@(anim.SpriteSheet?.Name ?? "?")] @anim.Key - @anim.FrameSequence (@anim.Fps fps)">[@(anim.SpriteSheet?.Name ?? "?")] @anim.Key - @anim.FrameSequence (@anim.Fps fps)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
@@ -746,14 +747,32 @@
|
||||
document.getElementById('addAnimationModal').classList.add('hidden');
|
||||
document.getElementById('addAnimationModal').classList.remove('flex');
|
||||
}
|
||||
document.addEventListener('keydown', e => {
|
||||
document.addEventListener('keydown', e => {
|
||||
if (e.key === 'Escape') {
|
||||
closeAddLootModal();
|
||||
closeAddLootModal();
|
||||
closeAddAbilityModal();
|
||||
closeAddAnimationModal();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Animation search filter
|
||||
function filterAnimations() {
|
||||
const searchInput = document.getElementById('animationSearch');
|
||||
const select = document.getElementById('animationSelect');
|
||||
const searchTerm = searchInput.value.toLowerCase();
|
||||
|
||||
for (let i = 0; i < select.options.length; i++) {
|
||||
const option = select.options[i];
|
||||
const searchText = option.getAttribute('data-search-text') || option.text;
|
||||
|
||||
if (searchTerm === '' || searchText.toLowerCase().includes(searchTerm)) {
|
||||
option.style.display = '';
|
||||
} else {
|
||||
option.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Resistance type options for dynamic rows
|
||||
const resistanceOptions = `@Html.Raw(string.Join("", Model.ResistanceTypes.Select(rt => $"<option value=\"{rt.Key}\">{rt.DisplayName}</option>")))`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user