mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
修复频繁说话导致说话动作不停止 fix #358
This commit is contained in:
parent
b54df8fae4
commit
7207d14284
@ -65,7 +65,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
MsgBar.Show(Core.Save.Name, text, msgcontent: (string.IsNullOrWhiteSpace(desc) ? null :
|
||||
MsgBar.Show(Core.Save.Name, text, graphname, msgcontent: (string.IsNullOrWhiteSpace(desc) ? null :
|
||||
new TextBlock() { Text = desc, FontSize = 20, ToolTip = desc, HorizontalAlignment = HorizontalAlignment.Right }));
|
||||
});
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
Opacity = 1;
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
MessageBoxContent.Children.Clear();
|
||||
});
|
||||
|
||||
EndAction?.Invoke();
|
||||
}
|
||||
else
|
||||
@ -114,12 +114,6 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
}
|
||||
}
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(timeleft * 50);
|
||||
if (!string.IsNullOrEmpty(graphName) && m.DisplayType.Type == GraphInfo.GraphType.Say)
|
||||
m.DisplayCEndtoNomal(graphName);
|
||||
});
|
||||
ShowTimer.Stop();
|
||||
EndTimer.Start();
|
||||
}
|
||||
@ -130,9 +124,10 @@ namespace VPet_Simulator.Core
|
||||
public event Action EndAction;
|
||||
private void EndTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
|
||||
if (--timeleft <= 0)
|
||||
{
|
||||
if ((m.DisplayType.Name == graphName || m.DisplayType.Type == GraphInfo.GraphType.Say) && m.DisplayType.Animat != GraphInfo.AnimatType.C_End)
|
||||
m.DisplayCEndtoNomal(graphName);
|
||||
EndTimer.Stop();
|
||||
CloseTimer.Start();
|
||||
}
|
||||
@ -194,6 +189,8 @@ namespace VPet_Simulator.Core
|
||||
EndTimer.Stop(); ShowTimer.Stop(); CloseTimer.Close();
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
MessageBoxContent.Children.Clear();
|
||||
if ((m.DisplayType.Name == graphName || m.DisplayType.Type == GraphInfo.GraphType.Say) && m.DisplayType.Animat != GraphInfo.AnimatType.C_End)
|
||||
m.DisplayCEndtoNomal(graphName);
|
||||
EndAction?.Invoke();
|
||||
}
|
||||
public void Dispose()
|
||||
|
Loading…
Reference in New Issue
Block a user