支持外置消息窗/时钟等窗口

This commit is contained in:
ZouJin 2023-05-31 02:51:17 +10:00
parent 685f369054
commit 689f655403
118 changed files with 67 additions and 12 deletions

View File

@ -8,11 +8,10 @@
x:FieldModifier="public" MouseLeftButtonUp="MainGrid_MouseLeftButtonUp"
MouseRightButtonDown="MainGrid_MouseRightButtonDown" MouseMove="MainGrid_MouseWave">
<MediaElement x:Name="VoicePlayer" LoadedBehavior="Manual" UnloadedBehavior="Stop" />
<Grid x:Name="UIGrid_Back" x:FieldModifier="public" Height="500" 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" />
<Border x:Name="PetGrid2" Height="500" VerticalAlignment="Top" Width="500" />
<Grid x:Name="UIGrid" x:FieldModifier="public" Height="500" VerticalAlignment="Top" Width="500" />
<Grid x:Name="UIGrid_Botton" x:FieldModifier="public" Width="500" VerticalAlignment="Top" Margin="0,500,0,0" />
<Grid x:Name="UIGrid" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
</Grid>
</Viewbox>
</pu:ContentControlX>

View File

@ -68,7 +68,16 @@ namespace VPet_Simulator.Core
{
if (Function.Rnd.Next(lowstrengthAskCount--) == 0)
{
Say("肚子饿了,想吃东西", GraphCore.Helper.SayType.Serious);//TODO:饥饿动画//TODO:不同的饥饿说话方式
Display(GraphCore.GraphType.Switch_Thirsty, () => Say("肚子饿了,想吃东西", GraphCore.Helper.SayType.Serious));//TODO:不同的饥饿说话方式
lowstrengthAskCount = 15;
}
}
private void lowStrengthDrink()//未来的Display
{
if (Function.Rnd.Next(lowstrengthAskCount--) == 0)
{
Display(GraphCore.GraphType.Switch_Thirsty, () => Say("渴了,想喝东西", GraphCore.Helper.SayType.Serious));//TODO:不同的饥饿说话方式
lowstrengthAskCount = 15;
}
@ -216,6 +225,7 @@ namespace VPet_Simulator.Core
if (Core.Save.StrengthDrink <= 25)
{
Core.Save.Health -= Function.Rnd.Next(0, 1) * TimePass;
lowStrengthDrink();
}
else if (Core.Save.StrengthDrink >= 75)
Core.Save.Health += Function.Rnd.Next(0, 1) * TimePass;

View File

@ -7,7 +7,7 @@
<UserControl.Resources>
<ResourceDictionary Source="Theme.xaml" />
</UserControl.Resources>
<Border Background="{DynamicResource Primary}" BorderBrush="{DynamicResource DARKPrimaryDark}" BorderThickness="5"
<Border x:Name="BorderMain" Background="{DynamicResource Primary}" BorderBrush="{DynamicResource DARKPrimaryDark}" BorderThickness="5"
VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5" MouseEnter="Border_MouseEnter"
MouseLeave="Border_MouseLeave">
<StackPanel>

View File

@ -147,5 +147,17 @@ namespace VPet_Simulator.Core
ShowTimer.Dispose();
CloseTimer.Dispose();
}
public void SetPlaceIN()
{
this.Height = 500;
BorderMain.VerticalAlignment = VerticalAlignment.Bottom;
Margin = new Thickness(0);
}
public void SetPlaceOUT()
{
this.Height = double.NaN;
BorderMain.VerticalAlignment = VerticalAlignment.Top;
Margin = new Thickness(0, 500, 0, 0);
}
}
}

View File

@ -3,7 +3,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet_Simulator.Core"
mc:Ignorable="d" xmlns:pu="https://opensource.panuon.com/wpf-ui" MouseEnter="UserControl_MouseEnter"
MouseLeave="UserControl_MouseLeave" Height="500" Width="500">
MouseLeave="UserControl_MouseLeave" Height="500" Width="500" VerticalAlignment="Top">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

View File

@ -312,6 +312,10 @@ namespace VPet_Simulator.Core
/// 直播 (结束)
/// </summary>
WorkTWO_C_End,
/// <summary>
/// 口渴
/// </summary>
Switch_Thirsty,
}
/// <summary>

View File

@ -63,6 +63,6 @@ namespace VPet_Simulator.Core
/// <summary>
/// 互动周期
/// </summary>
int InteractionCycle { get; }
int InteractionCycle { get; }
}
}

View File

