mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
工作显示
This commit is contained in:
parent
1c08845294
commit
90a173120f
@ -18,7 +18,7 @@ namespace VPet_Simulator.Core
|
||||
/// <summary>
|
||||
/// 当前动画类型
|
||||
/// </summary>
|
||||
public GraphCore.GraphType DisplayType = GraphCore.GraphType.Default;
|
||||
public GraphCore.GraphType DisplayType = GraphType.Default;
|
||||
/// <summary>
|
||||
/// 默认循环次数
|
||||
/// </summary>
|
||||
@ -54,7 +54,7 @@ namespace VPet_Simulator.Core
|
||||
public void DisplayNomal()
|
||||
{
|
||||
CountNomal++;
|
||||
Display(GraphCore.GraphType.Default, DisplayNomal);
|
||||
Display(GraphType.Default, DisplayNomal);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示结束动画
|
||||
@ -65,41 +65,41 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
switch (DisplayType)
|
||||
{
|
||||
case GraphCore.GraphType.Boring_B_Loop:
|
||||
Display(GraphCore.GraphType.Boring_C_End, EndAction);
|
||||
case GraphType.Boring_B_Loop:
|
||||
Display(GraphType.Boring_C_End, EndAction);
|
||||
return true;
|
||||
case GraphCore.GraphType.Squat_B_Loop:
|
||||
Display(GraphCore.GraphType.Squat_C_End, EndAction);
|
||||
case GraphType.Squat_B_Loop:
|
||||
Display(GraphType.Squat_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Crawl_Left_B_Loop:
|
||||
Display(GraphCore.GraphType.Crawl_Left_C_End, EndAction);
|
||||
Display(GraphType.Crawl_Left_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Crawl_Right_B_Loop:
|
||||
Display(GraphCore.GraphType.Crawl_Right_C_End, EndAction);
|
||||
Display(GraphType.Crawl_Right_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Fall_Left_B_Loop:
|
||||
Display(GraphCore.GraphType.Fall_Left_C_End,
|
||||
() => Display(GraphCore.GraphType.Climb_Up_Left, EndAction));
|
||||
Display(GraphType.Fall_Left_C_End,
|
||||
() => Display(GraphType.Climb_Up_Left, EndAction));
|
||||
return true;
|
||||
case GraphType.Fall_Right_B_Loop:
|
||||
Display(GraphCore.GraphType.Fall_Right_C_End,
|
||||
() => Display(GraphCore.GraphType.Climb_Up_Right, EndAction));
|
||||
Display(GraphType.Fall_Right_C_End,
|
||||
() => Display(GraphType.Climb_Up_Right, EndAction));
|
||||
return true;
|
||||
case GraphType.Walk_Left_B_Loop:
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, EndAction);
|
||||
Display(GraphType.Walk_Left_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Walk_Right_B_Loop:
|
||||
Display(GraphCore.GraphType.Walk_Right_C_End, EndAction);
|
||||
Display(GraphType.Walk_Right_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Sleep_B_Loop:
|
||||
State = WorkingState.Nomal;
|
||||
Display(GraphCore.GraphType.Sleep_C_End, EndAction);
|
||||
Display(GraphType.Sleep_C_End, EndAction);
|
||||
return true;
|
||||
case GraphType.Idel_StateONE_B_Loop:
|
||||
Display(GraphCore.GraphType.Idel_StateONE_C_End, EndAction);
|
||||
Display(GraphType.Idel_StateONE_C_End, EndAction);
|
||||
return true;
|
||||
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;
|
||||
//case GraphType.Climb_Left:
|
||||
//case GraphType.Climb_Right:
|
||||
@ -116,7 +116,7 @@ namespace VPet_Simulator.Core
|
||||
public void DisplayClose(Action EndAction)
|
||||
{
|
||||
CountNomal++;
|
||||
Display(GraphCore.GraphType.Shutdown, EndAction);
|
||||
Display(GraphType.Shutdown, EndAction);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示摸头情况
|
||||
@ -131,20 +131,20 @@ namespace VPet_Simulator.Core
|
||||
if (DisplayType == GraphType.Touch_Head_A_Start)
|
||||
return;
|
||||
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;
|
||||
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;
|
||||
return;
|
||||
}
|
||||
|
||||
Display(GraphCore.GraphType.Touch_Head_A_Start, () =>
|
||||
Display(GraphCore.GraphType.Touch_Head_B_Loop, () =>
|
||||
Display(GraphCore.GraphType.Touch_Head_C_End, DisplayToNomal
|
||||
Display(GraphType.Touch_Head_A_Start, () =>
|
||||
Display(GraphType.Touch_Head_B_Loop, () =>
|
||||
Display(GraphType.Touch_Head_C_End, DisplayToNomal
|
||||
)));
|
||||
}
|
||||
/// <summary>
|
||||
@ -160,20 +160,20 @@ namespace VPet_Simulator.Core
|
||||
if (DisplayType == GraphType.Touch_Body_A_Start)
|
||||
return;
|
||||
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;
|
||||
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;
|
||||
return;
|
||||
}
|
||||
Core.Graph.RndGraph.Clear();
|
||||
Display(GraphCore.GraphType.Touch_Body_A_Start, () =>
|
||||
Display(GraphCore.GraphType.Touch_Body_B_Loop, () =>
|
||||
Display(GraphCore.GraphType.Touch_Body_C_End, DisplayToNomal
|
||||
Display(GraphType.Touch_Body_A_Start, () =>
|
||||
Display(GraphType.Touch_Body_B_Loop, () =>
|
||||
Display(GraphType.Touch_Body_C_End, DisplayToNomal
|
||||
)));
|
||||
}
|
||||
/// <summary>
|
||||
@ -183,7 +183,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
looptimes = 0;
|
||||
CountNomal = 0;
|
||||
Display(GraphCore.GraphType.Idel_StateONE_A_Start, DisplayIdel_StateONEing);
|
||||
Display(GraphType.Idel_StateONE_A_Start, DisplayIdel_StateONEing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示待机(模式1)情况
|
||||
@ -197,11 +197,11 @@ namespace VPet_Simulator.Core
|
||||
DisplayIdel_StateTWO();
|
||||
break;
|
||||
default:
|
||||
Display(GraphCore.GraphType.Idel_StateONE_C_End, DisplayToNomal);
|
||||
Display(GraphType.Idel_StateONE_C_End, DisplayToNomal);
|
||||
break;
|
||||
}
|
||||
else
|
||||
Display(GraphCore.GraphType.Idel_StateONE_B_Loop, DisplayIdel_StateONEing);
|
||||
Display(GraphType.Idel_StateONE_B_Loop, DisplayIdel_StateONEing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示待机(模式2)情况
|
||||
@ -210,7 +210,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
looptimes = 0;
|
||||
CountNomal++;
|
||||
Display(GraphCore.GraphType.Idel_StateTWO_A_Start, DisplayIdel_StateTWOing);
|
||||
Display(GraphType.Idel_StateTWO_A_Start, DisplayIdel_StateTWOing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示待机(模式2)情况
|
||||
@ -218,9 +218,9 @@ namespace VPet_Simulator.Core
|
||||
private void DisplayIdel_StateTWOing()
|
||||
{
|
||||
if (Function.Rnd.Next(++looptimes) > LoopMax)
|
||||
Display(GraphCore.GraphType.Idel_StateTWO_C_End, DisplayIdel_StateONEing);
|
||||
Display(GraphType.Idel_StateTWO_C_End, DisplayIdel_StateONEing);
|
||||
else
|
||||
Display(GraphCore.GraphType.Idel_StateTWO_B_Loop, DisplayIdel_StateTWOing);
|
||||
Display(GraphType.Idel_StateTWO_B_Loop, DisplayIdel_StateTWOing);
|
||||
}
|
||||
|
||||
int looptimes;
|
||||
@ -231,7 +231,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
looptimes = 0;
|
||||
CountNomal = 0;
|
||||
Display(GraphCore.GraphType.Squat_A_Start, DisplaySquating);
|
||||
Display(GraphType.Squat_A_Start, DisplaySquating);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示蹲下情况
|
||||
@ -239,9 +239,9 @@ namespace VPet_Simulator.Core
|
||||
private void DisplaySquating()
|
||||
{
|
||||
if (Function.Rnd.Next(++looptimes) > LoopProMax)
|
||||
Display(GraphCore.GraphType.Squat_C_End, DisplayToNomal);
|
||||
Display(GraphType.Squat_C_End, DisplayToNomal);
|
||||
else
|
||||
Display(GraphCore.GraphType.Squat_B_Loop, DisplaySquating);
|
||||
Display(GraphType.Squat_B_Loop, DisplaySquating);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示无聊情况
|
||||
@ -250,7 +250,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
looptimes = 0;
|
||||
CountNomal = 0;
|
||||
Display(GraphCore.GraphType.Boring_A_Start, DisplayBoringing);
|
||||
Display(GraphType.Boring_A_Start, DisplayBoringing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示无聊情况
|
||||
@ -258,9 +258,9 @@ namespace VPet_Simulator.Core
|
||||
private void DisplayBoringing()
|
||||
{
|
||||
if (Function.Rnd.Next(++looptimes) > LoopProMax)
|
||||
Display(GraphCore.GraphType.Boring_C_End, DisplayToNomal);
|
||||
Display(GraphType.Boring_C_End, DisplayToNomal);
|
||||
else
|
||||
Display(GraphCore.GraphType.Boring_B_Loop, DisplayBoringing);
|
||||
Display(GraphType.Boring_B_Loop, DisplayBoringing);
|
||||
}
|
||||
|
||||
|
||||
@ -274,10 +274,10 @@ namespace VPet_Simulator.Core
|
||||
if (force)
|
||||
{
|
||||
State = WorkingState.Sleep;
|
||||
Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleepingForce);
|
||||
Display(GraphType.Sleep_A_Start, DisplaySleepingForce);
|
||||
}
|
||||
else
|
||||
Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleeping);
|
||||
Display(GraphType.Sleep_A_Start, DisplaySleeping);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示睡觉情况 (正常)
|
||||
@ -285,16 +285,16 @@ namespace VPet_Simulator.Core
|
||||
private void DisplaySleeping()
|
||||
{
|
||||
if (Function.Rnd.Next(++looptimes) > LoopProMax)
|
||||
Display(GraphCore.GraphType.Sleep_C_End, DisplayToNomal);
|
||||
Display(GraphType.Sleep_C_End, DisplayToNomal);
|
||||
else
|
||||
Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleeping);
|
||||
Display(GraphType.Sleep_B_Loop, DisplaySleeping);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示睡觉情况 (强制)
|
||||
/// </summary>
|
||||
private void DisplaySleepingForce()
|
||||
{//TODO:如果开启了Function,强制睡觉为永久,否则睡到自然醒+LoopMax
|
||||
Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleepingForce);
|
||||
Display(GraphType.Sleep_B_Loop, DisplaySleepingForce);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -303,14 +303,22 @@ namespace VPet_Simulator.Core
|
||||
public void DisplayWorkONE()
|
||||
{
|
||||
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>
|
||||
private void DisplayWorkONEing()
|
||||
{
|
||||
Display(GraphCore.GraphType.WorkONE_B_Loop, DisplayWorkONEing);
|
||||
Display(GraphType.WorkONE_B_Loop, DisplayWorkONEing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示工作情况
|
||||
@ -318,14 +326,22 @@ namespace VPet_Simulator.Core
|
||||
public void DisplayWorkTWO()
|
||||
{
|
||||
State = WorkingState.WorkTWO;
|
||||
Display(GraphCore.GraphType.WorkTWO_A_Start, DisplayWorkTWOing);
|
||||
Display(GraphType.WorkTWO_A_Start, DisplayWorkTWOing);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示工作情况循环
|
||||
/// </summary>
|
||||
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>
|
||||
/// 显示学习情况
|
||||
@ -333,14 +349,14 @@ namespace VPet_Simulator.Core
|
||||
public void DisplayStudy()
|
||||
{
|
||||
State = WorkingState.Study;
|
||||
Display(GraphCore.GraphType.Study_A_Start, DisplayStudying);
|
||||
Display(GraphType.Study_A_Start, DisplayStudying);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示学习情况
|
||||
/// </summary>
|
||||
private void DisplayStudying()
|
||||
{
|
||||
Display(GraphCore.GraphType.Study_B_Loop, DisplayStudying);
|
||||
Display(GraphType.Study_B_Loop, DisplayStudying);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示拖拽情况
|
||||
@ -372,14 +388,14 @@ namespace VPet_Simulator.Core
|
||||
case 1:
|
||||
case 2:
|
||||
rasetype++;
|
||||
Display(GraphCore.GraphType.Raised_Dynamic, DisplayRaising);
|
||||
Display(GraphType.Raised_Dynamic, DisplayRaising);
|
||||
return;
|
||||
case 3:
|
||||
rasetype++;
|
||||
Display(GraphCore.GraphType.Raised_Static_A_Start, DisplayRaising);
|
||||
Display(GraphType.Raised_Static_A_Start, DisplayRaising);
|
||||
return;
|
||||
default:
|
||||
Display(GraphCore.GraphType.Raised_Static_B_Loop, DisplayRaising);
|
||||
Display(GraphType.Raised_Static_B_Loop, DisplayRaising);
|
||||
rasetype = 4;
|
||||
break;
|
||||
}
|
||||
@ -389,16 +405,16 @@ namespace VPet_Simulator.Core
|
||||
/// </summary>
|
||||
public void DisplayFalled_Left()
|
||||
{
|
||||
Display(GraphCore.GraphType.Fall_Left_C_End,
|
||||
() => Display(GraphCore.GraphType.Climb_Up_Left, DisplayToNomal));
|
||||
Display(GraphType.Fall_Left_C_End,
|
||||
() => Display(GraphType.Climb_Up_Left, DisplayToNomal));
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示掉到地上 从左边
|
||||
/// </summary>
|
||||
public void DisplayFalled_Right()
|
||||
{
|
||||
Display(GraphCore.GraphType.Fall_Right_C_End,
|
||||
() => Display(GraphCore.GraphType.Climb_Up_Right, DisplayToNomal));
|
||||
Display(GraphType.Fall_Right_C_End,
|
||||
() => Display(GraphType.Climb_Up_Right, DisplayToNomal));
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示向左走 (有判断)
|
||||
@ -410,7 +426,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
walklength = 0;
|
||||
CountNomal = 0;
|
||||
Display(GraphCore.GraphType.Walk_Left_A_Start, () =>
|
||||
Display(GraphType.Walk_Left_A_Start, () =>
|
||||
{
|
||||
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedWalk, 0);
|
||||
MoveTimer.Start();
|
||||
@ -432,26 +448,26 @@ namespace VPet_Simulator.Core
|
||||
DisplayFall_Left(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
case 1:
|
||||
DisplayFall_Right(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//不是:继续右边走or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMin)
|
||||
{
|
||||
Display(GraphCore.GraphType.Walk_Left_B_Loop, DisplayWalk_Lefting);
|
||||
Display(GraphType.Walk_Left_B_Loop, DisplayWalk_Lefting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
@ -462,19 +478,19 @@ namespace VPet_Simulator.Core
|
||||
DisplayFall_Left(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
DisplayFall_Right(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -490,7 +506,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
walklength = 0;
|
||||
CountNomal = 0;
|
||||
Display(GraphCore.GraphType.Walk_Right_A_Start, () =>
|
||||
Display(GraphType.Walk_Right_A_Start, () =>
|
||||
{
|
||||
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedWalk, 0);
|
||||
MoveTimer.Start();
|
||||
@ -512,26 +528,26 @@ namespace VPet_Simulator.Core
|
||||
DisplayClimb_Right_UP(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
case 1:
|
||||
DisplayClimb_Right_DOWN(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Right_C_End, DisplayToNomal);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//不是:继续右边走or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMin)
|
||||
{
|
||||
Display(GraphCore.GraphType.Walk_Right_B_Loop, DisplayWalk_Righting);
|
||||
Display(GraphType.Walk_Right_B_Loop, DisplayWalk_Righting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
@ -542,19 +558,19 @@ namespace VPet_Simulator.Core
|
||||
DisplayFall_Left(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
DisplayFall_Right(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Walk_Left_C_End, DisplayToNomal);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -569,7 +585,7 @@ namespace VPet_Simulator.Core
|
||||
if (Core.Controller.GetWindowsDistanceLeft() > DistanceMax * Core.Controller.ZoomRatio)
|
||||
{
|
||||
walklength = 0;
|
||||
Display(GraphCore.GraphType.Crawl_Left_A_Start, () =>
|
||||
Display(GraphType.Crawl_Left_A_Start, () =>
|
||||
{
|
||||
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedCrawl, 0);
|
||||
MoveTimer.Start();
|
||||
@ -591,31 +607,31 @@ namespace VPet_Simulator.Core
|
||||
DisplayClimb_Left_UP(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
case 1:
|
||||
DisplayClimb_Left_DOWN(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//不是:继续右边走or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMin)
|
||||
{
|
||||
Display(GraphCore.GraphType.Crawl_Left_B_Loop, DisplayCrawl_Lefting);
|
||||
Display(GraphType.Crawl_Left_B_Loop, DisplayCrawl_Lefting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Left_C_End, DisplayToNomal);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@ -627,7 +643,7 @@ namespace VPet_Simulator.Core
|
||||
if (Core.Controller.GetWindowsDistanceRight() > DistanceMax * Core.Controller.ZoomRatio)
|
||||
{
|
||||
walklength = 0;
|
||||
Display(GraphCore.GraphType.Crawl_Right_A_Start, () =>
|
||||
Display(GraphType.Crawl_Right_A_Start, () =>
|
||||
{
|
||||
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedCrawl, 0);
|
||||
MoveTimer.Start();
|
||||
@ -649,31 +665,31 @@ namespace VPet_Simulator.Core
|
||||
DisplayClimb_Right_UP(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
case 1:
|
||||
DisplayClimb_Right_DOWN(() =>
|
||||
{
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
});
|
||||
return;
|
||||
default:
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//不是:继续右边走or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMin)
|
||||
{
|
||||
Display(GraphCore.GraphType.Crawl_Right_B_Loop, DisplayCrawl_Righting);
|
||||
Display(GraphType.Crawl_Right_B_Loop, DisplayCrawl_Righting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
MoveTimer.Enabled = false;
|
||||
Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
Display(GraphType.Crawl_Right_C_End, DisplayToNomal);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@ -687,7 +703,7 @@ namespace VPet_Simulator.Core
|
||||
walklength = 0;
|
||||
CountNomal = 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);
|
||||
MoveTimer.Start();
|
||||
@ -722,7 +738,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
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
|
||||
{//停下来
|
||||
@ -750,7 +766,7 @@ namespace VPet_Simulator.Core
|
||||
CountNomal = 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);
|
||||
MoveTimer.Start();
|
||||
@ -774,7 +790,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
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
|
||||
{//停下来
|
||||
@ -794,7 +810,7 @@ namespace VPet_Simulator.Core
|
||||
CountNomal = 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);
|
||||
MoveTimer.Start();
|
||||
@ -829,7 +845,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
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
|
||||
{//停下来
|
||||
@ -857,7 +873,7 @@ namespace VPet_Simulator.Core
|
||||
CountNomal = 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);
|
||||
MoveTimer.Start();
|
||||
@ -881,7 +897,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
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
|
||||
{//停下来
|
||||
@ -984,7 +1000,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMax)
|
||||
{
|
||||
Display(GraphCore.GraphType.Climb_Top_Left, DisplayClimb_Top_Lefting);
|
||||
Display(GraphType.Climb_Top_Left, DisplayClimb_Top_Lefting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
@ -1045,7 +1061,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMid)
|
||||
{
|
||||
Display(GraphCore.GraphType.Fall_Left_B_Loop, DisplayFall_Lefting);
|
||||
Display(GraphType.Fall_Left_B_Loop, DisplayFall_Lefting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
@ -1108,7 +1124,7 @@ namespace VPet_Simulator.Core
|
||||
//不是:继续or停下
|
||||
if (Function.Rnd.Next(walklength++) < LoopMid)
|
||||
{
|
||||
Display(GraphCore.GraphType.Fall_Right_B_Loop, DisplayFall_Righting);
|
||||
Display(GraphType.Fall_Right_B_Loop, DisplayFall_Righting);
|
||||
}
|
||||
else
|
||||
{//停下来
|
||||
|
@ -1,10 +1,9 @@
|
||||
<UserControl x:Class="VPet_Simulator.Core.MessageBar"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<UserControl x:Class="VPet_Simulator.Core.MessageBar" 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:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500"
|
||||
Width="500" MouseDoubleClick="UserControl_MouseDoubleClick">
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500" Width="500"
|
||||
MouseDoubleClick="UserControl_MouseDoubleClick">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="Theme.xaml" />
|
||||
</UserControl.Resources>
|
||||
@ -12,12 +11,13 @@
|
||||
VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5" MouseEnter="Border_MouseEnter"
|
||||
MouseLeave="Border_MouseLeave">
|
||||
<StackPanel>
|
||||
<Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}" HorizontalAlignment="Left" Padding="0"
|
||||
FontWeight="Bold" Margin="0,0,0,6" FontSize="32" Background="{x:Null}" />
|
||||
<Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}"
|
||||
HorizontalAlignment="Left" Padding="0" FontWeight="Bold" Margin="0,0,0,6" FontSize="32"
|
||||
Background="{x:Null}" />
|
||||
<ScrollViewer MaxHeight="400">
|
||||
<TextBlock x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉" TextWrapping="WrapWithOverflow"
|
||||
FontSize="24" x:FieldModifier="public"/>
|
||||
</ScrollViewer>
|
||||
<TextBlock x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉"
|
||||
TextWrapping="WrapWithOverflow" FontSize="24" x:FieldModifier="public" />
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
@ -281,7 +281,9 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (m.Core.Save.Mode != GameSave.ModeType.Ill)
|
||||
if (m.State == Main.WorkingState.WorkONE)
|
||||
{
|
||||
m.Display(GraphCore.GraphType.WorkONE_C_End, m.DisplayNomal);
|
||||
}
|
||||
else m.DisplayWorkONE();
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
42
VPet-Simulator.Core/Display/WorkTimer.xaml
Normal file
42
VPet-Simulator.Core/Display/WorkTimer.xaml
Normal 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>
|
28
VPet-Simulator.Core/Display/WorkTimer.xaml.cs
Normal file
28
VPet-Simulator.Core/Display/WorkTimer.xaml.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
@ -100,6 +100,9 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Display\WorkTimer.xaml.cs">
|
||||
<DependentUpon>WorkTimer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="Display\basestyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -132,6 +135,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Display\WorkTimer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Display\MainDisplay.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user