mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
重构Main加载
This commit is contained in:
parent
eac5a74371
commit
56502ca22c
@ -10,7 +10,7 @@
|
|||||||
<MediaElement x:Name="VoicePlayer" LoadedBehavior="Manual" UnloadedBehavior="Stop" x:FieldModifier="public" />
|
<MediaElement x:Name="VoicePlayer" LoadedBehavior="Manual" UnloadedBehavior="Stop" x:FieldModifier="public" />
|
||||||
<Grid x:Name="UIGrid_Back" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
|
<Grid x:Name="UIGrid_Back" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
|
||||||
<Border x:Name="PetGrid" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public"/>
|
<Border x:Name="PetGrid" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public"/>
|
||||||
<Border x:Name="PetGrid2" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public"/>
|
<Border x:Name="PetGrid2" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public" Visibility="Collapsed"/>
|
||||||
<Grid x:Name="UIGrid" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
|
<Grid x:Name="UIGrid" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
|
||||||
<Label x:Name="LabelDisplay" HorizontalAlignment="Center" VerticalAlignment="Center" Content="内容显示如下"
|
<Label x:Name="LabelDisplay" HorizontalAlignment="Center" VerticalAlignment="Center" Content="内容显示如下"
|
||||||
FontSize="30" Background="{DynamicResource DARKPrimaryTransA}"
|
FontSize="30" Background="{DynamicResource DARKPrimaryTransA}"
|
||||||
|
@ -52,57 +52,51 @@ namespace VPet_Simulator.Core
|
|||||||
public bool IsWorking { get; private set; } = false;
|
public bool IsWorking { get; private set; } = false;
|
||||||
public SoundPlayer soundPlayer = new SoundPlayer();
|
public SoundPlayer soundPlayer = new SoundPlayer();
|
||||||
public bool windowMediaPlayerAvailable = true;
|
public bool windowMediaPlayerAvailable = true;
|
||||||
public Main(GameCore core, bool loadtouchevent = true, IGraph startUPGraph = null)
|
|
||||||
|
public void Load_0_BaseConsole()
|
||||||
{
|
{
|
||||||
//Console.WriteLine(DateTime.Now.ToString("T:fff"));
|
Dispatcher.Invoke(() =>
|
||||||
InitializeComponent();
|
|
||||||
Core = core;
|
|
||||||
WorkTimer = new WorkTimer(this);
|
|
||||||
WorkTimer.Visibility = Visibility.Collapsed;
|
|
||||||
UIGrid.Children.Add(WorkTimer);
|
|
||||||
ToolBar = new ToolBar(this);
|
|
||||||
ToolBar.Visibility = Visibility.Collapsed;
|
|
||||||
UIGrid.Children.Add(ToolBar);
|
|
||||||
MsgBar = new MessageBar(this);
|
|
||||||
MsgBar.Visibility = Visibility.Collapsed;
|
|
||||||
UIGrid.Children.Add(MsgBar.This);
|
|
||||||
labeldisplaytimer.Elapsed += Labledisplaytimer_Elapsed;
|
|
||||||
|
|
||||||
DisplayNomal = DisplayDefault;
|
|
||||||
|
|
||||||
if (loadtouchevent)
|
|
||||||
{
|
{
|
||||||
LoadTouchEvent();
|
WorkTimer = new WorkTimer(this);
|
||||||
}
|
WorkTimer.Visibility = Visibility.Collapsed;
|
||||||
if (!core.Controller.EnableFunction)
|
UIGrid.Children.Add(WorkTimer);
|
||||||
Core.Save.Mode = NoFunctionMOD;
|
ToolBar = new ToolBar(this);
|
||||||
IGraph ig = startUPGraph ?? Core.Graph.FindGraph(Core.Graph.FindName(GraphType.StartUP), AnimatType.Single, core.Save.Mode);
|
ToolBar.Visibility = Visibility.Collapsed;
|
||||||
ig ??= Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Default), AnimatType.Single, core.Save.Mode);
|
UIGrid.Children.Add(ToolBar);
|
||||||
//var ig2 = Core.Graph.FindGraph(GraphType.Default, core.GameSave.Mode);
|
MsgBar = new MessageBar(this);
|
||||||
PetGrid2.Visibility = Visibility.Collapsed;
|
MsgBar.Visibility = Visibility.Collapsed;
|
||||||
Task.Run(() =>
|
UIGrid.Children.Add(MsgBar.This);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public void Load_3_BindingTimer()
|
||||||
|
{
|
||||||
|
EventTimer.Elapsed += (s, e) => EventTimer_Elapsed();
|
||||||
|
MoveTimer.Elapsed += MoveTimer_Elapsed;
|
||||||
|
SmartMoveTimer.Elapsed += SmartMoveTimer_Elapsed;
|
||||||
|
}
|
||||||
|
public async Task Load_2_WaitGraph()
|
||||||
|
{
|
||||||
|
//新功能:等待所有图像加载完成再跑
|
||||||
|
foreach (var igs in Core.Graph.GraphsList.Values)
|
||||||
{
|
{
|
||||||
EventTimer.Elapsed += (s, e) => EventTimer_Elapsed();
|
foreach (var ig2 in igs.Values)
|
||||||
MoveTimer.Elapsed += MoveTimer_Elapsed;
|
|
||||||
SmartMoveTimer.Elapsed += SmartMoveTimer_Elapsed;
|
|
||||||
//while (!ig.IsReady)
|
|
||||||
//{
|
|
||||||
// Thread.Sleep(100);
|
|
||||||
//}//新功能:等待所有图像加载完成再跑
|
|
||||||
foreach (var igs in Core.Graph.GraphsList.Values)
|
|
||||||
{
|
{
|
||||||
foreach (var ig2 in igs.Values)
|
foreach (var ig3 in ig2)
|
||||||
{
|
{
|
||||||
foreach (var ig3 in ig2)
|
while (!ig3.IsReady)
|
||||||
{
|
{
|
||||||
while (!ig3.IsReady)
|
await Task.Delay(100);
|
||||||
{
|
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Load_4_Start(IGraph startUPGraph = null)
|
||||||
|
{
|
||||||
|
IGraph ig = startUPGraph ?? Core.Graph.FindGraph(Core.Graph.FindName(GraphType.StartUP), AnimatType.Single, Core.Save.Mode);
|
||||||
|
ig ??= Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Default), AnimatType.Single, Core.Save.Mode);
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
ig.Run(PetGrid, () =>
|
ig.Run(PetGrid, () =>
|
||||||
{
|
{
|
||||||
IsWorking = true;
|
IsWorking = true;
|
||||||
@ -116,6 +110,33 @@ namespace VPet_Simulator.Core
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Load_24_WaitAndStart()
|
||||||
|
{
|
||||||
|
Load_2_WaitGraph().Wait();
|
||||||
|
Load_4_Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Main(GameCore core)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Core = core;
|
||||||
|
|
||||||
|
labeldisplaytimer.Elapsed += Labledisplaytimer_Elapsed;
|
||||||
|
|
||||||
|
DisplayNomal = DisplayDefault;
|
||||||
|
|
||||||
|
if (!core.Controller.EnableFunction)
|
||||||
|
Core.Save.Mode = NoFunctionMOD;
|
||||||
|
}
|
||||||
|
public void LoadALL()
|
||||||
|
{
|
||||||
|
Load_0_BaseConsole();
|
||||||
|
Load_2_TouchEvent();
|
||||||
|
Load_2_WaitGraph().Wait();
|
||||||
|
Load_3_BindingTimer();
|
||||||
|
Load_4_Start();
|
||||||
|
}
|
||||||
|
|
||||||
private void Labledisplaytimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
private void Labledisplaytimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
if (--labeldisplaycount <= 0)
|
if (--labeldisplaycount <= 0)
|
||||||
@ -140,7 +161,7 @@ namespace VPet_Simulator.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自动加载触摸事件
|
/// 自动加载触摸事件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void LoadTouchEvent()
|
public void Load_2_TouchEvent()
|
||||||
{
|
{
|
||||||
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchHeadLocate, Core.Graph.GraphConfig.TouchHeadSize, () => { DisplayTouchHead(); return true; }));
|
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchHeadLocate, Core.Graph.GraphConfig.TouchHeadSize, () => { DisplayTouchHead(); return true; }));
|
||||||
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchBodyLocate, Core.Graph.GraphConfig.TouchBodySize, () => { DisplayTouchBody(); return true; }));
|
Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchBodyLocate, Core.Graph.GraphConfig.TouchBodySize, () => { DisplayTouchBody(); return true; }));
|
||||||
|
@ -1537,7 +1537,7 @@ namespace VPet_Simulator.Windows
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载游戏动画".Translate()));
|
//await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载游戏动画".Translate()));
|
||||||
await Dispatcher.InvokeAsync(new Action(() =>
|
await Dispatcher.InvokeAsync(new Action(() =>
|
||||||
{
|
{
|
||||||
LoadingText.Content = "尝试加载动画和生成缓存\n该步骤可能会耗时比较长\n请耐心等待".Translate();
|
LoadingText.Content = "尝试加载动画和生成缓存\n该步骤可能会耗时比较长\n请耐心等待".Translate();
|
||||||
@ -1552,401 +1552,404 @@ namespace VPet_Simulator.Windows
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
Main = new Main(Core);
|
Main = new Main(Core);
|
||||||
Main.NoFunctionMOD = Set.CalFunState;
|
}));
|
||||||
|
Main.LoadALL();
|
||||||
//清空资源
|
Main.NoFunctionMOD = Set.CalFunState;
|
||||||
Main.Resources = Application.Current.Resources;
|
await Dispatcher.InvokeAsync(() =>
|
||||||
Main.MsgBar.This.Resources = Application.Current.Resources;
|
{
|
||||||
Main.ToolBar.Resources = Application.Current.Resources;
|
//清空资源
|
||||||
Main.ToolBar.LoadClean();
|
Main.Resources = Application.Current.Resources;
|
||||||
Main.WorkList(out List<Work> ws, out List<Work> ss, out List<Work> ps);
|
Main.MsgBar.This.Resources = Application.Current.Resources;
|
||||||
if (ws.Count == 0)
|
Main.ToolBar.Resources = Application.Current.Resources;
|
||||||
{
|
Main.ToolBar.LoadClean();
|
||||||
Main.ToolBar.MenuWork.Visibility = Visibility.Collapsed;
|
Main.WorkList(out List<Work> ws, out List<Work> ss, out List<Work> ps);
|
||||||
}
|
if (ws.Count == 0)
|
||||||
else
|
{
|
||||||
{
|
Main.ToolBar.MenuWork.Visibility = Visibility.Collapsed;
|
||||||
Main.ToolBar.MenuWork.Click += (x, y) =>
|
}
|
||||||
{
|
else
|
||||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
{
|
||||||
ShowWorkMenu(Work.WorkType.Work);
|
Main.ToolBar.MenuWork.Click += (x, y) =>
|
||||||
};
|
{
|
||||||
}
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
if (ss.Count == 0)
|
ShowWorkMenu(Work.WorkType.Work);
|
||||||
{
|
};
|
||||||
Main.ToolBar.MenuStudy.Visibility = Visibility.Collapsed;
|
}
|
||||||
}
|
if (ss.Count == 0)
|
||||||
else
|
{
|
||||||
{
|
Main.ToolBar.MenuStudy.Visibility = Visibility.Collapsed;
|
||||||
Main.ToolBar.MenuStudy.Click += (x, y) =>
|
}
|
||||||
{
|
else
|
||||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
{
|
||||||
ShowWorkMenu(Work.WorkType.Study);
|
Main.ToolBar.MenuStudy.Click += (x, y) =>
|
||||||
};
|
{
|
||||||
}
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
if (ps.Count == 0)
|
ShowWorkMenu(Work.WorkType.Study);
|
||||||
{
|
};
|
||||||
Main.ToolBar.MenuPlay.Visibility = Visibility.Collapsed;
|
}
|
||||||
}
|
if (ps.Count == 0)
|
||||||
else
|
{
|
||||||
{
|
Main.ToolBar.MenuPlay.Visibility = Visibility.Collapsed;
|
||||||
Main.ToolBar.MenuPlay.Click += (x, y) =>
|
}
|
||||||
{
|
else
|
||||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
{
|
||||||
ShowWorkMenu(Work.WorkType.Play);
|
Main.ToolBar.MenuPlay.Click += (x, y) =>
|
||||||
};
|
{
|
||||||
}
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
|
ShowWorkMenu(Work.WorkType.Play);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//加载主题:
|
//加载主题:
|
||||||
LoadTheme(Set.Theme);
|
LoadTheme(Set.Theme);
|
||||||
//加载字体
|
//加载字体
|
||||||
LoadFont(Set.Font);
|
LoadFont(Set.Font);
|
||||||
|
|
||||||
LoadingText.Content = "正在加载游戏\n该步骤可能会耗时比较长\n请耐心等待".Translate();
|
LoadingText.Content = "正在加载游戏\n该步骤可能会耗时比较长\n请耐心等待".Translate();
|
||||||
|
|
||||||
|
|
||||||
//加载数据合理化:工作
|
//加载数据合理化:工作
|
||||||
if (!Set["gameconfig"].GetBool("noAutoCal"))
|
if (!Set["gameconfig"].GetBool("noAutoCal"))
|
||||||
{
|
{
|
||||||
foreach (var work in Core.Graph.GraphConfig.Works)
|
foreach (var work in Core.Graph.GraphConfig.Works)
|
||||||
{
|
{
|
||||||
if (work.LevelLimit > 100)//导入的最大合理工作不能超过100级
|
if (work.LevelLimit > 100)//导入的最大合理工作不能超过100级
|
||||||
work.LevelLimit = 100;
|
work.LevelLimit = 100;
|
||||||
if (work.IsOverLoad())
|
if (work.IsOverLoad())
|
||||||
{
|
{
|
||||||
work.FixOverLoad();
|
work.FixOverLoad();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var m = new System.Windows.Controls.MenuItem()
|
var m = new System.Windows.Controls.MenuItem()
|
||||||
{
|
{
|
||||||
Header = "MOD管理".Translate(),
|
Header = "MOD管理".Translate(),
|
||||||
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
|
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
|
||||||
};
|
};
|
||||||
m.Click += (x, y) =>
|
m.Click += (x, y) =>
|
||||||
{
|
{
|
||||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
winSetting.MainTab.SelectedIndex = 5;
|
winSetting.MainTab.SelectedIndex = 5;
|
||||||
winSetting.Show();
|
winSetting.Show();
|
||||||
};
|
};
|
||||||
Main.FunctionSpendHandle += lowStrength;
|
Main.FunctionSpendHandle += lowStrength;
|
||||||
Main.WorkTimer.E_FinishWork += WorkTimer_E_FinishWork;
|
Main.WorkTimer.E_FinishWork += WorkTimer_E_FinishWork;
|
||||||
Main.ToolBar.MenuMODConfig.Items.Add(m);
|
Main.ToolBar.MenuMODConfig.Items.Add(m);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//加载游戏创意工坊插件
|
//加载游戏创意工坊插件
|
||||||
foreach (MainPlugin mp in Plugins)
|
foreach (MainPlugin mp in Plugins)
|
||||||
mp.LoadPlugin();
|
mp.LoadPlugin();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
new winReport(this, "由于插件引起的游戏启动错误".Translate() + "\n" + e.ToString()).Show();
|
new winReport(this, "由于插件引起的游戏启动错误".Translate() + "\n" + e.ToString()).Show();
|
||||||
}
|
}
|
||||||
Foods.ForEach(item => item.LoadImageSource(this));
|
Foods.ForEach(item => item.LoadImageSource(this));
|
||||||
Main.TimeHandle += Handle_Music;
|
Main.TimeHandle += Handle_Music;
|
||||||
if (IsSteamUser)
|
if (IsSteamUser)
|
||||||
Main.TimeHandle += Handle_Steam;
|
Main.TimeHandle += Handle_Steam;
|
||||||
Main.TimeHandle += (x) => DiagnosisUPLoad();
|
Main.TimeHandle += (x) => DiagnosisUPLoad();
|
||||||
|
|
||||||
|
|
||||||
var tlv = Main.ToolBar.Tlv;
|
var tlv = Main.ToolBar.Tlv;
|
||||||
Main.ToolBar.gdPanel.Children.Remove(tlv);
|
Main.ToolBar.gdPanel.Children.Remove(tlv);
|
||||||
var sp = new StackPanel();
|
var sp = new StackPanel();
|
||||||
Grid.SetColumnSpan(sp, 3);
|
Grid.SetColumnSpan(sp, 3);
|
||||||
sp.Orientation = System.Windows.Controls.Orientation.Horizontal;
|
sp.Orientation = System.Windows.Controls.Orientation.Horizontal;
|
||||||
sp.Children.Add(tlv);
|
sp.Children.Add(tlv);
|
||||||
tlvplus = new TextBlock();
|
tlvplus = new TextBlock();
|
||||||
tlvplus.Margin = new Thickness(1);
|
tlvplus.Margin = new Thickness(1);
|
||||||
tlvplus.VerticalAlignment = VerticalAlignment.Bottom;
|
tlvplus.VerticalAlignment = VerticalAlignment.Bottom;
|
||||||
tlvplus.FontSize = 18;
|
tlvplus.FontSize = 18;
|
||||||
tlvplus.Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText);
|
tlvplus.Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText);
|
||||||
sp.Children.Add(tlvplus);
|
sp.Children.Add(tlvplus);
|
||||||
Main.ToolBar.gdPanel.Children.Add(sp);
|
Main.ToolBar.gdPanel.Children.Add(sp);
|
||||||
Main.TimeUIHandle += MWUIHandle;
|
Main.TimeUIHandle += MWUIHandle;
|
||||||
Main.ToolBar.EventMenuPanelShow += () => MWUIHandle(Main);
|
Main.ToolBar.EventMenuPanelShow += () => MWUIHandle(Main);
|
||||||
|
|
||||||
|
|
||||||
switch (Set["CGPT"][(gstr)"type"])
|
switch (Set["CGPT"][(gstr)"type"])
|
||||||
{
|
{
|
||||||
case "DIY":
|
case "DIY":
|
||||||
TalkAPIIndex = TalkAPI.FindIndex(x => x.APIName == Set["CGPT"][(gstr)"DIY"]);
|
TalkAPIIndex = TalkAPI.FindIndex(x => x.APIName == Set["CGPT"][(gstr)"DIY"]);
|
||||||
LoadTalkDIY();
|
LoadTalkDIY();
|
||||||
break;
|
break;
|
||||||
//case "API":
|
//case "API":
|
||||||
// TalkBox = new TalkBoxAPI(this);
|
// TalkBox = new TalkBoxAPI(this);
|
||||||
// Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
// Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||||
// break;
|
// break;
|
||||||
case "LB":
|
case "LB":
|
||||||
//if (IsSteamUser)
|
//if (IsSteamUser)
|
||||||
//{
|
//{
|
||||||
// TalkBox = new TalkSelect(this);
|
// TalkBox = new TalkSelect(this);
|
||||||
// Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
// Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||||
//}
|
//}
|
||||||
TalkBox = new TalkSelect(this);
|
TalkBox = new TalkSelect(this);
|
||||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//窗口部件
|
//窗口部件
|
||||||
winSetting = new winGameSetting(this);
|
winSetting = new winGameSetting(this);
|
||||||
winBetterBuy = new winBetterBuy(this);
|
winBetterBuy = new winBetterBuy(this);
|
||||||
|
|
||||||
Main.DefaultClickAction = () =>
|
Main.DefaultClickAction = () =>
|
||||||
{
|
{
|
||||||
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
|
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
|
||||||
{
|
{
|
||||||
lastclicktime = DateTime.Now.Ticks;
|
lastclicktime = DateTime.Now.Ticks;
|
||||||
var rt = GetClickText();
|
var rt = GetClickText();
|
||||||
if (rt != null)
|
if (rt != null)
|
||||||
{
|
{
|
||||||
//聊天效果
|
//聊天效果
|
||||||
if (rt.Exp != 0)
|
if (rt.Exp != 0)
|
||||||
{
|
{
|
||||||
if (rt.Exp > 0)
|
if (rt.Exp > 0)
|
||||||
{
|
{
|
||||||
GameSavesData.Statistics[(gint)"stat_say_exp_p"]++;
|
GameSavesData.Statistics[(gint)"stat_say_exp_p"]++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GameSavesData.Statistics[(gint)"stat_say_exp_d"]++;
|
GameSavesData.Statistics[(gint)"stat_say_exp_d"]++;
|
||||||
}
|
}
|
||||||
if (rt.Likability != 0)
|
if (rt.Likability != 0)
|
||||||
{
|
{
|
||||||
if (rt.Likability > 0)
|
if (rt.Likability > 0)
|
||||||
GameSavesData.Statistics[(gint)"stat_say_like_p"]++;
|
GameSavesData.Statistics[(gint)"stat_say_like_p"]++;
|
||||||
else
|
else
|
||||||
GameSavesData.Statistics[(gint)"stat_say_like_d"]++;
|
GameSavesData.Statistics[(gint)"stat_say_like_d"]++;
|
||||||
}
|
}
|
||||||
if (rt.Money != 0)
|
if (rt.Money != 0)
|
||||||
{
|
{
|
||||||
if (rt.Money > 0)
|
if (rt.Money > 0)
|
||||||
GameSavesData.Statistics[(gint)"stat_say_money_p"]++;
|
GameSavesData.Statistics[(gint)"stat_say_money_p"]++;
|
||||||
else
|
else
|
||||||
GameSavesData.Statistics[(gint)"stat_say_money_d"]++;
|
GameSavesData.Statistics[(gint)"stat_say_money_d"]++;
|
||||||
}
|
}
|
||||||
Main.Core.Save.EatFood(rt);
|
Main.Core.Save.EatFood(rt);
|
||||||
Main.Core.Save.Money += rt.Money;
|
Main.Core.Save.Money += rt.Money;
|
||||||
Main.SayRnd(rt.TranslateText, desc: rt.FoodToDescription());
|
Main.SayRnd(rt.TranslateText, desc: rt.FoodToDescription());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Main.PlayVoiceVolume = Set.VoiceVolume;
|
Main.PlayVoiceVolume = Set.VoiceVolume;
|
||||||
Main.FunctionSpendHandle += StatisticsCalHandle;
|
Main.FunctionSpendHandle += StatisticsCalHandle;
|
||||||
DisplayGrid.Child = Main;
|
DisplayGrid.Child = Main;
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
while (Main.IsWorking)
|
while (Main.IsWorking)
|
||||||
{
|
{
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
await Dispatcher.InvokeAsync(() => LoadingText.Visibility = Visibility.Collapsed);
|
await Dispatcher.InvokeAsync(() => LoadingText.Visibility = Visibility.Collapsed);
|
||||||
});
|
});
|
||||||
|
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "退出桌宠".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; Close(); });
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "退出桌宠".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; Close(); });
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "开发控制台".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winConsole(this).Show(); });
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "开发控制台".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winConsole(this).Show(); });
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "操作教程".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "操作教程".Translate(), () =>
|
||||||
{
|
{
|
||||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
||||||
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
||||||
else
|
else
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
||||||
});
|
});
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "反馈中心".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winReport(this).Show(); });
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "反馈中心".Translate(), () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winReport(this).Show(); });
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "设置面板".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "设置面板".Translate(), () =>
|
||||||
{
|
{
|
||||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
winSetting.Show();
|
winSetting.Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
//this.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Res/TopLogo2019.PNG")));
|
//this.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Res/TopLogo2019.PNG")));
|
||||||
|
|
||||||
//Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喂食测试", () =>
|
//Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喂食测试", () =>
|
||||||
// {
|
// {
|
||||||
// Main.ToolBar.Visibility = Visibility.Collapsed;
|
// Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
// IRunImage eat = (IRunImage)Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
|
// IRunImage eat = (IRunImage)Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
|
||||||
// var b = Main.FindDisplayBorder(eat);
|
// var b = Main.FindDisplayBorder(eat);
|
||||||
// eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/汉堡.png")), Main.DisplayToNomal);
|
// eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/汉堡.png")), Main.DisplayToNomal);
|
||||||
// }
|
// }
|
||||||
//);
|
//);
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "吃饭".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "吃饭".Translate(), () =>
|
||||||
{
|
{
|
||||||
winBetterBuy.Show(Food.FoodType.Meal);
|
winBetterBuy.Show(Food.FoodType.Meal);
|
||||||
});
|
});
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "喝水".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "喝水".Translate(), () =>
|
||||||
{
|
{
|
||||||
winBetterBuy.Show(Food.FoodType.Drink);
|
winBetterBuy.Show(Food.FoodType.Drink);
|
||||||
});
|
});
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "收藏".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "收藏".Translate(), () =>
|
||||||
{
|
{
|
||||||
winBetterBuy.Show(Food.FoodType.Star);
|
winBetterBuy.Show(Food.FoodType.Star);
|
||||||
});
|
});
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "药品".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "药品".Translate(), () =>
|
||||||
{
|
{
|
||||||
winBetterBuy.Show(Food.FoodType.Drug);
|
winBetterBuy.Show(Food.FoodType.Drug);
|
||||||
});
|
});
|
||||||
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "礼品".Translate(), () =>
|
Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "礼品".Translate(), () =>
|
||||||
{
|
{
|
||||||
winBetterBuy.Show(Food.FoodType.Gift);
|
winBetterBuy.Show(Food.FoodType.Gift);
|
||||||
});
|
});
|
||||||
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
|
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
|
||||||
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
|
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
|
||||||
if (Set.MessageBarOutside)
|
if (Set.MessageBarOutside)
|
||||||
Main.MsgBar.SetPlaceOUT();
|
Main.MsgBar.SetPlaceOUT();
|
||||||
|
|
||||||
Main.WorkCheck = WorkCheck;
|
Main.WorkCheck = WorkCheck;
|
||||||
|
|
||||||
//加载图标
|
//加载图标
|
||||||
notifyIcon = new NotifyIcon();
|
notifyIcon = new NotifyIcon();
|
||||||
notifyIcon.Text = "虚拟桌宠模拟器".Translate() + PrefixSave;
|
notifyIcon.Text = "虚拟桌宠模拟器".Translate() + PrefixSave;
|
||||||
ContextMenu m_menu;
|
ContextMenu m_menu;
|
||||||
|
|
||||||
if (Set.PetHelper)
|
if (Set.PetHelper)
|
||||||
LoadPetHelper();
|
LoadPetHelper();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_menu = new ContextMenu();
|
m_menu = new ContextMenu();
|
||||||
m_menu.Opening += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; };
|
m_menu.Opening += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; };
|
||||||
var hitThrough = new MenuItem("鼠标穿透".Translate(), null, (x, y) => { SetTransparentHitThrough(); })
|
var hitThrough = new MenuItem("鼠标穿透".Translate(), null, (x, y) => { SetTransparentHitThrough(); })
|
||||||
{
|
{
|
||||||
Name = "NotifyIcon_HitThrough",
|
Name = "NotifyIcon_HitThrough",
|
||||||
Checked = HitThrough
|
Checked = HitThrough
|
||||||
};
|
};
|
||||||
m_menu.Items.Add(hitThrough);
|
m_menu.Items.Add(hitThrough);
|
||||||
m_menu.Items.Add(new MenuItem("操作教程".Translate(), null, (x, y) =>
|
m_menu.Items.Add(new MenuItem("操作教程".Translate(), null, (x, y) =>
|
||||||
{
|
{
|
||||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
||||||
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
||||||
else
|
else
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
||||||
}));
|
}));
|
||||||
m_menu.Items.Add(new MenuItem("重置位置与状态".Translate(), null, (x, y) =>
|
m_menu.Items.Add(new MenuItem("重置位置与状态".Translate(), null, (x, y) =>
|
||||||
{
|
{
|
||||||
Main.CleanState();
|
Main.CleanState();
|
||||||
Main.DisplayToNomal();
|
Main.DisplayToNomal();
|
||||||
Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
|
Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
|
||||||
Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
|
Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
|
||||||
}));
|
}));
|
||||||
m_menu.Items.Add(new MenuItem("反馈中心".Translate(), null, (x, y) => { new winReport(this).Show(); }));
|
m_menu.Items.Add(new MenuItem("反馈中心".Translate(), null, (x, y) => { new winReport(this).Show(); }));
|
||||||
m_menu.Items.Add(new MenuItem("开发控制台".Translate(), null, (x, y) => { new winConsole(this).Show(); }));
|
m_menu.Items.Add(new MenuItem("开发控制台".Translate(), null, (x, y) => { new winConsole(this).Show(); }));
|
||||||
|
|
||||||
m_menu.Items.Add(new MenuItem("设置面板".Translate(), null, (x, y) =>
|
m_menu.Items.Add(new MenuItem("设置面板".Translate(), null, (x, y) =>
|
||||||
{
|
{
|
||||||
winSetting.Show();
|
winSetting.Show();
|
||||||
}));
|
}));
|
||||||
m_menu.Items.Add(new MenuItem("退出桌宠".Translate(), null, (x, y) => Close()));
|
m_menu.Items.Add(new MenuItem("退出桌宠".Translate(), null, (x, y) => Close()));
|
||||||
|
|
||||||
LoadDIY();
|
LoadDIY();
|
||||||
|
|
||||||
notifyIcon.ContextMenuStrip = m_menu;
|
notifyIcon.ContextMenuStrip = m_menu;
|
||||||
|
|
||||||
notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream);
|
notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream);
|
||||||
|
|
||||||
notifyIcon.Visible = true;
|
notifyIcon.Visible = true;
|
||||||
notifyIcon.BalloonTipClicked += (a, b) =>
|
notifyIcon.BalloonTipClicked += (a, b) =>
|
||||||
{
|
{
|
||||||
winSetting.Show();
|
winSetting.Show();
|
||||||
};
|
};
|
||||||
if (Set.StartUPBoot == true && !Set["v"][(gbol)"newverstartup"])
|
if (Set.StartUPBoot == true && !Set["v"][(gbol)"newverstartup"])
|
||||||
{//更新到最新版开机启动方式
|
{//更新到最新版开机启动方式
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
winSetting.GenStartUP();
|
winSetting.GenStartUP();
|
||||||
Set["v"][(gbol)"newverstartup"] = true;
|
Set["v"][(gbol)"newverstartup"] = true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//成就和统计
|
//成就和统计
|
||||||
GameSavesData.Statistics[(gint)"stat_open_times"]++;
|
GameSavesData.Statistics[(gint)"stat_open_times"]++;
|
||||||
Main.MoveTimer.Elapsed += MoveTimer_Elapsed;
|
Main.MoveTimer.Elapsed += MoveTimer_Elapsed;
|
||||||
Main.OnSay += Main_OnSay;
|
Main.OnSay += Main_OnSay;
|
||||||
Main.Event_TouchHead += Main_Event_TouchHead;
|
Main.Event_TouchHead += Main_Event_TouchHead;
|
||||||
Main.Event_TouchBody += Main_Event_TouchBody;
|
Main.Event_TouchBody += Main_Event_TouchBody;
|
||||||
|
|
||||||
HashCheck = HashCheck;
|
HashCheck = HashCheck;
|
||||||
|
|
||||||
//添加捏脸动画(若有)
|
//添加捏脸动画(若有)
|
||||||
if (Core.Graph.GraphConfig.Data.ContainsLine("pinch"))
|
if (Core.Graph.GraphConfig.Data.ContainsLine("pinch"))
|
||||||
{
|
{
|
||||||
var pin = Core.Graph.GraphConfig.Data["pinch"];
|
var pin = Core.Graph.GraphConfig.Data["pinch"];
|
||||||
Main.Core.TouchEvent.Insert(0, new TouchArea(
|
Main.Core.TouchEvent.Insert(0, new TouchArea(
|
||||||
new Point(pin[(gdbe)"px"], pin[(gdbe)"py"]), new Size(pin[(gdbe)"sw"], pin[(gdbe)"sh"])
|
new Point(pin[(gdbe)"px"], pin[(gdbe)"py"]), new Size(pin[(gdbe)"sw"], pin[(gdbe)"sh"])
|
||||||
, DisplayPinch, true));
|
, DisplayPinch, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Set.HitThrough)
|
if (Set.HitThrough)
|
||||||
{
|
{
|
||||||
if (!Set["v"][(gbol)"HitThrough"])
|
if (!Set["v"][(gbol)"HitThrough"])
|
||||||
{
|
{
|
||||||
Set["v"][(gbol)"HitThrough"] = true;
|
Set["v"][(gbol)"HitThrough"] = true;
|
||||||
Set.HitThrough = false;
|
Set.HitThrough = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetTransparentHitThrough();
|
SetTransparentHitThrough();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 10, 20) && App.MainWindows.Count == 1)
|
if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 10, 20) && App.MainWindows.Count == 1)
|
||||||
{
|
{
|
||||||
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
|
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
|
||||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
|
||||||
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
else if (LocalizeCore.CurrentCulture == "zh-Hant")
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_zht.html");
|
||||||
else
|
else
|
||||||
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
|
||||||
}
|
}
|
||||||
if (!Set["SingleTips"].GetBool("helloworld"))
|
if (!Set["SingleTips"].GetBool("helloworld"))
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
Set["SingleTips"].SetBool("helloworld", true);
|
Set["SingleTips"].SetBool("helloworld", true);
|
||||||
NoticeBox.Show("欢迎使用虚拟桌宠模拟器!\n如果遇到桌宠爬不见了,可以在我这里设置居中或退出桌宠".Translate(),
|
NoticeBox.Show("欢迎使用虚拟桌宠模拟器!\n如果遇到桌宠爬不见了,可以在我这里设置居中或退出桌宠".Translate(),
|
||||||
"你好".Translate() + (IsSteamUser ? SteamClient.Name : Environment.UserName), Panuon.WPF.UI.MessageBoxIcon.Info, true, 5000);
|
"你好".Translate() + (IsSteamUser ? SteamClient.Name : Environment.UserName), Panuon.WPF.UI.MessageBoxIcon.Info, true, 5000);
|
||||||
//Thread.Sleep(2000);
|
//Thread.Sleep(2000);
|
||||||
//Main.SayRnd("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议".Translate());
|
//Main.SayRnd("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议".Translate());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (Set["v"][(gint)"rank"] != DateTime.Now.Year && GameSavesData.Statistics[(gint)"stat_total_time"] > 3600)
|
if (Set["v"][(gint)"rank"] != DateTime.Now.Year && GameSavesData.Statistics[(gint)"stat_total_time"] > 3600)
|
||||||
{//年度报告提醒
|
{//年度报告提醒
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
Thread.Sleep(120000);
|
Thread.Sleep(120000);
|
||||||
Set["v"][(gint)"rank"] = DateTime.Now.Year;
|
Set["v"][(gint)"rank"] = DateTime.Now.Year;
|
||||||
var btn = Dispatcher.Invoke(() =>
|
var btn = Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var button = new System.Windows.Controls.Button()
|
var button = new System.Windows.Controls.Button()
|
||||||
{
|
{
|
||||||
Content = "点击前往查看".Translate(),
|
Content = "点击前往查看".Translate(),
|
||||||
FontSize = 20,
|
FontSize = 20,
|
||||||
HorizontalAlignment = System.Windows.HorizontalAlignment.Right,
|
HorizontalAlignment = System.Windows.HorizontalAlignment.Right,
|
||||||
Background = Function.ResourcesBrush(Function.BrushType.Primary),
|
Background = Function.ResourcesBrush(Function.BrushType.Primary),
|
||||||
Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText),
|
Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText),
|
||||||
};
|
};
|
||||||
button.Click += (x, y) =>
|
button.Click += (x, y) =>
|
||||||
{
|
{
|
||||||
var panelWindow = new winCharacterPanel(this);
|
var panelWindow = new winCharacterPanel(this);
|
||||||
panelWindow.MainTab.SelectedIndex = 2;
|
panelWindow.MainTab.SelectedIndex = 2;
|
||||||
panelWindow.Show();
|
panelWindow.Show();
|
||||||
Main.MsgBar.ForceClose();
|
Main.MsgBar.ForceClose();
|
||||||
};
|
};
|
||||||
return button;
|
return button;
|
||||||
});
|
});
|
||||||
Main.Say("哼哼~主人,我的考试成绩出炉了哦,快来和我一起看我的成绩单喵".Translate(), btn, "shining");
|
Main.Say("哼哼~主人,我的考试成绩出炉了哦,快来和我一起看我的成绩单喵".Translate(), btn, "shining");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#if NewYear
|
#if NewYear
|
||||||
//仅新年功能
|
//仅新年功能
|
||||||
if (DateTime.Now < new DateTime(2024, 2, 18))
|
if (DateTime.Now < new DateTime(2024, 2, 18))
|
||||||
@ -1959,17 +1962,18 @@ namespace VPet_Simulator.Windows
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//MOD报错
|
//MOD报错
|
||||||
foreach (CoreMOD cm in CoreMODs)
|
foreach (CoreMOD cm in CoreMODs)
|
||||||
if (!cm.SuccessLoad)
|
if (!cm.SuccessLoad)
|
||||||
if (cm.Tag.Contains("该模组已损坏"))
|
if (cm.Tag.Contains("该模组已损坏"))
|
||||||
MessageBoxX.Show("模组 {0} 插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "该模组已损坏".Translate());
|
MessageBoxX.Show("模组 {0} 插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "该模组已损坏".Translate());
|
||||||
else if (Set.IsPassMOD(cm.Name))
|
else if (Set.IsPassMOD(cm.Name))
|
||||||
MessageBoxX.Show("模组 {0} 的代码插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "{0} 未加载代码插件".Translate(cm.Name));
|
MessageBoxX.Show("模组 {0} 的代码插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "{0} 未加载代码插件".Translate(cm.Name));
|
||||||
else if (Set.IsMSGMOD(cm.Name))
|
else if (Set.IsMSGMOD(cm.Name))
|
||||||
MessageBoxX.Show("由于 {0} 包含代码插件\n虚拟桌宠模拟器已自动停止加载该插件\n请手动前往设置允许启用该mod 代码插件".Translate(cm.Name), "{0} 未加载代码插件".Translate(cm.Name));
|
MessageBoxX.Show("由于 {0} 包含代码插件\n虚拟桌宠模拟器已自动停止加载该插件\n请手动前往设置允许启用该mod 代码插件".Translate(cm.Name), "{0} 未加载代码插件".Translate(cm.Name));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}));
|
|
||||||
|
|
||||||
////游戏提示
|
////游戏提示
|
||||||
//if (Set["SingleTips"][(gint)"open"] == 0 && Set.StartUPBoot == true && Set.StartUPBootSteam == true)
|
//if (Set["SingleTips"][(gint)"open"] == 0 && Set.StartUPBoot == true && Set.StartUPBootSteam == true)
|
||||||
|
@ -205,6 +205,15 @@ public partial class MPFriends : WindowX
|
|||||||
|
|
||||||
Core.Graph = petloader.Graph(mw.Set.Resolution);
|
Core.Graph = petloader.Graph(mw.Set.Resolution);
|
||||||
Main = new Main(Core);
|
Main = new Main(Core);
|
||||||
|
Main.MsgBar = new MessageBar(Main);
|
||||||
|
Main.MsgBar.Visibility = Visibility.Collapsed;
|
||||||
|
Main.UIGrid.Children.Add(Main.MsgBar.This);
|
||||||
|
Main.ToolBar = new Core.ToolBar(Main);
|
||||||
|
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||||
|
Main.UIGrid.Children.Add(Main.ToolBar);
|
||||||
|
Main.Load_2_TouchEvent();
|
||||||
|
Task.Run(Main.Load_24_WaitAndStart);
|
||||||
|
|
||||||
Main.EventTimer.AutoReset = false;
|
Main.EventTimer.AutoReset = false;
|
||||||
Main.EventTimer.Enabled = false;
|
Main.EventTimer.Enabled = false;
|
||||||
|
|
||||||
@ -212,7 +221,6 @@ public partial class MPFriends : WindowX
|
|||||||
Main.Resources = Application.Current.Resources;
|
Main.Resources = Application.Current.Resources;
|
||||||
Main.MsgBar.This.Resources = Application.Current.Resources;
|
Main.MsgBar.This.Resources = Application.Current.Resources;
|
||||||
Main.ToolBar.Resources = Application.Current.Resources;
|
Main.ToolBar.Resources = Application.Current.Resources;
|
||||||
Main.ToolBar.LoadClean();
|
|
||||||
|
|
||||||
HideForDesign.Children.Remove(MPTalkBox);
|
HideForDesign.Children.Remove(MPTalkBox);
|
||||||
Main.ToolBar.MainGrid.Children.Add(MPTalkBox);
|
Main.ToolBar.MainGrid.Children.Add(MPTalkBox);
|
||||||
|
Loading…
Reference in New Issue
Block a user