Merge branch 'main' into beta-v1.10

This commit is contained in:
ZouJin 2023-12-08 23:35:53 +08:00
commit 6ca3f6bb6d
115 changed files with 173 additions and 49 deletions

3
.gitignore vendored
View File

@ -352,4 +352,5 @@ MigrationBackup/
*.zip *.zip
*.rar *.rar
*_PDLC_* *_PDLC_*
*_DLC_* *_DLC_*
VPet-Simulator.Windows/mod/1111_ChatGPTPlus

BIN
Tutorial.assets/ss33.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -6,6 +6,14 @@
本游戏是核心是桌面宠物, 更多自动操作例如乱走乱动,发呆,蹲下等需要挂机才能看到. 本游戏是核心是桌面宠物, 更多自动操作例如乱走乱动,发呆,蹲下等需要挂机才能看到.
## 11/24 更新 捏脸
捏脸动画为2023年的steam大奖提名活动奖励
长按脸部捏脸
![ss33](Tutorial.assets/ss33.gif)
## 基本操作 ## 基本操作
### 鼠标右键打开菜单栏 ### 鼠标右键打开菜单栏

View File

@ -7,6 +7,15 @@
The core gameplay revolves taking care of your Pet. However, more automatic actions, such as wandering around, spacing out, squatting, etc., can be seen only when the game is idle. The core gameplay revolves taking care of your Pet. However, more automatic actions, such as wandering around, spacing out, squatting, etc., can be seen only when the game is idle.
## 11/24 Update Pinch Face
Pinch animation for 2023 steam award Voting Rewards
Long press on the face to pinch the face
![ss33](Tutorial.assets/ss33.gif)
## Basics ## Basics
### Right Click to Open/Close the Menu Bar ### Right Click to Open/Close the Menu Bar

View File

@ -8,6 +8,12 @@
本遊戲的核心是桌面寵物,更多自動行為如亂走亂動、發呆、蹲下等,需要掛機才能看見。 本遊戲的核心是桌面寵物,更多自動行為如亂走亂動、發呆、蹲下等,需要掛機才能看見。
## 11/24 更新捏臉
捏臉動畫為2023年的steam大獎提名活動
長按臉部捏臉
![ss33](Tutorial.assets/ss33.gif)
## 基本操作 ## 基本操作
### 滑鼠右鍵打開功能表 ### 滑鼠右鍵打開功能表

View File

@ -381,6 +381,9 @@ namespace VPet_Simulator.Core
private DateTime wavespan; private DateTime wavespan;
private void MainGrid_MouseWave(object sender, MouseEventArgs e) private void MainGrid_MouseWave(object sender, MouseEventArgs e)
{ {
if(e.LeftButton == MouseButtonState.Pressed)
return;
isPress = false;
if (rasetype >= 0 || State != WorkingState.Nomal) if (rasetype >= 0 || State != WorkingState.Nomal)
return; return;

View File

@ -377,6 +377,7 @@ namespace VPet_Simulator.Core
break; break;
case -1: case -1:
rasetype = int.MinValue; rasetype = int.MinValue;
Core.Controller.RePostionActive = !Core.Controller.CheckPosition();
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
Display(GraphType.Raised_Static, AnimatType.C_End, DisplayToNomal); Display(GraphType.Raised_Static, AnimatType.C_End, DisplayToNomal);
else else

View File

@ -485,8 +485,7 @@ namespace VPet_Simulator.Core
return; return;
} }
} }
m.MoveTimer.Enabled = false; StopMoving(m);
m.Display(Graph, AnimatType.C_End, m.DisplayToNomal);
return; return;
} }
//不是:继续右边走or停下 //不是:继续右边走or停下
@ -504,6 +503,14 @@ namespace VPet_Simulator.Core
return; return;
} }
} }
StopMoving(m);
}
private void StopMoving(Main m)
{
if (m.Core.Controller.RePostionActive)
m.Core.Controller.ResetPosition();
m.Core.Controller.RePostionActive = !m.Core.Controller.CheckPosition();
m.MoveTimer.Enabled = false; m.MoveTimer.Enabled = false;
m.Display(Graph, AnimatType.C_End, m.DisplayToNomal); m.Display(Graph, AnimatType.C_End, m.DisplayToNomal);
} }

View File

