mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
新增管理控制台
This commit is contained in:
parent
892761066c
commit
2babad03a2
@ -56,6 +56,8 @@ namespace VPet_Simulator.Core
|
|||||||
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchRaisedLocate, Core.Graph.GraphConfig.TouchRaisedSize, DisplayRaised, true));
|
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchRaisedLocate, Core.Graph.GraphConfig.TouchRaisedSize, DisplayRaised, true));
|
||||||
var ig = Core.Graph.FindGraph(GraphCore.GraphType.Default, core.Save.Mode);
|
var ig = Core.Graph.FindGraph(GraphCore.GraphType.Default, core.Save.Mode);
|
||||||
PetGrid.Child = ig.This;
|
PetGrid.Child = ig.This;
|
||||||
|
var ig2 = Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_A_Start, core.Save.Mode);
|
||||||
|
PetGrid2.Child = ig2.This; //用于缓存
|
||||||
ig.Run(DisplayNomal);
|
ig.Run(DisplayNomal);
|
||||||
|
|
||||||
|
|
||||||
|
@ -988,20 +988,22 @@ namespace VPet_Simulator.Core
|
|||||||
DisplayType = graph.GraphType;
|
DisplayType = graph.GraphType;
|
||||||
if (PetGrid.Child == graph.This)
|
if (PetGrid.Child == graph.This)
|
||||||
{
|
{
|
||||||
|
((IGraph)(PetGrid2.Child)).Stop(true);
|
||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
PetGrid.Visibility = Visibility.Visible;
|
PetGrid.Visibility = Visibility.Visible;
|
||||||
PetGrid2.Visibility = Visibility.Collapsed;
|
PetGrid2.Visibility = Visibility.Hidden;
|
||||||
});
|
});
|
||||||
graph.Run(EndAction);
|
graph.Run(EndAction);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (PetGrid2.Child == graph.This)
|
else if (PetGrid2.Child == graph.This)
|
||||||
{
|
{
|
||||||
|
((IGraph)(PetGrid.Child)).Stop(true);
|
||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
PetGrid2.Visibility = Visibility.Visible;
|
PetGrid2.Visibility = Visibility.Visible;
|
||||||
PetGrid.Visibility = Visibility.Collapsed;
|
PetGrid.Visibility = Visibility.Hidden;
|
||||||
});
|
});
|
||||||
graph.Run(EndAction);
|
graph.Run(EndAction);
|
||||||
return;
|
return;
|
||||||
@ -1015,7 +1017,7 @@ namespace VPet_Simulator.Core
|
|||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
PetGrid2.Child = graph.This;
|
PetGrid2.Child = graph.This;
|
||||||
PetGrid.Visibility = Visibility.Collapsed;
|
PetGrid.Visibility = Visibility.Hidden;
|
||||||
PetGrid2.Visibility = Visibility.Visible;
|
PetGrid2.Visibility = Visibility.Visible;
|
||||||
});
|
});
|
||||||
//Task.Run(() =>
|
//Task.Run(() =>
|
||||||
@ -1030,7 +1032,7 @@ namespace VPet_Simulator.Core
|
|||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
PetGrid.Child = graph.This;
|
PetGrid.Child = graph.This;
|
||||||
PetGrid2.Visibility = Visibility.Collapsed;
|
PetGrid2.Visibility = Visibility.Hidden;
|
||||||
PetGrid.Visibility = Visibility.Visible;
|
PetGrid.Visibility = Visibility.Visible;
|
||||||
});
|
});
|
||||||
//Task.Run(() =>
|
//Task.Run(() =>
|
||||||
|
@ -85,7 +85,7 @@ namespace VPet_Simulator.Core
|
|||||||
Dispatcher.Invoke(() => TimeUIHandle.Invoke(this));
|
Dispatcher.Invoke(() => TimeUIHandle.Invoke(this));
|
||||||
|
|
||||||
if (DisplayType == GraphCore.GraphType.Default && !isPress)
|
if (DisplayType == GraphCore.GraphType.Default && !isPress)
|
||||||
switch (17)//Function.Rnd.Next(Math.Max(20, Core.Controller.InteractionCycle - CountNomal)))
|
switch (Function.Rnd.Next(Math.Max(20, Core.Controller.InteractionCycle - CountNomal)))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
//随机向右
|
//随机向右
|
||||||
|
@ -244,8 +244,8 @@ namespace VPet_Simulator.Core
|
|||||||
/// <param name="path">位置</param>
|
/// <param name="path">位置</param>
|
||||||
/// <param name="modetype">状态类型</param>
|
/// <param name="modetype">状态类型</param>
|
||||||
/// <param name="graphtype">动画类型</param>
|
/// <param name="graphtype">动画类型</param>
|
||||||
/// <param name="storemem">是否储存到内存以节约加载</param>
|
///// <param name="storemem">是否储存到内存以节约加载</param>
|
||||||
public void AddGraph(string path, Save.ModeType modetype, GraphType graphtype, bool storemem = false)
|
public void AddGraph(string path, Save.ModeType modetype, GraphType graphtype)//, bool storemem = false)
|
||||||
{
|
{
|
||||||
var paths = new DirectoryInfo(path).GetFiles();
|
var paths = new DirectoryInfo(path).GetFiles();
|
||||||
if (paths.Length == 0)
|
if (paths.Length == 0)
|
||||||
@ -254,7 +254,7 @@ namespace VPet_Simulator.Core
|
|||||||
AddGraph(new Picture(paths[0].FullName, modetype, graphtype,
|
AddGraph(new Picture(paths[0].FullName, modetype, graphtype,
|
||||||
int.Parse(paths[0].Name.Split('.').Reverse().ToArray()[1].Split('_').Last())), graphtype);
|
int.Parse(paths[0].Name.Split('.').Reverse().ToArray()[1].Split('_').Last())), graphtype);
|
||||||
else
|
else
|
||||||
AddGraph(new PNGAnimation(paths, modetype, graphtype, storemem), graphtype);
|
AddGraph(new PNGAnimation(paths, modetype, graphtype), graphtype);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 随机数字典(用于确保随机动画不会错位)
|
/// 随机数字典(用于确保随机动画不会错位)
|
||||||
|
@ -79,6 +79,7 @@ namespace VPet_Simulator.Windows
|
|||||||
}
|
}
|
||||||
Task.Run(GameLoad);
|
Task.Run(GameLoad);
|
||||||
}
|
}
|
||||||
|
private long lastclicktime;
|
||||||
public void GameLoad()
|
public void GameLoad()
|
||||||
{
|
{
|
||||||
//加载所有MOD
|
//加载所有MOD
|
||||||
@ -134,9 +135,16 @@ namespace VPet_Simulator.Windows
|
|||||||
LoadingText.Visibility = Visibility.Collapsed;
|
LoadingText.Visibility = Visibility.Collapsed;
|
||||||
winSetting = new winGameSetting(this);
|
winSetting = new winGameSetting(this);
|
||||||
Main = new Main(Core) { };
|
Main = new Main(Core) { };
|
||||||
Main.DefaultClickAction = () => { Dispatcher.Invoke(() => { Main.Say("你知道吗? 鼠标右键可以打开菜单栏"); }); };
|
Main.DefaultClickAction = () => {
|
||||||
|
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalMinutes > 1)
|
||||||
|
{
|
||||||
|
lastclicktime = DateTime.Now.Ticks;
|
||||||
|
Dispatcher.Invoke(() => { Main.Say("你知道吗? 鼠标右键可以打开菜单栏"); });
|
||||||
|
}
|
||||||
|
};
|
||||||
DisplayGrid.Child = Main;
|
DisplayGrid.Child = Main;
|
||||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Close(); });
|
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Close(); });
|
||||||
|
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "管理控制台", () => { new winConsole(this).Show(); });
|
||||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { new winReport(this).Show(); });
|
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { new winReport(this).Show(); });
|
||||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () =>
|
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () =>
|
||||||
{
|
{
|
||||||
|
@ -118,6 +118,9 @@
|
|||||||
<Compile Include="WinDesign\winCharacterPanel.xaml.cs">
|
<Compile Include="WinDesign\winCharacterPanel.xaml.cs">
|
||||||
<DependentUpon>winCharacterPanel.xaml</DependentUpon>
|
<DependentUpon>winCharacterPanel.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="WinDesign\winConsole.xaml.cs">
|
||||||
|
<DependentUpon>winConsole.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="WinDesign\winGameSetting.xaml.cs">
|
<Compile Include="WinDesign\winGameSetting.xaml.cs">
|
||||||
<DependentUpon>winGameSetting.xaml</DependentUpon>
|
<DependentUpon>winGameSetting.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -145,6 +148,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="WinDesign\winConsole.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="WinDesign\winGameSetting.xaml">
|
<Page Include="WinDesign\winGameSetting.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
15
VPet-Simulator.Windows/WinDesign/winConsole.xaml
Normal file
15
VPet-Simulator.Windows/WinDesign/winConsole.xaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<Window x:Class="VPet_Simulator.Windows.winConsole" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" Title="桌宠管理控制台" Height="450" Width="450">
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="动画列表">
|
||||||
|
<Grid>
|
||||||
|
<Label Background="{x:Null}" Content="双击查看动画效果" />
|
||||||
|
<Label x:Name="LabelNowPlay" Background="{x:Null}" Content="" HorizontalAlignment="Right" />
|
||||||
|
<ListBox x:Name="GraphListBox" Margin="0,20,0,0" MouseDoubleClick="GraphListBox_MouseDoubleClick" />
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Window>
|
46
VPet-Simulator.Windows/WinDesign/winConsole.xaml.cs
Normal file
46
VPet-Simulator.Windows/WinDesign/winConsole.xaml.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
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.Shapes;
|
||||||
|
using static VPet_Simulator.Core.GraphCore;
|
||||||
|
|
||||||
|
namespace VPet_Simulator.Windows
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// winConsole.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class winConsole : Window
|
||||||
|
{
|
||||||
|
MainWindow mw;
|
||||||
|
public winConsole(MainWindow mw)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.mw = mw;
|
||||||
|
foreach (string v in Enum.GetNames(typeof(GraphType)))
|
||||||
|
{
|
||||||
|
GraphListBox.Items.Add(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public void DisplayLoop(GraphType graphType)
|
||||||
|
{
|
||||||
|
mw.Main.Display(graphType, () => DisplayLoop(graphType));
|
||||||
|
}
|
||||||
|
private void GraphListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (GraphListBox.SelectedItem == null)
|
||||||
|
return;
|
||||||
|
LabelNowPlay.Content = $"当前正在播放: {GraphListBox.SelectedItem}";
|
||||||
|
DisplayLoop((GraphType)Enum.Parse(typeof(GraphType), (string)GraphListBox.SelectedItem));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user