From 03aa64cd70d862120bafcef56ccfc8ab1143466f Mon Sep 17 00:00:00 2001 From: floribe2000 Date: Sat, 28 Oct 2023 02:16:14 +0200 Subject: [PATCH] improvements from review --- .../AccelerationCharts.razor | 6 +- .../ShipBuildContainerSelectionDialog.razor | 2 +- .../Features/BallisticCharts/Charts.razor | 2 +- .../ShipAndShellSelectionDialog.razor | 65 +++++++++---------- .../Components/BuildConfigurationDialog.razor | 34 +++++----- .../Components/BuildImageSettingsDialog.razor | 18 ++--- .../CaptainSkillSelectorImageRender.razor | 2 +- .../SignalSelectorImageRender.razor | 2 +- .../ShipComparison/ComparisonShipFilter.razor | 37 +++++------ .../HideComparisonColumnsDialog.razor | 8 +-- .../ShipComparison/ShipComparison.razor | 12 ++-- .../Features/ShipSelection/ShipSelector.razor | 14 ++-- .../Components/CaptainSkillSelector.razor | 2 +- .../ShipStats/Components/ShipStatsPanel.razor | 17 ++--- .../Features/ShipStats/ShipStats.razor | 14 ++-- .../Infrastructure/Utility/Helpers.cs | 3 +- WoWsShipBuilder.Common/wwwroot/css/app.css | 22 +++++++ .../Features/UserSettings/UserSettings.razor | 14 ++-- 18 files changed, 142 insertions(+), 132 deletions(-) diff --git a/WoWsShipBuilder.Common/Features/AccelerationCharts/AccelerationCharts.razor b/WoWsShipBuilder.Common/Features/AccelerationCharts/AccelerationCharts.razor index 95a390161..ce2d2d583 100644 --- a/WoWsShipBuilder.Common/Features/AccelerationCharts/AccelerationCharts.razor +++ b/WoWsShipBuilder.Common/Features/AccelerationCharts/AccelerationCharts.razor @@ -46,7 +46,7 @@ @Localizer.GetAppLocalization(nameof(Translation.AccelerationChart_CustomDataTitle)).Localization - + -1 0 1/4 @@ -54,7 +54,7 @@ 3/4 4/4 - + -1 0 1/4 @@ -62,7 +62,7 @@ 3/4 4/4 - + -1 0 1/4 diff --git a/WoWsShipBuilder.Common/Features/AccelerationCharts/ShipBuildContainerSelectionDialog.razor b/WoWsShipBuilder.Common/Features/AccelerationCharts/ShipBuildContainerSelectionDialog.razor index 1e3a4f9ad..5ff79e5f1 100644 --- a/WoWsShipBuilder.Common/Features/AccelerationCharts/ShipBuildContainerSelectionDialog.razor +++ b/WoWsShipBuilder.Common/Features/AccelerationCharts/ShipBuildContainerSelectionDialog.razor @@ -7,7 +7,7 @@ @implements IDisposable @inject ILocalizer Localizer - + diff --git a/WoWsShipBuilder.Common/Features/BallisticCharts/Charts.razor b/WoWsShipBuilder.Common/Features/BallisticCharts/Charts.razor index e69fde607..ad2eda058 100644 --- a/WoWsShipBuilder.Common/Features/BallisticCharts/Charts.razor +++ b/WoWsShipBuilder.Common/Features/BallisticCharts/Charts.razor @@ -254,7 +254,7 @@ - + diff --git a/WoWsShipBuilder.Common/Features/BallisticCharts/ShipAndShellSelectionDialog.razor b/WoWsShipBuilder.Common/Features/BallisticCharts/ShipAndShellSelectionDialog.razor index 6a98c4b04..0286ea130 100644 --- a/WoWsShipBuilder.Common/Features/BallisticCharts/ShipAndShellSelectionDialog.razor +++ b/WoWsShipBuilder.Common/Features/BallisticCharts/ShipAndShellSelectionDialog.razor @@ -16,7 +16,6 @@ - @Localizer.GetAppLocalization(nameof(Translation.ShipAndShellSelectionDialogWeb_SelectShipsAndShells)).Localization @@ -35,40 +34,38 @@ @Localizer.GetAppLocalization(Translation.ShipAndShellsSelectionDialog_NoShipSelected).Localization } - - @foreach (var dataWrapper in dataWrappers) - { - - - - @Localizer.GetGameLocalization($"{dataWrapper.ShipBuildContainer.Ship.Index}_FULL").Localization - - - - @if (dataWrapper.ShipBuildContainer.Ship.MainBatteryModuleList.Any()) - { - - @foreach (string shell in dataWrapper.ShipBuildContainer.Ship.ShellCompatibilities.Keys) - { - - @Localizer.GetGameLocalization(shell).Localization - - } - - } - else - { - - @Localizer.GetAppLocalization(nameof(Translation.MessageBox_ShipNoGun)).Localization - - } - - @($"{Localizer.GetAppLocalization(Translation.ChartsWeb_Build).Localization}: {(!string.IsNullOrWhiteSpace(dataWrapper.ShipBuildContainer.Build?.BuildName) ? dataWrapper.ShipBuildContainer.Build.BuildName : Build.DefaultBuildName)}") + @foreach (var dataWrapper in dataWrappers) + { + + + + @Localizer.GetGameLocalization($"{dataWrapper.ShipBuildContainer.Ship.Index}_FULL").Localization - + - } - + @if (dataWrapper.ShipBuildContainer.Ship.MainBatteryModuleList.Any()) + { + + @foreach (string shell in dataWrapper.ShipBuildContainer.Ship.ShellCompatibilities.Keys) + { + + @Localizer.GetGameLocalization(shell).Localization + + } + + } + else + { + + @Localizer.GetAppLocalization(nameof(Translation.MessageBox_ShipNoGun)).Localization + + } + + @($"{Localizer.GetAppLocalization(Translation.ChartsWeb_Build).Localization}: {(!string.IsNullOrWhiteSpace(dataWrapper.ShipBuildContainer.Build?.BuildName) ? dataWrapper.ShipBuildContainer.Build.BuildName : Build.DefaultBuildName)}") + + + + } @@ -346,7 +343,7 @@ private static Color GetColorFromBool(bool active) { - return active ? Color.Secondary : Color.Default; + return active ? Color.Primary : Color.Secondary; } private void Cancel() diff --git a/WoWsShipBuilder.Common/Features/Builds/Components/BuildConfigurationDialog.razor b/WoWsShipBuilder.Common/Features/Builds/Components/BuildConfigurationDialog.razor index 109bd8ee8..a40ad9f9e 100644 --- a/WoWsShipBuilder.Common/Features/Builds/Components/BuildConfigurationDialog.razor +++ b/WoWsShipBuilder.Common/Features/Builds/Components/BuildConfigurationDialog.razor @@ -48,16 +48,16 @@ - + @for (var i = 0; i < Ships.Count; i++) { int index = i; var shipData = Ships[index]; - + @Localizer.GetGameLocalization(Ships[index].Ship.Index + "_FULL").Localization - + @(Localizer.GetAppLocalization(Translation.ChartsWeb_Build).Localization + ": " + (buildNameDictionary.TryGetValue(shipData.Id, out string? value) ? value : !string.IsNullOrEmpty(shipData.Build?.BuildName) ? shipData.Build.BuildName : Build.DefaultBuildName)) @@ -194,24 +194,20 @@ - - - - - @Localizer.GetAppLocalization(Translation.BuildConfigurationDialog_Load).Localization - - - - Import - - - - + + + + @Localizer.GetAppLocalization(Translation.BuildConfigurationDialog_Load).Localization + + + + Import + + + - - - + } else diff --git a/WoWsShipBuilder.Common/Features/Builds/Components/BuildImageSettingsDialog.razor b/WoWsShipBuilder.Common/Features/Builds/Components/BuildImageSettingsDialog.razor index 4a45eafa3..098edf753 100644 --- a/WoWsShipBuilder.Common/Features/Builds/Components/BuildImageSettingsDialog.razor +++ b/WoWsShipBuilder.Common/Features/Builds/Components/BuildImageSettingsDialog.razor @@ -5,19 +5,19 @@ @Localizer.SimpleAppLocalization(nameof(Translation.BuildImageSettingsDialog_Layout)) - + @Localizer.SimpleAppLocalization(nameof(Translation.BuildImageSettingsDialog_Elements)) - - - - - + + + + + - @Localizer.GetAppLocalization(nameof(Translation.Cancel)).Localization - + @Localizer.GetAppLocalization(nameof(Translation.Cancel)).Localization + @Localizer.GetAppLocalization(nameof(Translation.Dialog_Save)).Localization @@ -88,4 +88,4 @@ ShowSignals = true; } } -} \ No newline at end of file +} diff --git a/WoWsShipBuilder.Common/Features/Builds/Components/CaptainSkillSelectorImageRender.razor b/WoWsShipBuilder.Common/Features/Builds/Components/CaptainSkillSelectorImageRender.razor index 9adc66017..bc2bfc0ba 100644 --- a/WoWsShipBuilder.Common/Features/Builds/Components/CaptainSkillSelectorImageRender.razor +++ b/WoWsShipBuilder.Common/Features/Builds/Components/CaptainSkillSelectorImageRender.razor @@ -179,6 +179,6 @@ private string GetMudPaperBorderColor(SkillItemViewModel skillItem) { - return $" border-color: {(ViewModel!.SkillOrderList.Any(x => x.SkillNumber.Equals(skillItem.Skill.SkillNumber)) ? "var(--mud-palette-text-primary)" : "var(--mud-palette-text-disabled)")};"; + return $" border-color: {(ViewModel!.SkillOrderList.Any(x => x.SkillNumber.Equals(skillItem.Skill.SkillNumber)) ? "#BC0606" : "var(--mud-palette-text-disabled)")};"; } } diff --git a/WoWsShipBuilder.Common/Features/Builds/Components/SignalSelectorImageRender.razor b/WoWsShipBuilder.Common/Features/Builds/Components/SignalSelectorImageRender.razor index 0ab2915d4..89ecb0cce 100644 --- a/WoWsShipBuilder.Common/Features/Builds/Components/SignalSelectorImageRender.razor +++ b/WoWsShipBuilder.Common/Features/Builds/Components/SignalSelectorImageRender.razor @@ -85,6 +85,6 @@ private string GetMudPaperStyle(bool isSelected) { - return $" border-color: {(isSelected ? "var(--mud-palette-text-primary)" : "var(--mud-palette-text-disabled); opacity: 0.4;")};"; + return $" border-color: {(isSelected ? "#BC0606" : "var(--mud-palette-text-disabled); opacity: 0.4;")};"; } } diff --git a/WoWsShipBuilder.Common/Features/ShipComparison/ComparisonShipFilter.razor b/WoWsShipBuilder.Common/Features/ShipComparison/ComparisonShipFilter.razor index 04e46e912..68c2855b3 100644 --- a/WoWsShipBuilder.Common/Features/ShipComparison/ComparisonShipFilter.razor +++ b/WoWsShipBuilder.Common/Features/ShipComparison/ComparisonShipFilter.razor @@ -26,7 +26,7 @@ { int tier = i; bool isSelected = ViewModel!.SelectedTiers.Contains(tier); - + @tier.ToTierString() } @@ -48,7 +48,7 @@ @foreach (var shipClass in ViewModel!.AvailableClasses) { bool isSelected = ViewModel.SelectedClasses.Contains(shipClass); - + @Localizer.GetAppLocalization(shipClass.ShipClassToString()).Localization } @@ -70,7 +70,7 @@ @foreach (var nation in ViewModel!.AvailableNations) { bool isSelected = ViewModel.SelectedNations.Contains(nation); - + @Localizer.GetAppLocalization(nation.ShipNationToString()).Localization } @@ -92,7 +92,7 @@ @foreach (var category in ViewModel!.AvailableShipCategories) { bool isSelected = ViewModel.SelectedCategories.Contains(category); - + @Localizer.GetAppLocalization(category.ShipCategoryToString()).Localization } @@ -120,7 +120,7 @@ { int tier = i; bool isSelected = ViewModel!.SelectedTiers.Contains(tier); - + @tier.ToTierString() } @@ -129,7 +129,7 @@ @foreach (var shipClass in ViewModel!.AvailableClasses) { bool isSelected = ViewModel.SelectedClasses.Contains(shipClass); - + @Localizer.GetAppLocalization(shipClass.ShipClassToString()).Localization } @@ -138,7 +138,7 @@ @foreach (var nation in ViewModel!.AvailableNations) { bool isSelected = ViewModel.SelectedNations.Contains(nation); - + @Localizer.GetAppLocalization(nation.ShipNationToString()).Localization } @@ -147,7 +147,7 @@ @foreach (var category in ViewModel!.AvailableShipCategories) { bool isSelected = ViewModel.SelectedCategories.Contains(category); - + @Localizer.GetAppLocalization(category.ShipCategoryToString()).Localization } @@ -155,34 +155,34 @@ - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_All)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_None)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_All)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_None)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_All)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_None)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_All)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_None)) @@ -198,11 +198,6 @@ [Parameter, EditorRequired] public Func SelectionChanged { get; set; } = default!; - private static Variant GetVariantFromBool(bool active) - { - return active ? Variant.Filled : Variant.Outlined; - } - private static Color GetColorFromBool(bool active) { return active ? Color.Primary : Color.Secondary; diff --git a/WoWsShipBuilder.Common/Features/ShipComparison/HideComparisonColumnsDialog.razor b/WoWsShipBuilder.Common/Features/ShipComparison/HideComparisonColumnsDialog.razor index 8e4b86c6f..9621e8b16 100644 --- a/WoWsShipBuilder.Common/Features/ShipComparison/HideComparisonColumnsDialog.razor +++ b/WoWsShipBuilder.Common/Features/ShipComparison/HideComparisonColumnsDialog.razor @@ -15,7 +15,7 @@ @foreach (var column in columns) { - + } @@ -24,8 +24,8 @@ - @Localizer.GetAppLocalization(nameof(Translation.Cancel)).Localization - @Localizer.GetAppLocalization(nameof(Translation.Dialog_Save)).Localization + @Localizer.GetAppLocalization(nameof(Translation.Cancel)).Localization + @Localizer.GetAppLocalization(nameof(Translation.Dialog_Save)).Localization @@ -76,4 +76,4 @@ MudDialog.Close(DialogResult.Ok(result)); } -} \ No newline at end of file +} diff --git a/WoWsShipBuilder.Common/Features/ShipComparison/ShipComparison.razor b/WoWsShipBuilder.Common/Features/ShipComparison/ShipComparison.razor index 4abedf333..0bbb24c81 100644 --- a/WoWsShipBuilder.Common/Features/ShipComparison/ShipComparison.razor +++ b/WoWsShipBuilder.Common/Features/ShipComparison/ShipComparison.razor @@ -83,13 +83,13 @@ - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_DisplayOnlyPinnedShips)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_UseUpgradedModules)) - + @Localizer.SimpleAppLocalization(nameof(Translation.ShipComparison_HideIfNoSection)) @@ -148,12 +148,12 @@ - + - + @@ -245,7 +245,7 @@ - + } diff --git a/WoWsShipBuilder.Common/Features/ShipSelection/ShipSelector.razor b/WoWsShipBuilder.Common/Features/ShipSelection/ShipSelector.razor index 26e37d42c..7e2a1df6a 100644 --- a/WoWsShipBuilder.Common/Features/ShipSelection/ShipSelector.razor +++ b/WoWsShipBuilder.Common/Features/ShipSelection/ShipSelector.razor @@ -34,7 +34,7 @@ { - + @Localizer.GetAppLocalization(nameof(Translation.WebApp_LoadBuild)).Localization @@ -52,7 +52,7 @@ } - + @foreach (var item in tierList) { @@ -63,7 +63,7 @@ - + @foreach (ShipClass? item in classList) { @@ -74,7 +74,7 @@ - + @foreach (Nation? item in nationList) { @@ -85,7 +85,7 @@ - + @foreach (ShipCategory? item in typeList) { @@ -97,9 +97,7 @@ @* ship search box *@ - - - + @* ship list *@ diff --git a/WoWsShipBuilder.Common/Features/ShipStats/Components/CaptainSkillSelector.razor b/WoWsShipBuilder.Common/Features/ShipStats/Components/CaptainSkillSelector.razor index ef3c2d725..eb83c5381 100644 --- a/WoWsShipBuilder.Common/Features/ShipStats/Components/CaptainSkillSelector.razor +++ b/WoWsShipBuilder.Common/Features/ShipStats/Components/CaptainSkillSelector.razor @@ -36,7 +36,7 @@ - + @Localizer.GetAppLocalization(nameof(Translation.CaptainSkillSelector_SkillTalent)).Localization diff --git a/WoWsShipBuilder.Common/Features/ShipStats/Components/ShipStatsPanel.razor b/WoWsShipBuilder.Common/Features/ShipStats/Components/ShipStatsPanel.razor index 99f7bb82a..0557422f2 100644 --- a/WoWsShipBuilder.Common/Features/ShipStats/Components/ShipStatsPanel.razor +++ b/WoWsShipBuilder.Common/Features/ShipStats/Components/ShipStatsPanel.razor @@ -23,7 +23,7 @@ @if (ViewModel?.CurrentShipStats is not null) { - + @@ -83,7 +83,7 @@ - + @Localizer.GetAppLocalization(nameof(Translation.ShipStats_TurretAngles)).Localization @@ -98,7 +98,7 @@ { @DataElementFragment((data, Localizer)) } - + @Localizer.GetAppLocalization(nameof(Translation.ChartsWeb_ShowCharts)).Localization @@ -131,7 +131,7 @@ { @DataElementFragment((data,Localizer)) } - + @Localizer.GetAppLocalization(nameof(Translation.ShipStats_ShowLaunchersAngles)).Localization @@ -345,7 +345,7 @@ } - + @if (ViewModel.CurrentShipStats?.AirstrikeDataContainer is not null) { @@ -366,6 +366,7 @@ } + @if (ViewModel.CurrentShipStats?.AswAirstrikeDataContainer is not null) { var dcDataContext = ViewModel.CurrentShipStats.AswAirstrikeDataContainer.Weapon as DepthChargeDataContainer ?? throw new InvalidOperationException("Expected DepthChargeDataContainer but found another type."); @@ -381,7 +382,7 @@ { @DataElementFragment((weaponData,Localizer)) } - + @(showDepthChargeDamageDistributionChart ? Localizer.GetAppLocalization(nameof(Translation.ShipStats_HideDcDamageDistribution)).Localization : Localizer.GetAppLocalization(nameof(Translation.ShipStats_ShowDcDamageDistribution)).Localization)
@@ -407,7 +408,7 @@ { @DataElementFragment((data, Localizer)) } - + @(showDepthChargeDamageDistributionChart ? Localizer.GetAppLocalization(nameof(Translation.ShipStats_HideDcDamageDistribution)).Localization : Localizer.GetAppLocalization(nameof(Translation.ShipStats_ShowDcDamageDistribution)).Localization)
@@ -431,7 +432,7 @@ @DataElementFragment((data, Localizer)) } - + @Localizer.GetAppLocalization(nameof(Translation.ShipStats_ShowAccelerationCharts)).Localization diff --git a/WoWsShipBuilder.Common/Features/ShipStats/ShipStats.razor b/WoWsShipBuilder.Common/Features/ShipStats/ShipStats.razor index 0b955ab09..ee9ec45d8 100644 --- a/WoWsShipBuilder.Common/Features/ShipStats/ShipStats.razor +++ b/WoWsShipBuilder.Common/Features/ShipStats/ShipStats.razor @@ -21,11 +21,11 @@ @* HideSlider is set to true because of an issue in MudBlazor. see https://github.com/MudBlazor/MudBlazor/issues/4742*@ - + @foreach (var container in shipContainers) { - + } @@ -34,25 +34,25 @@ - + - + - + - + - + @code { diff --git a/WoWsShipBuilder.Common/Infrastructure/Utility/Helpers.cs b/WoWsShipBuilder.Common/Infrastructure/Utility/Helpers.cs index d006f2f07..e0bd782bc 100644 --- a/WoWsShipBuilder.Common/Infrastructure/Utility/Helpers.cs +++ b/WoWsShipBuilder.Common/Infrastructure/Utility/Helpers.cs @@ -77,12 +77,13 @@ public static MudTheme CreateDarkTheme(bool sharpCorners) Black = "#121212FF", White = "#FDFDFDFF", Primary = "#6186FF", - PrimaryContrastText = "#FDFDFDFF", + PrimaryContrastText = "#242424", Secondary = "#D4D4D4", SecondaryContrastText = "#282828", Tertiary = "#FFD700", TertiaryContrastText = "#282828", InfoContrastText = "#FDFDFDFF", + Success = "#00CD42", SuccessContrastText = "#282828", WarningContrastText = "#282828", Error = "#BF0000FF", diff --git a/WoWsShipBuilder.Common/wwwroot/css/app.css b/WoWsShipBuilder.Common/wwwroot/css/app.css index 4bdefa387..699269ad2 100644 --- a/WoWsShipBuilder.Common/wwwroot/css/app.css +++ b/WoWsShipBuilder.Common/wwwroot/css/app.css @@ -223,6 +223,7 @@ a.kofi-button:active { border-radius: 4px; } +/*noinspection CssUnresolvedCustomProperty*/ div.mud-expand-panel { border-radius: var(--mud-default-borderradius) !important; } @@ -243,6 +244,7 @@ div.mud-expand-panel { padding: 12px; } +/*noinspection CssUnresolvedCustomProperty*/ .custom-expansion-panel-header .mud-expand-panel-header { padding: 4px 8px; min-height: 24px; @@ -274,3 +276,23 @@ div.mud-expand-panel { .mud-data-grid-range-selector label.mud-input-label-text { display: ruby !important; } + +/*noinspection CssUnresolvedCustomProperty*/ +div.default-label-background label { + background-color: var(--mud-palette-background) !important; +} + +/*noinspection CssUnresolvedCustomProperty*/ +.link-text { + color: var(--mud-palette-primary-lighten) !important; + text-decoration: underline; + cursor: pointer; +} + +.ship-stats-tabs .mud-tabs-toolbar .mud-tab-active { + background-color: var(--mud-palette-primary); + color: var(--mud-palette-primary-text); + & svg { + fill: var(--mud-palette-primary-text); + } +} diff --git a/WoWsShipBuilder.Web/Features/UserSettings/UserSettings.razor b/WoWsShipBuilder.Web/Features/UserSettings/UserSettings.razor index bda45d08a..81e4e21c5 100644 --- a/WoWsShipBuilder.Web/Features/UserSettings/UserSettings.razor +++ b/WoWsShipBuilder.Web/Features/UserSettings/UserSettings.razor @@ -53,9 +53,9 @@ @Localizer.GetAppLocalization(nameof(Translation.WebApp_ExpanderSettingHeader)).Localization - - - + + + @@ -84,14 +84,14 @@ - + @Localizer.SimpleAppLocalization(nameof(Translation.BetaAccess_Heading)) - + @Localizer.SimpleAppLocalization(nameof(Translation.BetaAccess_AddCode)) @@ -119,10 +119,10 @@ - @Localizer.GetAppLocalization(nameof(Translation.SettingsWindow_Save)).Localization + @Localizer.GetAppLocalization(nameof(Translation.SettingsWindow_Save)).Localization - @Localizer.GetAppLocalization(nameof(Translation.SettingsWindow_Reset)).Localization + @Localizer.GetAppLocalization(nameof(Translation.SettingsWindow_Reset)).Localization