@ -49,6 +49,16 @@
/// 显示面板窗体 /// 显示面板窗体
/// </summary> /// </summary>
void ShowPanel(); void ShowPanel();
/// <summary>
/// 在边缘时重新靠边,防止被阻挡
/// </summary>
void ResetPosition();
/// <summary>
/// 判断桌宠是否靠边
/// </summary>
bool CheckPosition();
/// <summary> /// <summary>
/// 启用计算等数据功能 /// 启用计算等数据功能
/// </summary> /// </summary>
@ -56,6 +66,11 @@
/// <summary> /// <summary>
/// 互动周期 /// 互动周期
/// </summary> /// </summary>
int InteractionCycle { get; } int InteractionCycle { get; }
/// <summary>
/// 是否启用边缘重新定位
/// </summary>
bool RePostionActive { get; set; }
} }
} }

View File

@ -48,7 +48,7 @@ namespace VPet_Simulator.Windows
e.Handled = true; e.Handled = true;
var expt = e.Exception.ToString(); var expt = e.Exception.ToString();
if (expt.ToLower().Contains("value") && expt.Contains("NaN")) if (expt.ToLower().Contains("value") && expt.ToLower().Contains("nan"))
{ {
MessageBox.Show("由于修改游戏数据导致数据溢出,存档可能会出错\n开发者提醒您请不要使用过于超模的MOD".Translate()); MessageBox.Show("由于修改游戏数据导致数据溢出,存档可能会出错\n开发者提醒您请不要使用过于超模的MOD".Translate());
return; return;
@ -71,8 +71,8 @@ namespace VPet_Simulator.Windows
else if (expt.Contains("VPet.Plugin")) else if (expt.Contains("VPet.Plugin"))
{ {
var exptin = expt.Split('\n').First(x => x.Contains("VPet.Plugin")); var exptin = expt.Split('\n').First(x => x.Contains("VPet.Plugin"));
exptin = exptin.Substring(exptin.IndexOf("VPet.Plugin")); exptin = exptin.Substring(exptin.IndexOf("VPet.Plugin") + 12).Split('.')[0];
MessageBox.Show("游戏发生错误,可能是".Translate() + $"MOD({exptin})" + MessageBox.Show("游戏发生错误,可能是".Translate() + $"MOD({exptin.Translate()})" +
"导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n".Translate() "导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n".Translate()
+ expt, "游戏发生错误,可能是".Translate() + exptin); + expt, "游戏发生错误,可能是".Translate() + exptin);
return; return;

View File

@ -16,6 +16,11 @@ namespace VPet_Simulator.Windows
{ {
public class CoreMOD public class CoreMOD
{ {
/// <summary>
/// 自动启用MOD名称
/// </summary>
public static readonly string[] OnModDefList = new string[] { "Core", "PCat", "ModMaker" };
public static HashSet<string> LoadedDLL { get; } = new HashSet<string>() public static HashSet<string> LoadedDLL { get; } = new HashSet<string>()
{ {
"Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll", "Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll",
@ -264,7 +269,7 @@ namespace VPet_Simulator.Windows
} }
catch (Exception e) catch (Exception e)
{ {
ErrorMessage = e.Message; ErrorMessage = e.Message;
SuccessLoad = false; SuccessLoad = false;
} }
} }
@ -274,7 +279,7 @@ namespace VPet_Simulator.Windows
} }
} }
} }
catch(Exception e) catch (Exception e)
{ {
ErrorMessage = e.Message; ErrorMessage = e.Message;
Tag.Add("该模组已损坏"); Tag.Add("该模组已损坏");
@ -338,7 +343,7 @@ namespace VPet_Simulator.Windows
} }
public static bool IsOnMod(this Setting t, string ModName) public static bool IsOnMod(this Setting t, string ModName)
{ {
if (ModName == "Core") if (CoreMOD.OnModDefList.Contains(ModName))
return true; return true;
var line = t.FindLine("onmod"); var line = t.FindLine("onmod");
if (line == null) if (line == null)

View File

@ -107,6 +107,37 @@ namespace VPet_Simulator.Windows
panelWindow.Show(); panelWindow.Show();
} }
public void ResetPosition()
{
mw.Dispatcher.Invoke(() =>
{
if (GetWindowsDistanceUp() < -0.25 * mw.Height && GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight)
{
MoveWindows(0, -GetWindowsDistanceUp() / ZoomRatio);
}
else if (GetWindowsDistanceDown() < -0.25 * mw.Height && GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight)
{
MoveWindows(0, GetWindowsDistanceDown() / ZoomRatio);
}
if (GetWindowsDistanceLeft() < -0.25 * mw.Width && GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth)
{
MoveWindows(-GetWindowsDistanceLeft() / ZoomRatio, 0);
}
else if (GetWindowsDistanceRight() < -0.25 * mw.Width && GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth)
{
MoveWindows(GetWindowsDistanceRight() / ZoomRatio, 0);
}
});
}
public bool CheckPosition() => mw.Dispatcher.Invoke(() =>
GetWindowsDistanceUp() < -0.25 * mw.Height && GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight
|| GetWindowsDistanceDown() < -0.25 * mw.Height && GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight
|| GetWindowsDistanceLeft() < -0.25 * mw.Width && GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth
|| GetWindowsDistanceRight() < -0.25 * mw.Width && GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth
);
public bool RePostionActive { get; set; } = true;
public double ZoomRatio => mw.Set.ZoomLevel; public double ZoomRatio => mw.Set.ZoomLevel;
public int PressLength => mw.Set.PressLength; public int PressLength => mw.Set.PressLength;

