更新桌宠消息窗口显示逻辑

This commit is contained in:
ZouJin 2023-02-01 22:16:43 +08:00
parent 433bcc9367
commit f039ac86a6
10 changed files with 36 additions and 12 deletions

View File

@ -88,6 +88,11 @@ namespace VPet_Simulator.Core
/// <param name="text">内容</param> /// <param name="text">内容</param>
public void Show(string name, string text) public void Show(string name, string text)
{ {
if (m.UIGrid.Children.IndexOf(this) != m.UIGrid.Children.Count - 1)
{
m.UIGrid.Children.Remove(this);
m.UIGrid.Children.Add(this);
}
TText.Text = ""; TText.Text = "";
outputtext = text.ToList(); outputtext = text.ToList();
LName.Content = name; LName.Content = name;

View File

@ -60,7 +60,7 @@ namespace VPet_Simulator.Core
{ {
till.Visibility = Visibility.Collapsed; till.Visibility = Visibility.Collapsed;
tfun.Visibility = Visibility.Visible; tfun.Visibility = Visibility.Visible;
} }
pExp.Maximum = m.Core.Save.LevelUpNeed(); pExp.Maximum = m.Core.Save.LevelUpNeed();
pExp.Value = m.Core.Save.Exp; pExp.Value = m.Core.Save.Exp;
pStrength.Value = m.Core.Save.Strength; pStrength.Value = m.Core.Save.Strength;
@ -101,6 +101,11 @@ namespace VPet_Simulator.Core
public void Show() public void Show()
{ {
if (m.UIGrid.Children.IndexOf(this) != m.UIGrid.Children.Count - 1)
{
m.UIGrid.Children.Remove(this);
m.UIGrid.Children.Add(this);
}
Visibility = Visibility.Visible; Visibility = Visibility.Visible;
if (closetimer.Enabled) if (closetimer.Enabled)
onFocus = true; onFocus = true;

View File

@ -457,17 +457,17 @@ namespace VPet_Simulator.Core
/// </summary> /// </summary>
public void Set(LpsDocument lps) public void Set(LpsDocument lps)
{ {
if (lps.HaveLine("touchhead")) if (lps.FindLine("touchhead") != null)
{ {
TouchHeadLocate = new Point(lps["touchhead"][(gdbe)"px"], lps["touchhead"][(gdbe)"py"]); TouchHeadLocate = new Point(lps["touchhead"][(gdbe)"px"], lps["touchhead"][(gdbe)"py"]);
TouchHeadSize = new Size(lps["touchhead"][(gdbe)"sw"], lps["touchhead"][(gdbe)"wh"]); TouchHeadSize = new Size(lps["touchhead"][(gdbe)"sw"], lps["touchhead"][(gdbe)"wh"]);
} }
if (lps.HaveLine("touchraised")) if (lps.FindLine("touchraised") != null)
{ {
TouchRaisedLocate = new Point(lps["touchraised"][(gdbe)"px"], lps["touchraised"][(gdbe)"py"]); TouchRaisedLocate = new Point(lps["touchraised"][(gdbe)"px"], lps["touchraised"][(gdbe)"py"]);
TouchRaisedSize = new Size(lps["touchraised"][(gdbe)"sw"], lps["touchraised"][(gdbe)"wh"]); TouchRaisedSize = new Size(lps["touchraised"][(gdbe)"sw"], lps["touchraised"][(gdbe)"wh"]);
} }
if (lps.HaveLine("raisepoint")) if (lps.FindLine("raisepoint") != null)
RaisePoint = new Point(lps["raisepoint"][(gdbe)"x"], lps["raisepoint"][(gdbe)"y"]); RaisePoint = new Point(lps["raisepoint"][(gdbe)"x"], lps["raisepoint"][(gdbe)"y"]);
var s = lps.FindLine("speed"); var s = lps.FindLine("speed");
if (s != null) if (s != null)

View File

@ -210,16 +210,16 @@ namespace VPet_Simulator.Core
else else
{ {
parent.IsContinue = false; parent.IsContinue = false;
//parent.Dispatcher.Invoke(Hidden); parent.Dispatcher.Invoke(Hidden);
if (parent.DoEndAction) if (parent.DoEndAction)
EndAction?.Invoke();//运行结束动画时事件 EndAction?.Invoke();//运行结束动画时事件
parent.StopAction?.Invoke(); parent.StopAction?.Invoke();
parent.StopAction = null; parent.StopAction = null;
Task.Run(() => //Task.Run(() =>
{ //{
Thread.Sleep(25); // Thread.Sleep(25);
parent.Dispatcher.Invoke(Hidden); // parent.Dispatcher.Invoke(Hidden);
}); //});
} }
} }
} }

View File

@ -69,7 +69,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LinePutScript.1.5.4\lib\net462\LinePutScript.dll</HintPath> <HintPath>..\packages\LinePutScript.1.6.1\lib\net462\LinePutScript.dll</HintPath>
</Reference> </Reference>
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="LinePutScript" version="1.5.4" targetFramework="net462" /> <package id="LinePutScript" version="1.6.1" targetFramework="net462" />
<package id="Panuon.WPF" version="1.0.1" targetFramework="net462" /> <package id="Panuon.WPF" version="1.0.1" targetFramework="net462" />
<package id="Panuon.WPF.UI" version="1.1.6.5" targetFramework="net462" /> <package id="Panuon.WPF.UI" version="1.1.6.5" targetFramework="net462" />
</packages> </packages>

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 KiB

View File

@ -0,0 +1,2 @@
vupmod#MatchPet:|author#LorisYounger:|gamever#20:|ver#100:|
intro#来试试这个极简手残画风的单帧宠物吧:|

View File

@ -0,0 +1,6 @@
pet#火柴人:|intor#来试试这个极简手残画风的单帧宠物吧:|path#vup:|
touchhead:|px#159:|py#16:|sw#189:|sh#178:|
touchraised:|px#0:|py#50:|sw#500:|sh#200:|
raisepoint:|x#290:|y#128:|
speed:|walk#20:|climb#10:|climbtop#8:|crawl#8:|fallx#14:|fally#10:|crawl#10:|
locate:|climbleft#145:|climbright#185:|climbtop#150:|

View File

@ -0,0 +1,6 @@
pet#火柴人:|intor#来试试这个极简手残画风的单帧宠物吧:|path#matchmen:|
touchhead:|px#159:|py#16:|sw#189:|sh#178:|
touchraised:|px#0:|py#50:|sw#500:|sh#200:|
raisepoint:|x#290:|y#128:|
speed:|walk#20:|climb#10:|climbtop#8:|crawl#8:|fallx#14:|fally#10:|crawl#10:|
locate:|climbleft#145:|climbright#185:|climbtop#150:|