From fffe6496a4cd7d392e7379c8ecea3f14db45c453 Mon Sep 17 00:00:00 2001 From: whats2000 Date: Wed, 4 Sep 2024 17:04:31 +0800 Subject: [PATCH] Add: Add graphical view --- Components/ResultView.razor | 180 ++++++++++-------- Components/ResultView.razor.cs | 75 ++++++++ Pages/Index.razor | 4 +- PearlCalculatorBlazor.csproj | 83 ++++---- PearlCalculatorLib/Settings/CannonSettings.cs | 9 +- .../Settings/SettingsManager.cs | 52 ++--- _Imports.razor | 3 +- wwwroot/assets/i18n/en.json | 145 ++++++-------- wwwroot/assets/i18n/es_ES.json | 124 ++++++------ wwwroot/assets/i18n/zh_cn.json | 135 ++++++------- wwwroot/assets/i18n/zh_tw.json | 116 +++++------ wwwroot/css/app.css | 99 +++++----- wwwroot/index.html | 84 ++++---- wwwroot/tnt-weight-slider.js | 2 +- 14 files changed, 601 insertions(+), 510 deletions(-) diff --git a/Components/ResultView.razor b/Components/ResultView.razor index 29cdb11..e44b125 100644 --- a/Components/ResultView.razor +++ b/Components/ResultView.razor @@ -2,89 +2,113 @@ @using System.Globalization @using PearlCalculatorBlazor.Localizer @using PearlCalculatorLib.Result +@inject NavigationManager NavigationManager +@inject HttpClient HttpClient @inject MessageService AntMessage @inject NotificationService Notice @inject TranslateText TransText -
- @switch (ShowMode) - { - case ShowResultMode.Amount: - - - - - - - - - - - - @context.Distance.ToString(CultureInfo.InvariantCulture).Substring(0, 5) - - - - - - -
- break; - case ShowResultMode.Trace: - + + + + + + @switch (ShowMode) + { + case ShowResultMode.Amount: +
+ + + + + + + + + + + @context.Distance.ToString(CultureInfo.InvariantCulture).Substring(0, 5) + + + + + + +
+ break; + case ShowResultMode.Trace: + - - - - + + + + -
- break; - case ShowResultMode.Momentum: - default: - +
+ break; + case ShowResultMode.Momentum: + default: + - - - - -
- break; - } -
+ + + + + + break; + } + + + + + @TranslateText.GetTranslateText(_resultDirection) + + + + + + + @_resultAngle + + + + + + + @if (ShowMode == ShowResultMode.Trace) + { + + } + else if (ShowMode == ShowResultMode.Momentum) + { + + } + else if (ShowMode == ShowResultMode.Amount) + { + + } + + + + - - - - - @TranslateText.GetTranslateText(_resultDirection) - - - - - - - @_resultAngle - - - - \ No newline at end of file + \ No newline at end of file diff --git a/Components/ResultView.razor.cs b/Components/ResultView.razor.cs index c7f6282..d97adab 100644 --- a/Components/ResultView.razor.cs +++ b/Components/ResultView.razor.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using AntDesign; +using AntDesign.Charts; using AntDesign.TableModels; using PearlCalculatorBlazor.Localizer; using PearlCalculatorBlazor.Managers; @@ -18,9 +19,47 @@ public partial class ResultView private static string _resultDirection = string.Empty; private static string _resultAngle = string.Empty; + private readonly LineConfig _lineConfig = new() + { + Padding = "auto", + AutoFit = true, + XField = "tick", + YField = "yCoor" + }; + + private DualAxesConfig _dualAxesConfig = new() + { + XField = "index", + YField = new[] { "value", "count" }, + GeometryOptions = new object[] + { + new + { + Geometry = "column", + IsStack = true, + seriesField = "type", + // Red, Blue + Color = new[] { "#FF7260", "#9BD7D5" } + }, + new + { + Geometry = "line", + seriesField = "name", + Color = new[] { "#129793", "#90AEC6" }, + LineStyle = new + { + lineWidth = 1.5 + } + } + } + }; + private int _pageIndex = 1; private int _pageSize = 50; + private object[] StackedBarData => GetStackedBarData(); + private object[] LineData => GetLineData(); + private ShowResultMode ShowMode { get; set; } = ShowResultMode.Amount; private int AmountTotal => AmountResult?.Count ?? 0; @@ -32,6 +71,42 @@ public partial class ResultView private List PearlTrace { get; set; } = new(); private List PearlMotion { get; set; } = new(); + private object[] GetStackedBarData() + { + return AmountResult + .Select((r, index) => new + { + index, + value = r.Red, + type = TranslateText.GetTranslateText("DisplayRed") + }) + .Concat(AmountResult.Select((r, index) => new + { + index, + value = r.Blue, + type = TranslateText.GetTranslateText("DisplayBlue") + })) + .ToArray(); + } + + private object[] GetLineData() + { + return AmountResult.Select((r, index) => new + { + index, + count = r.Distance, + name = TranslateText.GetTranslateText("DisplayDistance") + }) + .Concat(AmountResult.Select((r, index) => new + { + index, + count = (double)r.Tick, + name = TranslateText.GetTranslateText("DisplayTicks") + })) + .ToArray(); + } + + private static void ShowDirectionResult(Space3D pearlPos, Space3D destination) { var angle = pearlPos.WorldAngle(destination); diff --git a/Pages/Index.razor b/Pages/Index.razor index de68264..5562048 100644 --- a/Pages/Index.razor +++ b/Pages/Index.razor @@ -24,8 +24,6 @@ - - - + \ No newline at end of file diff --git a/PearlCalculatorBlazor.csproj b/PearlCalculatorBlazor.csproj index 77caaa8..3b01d48 100644 --- a/PearlCalculatorBlazor.csproj +++ b/PearlCalculatorBlazor.csproj @@ -1,43 +1,48 @@  - - net6.0 - service-worker-assets.js - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net6.0 + service-worker-assets.js + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PearlCalculatorLib/Settings/CannonSettings.cs b/PearlCalculatorLib/Settings/CannonSettings.cs index afcbfa5..573c599 100644 --- a/PearlCalculatorLib/Settings/CannonSettings.cs +++ b/PearlCalculatorLib/Settings/CannonSettings.cs @@ -27,6 +27,10 @@ public class CannonSettings : IDeepCloneable public List RedTNTConfiguration { get; set; } public List BlueTNTConfiguration { get; set; } + public bool PearlYMotionCancellation { get; set; } + public double PearlYPositionOriginal { get; set; } + public double PearlYPositionAdjusted { get; set; } + public CannonSettings DeepClone() { List redTNTConfiguration = new List(RedTNTConfiguration.Count); @@ -48,7 +52,10 @@ public CannonSettings DeepClone() Offset = Offset, Pearl = Pearl.DeepClone(), RedTNTConfiguration = redTNTConfiguration, - BlueTNTConfiguration = blueTNTConfiguration + BlueTNTConfiguration = blueTNTConfiguration, + PearlYMotionCancellation = PearlYMotionCancellation, + PearlYPositionOriginal = PearlYPositionOriginal, + PearlYPositionAdjusted = PearlYPositionAdjusted }; return result; diff --git a/PearlCalculatorLib/Settings/SettingsManager.cs b/PearlCalculatorLib/Settings/SettingsManager.cs index 6b67fa3..8daf47b 100644 --- a/PearlCalculatorLib/Settings/SettingsManager.cs +++ b/PearlCalculatorLib/Settings/SettingsManager.cs @@ -47,18 +47,21 @@ private void CreateDefaultSettings() SettingsList = new List(); CannonSettings setting = new CannonSettings { - CannonName = "Default", - MaxTNT = Data.MaxTNT, - DefaultRedDirection = Data.DefaultRedDuper, - DefaultBlueDirection = Data.DefaultBlueDuper, - NorthWestTNT = Data.NorthWestTNT, - NorthEastTNT = Data.NorthEastTNT, - SouthWestTNT = Data.SouthWestTNT, - SouthEastTNT = Data.SouthEastTNT, - Offset = Data.PearlOffset, - Pearl = Data.Pearl, - RedTNTConfiguration = Data.RedTNTConfiguration, - BlueTNTConfiguration = Data.BlueTNTConfiguration + CannonName = "Default", + MaxTNT = Data.MaxTNT, + DefaultRedDirection = Data.DefaultRedDuper, + DefaultBlueDirection = Data.DefaultBlueDuper, + NorthWestTNT = Data.NorthWestTNT, + NorthEastTNT = Data.NorthEastTNT, + SouthWestTNT = Data.SouthWestTNT, + SouthEastTNT = Data.SouthEastTNT, + Offset = Data.PearlOffset, + Pearl = Data.Pearl, + RedTNTConfiguration = Data.RedTNTConfiguration, + BlueTNTConfiguration = Data.BlueTNTConfiguration, + PearlYMotionCancellation = Data.PearlYMotionCancellation, + PearlYPositionOriginal = Data.PearlYPositionOriginal, + PearlYPositionAdjusted = Data.PearlYPositionAdjusted }; SettingsList.Add(setting); _selectedCannon = setting; @@ -88,17 +91,20 @@ public bool SelectCannon(int index) private void SetGeneralData(CannonSettings settings) { - Data.MaxTNT = settings.MaxTNT; - Data.DefaultBlueDuper = settings.DefaultBlueDirection; - Data.DefaultRedDuper = settings.DefaultRedDirection; - Data.NorthEastTNT = settings.NorthEastTNT; - Data.NorthWestTNT = settings.NorthWestTNT; - Data.SouthEastTNT = settings.SouthEastTNT; - Data.SouthWestTNT = settings.SouthWestTNT; - Data.Pearl = settings.Pearl; - Data.PearlOffset = settings.Offset; - Data.RedTNTConfiguration = settings.RedTNTConfiguration; - Data.BlueTNTConfiguration = settings.BlueTNTConfiguration; + Data.MaxTNT = settings.MaxTNT; + Data.DefaultBlueDuper = settings.DefaultBlueDirection; + Data.DefaultRedDuper = settings.DefaultRedDirection; + Data.NorthEastTNT = settings.NorthEastTNT; + Data.NorthWestTNT = settings.NorthWestTNT; + Data.SouthEastTNT = settings.SouthEastTNT; + Data.SouthWestTNT = settings.SouthWestTNT; + Data.Pearl = settings.Pearl; + Data.PearlOffset = settings.Offset; + Data.RedTNTConfiguration = settings.RedTNTConfiguration; + Data.BlueTNTConfiguration = settings.BlueTNTConfiguration; + Data.PearlYMotionCancellation = settings.PearlYMotionCancellation; + Data.PearlYPositionOriginal = settings.PearlYPositionOriginal; + Data.PearlYPositionAdjusted = settings.PearlYPositionAdjusted; } public CannonSettings GetSettings(string cannonName) => diff --git a/_Imports.razor b/_Imports.razor index ce4aee0..6fa0c2a 100644 --- a/_Imports.razor +++ b/_Imports.razor @@ -8,4 +8,5 @@ @using PearlCalculatorBlazor @using PearlCalculatorBlazor.Shared @using PearlCalculatorBlazor.Components.GeneralFtlComponents -@using AntDesign \ No newline at end of file +@using AntDesign +@using AntDesign.Charts \ No newline at end of file diff --git a/wwwroot/assets/i18n/en.json b/wwwroot/assets/i18n/en.json index ec7f28b..949c834 100644 --- a/wwwroot/assets/i18n/en.json +++ b/wwwroot/assets/i18n/en.json @@ -1,101 +1,82 @@ { - "GeneralHeader": "General FTL", - "ManuallyHeader": "Manually", - - "GeneralFtlGeneral": "General", - "GeneralFtlAdvanced": "Advanced", - "GeneralFtlSettings": "Settings", - - "PearlPosX": "Pearl X :", - "PearlPosY": "Pearl Y :", - "PearlPosZ": "Pearl Z :", - + "AmountA": "TNT Amount(A):", + "AmountB": "TNT Amount(B):", + "BlueTNT": "Blue TNT :", + "CalculatePearlMomentum": "Calculate Pearl Momentum", + "CalculatePearlTrace": "Calculate Pearl Trace", + "CalculateTNTAmount": "Calculate TNT Amount", + "Coordinate": "Coordinate", + "DefaultBlueTNTPos": "Default Blue TNT Position", + "DefaultBlueTNTPosDesc": "Preset the position of the TNT duped from the blue array relative to the pearl without being changed by the slime block", + "DefaultRedTNTPos": "Default Red TNT Position", + "DefaultRedTNTPosDesc": "Preset the position of the TNT duped from the red array relative to the pearl without being changed by the slime block", "DestinationX": "Destination X :", "DestinationZ": "Destination Z :", - "Direction": "Direction :", - + "DisplayAngle": "Result Angle (x | z)", + "DisplayBlue": "Blue", + "DisplayDirection": "Result Direction", + "DisplayDistance": "Distance", + "DisplayRed": "Red", + "DisplayTicks": "Tick", + "DisplayTotal": "TotalTNT", + "DisplayXMotion": "X Motion", + "DisplayYMotion": "Y Motion", + "DisplayZMotion": "Z Motion", + "East": "East", + "GeneralFtlAdvanced": "Advanced", + "GeneralFtlGeneral": "General", + "GeneralFtlSettings": "Settings", + "GeneralHeader": "General FTL", + "GraphMode": "Graph Mode", + "ImportSettings": "Import Settings", + "ManuallyHeader": "Manually", "MaxTNT": "Max TNT :", - "RedTNT": "Red TNT :", - "BlueTNT": "Blue TNT :", - "Offset": "Offset :", - "ResultSortControl": "Result Sort Control", - "TNTWeight": "TNT Weight", "MixedWeightedDistance": "Mixed Weighted Distance", "MixedWeightedTotal": "Mixed Weighted Total", - - "PearlSimulate": "Pearl Simulate", - "ImportSettings": "Import Settings", - "SaveSettings": "Export Settings", - - "ResetToDefault": "Reset To Default", - + "Momentum": "Momentum", "MomentumX": "Momentum X:", "MomentumY": "Momentum Y:", "MomentumZ": "Momentum Z:", - - "DisplayXMotion": "X Motion", - "DisplayYMotion": "Y Motion", - "DisplayZMotion": "Z Motion", - - "XCoor": "XCoor", - "YCoor": "YCoor", - "ZCoor": "ZCoor", - - "TNTXA": "TNT X(A):", - "TNTYA": "TNT Y(A):", - "TNTZA": "TNT Z(A):", - - "TNTXB": "TNT X(B):", - "TNTYB": "TNT Y(B):", - "TNTZB": "TNT Z(B):", - - "AmountA": "TNT Amount(A):", - "AmountB": "TNT Amount(B):", - - "CalculateTNTAmount": "Calculate TNT Amount", - "CalculatePearlTrace": "Calculate Pearl Trace", - "CalculatePearlMomentum": "Calculate Pearl Momentum", - + "NormalProjection": "Normal Projection", + "North": "North", + "NorthEast": "NorthEast", + "NorthWest": "NorthWest", + "Offset": "Offset :", + "PearlPosX": "Pearl X :", + "PearlPosY": "Pearl Y :", + "PearlPosZ": "Pearl Z :", + "PearlSimulate": "Pearl Simulate", "PearlY": "Pearl Y", - "Coordinate": "Coordinate", - "Momentum": "Momentum", "PearlYMotionMode": "Pearl Y Motion Mode", - "NormalProjection": "Normal Projection", - "PerfectHorizontalProjection": "Perfect Horizontal Projection", - "PearlYPositionOriginal": "Pearl Y Position (Original)", - "PearlYPositionOriginalDesc": "To get the Y position of the pearl, you should remove the piston which is used to cancel the Y motion and get the Y position of the pearl at explosion tick. This position is where the pearl to get the momentum.", "PearlYPositionAdjusted": "Pearl Y Position (Adjusted)", "PearlYPositionAdjustedDesc": "To get the Y position of the pearl, just place the piston which is used to cancel the Y motion and get the Y position at the end of the tick. This position is where the pearl starts to move.", - - "DefaultRedTNTPos": "Default Red TNT Position", - "DefaultRedTNTPosDesc": "Preset the position of the TNT duped from the red array relative to the pearl without being changed by the slime block", - "DefaultBlueTNTPos": "Default Blue TNT Position", - "DefaultBlueTNTPosDesc": "Preset the position of the TNT duped from the blue array relative to the pearl without being changed by the slime block", - - "DisplayDistance": "Distance", - "DisplayTicks": "Tick", - "DisplayBlue": "Blue", - "DisplayRed": "Red", - "DisplayTotal": "TotalTNT", - "TNTCalculationResultTooltip": "Click this row to automatically input the values into the Blue TNT and Red TNT input fields.", - "TNTCalculationSetSuccessMessage": "TNT Calculation Set Successfully", - - "DisplayDirection": "Result Direction", - "DisplayAngle": "Result Angle (x | z)", - - "SettingsNorthWestTNT": "North West TNT", + "PearlYPositionOriginal": "Pearl Y Position (Original)", + "PearlYPositionOriginalDesc": "To get the Y position of the pearl, you should remove the piston which is used to cancel the Y motion and get the Y position of the pearl at explosion tick. This position is where the pearl to get the momentum.", + "PerfectHorizontalProjection": "Perfect Horizontal Projection", + "RedTNT": "Red TNT :", + "ResetToDefault": "Reset To Default", + "ResultSortControl": "Result Sort Control", + "SaveSettings": "Export Settings", "SettingsNorthEastTNT": "North East TNT", - "SettingsSouthWestTNT": "South West TNT", + "SettingsNorthWestTNT": "North West TNT", "SettingsSouthEastTNT": "South East TNT", - - "North": "North", + "SettingsSouthWestTNT": "South West TNT", "South": "South", - "East": "East", - "West": "West", - - "NorthWest": "NorthWest", - "NorthEast": "NorthEast", + "SouthEast": "SouthEast", "SouthWest": "SouthWest", - "SouthEast": "SouthEast" + "TNTCalculationResultTooltip": "Click this row to automatically input the values into the Blue TNT and Red TNT input fields.", + "TNTCalculationSetSuccessMessage": "TNT Calculation Set Successfully", + "TNTWeight": "TNT Weight", + "TNTXA": "TNT X(A):", + "TNTXB": "TNT X(B):", + "TNTYA": "TNT Y(A):", + "TNTYB": "TNT Y(B):", + "TNTZA": "TNT Z(A):", + "TNTZB": "TNT Z(B):", + "TableMode": "Table Mode", + "West": "West", + "XCoor": "XCoor", + "YCoor": "YCoor", + "ZCoor": "ZCoor" } \ No newline at end of file diff --git a/wwwroot/assets/i18n/es_ES.json b/wwwroot/assets/i18n/es_ES.json index b379837..3776220 100644 --- a/wwwroot/assets/i18n/es_ES.json +++ b/wwwroot/assets/i18n/es_ES.json @@ -1,80 +1,82 @@ { - "GeneralHeader": "FTL General", - "ManuallyHeader": "Manual", - "GeneralFtlGeneral": "General", - "GeneralFtlAdvanced": "Avanzado", - "GeneralFtlSettings": "Configuración", - "PearlPosX": "X Perla :", - "PearlPosY": "Y Perla :", - "PearlPosZ": "Z Perla :", + "AmountA": "Cantidad de TNT(A):", + "AmountB": "Cantidad de TNT(B):", + "BlueTNT": "TNT Azul:", + "CalculatePearlMomentum": "Simular Vel. Perla", + "CalculatePearlTrace": "Simular Pos. Perla", + "CalculateTNTAmount": "Calcular Cantidades de TNT", + "Coordinate": "Coordenada", + "DefaultBlueTNTPos": "Posición Predet. TNT Azul", + "DefaultBlueTNTPosDesc": "La Posición de la TNT Azul (Respecto a la perla) si el Slime Block no la mueve", + "DefaultRedTNTPos": "Posición Predet. TNT Roja", + "DefaultRedTNTPosDesc": "La Posición de la TNT Roja (Respecto a la perla) si el Slime Block no la mueve", "DestinationX": "X Destino :", "DestinationZ": "Z Destino :", "Direction": "Dirección :", + "DisplayAngle": "Ángulo de Resultado (x | z)", + "DisplayBlue": "Azul", + "DisplayDirection": "Dirección de Resultado", + "DisplayDistance": "Distancia", + "DisplayRed": "Roja", + "DisplayTicks": "Tick", + "DisplayTotal": "TNTTotal", + "DisplayXMotion": "Vel. X", + "DisplayYMotion": "Vel. Y", + "DisplayZMotion": "Vel. Z", + "East": "Este", + "GeneralFtlAdvanced": "Avanzado", + "GeneralFtlGeneral": "General", + "GeneralFtlSettings": "Configuración", + "GeneralHeader": "FTL General", + "GraphMode": "Modo Gráfico", + "ImportSettings": "Importar Configuración", + "ManuallyHeader": "Manual", "MaxTNT": "Máximo TNT (Total) :", - "RedTNT": "TNT Roja :", - "BlueTNT": "TNT Azul:", - "Offset": "Desfase :", - "ResultSortControl": "Control de Orden de Resultados", - "TNTWeight": "Peso TNT", "MixedWeightedDistance": "Distancia Ponderada Mixta", "MixedWeightedTotal": "Total Ponderado Mixto", - "PearlSimulate": "Simular Perla", - "ImportSettings": "Importar Configuración", - "SaveSettings": "Exportar Configuración", - "ResetToDefault": "Resetear", + "Momentum": "Velocidad", "MomentumX": "Velocidad X:", "MomentumY": "Velocidad Y:", "MomentumZ": "Velocidad Z:", - "DisplayXMotion": "Vel. X", - "DisplayYMotion": "Vel. Y", - "DisplayZMotion": "Vel. Z", - "XCoor": "Pos. X", - "YCoor": "Pos. Y", - "ZCoor": "Pos. Z", - "TNTXA": "X TNT(A):", - "TNTYA": "Y TNT(A):", - "TNTZA": "Z TNT(A):", - "TNTXB": "X TNT(B):", - "TNTYB": "Y TNT(B):", - "TNTZB": "Z TNT(B):", - "AmountA": "Cantidad de TNT(A):", - "AmountB": "Cantidad de TNT(B):", - "CalculateTNTAmount": "Calcular Cantidades de TNT", - "CalculatePearlTrace": "Simular Pos. Perla", - "CalculatePearlMomentum": "Simular Vel. Perla", + "NormalProjection": "Proyección Normal", + "North": "Norte", + "NorthEast": "Noreste", + "NorthWest": "Noroeste", + "Offset": "Desfase :", + "PearlPosX": "X Perla :", + "PearlPosY": "Y Perla :", + "PearlPosZ": "Z Perla :", + "PearlSimulate": "Simular Perla", "PearlY": "Y de Perla", - "Coordinate": "Coordenada", - "Momentum": "Velocidad", "PearlYMotionMode": "Modo de Movimiento de Perla Y", - "NormalProjection": "Proyección Normal", - "PerfectHorizontalProjection": "Proyección Horizontal Perfecta", - "PearlYPositionOriginal": "Posición Y de la Perla (Original)", - "PearlYPositionOriginalDesc": "Para obtener la posición Y de la perla, debes quitar el pistón que se usa para cancelar el movimiento Y y obtener la posición Y de la perla en el tick de la explosión. Esta posición es donde la perla obtiene el impulso.", "PearlYPositionAdjusted": "Posición Y de la Perla (Ajustada)", "PearlYPositionAdjustedDesc": "Para obtener la posición Y de la perla, simplemente coloca el pistón que se usa para cancelar el movimiento Y y obtén la posición Y al final del tick. Esta posición es donde la perla comienza a moverse.", - "DefaultRedTNTPos": "Posición Predet. TNT Roja", - "DefaultRedTNTPosDesc": "La Posición de la TNT Roja (Respecto a la perla) si el Slime Block no la mueve", - "DefaultBlueTNTPos": "Posición Predet. TNT Azul", - "DefaultBlueTNTPosDesc": "La Posición de la TNT Azul (Respecto a la perla) si el Slime Block no la mueve", - "DisplayDistance": "Distancia", - "DisplayTicks": "Tick", - "DisplayBlue": "Azul", - "DisplayRed": "Roja", - "DisplayTotal": "TNTTotal", - "TNTCalculationResultTooltip": "Haga clic en esta fila para ingresar automáticamente los valores en los campos de entrada de TNT Azul y TNT Rojo.", - "TNTCalculationSetSuccessMessage": "Valores de TNT calculados con éxito.", - "DisplayDirection": "Dirección de Resultado", - "DisplayAngle": "Ángulo de Resultado (x | z)", - "SettingsNorthWestTNT": "TNT Noroeste", + "PearlYPositionOriginal": "Posición Y de la Perla (Original)", + "PearlYPositionOriginalDesc": "Para obtener la posición Y de la perla, debes quitar el pistón que se usa para cancelar el movimiento Y y obtener la posición Y de la perla en el tick de la explosión. Esta posición es donde la perla obtiene el impulso.", + "PerfectHorizontalProjection": "Proyección Horizontal Perfecta", + "RedTNT": "TNT Roja :", + "ResetToDefault": "Resetear", + "ResultSortControl": "Control de Orden de Resultados", + "SaveSettings": "Exportar Configuración", "SettingsNorthEastTNT": "TNT Noreste", - "SettingsSouthWestTNT": "TNT Sudoeste", + "SettingsNorthWestTNT": "TNT Noroeste", "SettingsSouthEastTNT": "TNT Sudeste", - "North": "Norte", + "SettingsSouthWestTNT": "TNT Sudoeste", "South": "Sur", - "East": "Este", - "West": "Oeste", - "NorthWest": "Noroeste", - "NorthEast": "Noreste", + "SouthEast": "Sudeste", "SouthWest": "Sudoeste", - "SouthEast": "Sudeste" + "TNTCalculationResultTooltip": "Haga clic en esta fila para ingresar automáticamente los valores en los campos de entrada de TNT Azul y TNT Rojo.", + "TNTCalculationSetSuccessMessage": "Valores de TNT calculados con éxito.", + "TNTWeight": "Peso TNT", + "TNTXA": "X TNT(A):", + "TNTXB": "X TNT(B):", + "TNTYA": "Y TNT(A):", + "TNTYB": "Y TNT(B):", + "TNTZA": "Z TNT(A):", + "TNTZB": "Z TNT(B):", + "TableMode": "Modo Tabla", + "West": "Oeste", + "XCoor": "Pos. X", + "YCoor": "Pos. Y", + "ZCoor": "Pos. Z" } diff --git a/wwwroot/assets/i18n/zh_cn.json b/wwwroot/assets/i18n/zh_cn.json index cdb9e7a..0bb5624 100644 --- a/wwwroot/assets/i18n/zh_cn.json +++ b/wwwroot/assets/i18n/zh_cn.json @@ -1,93 +1,76 @@ { - "GeneralHeader": "通用FTL", - "ManuallyHeader": "自定义FTL", - - "GeneralFtlGeneral": "一般选项", - "GeneralFtlAdvanced": "进阶选项", - "GeneralFtlSettings": "更多基础选项", - - "PearlPosX": "珍珠X坐标 :", - "PearlPosY": "珍珠Y坐标 :", - "PearlPosZ": "珍珠Z坐标 :", - + "AmountA": "TNT(A)数量 :", + "AmountB": "TNT(B)数量 :", + "BlueTNT": "蓝色阵列", + "CalculatePearlMomentum": "计算珍珠动能", + "CalculatePearlTrace": "计算珍珠轨迹", + "CalculateTNTAmount": "计算TNT当量", + "ConsoleHeader": "控制台", + "Coordinate": "坐标", + "DefaultBlueTNTPos": "预设蓝色TNT方位", + "DefaultBlueTNTPosDesc": "预设从蓝色阵列复制的TNT\n在不被粘液块改位置下相对于珍珠的方位", + "DefaultRedTNTPos": "预设红色TNT方位", + "DefaultRedTNTPosDesc": "预设从红色阵列复制的TNT\n在不被粘液块改位置下相对于珍珠的方位", "DestinationX": "目标点X坐标 :", "DestinationZ": "目标点Z坐标 :", - "Direction": "方向 :", - + "DisplayAngle": "发射角度 (x | z)", + "DisplayBlue": "蓝色", + "DisplayDirection": "方位", + "DisplayDistance": "距离偏移", + "DisplayHeader": "结果输出", + "DisplayRed": "红色", + "DisplayTicks": "游戏刻", + "DisplayTotal": "总量", + "DisplayXMotion": "X矢量", + "DisplayYMotion": "Y矢量", + "DisplayZMotion": "Z矢量", + "GeneralFtlAdvanced": "进阶选项", + "GeneralFtlGeneral": "一般选项", + "GeneralFtlSettings": "更多基础选项", + "GeneralHeader": "通用FTL", + "GraphMode": "图表模式", + "ImportSettings": "导入设置", + "ManuallyHeader": "自定义FTL", "MaxTNT": "最大TNT当量", - "RedTNT": "红色阵列", - "BlueTNT": "蓝色阵列", - "Offset": "珍珠矫正偏移", - "ResultSortControl": "结果排序控制", - "TNTWeight": "TNT权重", "MixedWeightedDistance": "混合加权距离", "MixedWeightedTotal": "混合加权总量", - - "PearlSimulate": "珍珠模拟", - "ImportSettings": "导入设置", - "SaveSettings": "保存设置", - - "DisplayHeader": "结果输出", - "ConsoleHeader": "控制台", - - "ResetToDefault": "重置为默认值", - + "Momentum": "矢量", "MomentumX": "X矢量 :", "MomentumY": "Y矢量 :", "MomentumZ": "Z矢量 :", - - "DisplayXMotion": "X矢量", - "DisplayYMotion": "Y矢量", - "DisplayZMotion": "Z矢量", - - "XCoor": "X坐标", - "YCoor": "Y坐标", - "ZCoor": "Z坐标", - - "TNTXA": "TNT(A)的X坐标 :", - "TNTYA": "TNT(A)的Y坐标 :", - "TNTZA": "TNT(A)的Z坐标 :", - - "TNTXB": "TNT(B)的X坐标 :", - "TNTYB": "TNT(B)的Y坐标 :", - "TNTZB": "TNT(B)的Z坐标 :", - - "AmountA": "TNT(A)数量 :", - "AmountB": "TNT(B)数量 :", - - "CalculateTNTAmount": "计算TNT当量", - "CalculatePearlTrace": "计算珍珠轨迹", - "CalculatePearlMomentum": "计算珍珠动能", - + "NormalProjection": "正常抛射", + "Offset": "珍珠矫正偏移", + "PearlPosX": "珍珠X坐标 :", + "PearlPosY": "珍珠Y坐标 :", + "PearlPosZ": "珍珠Z坐标 :", + "PearlSimulate": "珍珠模拟", "PearlY": "珍珠Y", - "Coordinate": "坐标", - "Momentum": "矢量", "PearlYMotionMode": "珍珠Y轴运动模式", - "NormalProjection": "正常抛射", - "PerfectHorizontalProjection": "完美水平抛射","PearlYPositionOriginal": "珍珠 Y 轴位置(原始)", - "PearlYPositionOriginalDesc": "要获得珍珠的 Y 轴位置,应移除用于取消 Y 轴运动的活塞,并在爆炸时刻获得珍珠的 Y 轴位置。这个位置是珍珠获得矢量的地方。", "PearlYPositionAdjusted": "珍珠 Y 轴位置(调整后)", "PearlYPositionAdjustedDesc": "要获得珍珠的 Y 轴位置,只需放置用于取消 Y 轴运动的活塞,并在时间结束时获得 Y 轴位置。这个位置是珍珠开始移动的地方。", - - "DefaultRedTNTPos": "预设红色TNT方位", - "DefaultRedTNTPosDesc": "预设从红色阵列复制的TNT\n在不被粘液块改位置下相对于珍珠的方位", - "DefaultBlueTNTPos": "预设蓝色TNT方位", - "DefaultBlueTNTPosDesc": "预设从蓝色阵列复制的TNT\n在不被粘液块改位置下相对于珍珠的方位", - - "DisplayDistance": "距离偏移", - "DisplayTicks": "游戏刻", - "DisplayBlue": "蓝色", - "DisplayRed": "红色", - "DisplayTotal": "总量", - "TNTCalculationResultTooltip": "点击此行可自动将数值输入到蓝色 TNT 和红色 TNT 的输入字段。", - "TNTCalculationSetSuccessMessage": "成功设置 TNT 数量。", - - "DisplayDirection": "方位", - "DisplayAngle": "发射角度 (x | z)", - - "SettingsNorthWestTNT": "North West TNT", + "PearlYPositionOriginal": "珍珠 Y 轴位置(原始)", + "PearlYPositionOriginalDesc": "要获得珍珠的 Y 轴位置,应移除用于取消 Y 轴运动的活塞,并在爆炸时刻获得珍珠的 Y 轴位置。这个位置是珍珠获得矢量的地方。", + "PerfectHorizontalProjection": "完美水平抛射", + "RedTNT": "红色阵列", + "ResetToDefault": "重置为默认值", + "ResultSortControl": "结果排序控制", + "SaveSettings": "保存设置", "SettingsNorthEastTNT": "North East TNT", + "SettingsNorthWestTNT": "North West TNT", + "SettingsSouthEastTNT": "South East TNT", "SettingsSouthWestTNT": "South West TNT", - "SettingsSouthEastTNT": "South East TNT" + "TNTCalculationResultTooltip": "点击此行可自动将数值输入到蓝色 TNT 和红色 TNT 的输入字段。", + "TNTCalculationSetSuccessMessage": "成功设置 TNT 数量。", + "TNTWeight": "TNT权重", + "TNTXA": "TNT(A)的X坐标 :", + "TNTXB": "TNT(B)的X坐标 :", + "TNTYA": "TNT(A)的Y坐标 :", + "TNTYB": "TNT(B)的Y坐标 :", + "TNTZA": "TNT(A)的Z坐标 :", + "TNTZB": "TNT(B)的Z坐标 :", + "TableMode": "表格模式", + "XCoor": "X坐标", + "YCoor": "Y坐标", + "ZCoor": "Z坐标" } diff --git a/wwwroot/assets/i18n/zh_tw.json b/wwwroot/assets/i18n/zh_tw.json index e41d22d..af0c0c4 100644 --- a/wwwroot/assets/i18n/zh_tw.json +++ b/wwwroot/assets/i18n/zh_tw.json @@ -1,74 +1,76 @@ { - "GeneralHeader": "通用FTL", - "ManuallyHeader": "自訂義FTL", - "GeneralFtlGeneral": "一般設定", - "GeneralFtlAdvanced": "進階設定", - "GeneralFtlSettings": "更多基礎設定", - "PearlPosX": "珍珠X座標 :", - "PearlPosY": "珍珠Y座標 :", - "PearlPosZ": "珍珠Z座標 :", + "AmountA": "TNT(A)數量 :", + "AmountB": "TNT(B)數量 :", + "BlueTNT": "藍色TNT陣列", + "CalculatePearlMomentum": "計算珍珠動量", + "CalculatePearlTrace": "計算珍珠軌跡", + "CalculateTNTAmount": "計算TNT數量", + "ConsoleHeader": "控制台", + "Coordinate": "座標", + "DefaultBlueTNTPos": "預設藍色TNT方位", + "DefaultBlueTNTPosDesc": "預設從藍色陣列複製的TNT\n在不被史萊姆方塊改位置下相對於珍珠的方位", + "DefaultRedTNTPos": "預設紅色TNT方位", + "DefaultRedTNTPosDesc": "預設從紅色陣列複製的TNT\n在不被史萊姆方塊改位置下相對於珍珠的方位", "DestinationX": "目標點X座標 :", "DestinationZ": "目標點Z座標 :", "Direction": "方向 :", + "DisplayAngle": "發射角度 (x | z)", + "DisplayBlue": "藍色", + "DisplayDirection": "方位", + "DisplayDistance": "距離偏移", + "DisplayHeader": "結果輸出", + "DisplayRed": "紅色", + "DisplayTicks": "遊戲刻", + "DisplayTotal": "總量", + "DisplayXMotion": "X動量", + "DisplayYMotion": "Y動量", + "DisplayZMotion": "Z動量", + "GeneralFtlAdvanced": "進階設定", + "GeneralFtlGeneral": "一般設定", + "GeneralFtlSettings": "更多基礎設定", + "GeneralHeader": "通用FTL", + "GraphMode": "圖表模式", + "ImportSettings": "開啟設定檔", + "ManuallyHeader": "自訂義FTL", "MaxTNT": "最大TNT數量", - "RedTNT": "紅色TNT陣列", - "BlueTNT": "藍色TNT陣列", - "Offset": "珍珠矯正偏移", - "ResultSortControl": "結果排序控制", - "TNTWeight": "TNT最大數量", "MixedWeightedDistance": "混合加權距離", "MixedWeightedTotal": "混合加權總量", - "PearlSimulate": "珍珠模擬軌跡", - "ImportSettings": "開啟設定檔", - "SaveSettings": "儲存設定檔", - "DisplayHeader": "結果輸出", - "ConsoleHeader": "控制台", - "ResetToDefault": "恢復至預設值", + "Momentum": "動量", "MomentumX": "X動量 :", "MomentumY": "Y動量 :", "MomentumZ": "Z動量 :", - "DisplayXMotion": "X動量", - "DisplayYMotion": "Y動量", - "DisplayZMotion": "Z動量", - "XCoor": "X座標", - "YCoor": "Y座標", - "ZCoor": "Z座標", - "TNTXA": "TNT(A)的X座標 :", - "TNTYA": "TNT(A)的Y座標 :", - "TNTZA": "TNT(A)的Z座標 :", - "TNTXB": "TNT(B)的X座標 :", - "TNTYB": "TNT(B)的Y座標 :", - "TNTZB": "TNT(B)的Z座標 :", - "AmountA": "TNT(A)數量 :", - "AmountB": "TNT(B)數量 :", - "CalculateTNTAmount": "計算TNT數量", - "CalculatePearlTrace": "計算珍珠軌跡", - "CalculatePearlMomentum": "計算珍珠動量", + "NormalProjection": "正常抛射", + "Offset": "珍珠矯正偏移", + "PearlPosX": "珍珠X座標 :", + "PearlPosY": "珍珠Y座標 :", + "PearlPosZ": "珍珠Z座標 :", + "PearlSimulate": "珍珠模擬軌跡", "PearlY": "珍珠Y", - "Coordinate": "座標", - "Momentum": "動量", "PearlYMotionMode": "珍珠Y軸運動模式", - "NormalProjection": "正常抛射", - "PerfectHorizontalProjection": "完美水平抛射", - "PearlYPositionOriginal": "珍珠 Y 軸位置(原始)", - "PearlYPositionOriginalDesc": "要獲得珍珠的 Y 軸位置,應移除用來取消 Y 軸運動的活塞,並在爆炸時刻獲得珍珠的 Y 軸位置。這個位置是珍珠獲得動量的地方。", "PearlYPositionAdjusted": "珍珠 Y 軸位置(調整後)", "PearlYPositionAdjustedDesc": "要獲得珍珠的 Y 軸位置,只需放置用來取消 Y 軸運動的活塞,並在時間結束時獲得 Y 軸位置。這個位置是珍珠開始移動的地方。", - "DefaultRedTNTPos": "預設紅色TNT方位", - "DefaultRedTNTPosDesc": "預設從紅色陣列複製的TNT\n在不被史萊姆方塊改位置下相對於珍珠的方位", - "DefaultBlueTNTPos": "預設藍色TNT方位", - "DefaultBlueTNTPosDesc": "預設從藍色陣列複製的TNT\n在不被史萊姆方塊改位置下相對於珍珠的方位", - "DisplayDistance": "距離偏移", - "DisplayTicks": "遊戲刻", - "DisplayBlue": "藍色", - "DisplayRed": "紅色", - "DisplayTotal": "總量", - "TNTCalculationResultTooltip": "點擊此行可自動將數值輸入到藍色 TNT 和紅色 TNT 的輸入欄位。", - "TNTCalculationSetSuccessMessage": "成功設定 TNT 數量。", - "DisplayDirection": "方位", - "DisplayAngle": "發射角度 (x | z)", - "SettingsNorthWestTNT": "North West TNT", + "PearlYPositionOriginal": "珍珠 Y 軸位置(原始)", + "PearlYPositionOriginalDesc": "要獲得珍珠的 Y 軸位置,應移除用來取消 Y 軸運動的活塞,並在爆炸時刻獲得珍珠的 Y 軸位置。這個位置是珍珠獲得動量的地方。", + "PerfectHorizontalProjection": "完美水平抛射", + "RedTNT": "紅色TNT陣列", + "ResetToDefault": "恢復至預設值", + "ResultSortControl": "結果排序控制", + "SaveSettings": "儲存設定檔", "SettingsNorthEastTNT": "North East TNT", + "SettingsNorthWestTNT": "North West TNT", + "SettingsSouthEastTNT": "South East TNT", "SettingsSouthWestTNT": "South West TNT", - "SettingsSouthEastTNT": "South East TNT" + "TNTCalculationResultTooltip": "點擊此行可自動將數值輸入到藍色 TNT 和紅色 TNT 的輸入欄位。", + "TNTCalculationSetSuccessMessage": "成功設定 TNT 數量。", + "TNTWeight": "TNT最大數量", + "TNTXA": "TNT(A)的X座標 :", + "TNTXB": "TNT(B)的X座標 :", + "TNTYA": "TNT(A)的Y座標 :", + "TNTYB": "TNT(B)的Y座標 :", + "TNTZA": "TNT(A)的Z座標 :", + "TNTZB": "TNT(B)的Z座標 :", + "TableMode": "表格模式", + "XCoor": "X座標", + "YCoor": "Y座標", + "ZCoor": "Z座標" } \ No newline at end of file diff --git a/wwwroot/css/app.css b/wwwroot/css/app.css index 9a2e051..d2322df 100644 --- a/wwwroot/css/app.css +++ b/wwwroot/css/app.css @@ -1,92 +1,93 @@ @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); +@import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); html, body { - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; } a, .btn-link { - color: #0366d6; + color: #0366d6; } .btn-primary { - color: #fff; - background-color: #1b6ec2; - border-color: #1861ac; + color: #fff; + background-color: #1b6ec2; + border-color: #1861ac; } .content { - padding-top: 1.1rem; + padding-top: 1.1rem; } .valid.modified:not([type=checkbox]) { - outline: 1px solid #26b050; + outline: 1px solid #26b050; } .invalid { - outline: 1px solid red; + outline: 1px solid red; } .validation-message { - color: red; + color: red; } #blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; } - #blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; - } +#blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; +} #start-up-container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100vh; - position: absolute; - width: 100%; - background-color: white; - z-index: 1000; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; + position: absolute; + width: 100%; + background-color: white; + z-index: 1000; } #start-up-loading-circle { - border: 4px solid #f3f3f3; - border-top: 6px solid #3498db; - border-radius: 50%; - width: 60px; - height: 60px; - animation: spin 2s linear infinite; - margin-bottom: 20px; + border: 4px solid #f3f3f3; + border-top: 6px solid #3498db; + border-radius: 50%; + width: 60px; + height: 60px; + animation: spin 2s linear infinite; + margin-bottom: 20px; } @keyframes spin { - 0% { - transform: rotate(0deg); - } + 0% { + transform: rotate(0deg); + } - 100% { - transform: rotate(360deg); - } + 100% { + transform: rotate(360deg); + } } p { - font-size: 1.5em; - color: #3498db; + font-size: 1.5em; + color: #3498db; } /* Button Block */ .button-block > * { - margin-bottom: 12px; + margin-bottom: 12px; } diff --git a/wwwroot/index.html b/wwwroot/index.html index 1f302d3..fbf5899 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -2,56 +2,62 @@ - - - + + + Pearl Calculator - + - - + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + -
-
-
-

Loading, first entry will take a while...

-
+
+
+
+

Loading, first entry will take a while...

- -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - - +
+ +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + + + + + + \ No newline at end of file diff --git a/wwwroot/tnt-weight-slider.js b/wwwroot/tnt-weight-slider.js index 7491c53..490d69f 100644 --- a/wwwroot/tnt-weight-slider.js +++ b/wwwroot/tnt-weight-slider.js @@ -9,7 +9,7 @@ function AddTNTWeightSliderEvent() { document.onmouseup = () => { if (isTntWeightSliderMouseDown) { isTntWeightSliderMouseDown = false; - DotNet.invokeMethod("PearlCalculatorBlazor", "ChangeTNTWeightJS"); + DotNet.invokeMethod("PearlCalculatorBlazor", "ChangeTntWeightJs"); } } } \ No newline at end of file