View File

@ -333,7 +333,7 @@ namespace VPet_Simulator.Windows
{ {
try try
{ {
System.Windows.Forms.SendKeys.SendWait(content); SendKeys.SendWait(content);
} }
catch (Exception e) catch (Exception e)
{ {
@ -605,7 +605,7 @@ namespace VPet_Simulator.Windows
{ {
if (name.StartsWith("stat_")) if (name.StartsWith("stat_"))
{ {
Steamworks.SteamUserStats.SetStat(name, (int)value); SteamUserStats.SetStat(name, (int)value);
} }
} }
/// <summary> /// <summary>
@ -623,7 +623,7 @@ namespace VPet_Simulator.Windows
switch (Main.State) switch (Main.State)
{ {
case Main.WorkingState.Work: case Main.WorkingState.Work:
if (Main.nowWork.Type == GraphHelper.Work.WorkType.Work) if (Main.nowWork.Type == Work.WorkType.Work)
stat[(gi64)"stat_work_time"] += (int)Set.LogicInterval; stat[(gi64)"stat_work_time"] += (int)Set.LogicInterval;
else else
stat[(gi64)"stat_study_time"] += (int)Set.LogicInterval; stat[(gi64)"stat_study_time"] += (int)Set.LogicInterval;
@ -662,7 +662,7 @@ namespace VPet_Simulator.Windows
if (IsSteamUser) if (IsSteamUser)
{ {
Task.Run(Steamworks.SteamUserStats.StoreStats); Task.Run(SteamUserStats.StoreStats);
} }
} }
/// <summary> /// <summary>
@ -975,7 +975,7 @@ namespace VPet_Simulator.Windows
//参数 //参数
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append("action=data"); sb.Append("action=data");
sb.Append($"&steamid={Steamworks.SteamClient.SteamId.Value}"); sb.Append($"&steamid={SteamClient.SteamId.Value}");
sb.Append($"&ver={version}"); sb.Append($"&ver={version}");
sb.Append("&save="); sb.Append("&save=");
sb.AppendLine(HttpUtility.UrlEncode(Core.Save.ToLine().ToString() + Set.ToString())); sb.AppendLine(HttpUtility.UrlEncode(Core.Save.ToLine().ToString() + Set.ToString()));
@ -1093,9 +1093,9 @@ namespace VPet_Simulator.Windows
Set = new Setting("Setting#VPET:|\n"); Set = new Setting("Setting#VPET:|\n");
var visualTree = new FrameworkElementFactory(typeof(Border)); var visualTree = new FrameworkElementFactory(typeof(Border));
visualTree.SetValue(Border.BackgroundProperty, new TemplateBindingExtension(Window.BackgroundProperty)); visualTree.SetValue(Border.BackgroundProperty, new TemplateBindingExtension(BackgroundProperty));
var childVisualTree = new FrameworkElementFactory(typeof(ContentPresenter)); var childVisualTree = new FrameworkElementFactory(typeof(ContentPresenter));
childVisualTree.SetValue(UIElement.ClipToBoundsProperty, true); childVisualTree.SetValue(ClipToBoundsProperty, true);
visualTree.AppendChild(childVisualTree); visualTree.AppendChild(childVisualTree);
Template = new ControlTemplate Template = new ControlTemplate
@ -1217,6 +1217,18 @@ namespace VPet_Simulator.Windows
CoreMOD.NowLoading = null; CoreMOD.NowLoading = null;
//判断是否需要清空缓存
if (App.MainWindows.Count == 1 && Set.LastCacheDate < CoreMODs.Max(x => x.CacheDate))
{//需要清理缓存
Set.LastCacheDate = DateTime.Now;
if (Directory.Exists(GraphCore.CachePath))
{
Directory.Delete(GraphCore.CachePath, true);
Directory.CreateDirectory(GraphCore.CachePath);
}
}
await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载游戏MOD".Translate())); await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载游戏MOD".Translate()));
//当前桌宠动画 //当前桌宠动画
@ -1334,11 +1346,11 @@ namespace VPet_Simulator.Windows
//ClickTexts.Add(new ClickText("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧")); //ClickTexts.Add(new ClickText("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧"));
ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置")); ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置"));
//临时聊天内容 ////临时聊天内容
ClickTexts.Add(new ClickText("主人sbema秋季促销开始了哦还有游戏大奖赛快去给{name}去投一票吧。")); //ClickTexts.Add(new ClickText("主人sbema秋季促销开始了哦还有游戏大奖赛快去给{name}去投一票吧。"));
ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦给人家投一票喵")); //ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦给人家投一票喵"));
ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~")); //ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~"));
ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛快来给桌宠投一票吧")); //ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛快来给桌宠投一票吧"));
//"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(), //"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(),
//"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(), //"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(),
//"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(), //"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(),
@ -1405,7 +1417,7 @@ namespace VPet_Simulator.Windows
{ {
work.MoneyLevel = 0.5; work.MoneyLevel = 0.5;
work.MoneyBase = 8; work.MoneyBase = 8;
if (work.Type == GraphHelper.Work.WorkType.Work) if (work.Type == Work.WorkType.Work)
{ {
work.StrengthDrink = 2.5; work.StrengthDrink = 2.5;
work.StrengthFood = 3.5; work.StrengthFood = 3.5;
@ -1530,9 +1542,9 @@ namespace VPet_Simulator.Windows
await Dispatcher.InvokeAsync(() => LoadingText.Visibility = Visibility.Collapsed); await Dispatcher.InvokeAsync(() => LoadingText.Visibility = Visibility.Collapsed);
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.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(VPet_Simulator.Core.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(VPet_Simulator.Core.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");
@ -1541,8 +1553,8 @@ namespace VPet_Simulator.Windows
else else
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html"); ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.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(VPet_Simulator.Core.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();
@ -1558,23 +1570,23 @@ namespace VPet_Simulator.Windows
// 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(VPet_Simulator.Core.ToolBar.MenuType.Feed, "吃饭".Translate(), () => Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "吃饭".Translate(), () =>
{ {
winBetterBuy.Show(Food.FoodType.Meal); winBetterBuy.Show(Food.FoodType.Meal);
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喝水".Translate(), () => Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "喝水".Translate(), () =>
{ {
winBetterBuy.Show(Food.FoodType.Drink); winBetterBuy.Show(Food.FoodType.Drink);
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "收藏".Translate(), () => Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "收藏".Translate(), () =>
{ {
winBetterBuy.Show(Food.FoodType.Star); winBetterBuy.Show(Food.FoodType.Star);
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "药品".Translate(), () => Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "药品".Translate(), () =>
{ {
winBetterBuy.Show(Food.FoodType.Drug); winBetterBuy.Show(Food.FoodType.Drug);
}); });
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "礼品".Translate(), () => Main.ToolBar.AddMenuButton(ToolBar.MenuType.Feed, "礼品".Translate(), () =>
{ {
winBetterBuy.Show(Food.FoodType.Gift); winBetterBuy.Show(Food.FoodType.Gift);
}); });
@ -1668,7 +1680,7 @@ namespace VPet_Simulator.Windows
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(); return true; }, true)); , DisplayPinch, true));
} }
@ -1683,7 +1695,7 @@ namespace VPet_Simulator.Windows
SetTransparentHitThrough(); SetTransparentHitThrough();
} }
if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 6, 20)) 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")
@ -1700,7 +1712,7 @@ namespace VPet_Simulator.Windows
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 ? Steamworks.SteamClient.Name : Environment.UserName)); "你好".Translate() + (IsSteamUser ? SteamClient.Name : Environment.UserName));
//Thread.Sleep(2000); //Thread.Sleep(2000);
//Main.SayRnd("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议".Translate()); //Main.SayRnd("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议".Translate());
}); });
@ -1752,9 +1764,14 @@ namespace VPet_Simulator.Windows
/// <summary> /// <summary>
/// 显示捏脸情况 /// 显示捏脸情况
/// </summary> /// </summary>
public void DisplayPinch() public bool DisplayPinch()
{ {
if (Core.Graph.FindGraphs("pinch", AnimatType.A_Start, Core.Save.Mode) == null)
{
return false;
}
Main.CountNomal = 0; Main.CountNomal = 0;
if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100) if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
{ {
Core.Save.StrengthChange(-2); Core.Save.StrengthChange(-2);
@ -1765,28 +1782,36 @@ namespace VPet_Simulator.Windows
if (Main.DisplayType.Name == "pinch") if (Main.DisplayType.Name == "pinch")
{ {
if (Main.DisplayType.Animat == AnimatType.A_Start) if (Main.DisplayType.Animat == AnimatType.A_Start)
return; return false;
else if (Main.DisplayType.Animat == AnimatType.B_Loop) else if (Main.DisplayType.Animat == AnimatType.B_Loop)
if (Dispatcher.Invoke(() => Main.PetGrid.Tag) is IGraph ig && ig.GraphInfo.Name == "pinch" && ig.GraphInfo.Animat == AnimatType.B_Loop) if (Dispatcher.Invoke(() => Main.PetGrid.Tag) is IGraph ig && ig.GraphInfo.Name == "pinch" && ig.GraphInfo.Animat == AnimatType.B_Loop)
{ {
ig.IsContinue = true; ig.IsContinue = true;
return; return true;
} }
else if (Dispatcher.Invoke(() => Main.PetGrid2.Tag) is IGraph ig2 && ig2.GraphInfo.Name == "pinch" && ig2.GraphInfo.Animat == AnimatType.B_Loop) else if (Dispatcher.Invoke(() => Main.PetGrid2.Tag) is IGraph ig2 && ig2.GraphInfo.Name == "pinch" && ig2.GraphInfo.Animat == AnimatType.B_Loop)
{ {
ig2.IsContinue = true; ig2.IsContinue = true;
return; return true;
} }
} }
Main_Event_TouchHead(); Main_Event_TouchHead();
Main_Event_TouchBody(); Main_Event_TouchBody();
Main.Display("pinch", AnimatType.A_Start, () => Main.Display("pinch", AnimatType.A_Start, () =>
Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop)); Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop));
return true;
} }
private void DisplayPinch_loop() private void DisplayPinch_loop()
{ {
if (Main.isPress && Main.DisplayType.Name == "pinch" && Main.DisplayType.Animat == AnimatType.B_Loop) if (Main.isPress && Main.DisplayType.Name == "pinch" && Main.DisplayType.Animat == AnimatType.B_Loop)
{ {
if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
{
Core.Save.StrengthChange(-2);
Core.Save.FeelingChange(1);
Core.Save.Mode = Core.Save.CalMode();
Main.LabelDisplayShowChangeNumber(LocalizeCore.Translate("体力-{0:f0} 心情+{1:f0}"), 2, 1);
}
Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop); Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop);
} }
else else

