工作累计显示框
@ -33,10 +33,14 @@ namespace VPet_Simulator.Core
|
||||
/// </summary>
|
||||
public ToolBar ToolBar;
|
||||
/// <summary>
|
||||
/// 菜单栏
|
||||
/// 消息栏
|
||||
/// </summary>
|
||||
public MessageBar MsgBar;
|
||||
/// <summary>
|
||||
/// 工作显示栏
|
||||
/// </summary>
|
||||
public WorkTimer WorkTimer;
|
||||
/// <summary>
|
||||
/// 刷新时间时会调用该方法
|
||||
/// </summary>
|
||||
public event Action<Main> TimeHandle;
|
||||
@ -53,7 +57,9 @@ namespace VPet_Simulator.Core
|
||||
Console.WriteLine(DateTime.Now.ToString("T:fff"));
|
||||
InitializeComponent();
|
||||
Core = core;
|
||||
|
||||
WorkTimer = new WorkTimer(this);
|
||||
WorkTimer.Visibility = Visibility.Collapsed;
|
||||
UIGrid.Children.Add(WorkTimer);
|
||||
ToolBar = new ToolBar(this);
|
||||
ToolBar.Visibility = Visibility.Collapsed;
|
||||
ToolBar.MenuWork1.Header = core.Graph.GraphConfig.Str[(gstr)"work1"];
|
||||
@ -63,6 +69,9 @@ namespace VPet_Simulator.Core
|
||||
MsgBar.Visibility = Visibility.Collapsed;
|
||||
UIGrid.Children.Add(MsgBar);
|
||||
|
||||
|
||||
|
||||
|
||||
if (loadtouchevent)
|
||||
{
|
||||
LoadTouchEvent();
|
||||
@ -221,7 +230,7 @@ namespace VPet_Simulator.Core
|
||||
private bool? wavetop = null;
|
||||
private DateTime wavespan;
|
||||
private void MainGrid_MouseWave(object sender, MouseEventArgs e)
|
||||
{
|
||||
{
|
||||
if (rasetype >= 0 || State != WorkingState.Nomal)
|
||||
return;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
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: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">
|
||||
mc:Ignorable="d" xmlns:pu="https://opensource.panuon.com/wpf-ui" MouseEnter="UserControl_MouseEnter"
|
||||
MouseLeave="UserControl_MouseLeave" Height="500" Width="500">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@ -14,9 +14,9 @@
|
||||
</UserControl.Resources>
|
||||
<Grid x:Name="MainGrid" x:FieldModifier="public">
|
||||
<Border x:Name="BdrPanel" VerticalAlignment="Bottom" Margin="0,0,0,55" TextBlock.FontSize="24"
|
||||
TextElement.FontSize="24" BorderBrush="{DynamicResource DARKPrimaryDarker}"
|
||||
BorderThickness="1" Background="{DynamicResource DARKPrimaryText}" CornerRadius="5"
|
||||
MouseLeave="MenuPanel_MouseLeave" Visibility="Collapsed" x:FieldModifier="public">
|
||||
TextElement.FontSize="24" BorderBrush="{DynamicResource DARKPrimaryDarker}" BorderThickness="1"
|
||||
Background="{DynamicResource DARKPrimaryText}" CornerRadius="5" MouseLeave="MenuPanel_MouseLeave"
|
||||
Visibility="Collapsed" x:FieldModifier="public">
|
||||
<Grid Margin="15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@ -38,7 +38,8 @@
|
||||
<TextBlock x:Name="Tlv" Text="Lv 14" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource DARKPrimary}" Grid.ColumnSpan="3" />
|
||||
<Button Grid.Column="4" VerticalAlignment="Center" Background="Transparent"
|
||||
Foreground="{DynamicResource DARKPrimary}" Content="详细" Cursor="Hand" Click="MenuPanel_Click" IsEnabled="False">
|
||||
Foreground="{DynamicResource DARKPrimary}" Content="详细" Cursor="Hand" Click="MenuPanel_Click"
|
||||
IsEnabled="False">
|
||||
<Button.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" TextDecorations="Underline" />
|
||||
@ -103,15 +104,17 @@
|
||||
<MenuItem x:Name="MenuFeed" Header="投喂" HorizontalContentAlignment="Center" Width="99" Padding="0">
|
||||
<MenuItem Header="食物" HorizontalContentAlignment="Center" IsEnabled="False" />
|
||||
<MenuItem Header="饮料" HorizontalContentAlignment="Center" IsEnabled="False" />
|
||||
<MenuItem Header="药品" HorizontalContentAlignment="Center" IsEnabled="False"/>
|
||||
<MenuItem Header="药品" HorizontalContentAlignment="Center" IsEnabled="False" />
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MenuPanel" Header="面板" MouseEnter="MenuPanel_MouseEnter" MouseLeave="MenuPanel_MouseLeave"
|
||||
HorizontalContentAlignment="Center" Width="99" Padding="0" />
|
||||
<MenuItem x:Name="MenuInteract" Header="互动" HorizontalContentAlignment="Center" Width="99" Padding="0">
|
||||
<MenuItem Header="睡觉" HorizontalContentAlignment="Center" Click="Sleep_Click" />
|
||||
<MenuItem Header="学习" HorizontalContentAlignment="Center" Click="Study_Click" />
|
||||
<MenuItem x:Name="MenuWork1" Header="工作1" HorizontalContentAlignment="Center" Click="Work1_Click" />
|
||||
<MenuItem x:Name="MenuWork2" Header="工作2" HorizontalContentAlignment="Center" Click="Work2_Click" />
|
||||
<MenuItem x:Name="MenuWork1" Header="工作1" HorizontalContentAlignment="Center" Click="Work1_Click"
|
||||
ToolTip="工作" />
|
||||
<MenuItem x:Name="MenuWork2" Header="工作2" HorizontalContentAlignment="Center" Click="Work2_Click"
|
||||
ToolTip="工作" />
|
||||
<MenuItem Header="说话" HorizontalContentAlignment="Center" IsEnabled="False" />
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MenuDIY" Header="自定" HorizontalContentAlignment="Center" Click="MenuDIY_Click"
|
||||
|
@ -263,8 +263,12 @@ namespace VPet_Simulator.Core
|
||||
if (m.Core.Save.Mode != GameSave.ModeType.Ill)
|
||||
if (m.State == Main.WorkingState.Sleep)
|
||||
m.Display(GraphCore.GraphType.Sleep_C_End, m.DisplayNomal);
|
||||
else
|
||||
else if (m.State == Main.WorkingState.Nomal)
|
||||
m.DisplaySleep(true);
|
||||
else
|
||||
{
|
||||
m.WorkTimer.Stop(() => m.DisplaySleep(true));
|
||||
}
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
@ -272,8 +276,8 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (m.Core.Save.Mode != GameSave.ModeType.Ill)
|
||||
if (m.State == Main.WorkingState.Study)
|
||||
m.Display(GraphCore.GraphType.Study_C_End, m.DisplayNomal);
|
||||
else m.DisplayStudy();
|
||||
m.WorkTimer.Stop();
|
||||
else m.WorkTimer.Start(Main.WorkingState.Study);
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
@ -281,10 +285,8 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (m.Core.Save.Mode != GameSave.ModeType.Ill)
|
||||
if (m.State == Main.WorkingState.WorkONE)
|
||||
{
|
||||
m.Display(GraphCore.GraphType.WorkONE_C_End, m.DisplayNomal);
|
||||
}
|
||||
else m.DisplayWorkONE();
|
||||
m.WorkTimer.Stop();
|
||||
else m.WorkTimer.Start(Main.WorkingState.WorkONE);
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
@ -292,8 +294,8 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (m.Core.Save.Mode != GameSave.ModeType.Ill)
|
||||
if (m.State == Main.WorkingState.WorkTWO)
|
||||
m.Display(GraphCore.GraphType.WorkTWO_C_End, m.DisplayNomal);
|
||||
else m.DisplayWorkTWO();
|
||||
m.WorkTimer.Stop();
|
||||
else m.WorkTimer.Start(Main.WorkingState.WorkTWO);
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +1,50 @@
|
||||
<Border x:Class="VPet_Simulator.Core.WorkTimer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
<Viewbox x:Class="VPet_Simulator.Core.WorkTimer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Opacity=".8"
|
||||
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"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui" mc:Ignorable="d" Height="200" Width="300" BorderThickness="4"
|
||||
CornerRadius="5" Background="{DynamicResource Background}" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border.Resources>
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui" mc:Ignorable="d" Height="180" Width="300"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Viewbox.Resources>
|
||||
<ResourceDictionary>
|
||||
<SolidColorBrush x:Key="BorderBrush" Color="#FF0290D5" />
|
||||
<SolidColorBrush x:Key="Background" Color="#FF81d4fa" />
|
||||
<SolidColorBrush x:Key="ButtonBackground" Color="#FF0286C6" />
|
||||
<SolidColorBrush x:Key="ButtonBackground" Color="#AA0286C6" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundHover" Color="#FF0286C6" />
|
||||
<SolidColorBrush x:Key="ButtonForeground" Color="#FFffffff" />
|
||||
<SolidColorBrush x:Key="Foreground" Color="#FF0286C6" />
|
||||
</ResourceDictionary>
|
||||
</Border.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="4*" />
|
||||
<RowDefinition Height="1*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Foreground="{DynamicResource Foreground}" FontSize="36" FontWeight="Bold" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" Margin="5,0,5,0" Grid.ColumnSpan="2">
|
||||
<Run>当前已</Run><Run x:Name="rString">工作</Run>
|
||||
</TextBlock>
|
||||
<TextBlock Background="{x:Null}" Text="15.0" Grid.Row="1" FontSize="80" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Foreground}" />
|
||||
<TextBlock Text="分钟" Foreground="{DynamicResource Foreground}" Grid.Row="1" Grid.Column="1"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,15" FontSize="36" />
|
||||
<Button Grid.Row="2" Grid.ColumnSpan="2" Foreground="{DynamicResource ButtonForeground}"
|
||||
Background="{DynamicResource ButtonBackground}" Content="停止工作" FontSize="16" />
|
||||
<Button HorizontalAlignment="Left" VerticalAlignment="Center" Padding="5,5,8,7"
|
||||
Background="{DynamicResource ButtonBackground}" pu:ButtonHelper.CornerRadius="5" Margin="10,0,0,0">
|
||||
<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.Resources>
|
||||
<Border BorderThickness="4" CornerRadius="5" Background="{DynamicResource Background}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" Height="180" Width="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="4*" />
|
||||
<RowDefinition Height="1*" />
|
||||
</Grid.RowDefinitions>
|
||||
<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="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="停止工作" FontSize="16" 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"
|
||||
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>
|
||||
|
@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -18,11 +20,241 @@ namespace VPet_Simulator.Core
|
||||
/// <summary>
|
||||
/// WorkTimer.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WorkTimer : Border
|
||||
public partial class WorkTimer : Viewbox
|
||||
{
|
||||
public WorkTimer()
|
||||
Main m;
|
||||
public WorkTimer(Main m)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.m = m;
|
||||
//数据相关计算挪到MainLogic
|
||||
//这里只显示UI
|
||||
m.TimeUIHandle += M_TimeUIHandle;
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示模式
|
||||
/// 0 = 默认
|
||||
/// 1 = 剩余时间
|
||||
/// 2 = 已获取(金钱/等级)
|
||||
/// </summary>
|
||||
public int DisplayType = 0;
|
||||
/// <summary>
|
||||
/// 累计获得的钱/经验值
|
||||
/// </summary>
|
||||
public int GetCount;
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime StartTime;
|
||||
/// <summary>
|
||||
/// 最大时间(分钟)
|
||||
/// </summary>
|
||||
public int MaxTime;
|
||||
/// <summary>
|
||||
/// UI相关显示
|
||||
/// </summary>
|
||||
/// <param name="m"></param>
|
||||
private void M_TimeUIHandle(Main m)
|
||||
{
|
||||
if (Visibility == Visibility.Hidden) return;
|
||||
TimeSpan ts = DateTime.Now - StartTime;
|
||||
TimeSpan tleft;
|
||||
if (ts.TotalMinutes > MaxTime)//基本上不可能,加个这个作为容错
|
||||
{
|
||||
ts = TimeSpan.FromMinutes(MaxTime);
|
||||
tleft = TimeSpan.Zero;
|
||||
PBLeft.Value = MaxTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
tleft = TimeSpan.FromMinutes(MaxTime) - ts;
|
||||
PBLeft.Value = ts.TotalMinutes;
|
||||
}
|
||||
switch (DisplayType)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
ShowTimeSpan(ts); break;
|
||||
case 1:
|
||||
ShowTimeSpan(tleft); break;
|
||||
case 2:
|
||||
tNumber.Text = GetCount.ToString();
|
||||
switch (m.State)
|
||||
{
|
||||
case Main.WorkingState.Study:
|
||||
tNumberUnit.Text = "EXP";
|
||||
break;
|
||||
case Main.WorkingState.WorkONE:
|
||||
case Main.WorkingState.WorkTWO:
|
||||
tNumberUnit.Text = "金钱";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void ShowTimeSpan(TimeSpan ts)
|
||||
{
|
||||
if (ts.TotalSeconds < 90)
|
||||
{
|
||||
tNumber.Text = ts.TotalSeconds.ToString("f1");
|
||||
tNumberUnit.Text = "秒";
|
||||
}
|
||||
else if (ts.TotalMinutes < 90)
|
||||
{
|
||||
tNumber.Text = ts.TotalMinutes.ToString("f1");
|
||||
tNumberUnit.Text = "分钟";
|
||||
}
|
||||
else
|
||||
{
|
||||
tNumber.Text = ts.TotalHours.ToString("f1");
|
||||
tNumberUnit.Text = "小时";
|
||||
}
|
||||
}
|
||||
public void DisplayUI()
|
||||
{
|
||||
switch (m.State)
|
||||
{
|
||||
case Main.WorkingState.Study:
|
||||
btnStop.Content = "停止学习";
|
||||
switch (DisplayType)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
tNow.Text = "当前已学习";
|
||||
break;
|
||||
case 1:
|
||||
tNow.Text = "剩余学习时间";
|
||||
break;
|
||||
case 2:
|
||||
tNow.Text = "获得经验值";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Main.WorkingState.WorkONE:
|
||||
workdisplay(m.Core.Graph.GraphConfig.Str[(gstr)"work1"]);
|
||||
break;
|
||||
case Main.WorkingState.WorkTWO:
|
||||
workdisplay(m.Core.Graph.GraphConfig.Str[(gstr)"work2"]);
|
||||
break;
|
||||
}
|
||||
M_TimeUIHandle(m);
|
||||
}
|
||||
private void workdisplay(string workname)
|
||||
{
|
||||
btnStop.Content = "停止" + workname;
|
||||
switch (DisplayType)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
tNow.Text = "当前已" + workname;
|
||||
break;
|
||||
case 1:
|
||||
tNow.Text = $"剩余{workname}时间";
|
||||
break;
|
||||
case 2:
|
||||
tNow.Text = "累计金钱收益";
|
||||
break;
|
||||
}
|
||||
}
|
||||
private void SwitchState_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DisplayType++;
|
||||
if (DisplayType >= 3)
|
||||
DisplayType = 0;
|
||||
|
||||
DisplayUI();
|
||||
}
|
||||
public void Start(Main.WorkingState state)
|
||||
{
|
||||
//if (state == Main.WorkingState.Nomal)
|
||||
// return;
|
||||
Visibility = Visibility.Visible;
|
||||
m.State = state;
|
||||
StartTime = DateTime.Now;
|
||||
GetCount = 0;
|
||||
new UIStyleConfig().SetStyle(this);
|
||||
switch (state)
|
||||
{
|
||||
case Main.WorkingState.Study:
|
||||
m.Core.Graph.GraphConfig.UIStyleStudy.SetStyle(this);
|
||||
MaxTime = 45;
|
||||
m.DisplayStudy();
|
||||
break;
|
||||
case Main.WorkingState.WorkONE:
|
||||
m.Core.Graph.GraphConfig.UIStyleWork1.SetStyle(this);
|
||||
MaxTime = 60;
|
||||
m.DisplayWorkONE();
|
||||
break;
|
||||
case Main.WorkingState.WorkTWO:
|
||||
m.Core.Graph.GraphConfig.UIStyleWork2.SetStyle(this);
|
||||
MaxTime = 180;
|
||||
m.DisplayWorkTWO();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
PBLeft.Maximum = MaxTime;
|
||||
DisplayUI();
|
||||
}
|
||||
public void Stop(Action @then = null)
|
||||
{
|
||||
Visibility = Visibility.Collapsed;
|
||||
switch (m.State)
|
||||
{
|
||||
case Main.WorkingState.Study:
|
||||
m.State = Main.WorkingState.Nomal;
|
||||
m.Display(GraphCore.GraphType.Study_C_End, then ?? m.DisplayNomal);
|
||||
return;
|
||||
case Main.WorkingState.WorkONE:
|
||||
m.State = Main.WorkingState.Nomal;
|
||||
m.Display(GraphCore.GraphType.WorkONE_C_End, then ?? m.DisplayNomal);
|
||||
return;
|
||||
case Main.WorkingState.WorkTWO:
|
||||
m.State = Main.WorkingState.Nomal;
|
||||
m.Display(GraphCore.GraphType.WorkTWO_C_End, then ?? m.DisplayNomal);
|
||||
break;
|
||||
default:
|
||||
then?.Invoke();
|
||||
return;
|
||||
}
|
||||
}
|
||||
private void btnStop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
public class UIStyleConfig
|
||||
{
|
||||
[Line]
|
||||
public string BorderBrush = "0290D5";
|
||||
[Line]
|
||||
public string Background = "81d4fa";
|
||||
[Line]
|
||||
public string ButtonBackground = "0286C6";
|
||||
[Line]
|
||||
public string ButtonForeground = "ffffff";
|
||||
[Line]
|
||||
public string Foreground = "0286C6";
|
||||
[Line]
|
||||
public double Left = 100;
|
||||
[Line]
|
||||
public double Top = 160;
|
||||
[Line]
|
||||
public double Width = 300;
|
||||
|
||||
public void SetStyle(WorkTimer wt)
|
||||
{
|
||||
wt.Margin = new Thickness(Left, Top, 0, 0);
|
||||
wt.Width = Width;
|
||||
wt.Height = Width / 300 * 180;
|
||||
wt.Resources.Clear();
|
||||
wt.Resources.Add("BorderBrush", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + BorderBrush)));
|
||||
wt.Resources.Add("Background", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + Background)));
|
||||
wt.Resources.Add("ButtonBackground", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#AA" + ButtonBackground)));
|
||||
wt.Resources.Add("ButtonBackgroundHover", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + ButtonBackground)));
|
||||
wt.Resources.Add("ButtonForeground", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + ButtonForeground)));
|
||||
wt.Resources.Add("Foreground", new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + Foreground)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -395,6 +396,9 @@ namespace VPet_Simulator.Core
|
||||
RndGraph.Add(list.Count, index);
|
||||
return list[index];
|
||||
}
|
||||
else
|
||||
return list[Function.Rnd.Next(list.Count)];
|
||||
|
||||
}
|
||||
if (mode != GameSave.ModeType.Ill)
|
||||
{
|
||||
@ -491,6 +495,10 @@ namespace VPet_Simulator.Core
|
||||
public double LocateClimbTop;
|
||||
public List<string> StoreRnd = new List<string>();
|
||||
public ILine Str;
|
||||
public WorkTimer.UIStyleConfig UIStyleWork1;
|
||||
public WorkTimer.UIStyleConfig UIStyleWork2;
|
||||
public WorkTimer.UIStyleConfig UIStyleStudy;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化设置
|
||||
/// </summary>
|
||||
@ -525,6 +533,12 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
StoreRnd.Add(sub.Name);
|
||||
}
|
||||
var line = lps.FindLine("UIStyleConfig", "work1");
|
||||
UIStyleWork1 = line == null ? new WorkTimer.UIStyleConfig() : LPSConvert.DeserializeObject<WorkTimer.UIStyleConfig>(line);
|
||||
line = lps.FindLine("UIStyleConfig", "work2");
|
||||
UIStyleWork2 = line == null ? new WorkTimer.UIStyleConfig() : LPSConvert.DeserializeObject<WorkTimer.UIStyleConfig>(line);
|
||||
line = lps.FindLine("UIStyleConfig", "study");
|
||||
UIStyleStudy = line == null ? new WorkTimer.UIStyleConfig() : LPSConvert.DeserializeObject<WorkTimer.UIStyleConfig>(line);
|
||||
Str = lps["str"];
|
||||
}
|
||||
/// <summary>
|
||||
@ -573,7 +587,7 @@ namespace VPet_Simulator.Core
|
||||
if (!StoreRnd.Contains(sub.Name))
|
||||
StoreRnd.Add(sub.Name);
|
||||
}
|
||||
foreach(Sub sub in lps["str"])
|
||||
foreach (Sub sub in lps["str"])
|
||||
{
|
||||
if (!Str.Contains(sub.Name))
|
||||
Str.Add(sub);
|
||||
|
@ -5,4 +5,8 @@ raisepoint:|happy_x#290:|happy_y#128:|nomal_x#290:|nomal_y#128:|poorcondition_x#
|
||||
speed:|walk#20:|climb#10:|climbtop#8:|crawl#8:|fallx#14:|fally#10:|crawl#10:|
|
||||
locate:|climbleft#145:|climbright#185:|climbtop#150:|
|
||||
storernd:|Touch_Body_A_Start:|Touch_Body_B_Loop:|Touch_Body_C_End:|
|
||||
str:|work1#工作:|work2#直播:|
|
||||
str:|work1#文案:|work2#直播:|
|
||||
worktimer:|work1#10:|work2#10:|
|
||||
UIStyleConfig#work1:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|
|
||||
UIStyleConfig#work2:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|
|
||||
UIStyleConfig#study:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|
|
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 218 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 227 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 227 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 217 KiB |