Merge branch 'LorisYounger:main' into main

This commit is contained in:
Dragon Taki 2023-12-09 06:32:53 +08:00 committed by GitHub
commit d4b9fb810f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 91 additions and 18 deletions

1
.gitignore vendored
View File

@ -353,3 +353,4 @@ MigrationBackup/
*.rar
*_PDLC_*
*_DLC_*
VPet-Simulator.Windows/mod/1111_ChatGPTPlus

View File

@ -8,7 +8,7 @@
## 11/24 更新 捏脸
捏脸动画为2023年的[steam大奖提名活动](https://store.steampowered.com/news/app/1920960/view/6966567177514898075)奖励, 我们将参加轻松惬意大奖的提名,制作组期待喜欢《虚拟桌宠模拟器》各位主人们可以对我们提出[宝贵的一票](https://store.steampowered.com/news/app/1920960/view/6966567177514898075)。
捏脸动画为2023年的steam大奖提名活动奖励
长按脸部捏脸

View File

@ -9,7 +9,7 @@ The core gameplay revolves taking care of your Pet. However, more automatic acti
## 11/24 Update Pinch Face
Pinch animation for 2023 [steam award](https://store.steampowered.com/news/app/1920960/view/6966567177514898075) Voting Rewards, we participate in the nomination of the relaxation award. The production team is looking forward to the owners who like VPet Simulator to give us [valuable votes](https://store.steampowered.com/news/app/1920960/view/6966567177514898075)
Pinch animation for 2023 steam award Voting Rewards
Long press on the face to pinch the face

View File

@ -9,7 +9,7 @@
本遊戲的核心是桌面寵物,更多自動行為如亂走亂動、發呆、蹲下等,需要掛機才能看見。
## 11/24 更新捏臉
捏臉動畫為2023年的[steam大獎提名活動] https://store.steampowered.com/news/app/1920960/view/6966567177514898075 )獎勵,我們參加輕鬆愜意大獎的提名,製作組期待喜歡《虛擬桌寵模擬器》各位主人們可以對我們提出[寶貴的一票] https://store.steampowered.com/news/app/1920960/view/6966567177514898075 )。
捏臉動畫為2023年的steam大獎提名活動
長按臉部捏臉
![ss33](Tutorial.assets/ss33.gif)

View File

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

View File

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

View File

@ -485,8 +485,7 @@ namespace VPet_Simulator.Core
return;
}
}
m.MoveTimer.Enabled = false;
m.Display(Graph, AnimatType.C_End, m.DisplayToNomal);
StopMoving(m);
return;
}
//不是:继续右边走or停下
@ -504,6 +503,14 @@ namespace VPet_Simulator.Core
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.Display(Graph, AnimatType.C_End, m.DisplayToNomal);
}

View File

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

View File

@ -16,6 +16,11 @@ namespace VPet_Simulator.Windows
{
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>()
{
"Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll",
@ -274,7 +279,7 @@ namespace VPet_Simulator.Windows
}
}
}
catch(Exception e)
catch (Exception e)
{
ErrorMessage = e.Message;
Tag.Add("该模组已损坏");
@ -338,7 +343,7 @@ namespace VPet_Simulator.Windows
}
public static bool IsOnMod(this Setting t, string ModName)
{
if (ModName == "Core")
if (CoreMOD.OnModDefList.Contains(ModName))
return true;
var line = t.FindLine("onmod");
if (line == null)

View File

@ -107,6 +107,37 @@ namespace VPet_Simulator.Windows
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 int PressLength => mw.Set.PressLength;

View File

@ -1346,11 +1346,11 @@ namespace VPet_Simulator.Windows
//ClickTexts.Add(new ClickText("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧"));
ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置"));
//临时聊天内容
ClickTexts.Add(new ClickText("主人sbema秋季促销开始了哦还有游戏大奖赛快去给{name}去投一票吧。"));
ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦给人家投一票喵"));
ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~"));
ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛快来给桌宠投一票吧"));
////临时聊天内容
//ClickTexts.Add(new ClickText("主人sbema秋季促销开始了哦还有游戏大奖赛快去给{name}去投一票吧。"));
//ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦给人家投一票喵"));
//ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~"));
//ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛快来给桌宠投一票吧"));
//"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(),
//"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(),
//"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(),
@ -1695,7 +1695,7 @@ namespace VPet_Simulator.Windows
SetTransparentHitThrough();
}
if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 10, 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);
if (LocalizeCore.CurrentCulture == "zh-Hans")

View File

@ -547,11 +547,13 @@ namespace VPet_Simulator.Windows
private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e)
{
if (mod.Name.ToLower() == "core")
if (mod.Name == "Core")
{
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用".Translate(), "停用失败".Translate());
return;
}
else if (CoreMOD.OnModDefList.Contains(mod.Name))
return;
mw.Set.OnModRemove(mod.Name);
ShowMod(mod.Name);
ButtonRestart.Visibility = Visibility.Visible;
@ -577,7 +579,7 @@ namespace VPet_Simulator.Windows
MessageBoxX.Show("请先登录Steam后才能上传文件".Translate(), "上传MOD需要Steam登录".Translate(), MessageBoxIcon.Warning);
return;
}
if (mods.Name.ToLower() == "core")
if (CoreMOD.OnModDefList.Contains(mods.Name))
{
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称".Translate(), "MOD上传失败".Translate(), MessageBoxIcon.Error);
return;

View File

@ -1,9 +1,17 @@
chcp 65001
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\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\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\1110_ChatGPT" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.ChatGPT\1110_ChatGPT"
pause