工作显示

This commit is contained in:
ZouJin 2023-05-20 02:43:22 +10:00
parent 1c08845294
commit 90a173120f
6 changed files with 202 additions and 107 deletions

View File

@ -18,7 +18,7 @@ namespace VPet_Simulator.Core
/// <summary> /// <summary>
/// 当前动画类型 /// 当前动画类型
/// </summary> /// </summary>
public GraphCore.GraphType DisplayType = GraphCore.GraphType.Default; public GraphCore.GraphType DisplayType = GraphType.Default;
/// <summary> /// <summary>
/// 默认循环次数 /// 默认循环次数
/// </summary> /// </summary>
@ -54,7 +54,7 @@ namespace VPet_Simulator.Core
public void DisplayNomal() public void DisplayNomal()
{ {
CountNomal++; CountNomal++;
Display(GraphCore.GraphType.Default, DisplayNomal); Display(GraphType.Default, DisplayNomal);
} }
/// <summary> /// <summary>
/// 显示结束动画 /// 显示结束动画
@ -65,41 +65,41 @@ namespace VPet_Simulator.Core
{ {
switch (DisplayType) switch (DisplayType)
{ {
case GraphCore.GraphType.Boring_B_Loop: case GraphType.Boring_B_Loop:
Display(GraphCore.GraphType.Boring_C_End, EndAction); Display(GraphType.Boring_C_End, EndAction);
return true; return true;
case GraphCore.GraphType.Squat_B_Loop: case GraphType.Squat_B_Loop:
Display(GraphCore.GraphType.Squat_C_End, EndAction); Display(GraphType.Squat_C_End, EndAction);
return true; return true;
case GraphType.Crawl_Left_B_Loop: case GraphType.Crawl_Left_B_Loop:
Display(GraphCore.GraphType.Crawl_Left_C_End, EndAction); Display(GraphType.Crawl_Left_C_End, EndAction);
return true; return true;
case GraphType.Crawl_Right_B_Loop: case GraphType.Crawl_Right_B_Loop:
Display(GraphCore.GraphType.Crawl_Right_C_End, EndAction); Display(GraphType.Crawl_Right_C_End, EndAction);
return true; return true;
case GraphType.Fall_Left_B_Loop: case GraphType.Fall_Left_B_Loop:
Display(GraphCore.GraphType.Fall_Left_C_End, Display(GraphType.Fall_Left_C_End,
() => Display(GraphCore.GraphType.Climb_Up_Left, EndAction)); () => Display(GraphType.Climb_Up_Left, EndAction));
return true; return true;
case GraphType.Fall_Right_B_Loop: case GraphType.Fall_Right_B_Loop:
Display(GraphCore.GraphType.Fall_Right_C_End, Display(GraphType.Fall_Right_C_End,
() => Display(GraphCore.GraphType.Climb_Up_Right, EndAction)); () => Display(GraphType.Climb_Up_Right, EndAction));
return true; return true;
case GraphType.Walk_Left_B_Loop: case GraphType.Walk_Left_B_Loop:
Display(GraphCore.GraphType.Walk_Left_C_End, EndAction); Display(GraphType.Walk_Left_C_End, EndAction);
return true; return true;
case GraphType.Walk_Right_B_Loop: case GraphType.Walk_Right_B_Loop:
Display(GraphCore.GraphType.Walk_Right_C_End, EndAction); Display(GraphType.Walk_Right_C_End, EndAction);
return true; return true;
case GraphType.Sleep_B_Loop: case GraphType.Sleep_B_Loop:
State = WorkingState.Nomal; State = WorkingState.Nomal;
Display(GraphCore.GraphType.Sleep_C_End, EndAction); Display(GraphType.Sleep_C_End, EndAction);
return true; return true;
case GraphType.Idel_StateONE_B_Loop: case GraphType.Idel_StateONE_B_Loop:
Display(GraphCore.GraphType.Idel_StateONE_C_End, EndAction); Display(GraphType.Idel_StateONE_C_End, EndAction);
return true; return true;
case GraphType.Idel_StateTWO_B_Loop: case GraphType.Idel_StateTWO_B_Loop:
Display(GraphCore.GraphType.Idel_StateTWO_C_End, () => Display(GraphCore.GraphType.Idel_StateONE_C_End, EndAction)); Display(GraphType.Idel_StateTWO_C_End, () => Display(GraphType.Idel_StateONE_C_End, EndAction));
return true; return true;
//case GraphType.Climb_Left: //case GraphType.Climb_Left:
//case GraphType.Climb_Right: //case GraphType.Climb_Right:
@ -116,7 +116,7 @@ namespace VPet_Simulator.Core
public void DisplayClose(Action EndAction) public void DisplayClose(Action EndAction)
{ {
CountNomal++; CountNomal++;
Display(GraphCore.GraphType.Shutdown, EndAction); Display(GraphType.Shutdown, EndAction);
} }
/// <summary> /// <summary>
/// 显示摸头情况 /// 显示摸头情况
@ -131,20 +131,20 @@ namespace VPet_Simulator.Core
if (DisplayType == GraphType.Touch_Head_A_Start) if (DisplayType == GraphType.Touch_Head_A_Start)
return; return;
if (DisplayType == GraphType.Touch_Head_B_Loop) if (DisplayType == GraphType.Touch_Head_B_Loop)
if (Dispatcher.Invoke(() => PetGrid.Tag) is IGraph ig && ig.GraphType == GraphCore.GraphType.Touch_Head_B_Loop) if (Dispatcher.Invoke(() => PetGrid.Tag) is IGraph ig && ig.GraphType == GraphType.Touch_Head_B_Loop)
{ {
ig.IsContinue = true; ig.IsContinue = true;
return; return;
} }
else if (Dispatcher.Invoke(() => PetGrid2.Tag) is IGraph ig2 && ig2.GraphType == GraphCore.GraphType.Touch_Head_B_Loop) else if (Dispatcher.Invoke(() => PetGrid2.Tag) is IGraph ig2 && ig2.GraphType == GraphType.Touch_Head_B_Loop)
{ {
ig2.IsContinue = true; ig2.IsContinue = true;
return; return;
} }
Display(GraphCore.GraphType.Touch_Head_A_Start, () => Display(GraphType.Touch_Head_A_Start, () =>
Display(GraphCore.GraphType.Touch_Head_B_Loop, () => Display(GraphType.Touch_Head_B_Loop, () =>
Display(GraphCore.GraphType.Touch_Head_C_End, DisplayToNomal Display(GraphType.Touch_Head_C_End, DisplayToNomal
))); )));
} }
/// <summary> /// <summary>
@ -160,20 +160,20 @@ namespace VPet_Simulator.Core
if (DisplayType == GraphType.Touch_Body_A_Start) if (DisplayType == GraphType.Touch_Body_A_Start)
return; return;
if (DisplayType == GraphType.Touch_Body_B_Loop) if (DisplayType == GraphType.Touch_Body_B_Loop)
if (Dispatcher.Invoke(() => PetGrid.Tag) is IGraph ig && ig.GraphType == GraphCore.GraphType.Touch_Body_B_Loop) if (Dispatcher.Invoke(() => PetGrid.Tag) is IGraph ig && ig.GraphType == GraphType.Touch_Body_B_Loop)
{ {
ig.IsContinue = true; ig.IsContinue = true;
return; return;
} }
else if (Dispatcher.Invoke(() => PetGrid2.Tag) is IGraph ig2 && ig2.GraphType == GraphCore.GraphType.Touch_Body_B_Loop) else if (Dispatcher.Invoke(() => PetGrid2.Tag) is IGraph ig2 && ig2.GraphType == GraphType.Touch_Body_B_Loop)
{ {
ig2.IsContinue = true; ig2.IsContinue = true;
return; return;
} }
Core.Graph.RndGraph.Clear(); Core.Graph.RndGraph.Clear();
Display(GraphCore.GraphType.Touch_Body_A_Start, () => Display(GraphType.Touch_Body_A_Start, () =>
Display(GraphCore.GraphType.Touch_Body_B_Loop, () => Display(GraphType.Touch_Body_B_Loop, () =>
Display(GraphCore.GraphType.Touch_Body_C_End, DisplayToNomal Display(GraphType.Touch_Body_C_End, DisplayToNomal
))); )));
} }
/// <summary> /// <summary>
@ -183,7 +183,7 @@ namespace VPet_Simulator.Core
{ {
looptimes = 0; looptimes = 0;
CountNomal = 0; CountNomal = 0;
Display(GraphCore.GraphType.Idel_StateONE_A_Start, DisplayIdel_StateONEing); Display(GraphType.Idel_StateONE_A_Start, DisplayIdel_StateONEing);
} }
/// <summary> /// <summary>
/// 显示待机(模式1)情况 /// 显示待机(模式1)情况
@ -197,11 +197,11 @@ namespace VPet_Simulator.Core
DisplayIdel_StateTWO(); DisplayIdel_StateTWO();
break; break;
default: default:
Display(GraphCore.GraphType.Idel_StateONE_C_End, DisplayToNomal); Display(GraphType.Idel_StateONE_C_End, DisplayToNomal);
break; break;
} }
else else
Display(GraphCore.GraphType.Idel_StateONE_B_Loop, DisplayIdel_StateONEing); Display(GraphType.Idel_StateONE_B_Loop, DisplayIdel_StateONEing);
} }
/// <summary> /// <summary>
/// 显示待机(模式2)情况 /// 显示待机(模式2)情况
@ -210,7 +210,7 @@ namespace VPet_Simulator.Core
{ {
looptimes = 0; looptimes = 0;
CountNomal++; CountNomal++;
Display(GraphCore.GraphType.Idel_StateTWO_A_Start, DisplayIdel_StateTWOing); Display(GraphType.Idel_StateTWO_A_Start, DisplayIdel_StateTWOing);
} }
/// <summary> /// <summary>
/// 显示待机(模式2)情况 /// 显示待机(模式2)情况
@ -218,9 +218,9 @@ namespace VPet_Simulator.Core
private void DisplayIdel_StateTWOing() private void DisplayIdel_StateTWOing()
{ {
if (Function.Rnd.Next(++looptimes) > LoopMax) if (Function.Rnd.Next(++looptimes) > LoopMax)
Display(GraphCore.GraphType.Idel_StateTWO_C_End, DisplayIdel_StateONEing); Display(GraphType.Idel_StateTWO_C_End, DisplayIdel_StateONEing);
else else
Display(GraphCore.GraphType.Idel_StateTWO_B_Loop, DisplayIdel_StateTWOing); Display(GraphType.Idel_StateTWO_B_Loop, DisplayIdel_StateTWOing);
} }
int looptimes; int looptimes;
@ -231,7 +231,7 @@ namespace VPet_Simulator.Core
{ {
looptimes = 0; looptimes = 0;
CountNomal = 0; CountNomal = 0;
Display(GraphCore.GraphType.Squat_A_Start, DisplaySquating); Display(GraphType.Squat_A_Start, DisplaySquating);
} }
/// <summary> /// <summary>
/// 显示蹲下情况 /// 显示蹲下情况
@ -239,9 +239,9 @@ namespace VPet_Simulator.Core
private void DisplaySquating() private void DisplaySquating()
{ {
if (Function.Rnd.Next(++looptimes) > LoopProMax) if (Function.Rnd.Next(++looptimes) > LoopProMax)
Display(GraphCore.GraphType.Squat_C_End, DisplayToNomal); Display(GraphType.Squat_C_End, DisplayToNomal);
else else
Display(GraphCore.GraphType.Squat_B_Loop, DisplaySquating); Display(GraphType.Squat_B_Loop, DisplaySquating);
} }
/// <summary> /// <summary>
/// 显示无聊情况 /// 显示无聊情况
@ -250,7 +250,7 @@ namespace VPet_Simulator.Core
{ {
looptimes = 0; looptimes = 0;
CountNomal = 0; CountNomal = 0;
Display(GraphCore.GraphType.Boring_A_Start, DisplayBoringing); Display(GraphType.Boring_A_Start, DisplayBoringing);
} }
/// <summary> /// <summary>
/// 显示无聊情况 /// 显示无聊情况
@ -258,9 +258,9 @@ namespace VPet_Simulator.Core
private void DisplayBoringing() private void DisplayBoringing()
{ {
if (Function.Rnd.Next(++looptimes) > LoopProMax) if (Function.Rnd.Next(++looptimes) > LoopProMax)
Display(GraphCore.GraphType.Boring_C_End, DisplayToNomal); Display(GraphType.Boring_C_End, DisplayToNomal);
else else
Display(GraphCore.GraphType.Boring_B_Loop, DisplayBoringing); Display(GraphType.Boring_B_Loop, DisplayBoringing);
} }
@ -274,10 +274,10 @@ namespace VPet_Simulator.Core
if (force) if (force)
{ {
State = WorkingState.Sleep; State = WorkingState.Sleep;
Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleepingForce); Display(GraphType.Sleep_A_Start, DisplaySleepingForce);
} }
else else
Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleeping); Display(GraphType.Sleep_A_Start, DisplaySleeping);
} }
/// <summary> /// <summary>
/// 显示睡觉情况 (正常) /// 显示睡觉情况 (正常)
@ -285,16 +285,16 @@ namespace VPet_Simulator.Core
private void DisplaySleeping() private void DisplaySleeping()
{ {
if (Function.Rnd.Next(++looptimes) > LoopProMax) if (Function.Rnd.Next(++looptimes) > LoopProMax)
Display(GraphCore.GraphType.Sleep_C_End, DisplayToNomal); Display(GraphType.Sleep_C_End, DisplayToNomal);
else else
Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleeping); Display(GraphType.Sleep_B_Loop, DisplaySleeping);
} }
/// <summary> /// <summary>
/// 显示睡觉情况 (强制) /// 显示睡觉情况 (强制)
/// </summary> /// </summary>
private void DisplaySleepingForce() private void DisplaySleepingForce()
{//TODO:如果开启了Function,强制睡觉为永久,否则睡到自然醒+LoopMax {//TODO:如果开启了Function,强制睡觉为永久,否则睡到自然醒+LoopMax
Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleepingForce); Display(GraphType.Sleep_B_Loop, DisplaySleepingForce);
} }
/// <summary> /// <summary>
@ -303,14 +303,22 @@ namespace VPet_Simulator.Core
public void DisplayWorkONE() public void DisplayWorkONE()
{ {
State = WorkingState.WorkONE; State = WorkingState.WorkONE;
Display(GraphCore.GraphType.WorkONE_A_Start, DisplayWorkONEing); Display(GraphType.WorkONE_A_Start, DisplayWorkONEing);
}
/// <summary>
/// 显示工作情况结束
/// </summary>
public void DisplayWorkONEend()
{
State = WorkingState.Nomal;
Display(GraphType.WorkONE_C_End, DisplayNomal);
} }
/// <summary> /// <summary>
/// 显示工作情况循环 /// 显示工作情况循环
/// </summary> /// </summary>
private void DisplayWorkONEing() private void DisplayWorkONEing()
{ {
Display(GraphCore.GraphType.WorkONE_B_Loop, DisplayWorkONEing); Display(GraphType.WorkONE_B_Loop, DisplayWorkONEing);
} }
/// <summary> /// <summary>
/// 显示工作情况 /// 显示工作情况
@ -318,14 +326,22 @@ namespace VPet_Simulator.Core
public void DisplayWorkTWO() public void DisplayWorkTWO()
{ {
State = WorkingState.WorkTWO; State = WorkingState.WorkTWO;
Display(GraphCore.GraphType.WorkTWO_A_Start, DisplayWorkTWOing); Display(GraphType.WorkTWO_A_Start, DisplayWorkTWOing);
} }
/// <summary> /// <summary>
/// 显示工作情况循环 /// 显示工作情况循环
/// </summary> /// </summary>
private void DisplayWorkTWOing() private void DisplayWorkTWOing()
{ {
Display(GraphCore.GraphType.WorkTWO_B_Loop, DisplayWorkTWOing); Display(GraphType.WorkTWO_B_Loop, DisplayWorkTWOing);
}
/// <summary>
/// 显示工作情况结束
/// </summary>
public void DisplayWorkTWOend()
{
State = WorkingState.Nomal;
Display(GraphType.WorkTWO_C_End, DisplayNomal);
} }
/// <summary> /// <summary>
/// 显示学习情况 /// 显示学习情况
@ -333,14 +349,14 @@ namespace VPet_Simulator.Core
public void DisplayStudy() public void DisplayStudy()
{ {
State = WorkingState.Study; State = WorkingState.Study;
Display(GraphCore.GraphType.Study_A_Start, DisplayStudying); Display(GraphType.Study_A_Start, DisplayStudying);
} }
/// <summary> /// <summary>
/// 显示学习情况 /// 显示学习情况
/// </summary> /// </summary>
private void DisplayStudying() private void DisplayStudying()
{ {
Display(GraphCore.GraphType.Study_B_Loop, DisplayStudying); Display(GraphType.Study_B_Loop, DisplayStudying);
} }
/// <summary> /// <summary>
/// 显示拖拽情况 /// 显示拖拽情况
@ -372,14 +388,14 @@ namespace VPet_Simulator.Core
case 1: case 1:
case 2: case 2:
rasetype++; rasetype++;
Display(GraphCore.GraphType.Raised_Dynamic, DisplayRaising); Display(GraphType.Raised_Dynamic, DisplayRaising);
return; return;
case 3: case 3:
rasetype++; rasetype++;
Display(GraphCore.GraphType.Raised_Static_A_Start, DisplayRaising); Display(GraphType.Raised_Static_A_Start, DisplayRaising);
return; return;
default: default:
Display(GraphCore.GraphType.Raised_Static_B_Loop, DisplayRaising); Display(GraphType.Raised_Static_B_Loop, DisplayRaising);
rasetype = 4; rasetype = 4;
break; break;
} }
@ -389,16 +405,16 @@ namespace VPet_Simulator.Core
/// </summary> /// </summary>
public void DisplayFalled_Left() public void DisplayFalled_Left()
{ {
Display(GraphCore.GraphType.Fall_Left_C_End, Display(GraphType.Fall_Left_C_End,
() => Display(GraphCore.GraphType.Climb_Up_Left, DisplayToNomal)); () => Display(GraphType.Climb_Up_Left, DisplayToNomal));
} }
/// <summary> /// <summary>
/// 显示掉到地上 从左边 /// 显示掉到地上 从左边
/// </summary> /// </summary>
public void DisplayFalled_Right() public void DisplayFalled_Right()
{ {
Display(GraphCore.GraphType.Fall_Right_C_End, Display(GraphType.Fall_Right_C_End,
() => Display(GraphCore.GraphType.Climb_Up_Right, DisplayToNomal)); () => Display(GraphType.Climb_Up_Right, DisplayToNomal));
} }
/// <summary> /// <summary>
/// 显示向左走 (有判断) /// 显示向左走 (有判断)
@ -410,7 +426,7 @@ namespace VPet_Simulator.Core
{ {
walklength = 0; walklength = 0;
CountNomal = 0; CountNomal = 0;
Display(GraphCore.GraphType.Walk_Left_A_Start, () => Display(GraphType.Walk_Left_A_Start, () =>
{ {
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedWalk, 0); MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedWalk, 0);
MoveTimer.Start(); MoveTimer.Start();
@ -432,26 +448,26 @@ namespace VPet_Simulator.Core
DisplayFall_Left(() => DisplayFall_Left(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
return; return;
case 1: case 1:
DisplayFall_Right(() => DisplayFall_Right(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
return; return;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
return; return;
} }
} }
//不是:继续右边走or停下 //不是:继续右边走or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Walk_Left_B_Loop, DisplayWalk_Lefting); Display(GraphType.Walk_Left_B_Loop, DisplayWalk_Lefting);
} }
else else
{//停下来 {//停下来
@ -462,19 +478,19 @@ namespace VPet_Simulator.Core
DisplayFall_Left(() => DisplayFall_Left(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
break; break;
case 1: case 1:
DisplayFall_Right(() => DisplayFall_Right(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
break; break;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
break; break;
} }
@ -490,7 +506,7 @@ namespace VPet_Simulator.Core
{ {
walklength = 0; walklength = 0;
CountNomal = 0; CountNomal = 0;
Display(GraphCore.GraphType.Walk_Right_A_Start, () => Display(GraphType.Walk_Right_A_Start, () =>
{ {
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedWalk, 0); MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedWalk, 0);
MoveTimer.Start(); MoveTimer.Start();
@ -512,26 +528,26 @@ namespace VPet_Simulator.Core
DisplayClimb_Right_UP(() => DisplayClimb_Right_UP(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); Display(GraphType.Walk_Right_C_End, DisplayToNomal);
}); });
return; return;
case 1: case 1:
DisplayClimb_Right_DOWN(() => DisplayClimb_Right_DOWN(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); Display(GraphType.Walk_Right_C_End, DisplayToNomal);
}); });
return; return;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); Display(GraphType.Walk_Right_C_End, DisplayToNomal);
return; return;
} }
} }
//不是:继续右边走or停下 //不是:继续右边走or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Walk_Right_B_Loop, DisplayWalk_Righting); Display(GraphType.Walk_Right_B_Loop, DisplayWalk_Righting);
} }
else else
{//停下来 {//停下来
@ -542,19 +558,19 @@ namespace VPet_Simulator.Core
DisplayFall_Left(() => DisplayFall_Left(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
break; break;
case 1: case 1:
DisplayFall_Right(() => DisplayFall_Right(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
}); });
break; break;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); Display(GraphType.Walk_Left_C_End, DisplayToNomal);
break; break;
} }
@ -569,7 +585,7 @@ namespace VPet_Simulator.Core
if (Core.Controller.GetWindowsDistanceLeft() > DistanceMax * Core.Controller.ZoomRatio) if (Core.Controller.GetWindowsDistanceLeft() > DistanceMax * Core.Controller.ZoomRatio)
{ {
walklength = 0; walklength = 0;
Display(GraphCore.GraphType.Crawl_Left_A_Start, () => Display(GraphType.Crawl_Left_A_Start, () =>
{ {
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedCrawl, 0); MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedCrawl, 0);
MoveTimer.Start(); MoveTimer.Start();
@ -591,31 +607,31 @@ namespace VPet_Simulator.Core
DisplayClimb_Left_UP(() => DisplayClimb_Left_UP(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
}); });
return; return;
case 1: case 1:
DisplayClimb_Left_DOWN(() => DisplayClimb_Left_DOWN(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
}); });
return; return;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
return; return;
} }
} }
//不是:继续右边走or停下 //不是:继续右边走or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Crawl_Left_B_Loop, DisplayCrawl_Lefting); Display(GraphType.Crawl_Left_B_Loop, DisplayCrawl_Lefting);
} }
else else
{//停下来 {//停下来
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
} }
} }
/// <summary> /// <summary>
@ -627,7 +643,7 @@ namespace VPet_Simulator.Core
if (Core.Controller.GetWindowsDistanceRight() > DistanceMax * Core.Controller.ZoomRatio) if (Core.Controller.GetWindowsDistanceRight() > DistanceMax * Core.Controller.ZoomRatio)
{ {
walklength = 0; walklength = 0;
Display(GraphCore.GraphType.Crawl_Right_A_Start, () => Display(GraphType.Crawl_Right_A_Start, () =>
{ {
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedCrawl, 0); MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedCrawl, 0);
MoveTimer.Start(); MoveTimer.Start();
@ -649,31 +665,31 @@ namespace VPet_Simulator.Core
DisplayClimb_Right_UP(() => DisplayClimb_Right_UP(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
}); });
return; return;
case 1: case 1:
DisplayClimb_Right_DOWN(() => DisplayClimb_Right_DOWN(() =>
{ {
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
}); });
return; return;
default: default:
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
return; return;
} }
} }
//不是:继续右边走or停下 //不是:继续右边走or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Crawl_Right_B_Loop, DisplayCrawl_Righting); Display(GraphType.Crawl_Right_B_Loop, DisplayCrawl_Righting);
} }
else else
{//停下来 {//停下来
MoveTimer.Enabled = false; MoveTimer.Enabled = false;
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
} }
} }
/// <summary> /// <summary>
@ -687,7 +703,7 @@ namespace VPet_Simulator.Core
walklength = 0; walklength = 0;
CountNomal = 0; CountNomal = 0;
Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - Core.Graph.GraphConfig.LocateClimbLeft, 0); Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - Core.Graph.GraphConfig.LocateClimbLeft, 0);
Display(GraphCore.GraphType.Climb_Left_A_Start, () => Display(GraphType.Climb_Left_A_Start, () =>
{ {
MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb); MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb);
MoveTimer.Start(); MoveTimer.Start();
@ -722,7 +738,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMid) if (Function.Rnd.Next(walklength++) < LoopMid)
{ {
Display(GraphCore.GraphType.Climb_Left_B_Loop, DisplayClimb_Lefting_UP); Display(GraphType.Climb_Left_B_Loop, DisplayClimb_Lefting_UP);
} }
else else
{//停下来 {//停下来
@ -750,7 +766,7 @@ namespace VPet_Simulator.Core
CountNomal = 0; CountNomal = 0;
Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - Core.Graph.GraphConfig.LocateClimbLeft, 0); Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - Core.Graph.GraphConfig.LocateClimbLeft, 0);
Display(GraphCore.GraphType.Climb_Left_A_Start, () => Display(GraphType.Climb_Left_A_Start, () =>
{ {
MoveTimerPoint = new System.Windows.Point(0, Core.Graph.GraphConfig.SpeedClimb); MoveTimerPoint = new System.Windows.Point(0, Core.Graph.GraphConfig.SpeedClimb);
MoveTimer.Start(); MoveTimer.Start();
@ -774,7 +790,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Climb_Left_B_Loop, DisplayClimb_Lefting_DOWN); Display(GraphType.Climb_Left_B_Loop, DisplayClimb_Lefting_DOWN);
} }
else else
{//停下来 {//停下来
@ -794,7 +810,7 @@ namespace VPet_Simulator.Core
CountNomal = 0; CountNomal = 0;
Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + Core.Graph.GraphConfig.LocateClimbRight, 0); Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + Core.Graph.GraphConfig.LocateClimbRight, 0);
Display(GraphCore.GraphType.Climb_Right_A_Start, () => Display(GraphType.Climb_Right_A_Start, () =>
{ {
MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb); MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb);
MoveTimer.Start(); MoveTimer.Start();
@ -829,7 +845,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Climb_Right_B_Loop, DisplayClimb_Righting_UP); Display(GraphType.Climb_Right_B_Loop, DisplayClimb_Righting_UP);
} }
else else
{//停下来 {//停下来
@ -857,7 +873,7 @@ namespace VPet_Simulator.Core
CountNomal = 0; CountNomal = 0;
Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + Core.Graph.GraphConfig.LocateClimbRight, 0); Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + Core.Graph.GraphConfig.LocateClimbRight, 0);
Display(GraphCore.GraphType.Climb_Right_A_Start, () => Display(GraphType.Climb_Right_A_Start, () =>
{ {
MoveTimerPoint = new Point(0, Core.Graph.GraphConfig.SpeedClimb); MoveTimerPoint = new Point(0, Core.Graph.GraphConfig.SpeedClimb);
MoveTimer.Start(); MoveTimer.Start();
@ -881,7 +897,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMin) if (Function.Rnd.Next(walklength++) < LoopMin)
{ {
Display(GraphCore.GraphType.Climb_Right_B_Loop, DisplayClimb_Righting_DOWN); Display(GraphType.Climb_Right_B_Loop, DisplayClimb_Righting_DOWN);
} }
else else
{//停下来 {//停下来
@ -984,7 +1000,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMax) if (Function.Rnd.Next(walklength++) < LoopMax)
{ {
Display(GraphCore.GraphType.Climb_Top_Left, DisplayClimb_Top_Lefting); Display(GraphType.Climb_Top_Left, DisplayClimb_Top_Lefting);
} }
else else
{//停下来 {//停下来
@ -1045,7 +1061,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMid) if (Function.Rnd.Next(walklength++) < LoopMid)
{ {
Display(GraphCore.GraphType.Fall_Left_B_Loop, DisplayFall_Lefting); Display(GraphType.Fall_Left_B_Loop, DisplayFall_Lefting);
} }
else else
{//停下来 {//停下来
@ -1108,7 +1124,7 @@ namespace VPet_Simulator.Core
//不是:继续or停下 //不是:继续or停下
if (Function.Rnd.Next(walklength++) < LoopMid) if (Function.Rnd.Next(walklength++) < LoopMid)
{ {
Display(GraphCore.GraphType.Fall_Right_B_Loop, DisplayFall_Righting); Display(GraphType.Fall_Right_B_Loop, DisplayFall_Righting);
} }
else else
{//停下来 {//停下来

View File

@ -1,10 +1,9 @@
<UserControl x:Class="VPet_Simulator.Core.MessageBar" <UserControl x:Class="VPet_Simulator.Core.MessageBar" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500" xmlns:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500" Width="500"
Width="500" MouseDoubleClick="UserControl_MouseDoubleClick"> MouseDoubleClick="UserControl_MouseDoubleClick">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary Source="Theme.xaml" /> <ResourceDictionary Source="Theme.xaml" />
</UserControl.Resources> </UserControl.Resources>
@ -12,12 +11,13 @@
VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5" MouseEnter="Border_MouseEnter" VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5" MouseEnter="Border_MouseEnter"
MouseLeave="Border_MouseLeave"> MouseLeave="Border_MouseLeave">
<StackPanel> <StackPanel>
<Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}" HorizontalAlignment="Left" Padding="0" <Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}"
FontWeight="Bold" Margin="0,0,0,6" FontSize="32" Background="{x:Null}" /> HorizontalAlignment="Left" Padding="0" FontWeight="Bold" Margin="0,0,0,6" FontSize="32"
Background="{x:Null}" />
<ScrollViewer MaxHeight="400"> <ScrollViewer MaxHeight="400">
<TextBlock x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉" TextWrapping="WrapWithOverflow" <TextBlock x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉"
FontSize="24" x:FieldModifier="public"/> TextWrapping="WrapWithOverflow" FontSize="24" x:FieldModifier="public" />
</ScrollViewer> </ScrollViewer>
</StackPanel> </StackPanel>
</Border> </Border>
</UserControl> </UserControl>

View File

@ -281,7 +281,9 @@ namespace VPet_Simulator.Core
{ {
if (m.Core.Save.Mode != GameSave.ModeType.Ill) if (m.Core.Save.Mode != GameSave.ModeType.Ill)
if (m.State == Main.WorkingState.WorkONE) if (m.State == Main.WorkingState.WorkONE)
{
m.Display(GraphCore.GraphType.WorkONE_C_End, m.DisplayNomal); m.Display(GraphCore.GraphType.WorkONE_C_End, m.DisplayNomal);
}
else m.DisplayWorkONE(); else m.DisplayWorkONE();
this.Visibility = Visibility.Collapsed; this.Visibility = Visibility.Collapsed;
} }

View File

@ -0,0 +1,42 @@
<Border x:Class="VPet_Simulator.Core.WorkTimer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet_Simulator.Core"
xmlns:pu="https://opensource.panuon.com/wpf-ui" mc:Ignorable="d" Height="200" Width="300" BorderThickness="4"
CornerRadius="5" Background="{DynamicResource Background}" BorderBrush="{DynamicResource BorderBrush}">
<Border.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="BorderBrush" Color="#FF0290D5" />
<SolidColorBrush x:Key="Background" Color="#FF81d4fa" />
<SolidColorBrush x:Key="ButtonBackground" Color="#FF0286C6" />
<SolidColorBrush x:Key="ButtonForeground" Color="#FFffffff" />
<SolidColorBrush x:Key="Foreground" Color="#FF0286C6" />
</ResourceDictionary>
</Border.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="4*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<TextBlock Foreground="{DynamicResource Foreground}" FontSize="36" FontWeight="Bold" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="5,0,5,0" Grid.ColumnSpan="2">
<Run>当前已</Run><Run x:Name="rString">工作</Run>
</TextBlock>
<TextBlock Background="{x:Null}" Text="15.0" Grid.Row="1" FontSize="80" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Foreground}" />
<TextBlock Text="分钟" Foreground="{DynamicResource Foreground}" Grid.Row="1" Grid.Column="1"
HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,15" FontSize="36" />
<Button Grid.Row="2" Grid.ColumnSpan="2" Foreground="{DynamicResource ButtonForeground}"
Background="{DynamicResource ButtonBackground}" Content="停止工作" FontSize="16" />
<Button HorizontalAlignment="Left" VerticalAlignment="Center" Padding="5,5,8,7"
Background="{DynamicResource ButtonBackground}" pu:ButtonHelper.CornerRadius="5" Margin="10,0,0,0">
<Path Fill="{DynamicResource ButtonForeground}"
Data="M3 2.9918C3 2.44405 3.44495 2 3.9934 2H20.0066C20.5552 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918ZM19 11V4H5V11H19ZM19 13H5V20H19V13ZM9 6H15V8H9V6ZM9 15H15V17H9V15Z" />
</Button>
</Grid>
</Border>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VPet_Simulator.Core
{
/// <summary>
/// WorkTimer.xaml 的交互逻辑
/// </summary>
public partial class WorkTimer : Border
{
public WorkTimer()
{
InitializeComponent();
}
}
}

View File

@ -100,6 +100,9 @@
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Display\WorkTimer.xaml.cs">
<DependentUpon>WorkTimer.xaml</DependentUpon>
</Compile>
<Page Include="Display\basestyle.xaml"> <Page Include="Display\basestyle.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -132,6 +135,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Display\WorkTimer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Display\MainDisplay.cs" /> <Compile Include="Display\MainDisplay.cs" />