diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index 847aba5..226a1a7 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -38,12 +38,12 @@ namespace VPet_Simulator.Core /// 说话 /// /// 说话内容 - public void Say(string text, GraphCore.Helper.SayType type = GraphCore.Helper.SayType.Shining) + public void Say(string text, GraphCore.Helper.SayType type = GraphCore.Helper.SayType.Shining, bool force = false) { Task.Run(() => { OnSay?.Invoke(text); - if (type != GraphCore.Helper.SayType.None && DisplayType == GraphCore.GraphType.Default) + if (force || type != GraphCore.Helper.SayType.None && DisplayType == GraphCore.GraphType.Default) Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.A_Start), () => { Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text, type)); diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml.cs b/VPet-Simulator.Core/Display/ToolBar.xaml.cs index 5ca3e85..b91f5ab 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml.cs +++ b/VPet-Simulator.Core/Display/ToolBar.xaml.cs @@ -59,10 +59,22 @@ namespace VPet_Simulator.Core pFeeling.Value = m.Core.Save.Feeling; pStrengthFood.Value = m.Core.Save.StrengthFood; pStrengthDrink.Value = m.Core.Save.StrengthDrink; - tStrength.Text = $"{m.Core.Save.ChangeStrength:f1}/t"; - tFeeling.Text = $"{m.Core.Save.ChangeFeeling:f1}/t"; - tStrengthDrink.Text = $"{m.Core.Save.ChangeStrengthDrink:f1}/t"; - tStrengthFood.Text = $"{m.Core.Save.ChangeStrengthFood:f1}/t"; + if (m.Core.Save.ChangeStrength < 1) + tStrength.Text = $"{m.Core.Save.ChangeStrength:f1}/t"; + else + tStrength.Text = $"{m.Core.Save.ChangeStrength:f2}/t"; + if (m.Core.Save.ChangeFeeling < 1) + tFeeling.Text = $"{m.Core.Save.ChangeFeeling:f1}/t"; + else + tFeeling.Text = $"{m.Core.Save.ChangeFeeling:f2}/t"; + if (m.Core.Save.ChangeStrengthDrink < 1) + tStrengthDrink.Text = $"{m.Core.Save.ChangeStrengthDrink:f1}/t"; + else + tStrengthDrink.Text = $"{m.Core.Save.ChangeStrengthDrink:f2}/t"; + if (m.Core.Save.ChangeStrengthFood < 1) + tStrengthFood.Text = $"{m.Core.Save.ChangeStrengthFood:f1}/t"; + else + tStrengthFood.Text = $"{m.Core.Save.ChangeStrengthFood:f2}/t"; } } @@ -178,33 +190,33 @@ namespace VPet_Simulator.Core private void PgbExperience_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e) { - e.Text = $"{e.Value} / {pExp.Maximum}"; + e.Text = $"{e.Value:f2} / {pExp.Maximum:f0}"; } private void PgbStrength_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e) { - e.Text = $"{e.Value} / 100"; + e.Text = $"{e.Value:f2} / 100"; } private void PgbSpirit_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e) { var progressBar = (ProgressBar)sender; progressBar.Foreground = GetForeground(e.Value); - e.Text = $"{e.Value} / 100"; + e.Text = $"{e.Value:f2} / 100"; } private void PgbHunger_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e) { var progressBar = (ProgressBar)sender; progressBar.Foreground = GetForeground(e.Value); - e.Text = $"{e.Value} / 100"; + e.Text = $"{e.Value:f2} / 100"; } private void PgbThirsty_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e) { var progressBar = (ProgressBar)sender; progressBar.Foreground = GetForeground(e.Value); - e.Text = $"{e.Value} / 100"; + e.Text = $"{e.Value:f2} / 100"; //if (e.Value <= 20) //{ // tHearth.Visibility = Visibility.Visible; diff --git a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs index 657d338..165ae11 100644 --- a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs +++ b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs @@ -60,15 +60,18 @@ namespace VPet_Simulator.Core { case Main.WorkingState.Study: m.Core.Save.Money += GetCount * 0.2; - Stop(() => m.Say($"学习完成啦, 累计学会了 {(GetCount * 1.2):f2} EXP\n共计花费了{MaxTime}分钟")); + Stop(() => m.Say($"学习完成啦, 累计学会了 {(GetCount * 1.2):f2} 经验值\n共计花费了{MaxTime}分钟" + , GraphCore.Helper.SayType.Shining, true)); break; case Main.WorkingState.WorkONE: m.Core.Save.Money += GetCount * 0.15; - Stop(() => m.Say($"{m.Core.Graph.GraphConfig.Str[(gstr)"work1"]}完成啦, 累计赚了 {GetCount * 1.15:f2} 金钱\n共计花费了{MaxTime}分钟")); + Stop(() => m.Say($"{m.Core.Graph.GraphConfig.Str[(gstr)"work1"]}完成啦, 累计赚了 {GetCount * 1.15:f2} 金钱\n共计花费了{MaxTime}分钟" + , GraphCore.Helper.SayType.Shining, true)); break; case Main.WorkingState.WorkTWO: m.Core.Save.Money += GetCount * 0.25; - Stop(() => m.Say($"{m.Core.Graph.GraphConfig.Str[(gstr)"work2"]}完成啦, 累计赚了 {GetCount * 1.25:f2} 金钱\n共计花费了{MaxTime}分钟")); + Stop(() => m.Say($"{m.Core.Graph.GraphConfig.Str[(gstr)"work2"]}完成啦, 累计赚了 {GetCount * 1.25:f2} 金钱\n共计花费了{MaxTime}分钟" + , GraphCore.Helper.SayType.Shining, true)); break; } @@ -222,7 +225,10 @@ namespace VPet_Simulator.Core m.Display(GraphCore.GraphType.WorkTWO_C_End, then ?? m.DisplayNomal); break; default: - then?.Invoke(); + if (then == null) + m.DisplayNomal(); + else + then(); return; } } diff --git a/VPet-Simulator.Windows.Interface/Food.cs b/VPet-Simulator.Windows.Interface/Food.cs index a1e3eb5..dccc8b3 100644 --- a/VPet-Simulator.Windows.Interface/Food.cs +++ b/VPet-Simulator.Windows.Interface/Food.cs @@ -82,6 +82,7 @@ namespace VPet_Simulator.Windows.Interface /// [Line(ignoreCase: true)] public string Desc { get; set; } + private string desc = null; /// /// 描述(ToBetterBuy) /// @@ -89,8 +90,24 @@ namespace VPet_Simulator.Windows.Interface { get { - StringBuilder sb = new StringBuilder(Desc); - return sb.ToString(); + if(desc == null) + { + StringBuilder sb = new StringBuilder(); + if (Exp != 0) + sb.Append("经验值:\t").Append(Exp > 0 ? "+" : "").Append(Exp.ToString("f2")).AppendLine(); + if (StrengthFood != 0) sb.Append("饱腹度:\t").Append(StrengthFood > 0 ? "+" : "").Append(StrengthFood.ToString("f2")).Append("\t\t"); + if (StrengthDrink != 0) sb.Append("口渴度:\t").Append(StrengthDrink > 0 ? "+" : "").Append(StrengthDrink.ToString("f2")).AppendLine(); + if (Strength != 0) sb.Append("体力:\t").Append(Strength > 0 ? "+" : "").Append(Strength.ToString("f2")).Append("\t\t"); + if (Feeling != 0) + sb.Append("心情:\t").Append(Feeling > 0 ? "+" : "").Append(Feeling.ToString("f2")).AppendLine(); + if (Health != 0) + sb.Append("健康:\t").Append(Health > 0 ? "+" : "").Append(Health.ToString("f2")).Append("\t\t"); + if (Likability != 0) + sb.Append("好感度:\t").Append(Likability > 0 ? "+" : "").Append(Likability.ToString("f2")); + sb.AppendLine().Append(Desc); + desc = sb.ToString(); + } + return desc; } } /// diff --git a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml index 901cdfb..0ca0dd1 100644 --- a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml +++ b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml @@ -104,7 +104,7 @@ -->