mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
点击乱说话功能
This commit is contained in:
parent
f54b12f960
commit
f39108bc00
@ -15,8 +15,9 @@
|
||||
<SolidColorBrush x:Key="Foreground" Color="#FF0286C6" />
|
||||
</ResourceDictionary>
|
||||
</Viewbox.Resources>
|
||||
<Border BorderThickness="4" CornerRadius="5" Background="{DynamicResource Background}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" Height="180" Width="300">
|
||||
<Grid Height="180" Width="300">
|
||||
<Border x:Name="DisplayBorder" BorderThickness="4" CornerRadius="5" Background="{DynamicResource Background}"
|
||||
BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
@ -30,22 +31,26 @@
|
||||
<TextBlock x:Name="tNow" Foreground="{DynamicResource Foreground}" FontSize="36" FontWeight="Bold"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,5,0" Grid.ColumnSpan="2"
|
||||
Text="当前已工作" />
|
||||
<TextBlock x:Name="tNumber" Background="{x:Null}" Text="15.0" Grid.Row="1" FontSize="80" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Foreground}" />
|
||||
<TextBlock x:Name="tNumber" Background="{x:Null}" Text="15.0" Grid.Row="1" FontSize="80"
|
||||
FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource Foreground}" />
|
||||
<TextBlock x:Name="tNumberUnit" Text="分钟" Foreground="{DynamicResource Foreground}" Grid.Row="1"
|
||||
Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,15"
|
||||
FontSize="36" />
|
||||
<ProgressBar x:Name="PBLeft" Grid.Row="2" Grid.ColumnSpan="2" Background="{x:Null}"
|
||||
Foreground="{DynamicResource ButtonBackgroundHover}" Value="20" />
|
||||
<Button x:Name="btnStop" Grid.Row="2" Grid.ColumnSpan="2" Foreground="{DynamicResource ButtonForeground}"
|
||||
Background="{DynamicResource ButtonBackground}" Content="{ll:Str 停止工作}" FontSize="24" Click="btnStop_Click"
|
||||
<Button x:Name="btnStop" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Foreground="{DynamicResource ButtonForeground}" Background="{DynamicResource ButtonBackground}"
|
||||
Content="{ll:Str 停止工作}" FontSize="24" Click="btnStop_Click"
|
||||
pu:ButtonHelper.HoverBackground="{DynamicResource ButtonBackgroundHover}" />
|
||||
<Button HorizontalAlignment="Left" VerticalAlignment="Center" Padding="5,5,8,7"
|
||||
Background="{DynamicResource BorderBrush}" pu:ButtonHelper.CornerRadius="5" Margin="10,0,0,0"
|
||||
</Grid>
|
||||
</Border>
|
||||
<Button HorizontalAlignment="Left" VerticalAlignment="Top" Padding="5,5,8,7"
|
||||
Background="{DynamicResource BorderBrush}" pu:ButtonHelper.CornerRadius="5" Margin="10,10,0,0"
|
||||
Click="SwitchState_Click">
|
||||
<Path Fill="{DynamicResource ButtonForeground}"
|
||||
Data="M3 2.9918C3 2.44405 3.44495 2 3.9934 2H20.0066C20.5552 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918ZM19 11V4H5V11H19ZM19 13H5V20H19V13ZM9 6H15V8H9V6ZM9 15H15V17H9V15Z" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Viewbox>
|
||||
|
@ -86,6 +86,8 @@ namespace VPet_Simulator.Core
|
||||
else
|
||||
tNumberUnit.Text = LocalizeCore.Translate("EXP");
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void ShowTimeSpan(TimeSpan ts)
|
||||
@ -108,6 +110,13 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
public void DisplayUI()
|
||||
{
|
||||
if (DisplayType == 3)
|
||||
{
|
||||
DisplayBorder.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayBorder.Visibility = Visibility.Visible;
|
||||
btnStop.Content = LocalizeCore.Translate("停止") + nowWork.NameTrans;
|
||||
switch (DisplayType)
|
||||
{
|
||||
@ -125,14 +134,14 @@ namespace VPet_Simulator.Core
|
||||
tNow.Text = LocalizeCore.Translate("获得经验值");
|
||||
break;
|
||||
}
|
||||
}
|
||||
M_TimeUIHandle(m);
|
||||
}
|
||||
private void SwitchState_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DisplayType++;
|
||||
if (DisplayType >= 3)
|
||||
if (DisplayType >= 4)
|
||||
DisplayType = 0;
|
||||
|
||||
DisplayUI();
|
||||
}
|
||||
public void Start(Work work)
|
||||
|
@ -60,6 +60,15 @@ namespace VPet_Simulator.Windows.Interface
|
||||
/// </summary>
|
||||
List<LowText> LowDrinkText { get; }
|
||||
/// <summary>
|
||||
/// 点击时会说的话
|
||||
/// </summary>
|
||||
List<ClickText> ClickTexts { get; }
|
||||
/// <summary>
|
||||
/// 获得自动点击的文本
|
||||
/// </summary>
|
||||
/// <returns>说话内容</returns>
|
||||
ClickText GetClickText();
|
||||
/// <summary>
|
||||
/// 图片资源
|
||||
/// </summary>
|
||||
ImageResources ImageSources { get; }
|
||||
|
@ -5,6 +5,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.Main;
|
||||
|
||||
namespace VPet_Simulator.Windows.Interface
|
||||
{
|
||||
@ -13,8 +15,17 @@ namespace VPet_Simulator.Windows.Interface
|
||||
/// </summary>
|
||||
public class ClickText
|
||||
{
|
||||
public ClickText()
|
||||
{
|
||||
|
||||
}
|
||||
public ClickText(string text)
|
||||
{
|
||||
Text = text;
|
||||
}
|
||||
|
||||
[Line(ignoreCase: true)]
|
||||
private int mode { get; set; } = 15;
|
||||
private int mode { get; set; } = 7;
|
||||
/// <summary>
|
||||
/// 需求状态模式
|
||||
/// </summary>
|
||||
@ -86,7 +97,11 @@ namespace VPet_Simulator.Windows.Interface
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)]
|
||||
public int LikeMax = int.MaxValue;
|
||||
|
||||
/// <summary>
|
||||
/// 工作状态
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)]
|
||||
public WorkingState State { get; set; } = WorkingState.Nomal;
|
||||
/// <summary>
|
||||
/// 说话的内容
|
||||
/// </summary>
|
||||
@ -106,6 +121,31 @@ namespace VPet_Simulator.Windows.Interface
|
||||
}
|
||||
return transText;
|
||||
}
|
||||
set
|
||||
{
|
||||
transText = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 检查部分状态是否满足需求
|
||||
/// </summary>之所以不是全部的,是因为挨个取效率太差了
|
||||
public bool CheckState(Main m)
|
||||
{
|
||||
if (m.Core.Save.Likability < LikeMin || m.Core.Save.Likability > LikeMax)
|
||||
return false;
|
||||
if (string.IsNullOrWhiteSpace(Working))
|
||||
{
|
||||
if (State != m.State)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (State != WorkingState.Work)
|
||||
return false;
|
||||
if (m.nowWork.Name != Working)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
if (!IsOnMOD(mw))
|
||||
{
|
||||
//Content = "该模组已停用".Translate();
|
||||
Tag.Add("该模组已停用");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,47 @@ namespace VPet_Simulator.Windows
|
||||
public List<LowText> LowFoodText { get; set; } = new List<LowText>();
|
||||
|
||||
public List<LowText> LowDrinkText { get; set; } = new List<LowText>();
|
||||
|
||||
public List<ClickText> ClickTexts { get; set; } = new List<ClickText>();
|
||||
/// <summary>
|
||||
/// 获得自动点击的文本
|
||||
/// </summary>
|
||||
/// <returns>说话内容</returns>
|
||||
public ClickText GetClickText()
|
||||
{
|
||||
ClickText.DayTime dt;
|
||||
var now = DateTime.Now.Hour;
|
||||
if (now < 6)
|
||||
dt = ClickText.DayTime.Midnight;
|
||||
else if (now < 12)
|
||||
dt = ClickText.DayTime.Morning;
|
||||
else if (now < 18)
|
||||
dt = ClickText.DayTime.Afternoon;
|
||||
else
|
||||
dt = ClickText.DayTime.Night;
|
||||
|
||||
ClickText.ModeType mt;
|
||||
switch (Core.Save.Mode)
|
||||
{
|
||||
case GameSave.ModeType.PoorCondition:
|
||||
mt = ClickText.ModeType.PoorCondition;
|
||||
break;
|
||||
default:
|
||||
case GameSave.ModeType.Nomal:
|
||||
mt = ClickText.ModeType.Nomal;
|
||||
break;
|
||||
case GameSave.ModeType.Happy:
|
||||
mt = ClickText.ModeType.Happy;
|
||||
break;
|
||||
case GameSave.ModeType.Ill:
|
||||
mt = ClickText.ModeType.Ill;
|
||||
break;
|
||||
}
|
||||
var list = ClickTexts.FindAll(x => x.DaiTime.HasFlag(dt) && x.Mode.HasFlag(mt) && x.CheckState(Main));
|
||||
if (list.Count == 0)
|
||||
return null;
|
||||
return list[Function.Rnd.Next(list.Count)];
|
||||
}
|
||||
/// <summary>
|
||||
/// 存档 Hash检查 是否通过
|
||||
/// </summary>
|
||||
|
@ -154,7 +154,6 @@ namespace VPet_Simulator.Windows
|
||||
System.Environment.Exit(0);
|
||||
}
|
||||
|
||||
private List<string> rndtext;
|
||||
public long lastclicktime { get; set; }
|
||||
|
||||
public void LoadLatestSave(string petname)
|
||||
@ -278,25 +277,27 @@ namespace VPet_Simulator.Windows
|
||||
AutoSaveTimer.Interval = Set.AutoSaveInterval * 60000;
|
||||
AutoSaveTimer.Start();
|
||||
}
|
||||
ClickTexts.Add(new ClickText("你知道吗? 鼠标右键可以打开菜单栏"));
|
||||
ClickTexts.Add(new ClickText("你知道吗? 你可以在设置里面修改游戏的缩放比例"));
|
||||
ClickTexts.Add(new ClickText("想要宠物不乱动? 设置里可以设置智能移动或者关闭移动"));
|
||||
ClickTexts.Add(new ClickText("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧"));
|
||||
ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置"));
|
||||
ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置"));
|
||||
//"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(),
|
||||
//"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(),
|
||||
//"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(),
|
||||
//"你添加了虚拟主播模拟器和虚拟桌宠模拟器到愿望单了吗? 快去加吧".Translate(),
|
||||
//"这游戏开发这么慢,都怪画师太咕了".Translate(),
|
||||
//"欢迎加入 虚拟主播模拟器群 430081239".Translate()
|
||||
|
||||
rndtext = new List<string>
|
||||
{
|
||||
"你知道吗? 鼠标右键可以打开菜单栏".Translate(),
|
||||
"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(),
|
||||
"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(),
|
||||
"想要宠物不乱动? 设置里可以设置智能移动或者关闭移动".Translate(),
|
||||
"有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧".Translate(),
|
||||
"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(),
|
||||
"你添加了虚拟主播模拟器和虚拟桌宠模拟器到愿望单了吗? 快去加吧".Translate(),
|
||||
"这游戏开发这么慢,都怪画师太咕了".Translate(),
|
||||
"长按脑袋拖动桌宠到你喜欢的任意位置".Translate(),
|
||||
"欢迎加入 虚拟主播模拟器群 430081239".Translate()
|
||||
};
|
||||
await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载Steam内容".Translate()));
|
||||
//给正在玩这个游戏的主播/游戏up主做个小功能
|
||||
if (IsSteamUser)
|
||||
{
|
||||
rndtext.Add("关注 {0} 谢谢喵".Translate(SteamClient.Name));
|
||||
ClickTexts.Add(new ClickText("关注 {0} 谢谢喵")
|
||||
{
|
||||
TranslateText = "关注 {0} 谢谢喵".Translate(SteamClient.Name)
|
||||
});
|
||||
//Steam成就
|
||||
Set.Statistics.StatisticChanged += Statistics_StatisticChanged;
|
||||
//Steam通知
|
||||
@ -306,7 +307,10 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
rndtext.Add("关注 {0} 谢谢喵".Translate(Environment.UserName));
|
||||
ClickTexts.Add(new ClickText("关注 {0} 谢谢喵")
|
||||
{
|
||||
TranslateText = "关注 {0} 谢谢喵".Translate(Environment.UserName)
|
||||
});
|
||||
}
|
||||
|
||||
//音乐识别timer加载
|
||||
@ -380,7 +384,9 @@ namespace VPet_Simulator.Windows
|
||||
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
|
||||
{
|
||||
lastclicktime = DateTime.Now.Ticks;
|
||||
Main.SayRnd(rndtext[Function.Rnd.Next(rndtext.Count)]);
|
||||
var rt = GetClickText();
|
||||
if (rt != null)
|
||||
Main.SayRnd(rt.TranslateText);
|
||||
}
|
||||
};
|
||||
Main.PlayVoiceVolume = Set.VoiceVolume;
|
||||
|
@ -786,7 +786,10 @@ namespace VPet_Simulator.Windows
|
||||
ButtonRestartGraph.Visibility = Visibility.Visible;
|
||||
|
||||
if (ischangename)
|
||||
{
|
||||
mw.Core.Save.Name = petloader.PetName.Translate();
|
||||
TextBoxPetName.Text = mw.Core.Save.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void TextBoxPetName_TextChanged(object sender, TextChangedEventArgs e)
|
||||
@ -1070,7 +1073,10 @@ namespace VPet_Simulator.Windows
|
||||
LocalizeCore.LoadCulture((string)LanguageBox.SelectedItem);
|
||||
mw.Set.Language = LocalizeCore.CurrentCulture;
|
||||
if (ischangename)
|
||||
{
|
||||
mw.Core.Save.Name = petloader.PetName.Translate();
|
||||
TextBoxPetName.Text = mw.Core.Save.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void MainTab_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
@ -27,3 +27,4 @@ Happyly#Happily:|
|
||||
Nomally#Nomally:|
|
||||
PoorConditionly#Sadly:|
|
||||
Illly#Sickly:|
|
||||
plugin#Code Plugin:|
|
@ -27,3 +27,4 @@ Happyly#高兴地:|
|
||||
Nomally#普通地:|
|
||||
PoorConditionly#悲伤地:|
|
||||
Illly#生病地:|
|
||||
plugin#代码插件:|
|
@ -27,3 +27,4 @@ Happyly#高興地:|
|
||||
Nomally#普通地:|
|
||||
PoorConditionly#悲傷地:|
|
||||
Illly#生病地:|
|
||||
plugin#代碼外掛:|
|
Loading…
Reference in New Issue
Block a user