View File

@ -174,6 +174,7 @@ namespace VPet_Simulator.Windows
} }
} }
Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "Loading Translate")).Wait(); Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "Loading Translate")).Wait();
//加载语言 //加载语言
LocalizeCore.StoreTranslation = true; LocalizeCore.StoreTranslation = true;

View File

@ -163,8 +163,8 @@ namespace VPet_Simulator.Windows
//关于ui //关于ui
if (mw.IsSteamUser) if (mw.IsSteamUser)
{ {
runUserName.Text = Steamworks.SteamClient.Name; runUserName.Text = SteamClient.Name;
runActivate.Text = "已通过Steam[{0}]激活服务注册".Translate(Steamworks.SteamClient.SteamId.Value.ToString("x").Substring(6)); runActivate.Text = "已通过Steam[{0}]激活服务注册".Translate(SteamClient.SteamId.Value.ToString("x").Substring(6));
} }
else else
{ {
@ -411,7 +411,7 @@ namespace VPet_Simulator.Windows
ButtonPublish.Text = "更新至Steam".Translate(); ButtonPublish.Text = "更新至Steam".Translate();
ButtonSteam.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker); ButtonSteam.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
} }
if (mod.ItemID != 1 && (mod.AuthorID == Steamworks.SteamClient.SteamId.AccountId || mod.AuthorID == 0)) if (mod.ItemID != 1 && (mod.AuthorID == SteamClient.SteamId.AccountId || mod.AuthorID == 0))
{ {
ButtonPublish.IsEnabled = true; ButtonPublish.IsEnabled = true;
ButtonPublish.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker); ButtonPublish.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
@ -547,14 +547,16 @@ namespace VPet_Simulator.Windows
private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e) private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e)
{ {
if (mod.Name.ToLower() == "core") if (mod.Name == "Core")
{ {
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用".Translate(), "停用失败".Translate()); MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用".Translate(), "停用失败".Translate());
return; return;
} }
else if (CoreMOD.OnModDefList.Contains(mod.Name))
return;
mw.Set.OnModRemove(mod.Name); mw.Set.OnModRemove(mod.Name);
ShowMod(mod.Name); ShowMod(mod.Name);
ButtonRestart.Visibility = System.Windows.Visibility.Visible; ButtonRestart.Visibility = Visibility.Visible;
ShowModList(); ShowModList();
} }
class ProgressClass : IProgress<float> class ProgressClass : IProgress<float>
@ -577,7 +579,7 @@ namespace VPet_Simulator.Windows
MessageBoxX.Show("请先登录Steam后才能上传文件".Translate(), "上传MOD需要Steam登录".Translate(), MessageBoxIcon.Warning); MessageBoxX.Show("请先登录Steam后才能上传文件".Translate(), "上传MOD需要Steam登录".Translate(), MessageBoxIcon.Warning);
return; return;
} }
if (mods.Name.ToLower() == "core") if (CoreMOD.OnModDefList.Contains(mods.Name))
{ {
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称".Translate(), "MOD上传失败".Translate(), MessageBoxIcon.Error); MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称".Translate(), "MOD上传失败".Translate(), MessageBoxIcon.Error);
return; return;
@ -610,7 +612,7 @@ namespace VPet_Simulator.Windows
foreach (string tag in mods.Tag) foreach (string tag in mods.Tag)
result = result.WithTag(tag); result = result.WithTag(tag);
var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload)); var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
mods.AuthorID = Steamworks.SteamClient.SteamId.AccountId; mods.AuthorID = SteamClient.SteamId.AccountId;
mods.WriteFile(); mods.WriteFile();
if (r.Success) if (r.Success)
{ {
@ -630,7 +632,7 @@ namespace VPet_Simulator.Windows
.Translate(mods.Name, r.Result), "MOD上传失败 {0}".Translate(r.Result)); .Translate(mods.Name, r.Result), "MOD上传失败 {0}".Translate(r.Result));
} }
} }
else if (mods.AuthorID == Steamworks.SteamClient.SteamId.AccountId) else if (mods.AuthorID == SteamClient.SteamId.AccountId)
{ {
var item = await Item.GetAsync(mod.ItemID); var item = await Item.GetAsync(mod.ItemID);
Editor result; Editor result;
@ -656,7 +658,7 @@ namespace VPet_Simulator.Windows
var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload)); var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
if (r.Success) if (r.Success)
{ {
mods.AuthorID = Steamworks.SteamClient.SteamId.AccountId; mods.AuthorID = SteamClient.SteamId.AccountId;
mods.ItemID = r.FileId.Value; mods.ItemID = r.FileId.Value;
mods.WriteFile(); mods.WriteFile();
if (MessageBoxX.Show("{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?".Translate(mods.Name) if (MessageBoxX.Show("{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?".Translate(mods.Name)

View File

@ -1,9 +1,17 @@
chcp 65001
mklink /d "%~dp0\bin\x64\Debug\net462\mod" "%~dp0\mod" mklink /d "%~dp0\bin\x64\Debug\net462\mod" "%~dp0\mod"
echo ^"以下是其他相关MOD的自动链接生成, 若提示错误为正常现象,无需理会"
echo "The following is the automatic link generation for other related MODs. If an error is prompted, it is a normal phenomenon and should not be ignored"
mklink /d "%~dp0\bin\x64\Release\net462\mod" "%~dp0\mod" mklink /d "%~dp0\bin\x64\Release\net462\mod" "%~dp0\mod"
mklink /d "%~dp0\mod\0001_ModMaker" "%~dp0\..\..\VPet.ModMaker\0001_ModMaker" mklink /d "%~dp0\mod\0001_ModMaker" "%~dp0\..\..\VPet.ModMaker\0001_ModMaker"
mklink /d "%~dp0\mod\1100_DemoClock" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.DemoClock\1100_DemoClock" mklink /d "%~dp0\mod\1100_DemoClock" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.DemoClock\1100_DemoClock"
mklink /d "%~dp0\mod\1111_ChatGPTPlus" "%~dp0\..\..\VPet.Plugin.ChatGPTPlus\VPet.Plugin.ChatGPTPlus\1111_ChatGPTPlus"
mklink /d "%~dp0\mod\1101_EdgeTTS" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.EdgeTTS\1101_EdgeTTS" mklink /d "%~dp0\mod\1101_EdgeTTS" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.EdgeTTS\1101_EdgeTTS"
mklink /d "%~dp0\mod\1110_ChatGPT" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.ChatGPT\1110_ChatGPT" mklink /d "%~dp0\mod\1110_ChatGPT" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.ChatGPT\1110_ChatGPT"
pause pause

View File

@ -2,6 +2,8 @@ pet#默认虚拟桌宠:|intor#虚拟主播模拟器默认人物形象:|path#vup:
touchhead:|px#159:|py#16:|sw#189:|sh#178:| touchhead:|px#159:|py#16:|sw#189:|sh#178:|
touchbody:|px#166:|py#206:|sw#163:|sh#136:| touchbody:|px#166:|py#206:|sw#163:|sh#136:|
touchraised:|happy_px#0:|happy_py#50:|happy_sw#500:|happy_sh#200:|nomal_px#0:|nomal_py#50:|nomal_sw#500:|nomal_sh#200:|poorcondition_px#0:|poorcondition_py#50:|poorcondition_sw#500:|poorcondition_sh#200:|ill_px#0:|ill_py#200:|ill_sw#500:|ill_sh#300:| touchraised:|happy_px#0:|happy_py#50:|happy_sw#500:|happy_sh#200:|nomal_px#0:|nomal_py#50:|nomal_sw#500:|nomal_sh#200:|poorcondition_px#0:|poorcondition_py#50:|poorcondition_sw#500:|poorcondition_sh#200:|ill_px#0:|ill_py#200:|ill_sw#500:|ill_sh#300:|
pinch:|px#149:|py#128:|sw#56:|sh#59:|
raisepoint:|happy_x#290:|happy_y#128:|nomal_x#290:|nomal_y#128:|poorcondition_x#290:|poorcondition_y#128:|ill_x#225:|ill_y#115:| raisepoint:|happy_x#290:|happy_y#128:|nomal_x#290:|nomal_y#128:|poorcondition_x#290:|poorcondition_y#128:|ill_x#225:|ill_y#115:|
work:|Type#Work:|Name#文案:|MoneyBase#8:|MoneyLevel#0.2:|Graph#workone:|StrengthFood#3.5:|StrengthDrink#2.5:|Feeling#1.5:|Time#60:|FinishBonus#0.1:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| work:|Type#Work:|Name#文案:|MoneyBase#8:|MoneyLevel#0.2:|Graph#workone:|StrengthFood#3.5:|StrengthDrink#2.5:|Feeling#1.5:|Time#60:|FinishBonus#0.1:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|
work:|Type#Work:|Name#清屏:|MoneyBase#16:|MoneyLevel#1.2:|Graph#workclean:|StrengthFood#5:|StrengthDrink#4:|Feeling#2.5:|Time#90:|FinishBonus#0.2:|LevelLimit#10:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| work:|Type#Work:|Name#清屏:|MoneyBase#16:|MoneyLevel#1.2:|Graph#workclean:|StrengthFood#5:|StrengthDrink#4:|Feeling#2.5:|Time#90:|FinishBonus#0.2:|LevelLimit#10:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Some files were not shown because too many files have changed in this diff Show More