added new gif event
This commit is contained in:
parent
65c18f4f51
commit
40db3d08c0
|
|
@ -136,6 +136,7 @@ public class ClubTerminologyService(
|
||||||
ThrowEventType.Bell => await GetTermAsync(TermKey.Bell),
|
ThrowEventType.Bell => await GetTermAsync(TermKey.Bell),
|
||||||
ThrowEventType.Gutter => await GetTermAsync(TermKey.Gutter),
|
ThrowEventType.Gutter => await GetTermAsync(TermKey.Gutter),
|
||||||
ThrowEventType.NoWood => await GetTermAsync(TermKey.NoWood),
|
ThrowEventType.NoWood => await GetTermAsync(TermKey.NoWood),
|
||||||
|
ThrowEventType.Cleared => "Abgeräumt",
|
||||||
_ => type.ToString()
|
_ => type.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,5 @@ public enum ThrowEventType
|
||||||
Bell = 4, // Glocke - bell hit
|
Bell = 4, // Glocke - bell hit
|
||||||
Gutter = 8, // Rinne - gutter throw
|
Gutter = 8, // Rinne - gutter throw
|
||||||
NoWood = 16, // Fehlwurf - no pins hit
|
NoWood = 16, // Fehlwurf - no pins hit
|
||||||
|
Cleared = 32, // Abgeräumt - remaining pins hit
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class ClubGifRepository(IDbContextFactory<AppDbContext> contextFactory) :
|
||||||
await using var context = await contextFactory.CreateDbContextAsync(ct);
|
await using var context = await contextFactory.CreateDbContextAsync(ct);
|
||||||
|
|
||||||
// Get top-rated GIFs for each event type
|
// Get top-rated GIFs for each event type
|
||||||
var allEvents = new[] { ThrowEventType.Strike, ThrowEventType.Circle, ThrowEventType.Bell, ThrowEventType.Gutter, ThrowEventType.NoWood };
|
var allEvents = new[] { ThrowEventType.Strike, ThrowEventType.Circle, ThrowEventType.Bell, ThrowEventType.Gutter, ThrowEventType.NoWood, ThrowEventType.Cleared };
|
||||||
var result = new List<ClubGif>();
|
var result = new List<ClubGif>();
|
||||||
|
|
||||||
foreach (var eventType in allEvents)
|
foreach (var eventType in allEvents)
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@
|
||||||
ThrowEventType.Bell => _termBell,
|
ThrowEventType.Bell => _termBell,
|
||||||
ThrowEventType.Gutter => _termGutter,
|
ThrowEventType.Gutter => _termGutter,
|
||||||
ThrowEventType.NoWood => _termNoWood,
|
ThrowEventType.NoWood => _termNoWood,
|
||||||
|
ThrowEventType.Cleared => "ABGERÄUMT!",
|
||||||
_ => ""
|
_ => ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<MudCheckBox @bind-Value="_bell" Label="@_termBell" Color="Color.Warning" />
|
<MudCheckBox @bind-Value="_bell" Label="@_termBell" Color="Color.Warning" />
|
||||||
<MudCheckBox @bind-Value="_gutter" Label="@_termGutter" Color="Color.Error" />
|
<MudCheckBox @bind-Value="_gutter" Label="@_termGutter" Color="Color.Error" />
|
||||||
<MudCheckBox @bind-Value="_noWood" Label="@_termNoWood" Color="Color.Tertiary" />
|
<MudCheckBox @bind-Value="_noWood" Label="@_termNoWood" Color="Color.Tertiary" />
|
||||||
|
<MudCheckBox @bind-Value="_cleared" Label="Abgeräumt" Color="Color.Info" />
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
<MudTextField @bind-Value="_description"
|
<MudTextField @bind-Value="_description"
|
||||||
|
|
@ -63,7 +64,7 @@
|
||||||
|
|
||||||
private string _name = "";
|
private string _name = "";
|
||||||
private string _description = "";
|
private string _description = "";
|
||||||
private bool _strike, _circle, _bell, _gutter, _noWood;
|
private bool _strike, _circle, _bell, _gutter, _noWood, _cleared;
|
||||||
private bool _isEnabled = true;
|
private bool _isEnabled = true;
|
||||||
private string _termBell = "Glocke";
|
private string _termBell = "Glocke";
|
||||||
private string _termGutter = "Rinne";
|
private string _termGutter = "Rinne";
|
||||||
|
|
@ -93,6 +94,7 @@
|
||||||
_bell = (Gif.AssignedEvents & ThrowEventType.Bell) != 0;
|
_bell = (Gif.AssignedEvents & ThrowEventType.Bell) != 0;
|
||||||
_gutter = (Gif.AssignedEvents & ThrowEventType.Gutter) != 0;
|
_gutter = (Gif.AssignedEvents & ThrowEventType.Gutter) != 0;
|
||||||
_noWood = (Gif.AssignedEvents & ThrowEventType.NoWood) != 0;
|
_noWood = (Gif.AssignedEvents & ThrowEventType.NoWood) != 0;
|
||||||
|
_cleared = (Gif.AssignedEvents & ThrowEventType.Cleared) != 0;
|
||||||
_isEnabled = Gif.IsEnabled;
|
_isEnabled = Gif.IsEnabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -105,6 +107,7 @@
|
||||||
if (_bell) events |= ThrowEventType.Bell;
|
if (_bell) events |= ThrowEventType.Bell;
|
||||||
if (_gutter) events |= ThrowEventType.Gutter;
|
if (_gutter) events |= ThrowEventType.Gutter;
|
||||||
if (_noWood) events |= ThrowEventType.NoWood;
|
if (_noWood) events |= ThrowEventType.NoWood;
|
||||||
|
if (_cleared) events |= ThrowEventType.Cleared;
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
@using Koogle.Application.DTOs
|
@using Koogle.Application.DTOs
|
||||||
|
@using Koogle.Application.Interfaces
|
||||||
@using Koogle.Domain.Enums
|
@using Koogle.Domain.Enums
|
||||||
|
|
||||||
|
@inject IClubTerminologyService Term
|
||||||
|
|
||||||
<MudDialog>
|
<MudDialog>
|
||||||
<TitleContent>
|
<TitleContent>
|
||||||
<MudText Typo="Typo.h6">GIF von URL importieren</MudText>
|
<MudText Typo="Typo.h6">GIF von URL importieren</MudText>
|
||||||
|
|
@ -21,9 +24,10 @@
|
||||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-4">
|
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-4">
|
||||||
<MudCheckBox @bind-Value="_strike" Label="Alle 9" Color="Color.Success" />
|
<MudCheckBox @bind-Value="_strike" Label="Alle 9" Color="Color.Success" />
|
||||||
<MudCheckBox @bind-Value="_circle" Label="Kranz" Color="Color.Primary" />
|
<MudCheckBox @bind-Value="_circle" Label="Kranz" Color="Color.Primary" />
|
||||||
<MudCheckBox @bind-Value="_bell" Label="Glocke" Color="Color.Warning" />
|
<MudCheckBox @bind-Value="_bell" Label="@_termBell" Color="Color.Warning" />
|
||||||
<MudCheckBox @bind-Value="_gutter" Label="Rinne" Color="Color.Error" />
|
<MudCheckBox @bind-Value="_gutter" Label="@_termGutter" Color="Color.Error" />
|
||||||
<MudCheckBox @bind-Value="_noWood" Label="kein Holz" Color="Color.Tertiary" />
|
<MudCheckBox @bind-Value="_noWood" Label="@_termNoWood" Color="Color.Tertiary" />
|
||||||
|
<MudCheckBox @bind-Value="_cleared" Label="Abgeräumt" Color="Color.Info" />
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
<MudTextField @bind-Value="_description"
|
<MudTextField @bind-Value="_description"
|
||||||
|
|
@ -41,10 +45,14 @@
|
||||||
@code {
|
@code {
|
||||||
[CascadingParameter] IMudDialogInstance MudDialog { get; set; } = null!;
|
[CascadingParameter] IMudDialogInstance MudDialog { get; set; } = null!;
|
||||||
|
|
||||||
|
private string _termBell = "Glocke";
|
||||||
|
private string _termGutter = "Rinne";
|
||||||
|
private string _termNoWood = "Pudel";
|
||||||
|
|
||||||
private string _url = "";
|
private string _url = "";
|
||||||
private string _name = "";
|
private string _name = "";
|
||||||
private string _description = "";
|
private string _description = "";
|
||||||
private bool _strike, _circle, _bell, _gutter, _noWood;
|
private bool _strike, _circle, _bell, _gutter, _noWood, _cleared;
|
||||||
|
|
||||||
private bool IsValid => !string.IsNullOrWhiteSpace(_url)
|
private bool IsValid => !string.IsNullOrWhiteSpace(_url)
|
||||||
&& !string.IsNullOrWhiteSpace(_name)
|
&& !string.IsNullOrWhiteSpace(_name)
|
||||||
|
|
@ -59,6 +67,7 @@
|
||||||
if (_bell) events |= ThrowEventType.Bell;
|
if (_bell) events |= ThrowEventType.Bell;
|
||||||
if (_gutter) events |= ThrowEventType.Gutter;
|
if (_gutter) events |= ThrowEventType.Gutter;
|
||||||
if (_noWood) events |= ThrowEventType.NoWood;
|
if (_noWood) events |= ThrowEventType.NoWood;
|
||||||
|
if (_cleared) events |= ThrowEventType.Cleared;
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,4 +84,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Cancel() => MudDialog.Cancel();
|
private void Cancel() => MudDialog.Cancel();
|
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (firstRender)
|
||||||
|
{
|
||||||
|
_termBell = await Term.GetTermAsync(TermKey.Bell);
|
||||||
|
_termGutter = await Term.GetTermAsync(TermKey.Gutter);
|
||||||
|
_termNoWood = await Term.GetTermAsync(TermKey.NoWood);
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -512,6 +512,7 @@
|
||||||
if ((events & ThrowEventType.Bell) != 0) result.Add(ThrowEventType.Bell);
|
if ((events & ThrowEventType.Bell) != 0) result.Add(ThrowEventType.Bell);
|
||||||
if ((events & ThrowEventType.Gutter) != 0) result.Add(ThrowEventType.Gutter);
|
if ((events & ThrowEventType.Gutter) != 0) result.Add(ThrowEventType.Gutter);
|
||||||
if ((events & ThrowEventType.NoWood) != 0) result.Add(ThrowEventType.NoWood);
|
if ((events & ThrowEventType.NoWood) != 0) result.Add(ThrowEventType.NoWood);
|
||||||
|
if ((events & ThrowEventType.Cleared) != 0) result.Add(ThrowEventType.Cleared);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -522,6 +523,7 @@
|
||||||
ThrowEventType.Bell => Color.Warning,
|
ThrowEventType.Bell => Color.Warning,
|
||||||
ThrowEventType.Gutter => Color.Error,
|
ThrowEventType.Gutter => Color.Error,
|
||||||
ThrowEventType.NoWood => Color.Tertiary,
|
ThrowEventType.NoWood => Color.Tertiary,
|
||||||
|
ThrowEventType.Cleared => Color.Info,
|
||||||
_ => Color.Default
|
_ => Color.Default
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
<MudCheckBox @bind-Value="_bell" Label="@_termBell" Color="Color.Warning" />
|
<MudCheckBox @bind-Value="_bell" Label="@_termBell" Color="Color.Warning" />
|
||||||
<MudCheckBox @bind-Value="_noWood" Label="@_termNoWood" Color="Color.Tertiary" />
|
<MudCheckBox @bind-Value="_noWood" Label="@_termNoWood" Color="Color.Tertiary" />
|
||||||
<MudCheckBox @bind-Value="_gutter" Label="@_termGutter" Color="Color.Error" />
|
<MudCheckBox @bind-Value="_gutter" Label="@_termGutter" Color="Color.Error" />
|
||||||
|
<MudCheckBox @bind-Value="_cleared" Label="Abgeräumt" Color="Color.Info" />
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
<MudTextField @bind-Value="_description"
|
<MudTextField @bind-Value="_description"
|
||||||
|
|
@ -46,12 +47,12 @@
|
||||||
|
|
||||||
private string _name = "";
|
private string _name = "";
|
||||||
private string _description = "";
|
private string _description = "";
|
||||||
private bool _strike, _circle, _bell, _gutter, _noWood;
|
private bool _strike, _circle, _bell, _gutter, _noWood, _cleared;
|
||||||
private string _termGutter = "Rinne";
|
private string _termGutter = "Rinne";
|
||||||
private string _termNoWood = "Pudel";
|
private string _termNoWood = "Pudel";
|
||||||
private string _termBell = "Glocke";
|
private string _termBell = "Glocke";
|
||||||
|
|
||||||
private bool IsValid => !string.IsNullOrWhiteSpace(_name) && (_strike || _circle || _bell || _gutter || _noWood);
|
private bool IsValid => !string.IsNullOrWhiteSpace(_name) && (_strike || _circle || _bell || _gutter || _noWood || _cleared);
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
|
|
@ -72,6 +73,7 @@
|
||||||
if (_bell) events |= ThrowEventType.Bell;
|
if (_bell) events |= ThrowEventType.Bell;
|
||||||
if (_gutter) events |= ThrowEventType.Gutter;
|
if (_gutter) events |= ThrowEventType.Gutter;
|
||||||
if (_noWood) events |= ThrowEventType.NoWood;
|
if (_noWood) events |= ThrowEventType.NoWood;
|
||||||
|
if (_cleared) events |= ThrowEventType.Cleared;
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1059,6 +1059,10 @@ public class GameEffects
|
||||||
{
|
{
|
||||||
triggeredEvent = ThrowEventType.NoWood;
|
triggeredEvent = ThrowEventType.NoWood;
|
||||||
}
|
}
|
||||||
|
else if (afterThrowState.IsCleared)
|
||||||
|
{
|
||||||
|
triggeredEvent = ThrowEventType.Cleared;
|
||||||
|
}
|
||||||
|
|
||||||
if (!triggeredEvent.HasValue)
|
if (!triggeredEvent.HasValue)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue