mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
工作操作优化
This commit is contained in:
parent
7fd2f74740
commit
ea785811da
@ -545,7 +545,7 @@ namespace VPet_Simulator.Core
|
||||
/// 开始工作
|
||||
/// </summary>
|
||||
/// <param name="work">工作内容</param>
|
||||
public void StartWork(Work work)
|
||||
public bool StartWork(Work work)
|
||||
{
|
||||
if (!Core.Controller.EnableFunction || Core.Save.Mode != IGameSave.ModeType.Ill)
|
||||
if (!Core.Controller.EnableFunction || Core.Save.Level >= work.LevelLimit)
|
||||
@ -554,8 +554,9 @@ namespace VPet_Simulator.Core
|
||||
else
|
||||
{
|
||||
if (WorkCheck != null && !WorkCheck.Invoke(work))
|
||||
return;
|
||||
return false;
|
||||
WorkTimer.Start(work);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
MessageBoxX.Show(LocalizeCore.Translate("您的桌宠等级不足{0}/{2}\n无法进行{1}", Core.Save.Level.ToString()
|
||||
@ -563,7 +564,7 @@ namespace VPet_Simulator.Core
|
||||
else
|
||||
MessageBoxX.Show(LocalizeCore.Translate("您的桌宠 {0} 生病啦,没法进行{1}", Core.Save.Name,
|
||||
work.NameTrans), LocalizeCore.Translate("{0}取消", work.NameTrans));
|
||||
ToolBar.Visibility = Visibility.Collapsed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,11 @@ namespace VPet_Simulator.Core
|
||||
MenuStudy.Items.Clear();
|
||||
MenuPlay.Items.Clear();
|
||||
}
|
||||
public void StartWork(Work w)
|
||||
{
|
||||
if (m.StartWork(w))
|
||||
Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public void LoadWork()
|
||||
{
|
||||
@ -83,7 +88,8 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Header = w.NameTrans
|
||||
};
|
||||
mi.Click += (s, e) => m.StartWork(w);
|
||||
mi.Click += (s, e) => StartWork(w);
|
||||
|
||||
MenuWork.Items.Add(mi);
|
||||
}
|
||||
}
|
||||
@ -105,7 +111,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Header = w.NameTrans
|
||||
};
|
||||
mi.Click += (s, e) => m.StartWork(w);
|
||||
mi.Click += (s, e) => StartWork(w);
|
||||
MenuStudy.Items.Add(mi);
|
||||
}
|
||||
}
|
||||
@ -127,7 +133,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Header = w.NameTrans
|
||||
};
|
||||
mi.Click += (s, e) => m.StartWork(w);
|
||||
mi.Click += (s, e) => StartWork(w);
|
||||
MenuPlay.Items.Add(mi);
|
||||
}
|
||||
}
|
||||
@ -135,20 +141,20 @@ namespace VPet_Simulator.Core
|
||||
|
||||
private void MenuStudy_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m.StartWork(wstudy);
|
||||
StartWork(wstudy);
|
||||
}
|
||||
Work wwork;
|
||||
Work wstudy;
|
||||
Work wplay;
|
||||
|
||||
|
||||
|
||||
|
||||
private void MenuWork_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m.StartWork(wwork);
|
||||
StartWork(wwork);
|
||||
}
|
||||
private void MenuPlay_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m.StartWork(wplay);
|
||||
StartWork(wplay);
|
||||
}
|
||||
|
||||
private void M_TimeUIHandle(Main m)
|
||||
|
@ -7,7 +7,9 @@
|
||||
mc:Ignorable="d" Margin="5" Width="340" Height="100" Background="{DynamicResource SecondaryLight}"
|
||||
BorderBrush="{DynamicResource Secondary}">
|
||||
<Grid>
|
||||
<Image x:Name="uimg" HorizontalAlignment="Left" Source="/Res/TopLogo2019.PNG" Margin="4" />
|
||||
<Border HorizontalAlignment="Left" Margin="4" CornerRadius="43">
|
||||
<Image x:Name="uimg" Source="/Res/TopLogo2019.PNG" />
|
||||
</Border>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="110,0,0,0"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontSize="16">
|
||||
<Run Text="{ll:Str 访客}" />: <Run x:Name="rPetName" Text="{ll:Str 萝莉斯}" FontSize="20" FontWeight="Bold" />
|
||||
@ -16,7 +18,7 @@
|
||||
<Run x:Name="info" Text="Lv ??" />
|
||||
</TextBlock>
|
||||
<Button Style="{DynamicResource ThemedButtonStyle}" HorizontalAlignment="Right" Content="{ll:Str 重置位置}"
|
||||
VerticalAlignment="Top" Margin="10"/>
|
||||
VerticalAlignment="Top" Margin="10" />
|
||||
<Button Style="{DynamicResource ThemedButtonStyle}" HorizontalAlignment="Right" Content="{ll:Str 还没想好}"
|
||||
VerticalAlignment="Bottom" Margin="10" />
|
||||
</Grid>
|
||||
|
@ -8,8 +8,10 @@
|
||||
Title="{ll:Str 访客表}" MinHeight="400" Width="400" Closed="Window_Closed" FontSize="16" SizeToContent="Height"
|
||||
MaxHeight="800" ResizeMode="CanMinimize" Closing="Window_Closing">
|
||||
<Grid>
|
||||
<Image x:Name="HostHead" Margin="20" Width="80" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||
Source="/Res/TopLogo2019.PNG" />
|
||||
<Border Margin="20" Width="80" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" CornerRadius="40">
|
||||
<Image x:Name="HostHead" Source="/Res/TopLogo2019.PNG" />
|
||||
</Border>
|
||||
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="120,20,0,0"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}">
|
||||
<Run x:Name="hostPet" Text="萝莉斯" FontSize="24" FontWeight="Bold" /> <Run Text="{ll:Str 的访客表}" />
|
||||
|
@ -178,8 +178,8 @@ public partial class winWorkMenu : Window
|
||||
{
|
||||
if (nowworkdisplay != null)
|
||||
{
|
||||
mw.Main.StartWork(nowworkdisplay);
|
||||
Close();
|
||||
if (mw.Main.StartWork(nowworkdisplay))
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user