@ -87,7 +87,7 @@ namespace VPet_Simulator.Core
}
}
#if DEBUG
throw new Exception("未知的图像类型: " + path_name);
//throw new Exception("未知的图像类型: " + path_name);
#endif
}
else if (File.Exists(di.FullName + @"\info.lps"))

View File

@ -237,6 +237,14 @@ namespace VPet_Simulator.Windows.Interface
set => this["gameconfig"].SetInt("smartmoveinterval", value);
}
/// <summary>
/// 消息框外置
/// </summary>
public bool MessageBarOutside
{
get => this["gameconfig"].GetBool("msgbarout");
set => this["gameconfig"].SetBool("msgbarout", value);
}
/// <summary>
/// 开机启动
/// </summary>
public bool StartUPBoot

View File

@ -34,7 +34,7 @@ namespace VPet_Simulator.Windows
/// <summary>
/// 版本号
/// </summary>
public int verison { get; } = 10;
public int verison { get; } = 40;
/// <summary>
/// 版本号
/// </summary>

View File

@ -268,6 +268,9 @@ namespace VPet_Simulator.Windows
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
if (Set.MessageBarOutside)
Main.MsgBar.SetPlaceOUT();
//加载图标
notifyIcon = new NotifyIcon();
notifyIcon.Text = "虚拟桌宠模拟器";

View File

@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500">
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500" VerticalAlignment="Top">
<Border Background="{DynamicResource PrimaryLighter}" BorderBrush="{DynamicResource Primary}" BorderThickness="5"
VerticalAlignment="Top" Margin="5,50,5,5" CornerRadius="5" Padding="5">
<Grid>

View File

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500">
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500" VerticalAlignment="Top">
<Border Background="{DynamicResource SecondaryLighter}" BorderBrush="{DynamicResource Secondary}"
BorderThickness="5" VerticalAlignment="Top" Margin="5,50,5,5" CornerRadius="5" Padding="5">
<Grid>

View File

@ -115,6 +115,13 @@
BorderThickness="2" Click="BtnStartUpGet_Click" />
</Grid>
<TextBlock Grid.Row="6" Text="消息框" VerticalAlignment="Center" />
<pu:Switch x:Name="SwitchMsgOut" Grid.Column="2" Grid.Row="6" BorderBrush="{DynamicResource PrimaryDark}"
CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}"
Background="Transparent" BoxWidth="35" BoxHeight="18" ToggleSize="14"
ToggleShadowColor="{x:Null}" ToggleBrush="{DynamicResource PrimaryDark}"
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="SwitchMsgOut_Checked"
Unchecked="TopMostBox_Unchecked" ToolTip="将消息框置于外部" Content="将消息框置于外部"/>
<TextBlock Grid.Row="7" Text="开机启动" VerticalAlignment="Center" />
<Grid Grid.Row="7" Grid.Column="2">
<Grid.ColumnDefinitions>
@ -126,7 +133,7 @@
CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35"
BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}"
ToggleBrush="{DynamicResource PrimaryDark}" Content="开机启动"
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" ToolTip="该游戏随着开机启动该程序"
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" ToolTip="该游戏随着开机启动该程序&#13;如需卸载游戏,请关闭该选项"
Checked="StartUpBox_Checked" Unchecked="StartUpBox_Checked" />
<pu:Switch x:Name="StartUpSteamBox" BorderBrush="{DynamicResource PrimaryDark}"
CheckedBackground="{DynamicResource Primary}"

View File

@ -62,6 +62,7 @@ namespace VPet_Simulator.Windows
MoveEventBox.IsChecked = mw.Set.AllowMove;
SmartMoveEventBox.IsChecked = mw.Set.SmartMove;
PressLengthSlider.Value = mw.Set.PressLength / 1000.0;
SwitchMsgOut.IsChecked = mw.Set.MessageBarOutside;
StartUpBox.IsChecked = mw.Set.StartUPBoot;
StartUpSteamBox.IsChecked = mw.Set.StartUPBootSteam;
@ -797,5 +798,16 @@ namespace VPet_Simulator.Windows
MessageBoxX.Show("由于没做完,暂不支持数据计算\n敬请期待后续更新", "没做完!", MessageBoxButton.OK, MessageBoxIcon.Warning);
mw.Set.EnableFunction = CalFunctionBox.IsChecked.Value;
}
private void SwitchMsgOut_Checked(object sender, RoutedEventArgs e)
{
if (!AllowChange)
return;
mw.Set.MessageBarOutside = SwitchMsgOut.IsChecked.Value;
if (SwitchMsgOut.IsChecked.Value)
mw.Main.MsgBar.SetPlaceOUT();
else
mw.Main.MsgBar.SetPlaceIN();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

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