Add HazardZone tile tint config and state payload
This commit is contained in:
@@ -195,6 +195,19 @@
|
||||
<input type="number" asp-for="Ability.SpeedModifier" class="input" step="0.1" />
|
||||
<p class="text-xs text-gray-500 mt-1">0.5 = 50% slow</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">Hazard Tint Color</label>
|
||||
<div class="flex gap-2">
|
||||
<input type="color" value="@Model.Ability.HazardTintColor" class="w-10 h-10 rounded border border-gray-700 bg-gray-800 cursor-pointer" oninput="document.getElementById('hazardTintColor').value=this.value" />
|
||||
<input type="text" id="hazardTintColor" asp-for="Ability.HazardTintColor" class="input flex-1" />
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">Used by HazardZone tile tint</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">Hazard Tint Opacity</label>
|
||||
<input type="number" asp-for="Ability.HazardTintOpacity" class="input" step="0.01" min="0" max="1" />
|
||||
<p class="text-xs text-gray-500 mt-1">0 = invisible, 1 = solid</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -88,12 +88,17 @@ public class EditModel : AdminPageModel
|
||||
AnimationKey = Ability.AnimationKey,
|
||||
SoundEffectKey = Ability.SoundEffectKey,
|
||||
VisualEffectKey = Ability.VisualEffectKey,
|
||||
HazardTintColor = Ability.HazardTintColor,
|
||||
HazardTintOpacity = Math.Clamp(Ability.HazardTintOpacity, 0f, 1f),
|
||||
IsEnabled = true
|
||||
};
|
||||
_db.MobAbilityDefinitions.Add(newAbility);
|
||||
await _db.SaveChangesAsync();
|
||||
return RedirectToPage(new { id = newAbility.Id });
|
||||
}
|
||||
|
||||
Ability.HazardTintColor = string.IsNullOrWhiteSpace(Ability.HazardTintColor) ? "#ff5500" : Ability.HazardTintColor;
|
||||
Ability.HazardTintOpacity = Math.Clamp(Ability.HazardTintOpacity, 0f, 1f);
|
||||
|
||||
if (Ability.Id == 0)
|
||||
{
|
||||
@@ -147,6 +152,8 @@ public class EditModel : AdminPageModel
|
||||
existing.AnimationKey = Ability.AnimationKey;
|
||||
existing.SoundEffectKey = Ability.SoundEffectKey;
|
||||
existing.VisualEffectKey = Ability.VisualEffectKey;
|
||||
existing.HazardTintColor = Ability.HazardTintColor;
|
||||
existing.HazardTintOpacity = Ability.HazardTintOpacity;
|
||||
existing.IsEnabled = Ability.IsEnabled;
|
||||
existing.UpdatedAt = DateTime.UtcNow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user