Skip to content

Commit

Permalink
版本更新至V1.38
Browse files Browse the repository at this point in the history
调整一些过程的排列顺序
清理没删干净的代码
  • Loading branch information
Natsukage committed Nov 8, 2020
1 parent b3f963c commit 6665e91
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 33 deletions.
47 changes: 20 additions & 27 deletions 渔人的直感/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ private bool Initialize()
Closing += SaveLocation;
return true;
}

/// <summary>
/// 读取配置文件并设置窗体尺寸等
/// </summary>
private void LoadConfig()
{
BiteProgressBar.Height = Properties.Settings.Default.Height;
Expand All @@ -105,7 +107,17 @@ private void LoadConfig()
WindowStartupLocation = WindowStartupLocation.Manual;
}
}

/// <summary>
/// 设置窗体的隐藏与鼠标穿透属性
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Window_Loaded(object sender, RoutedEventArgs e)
{
WindowStyleHelper.ExStyle |= 0x00000080; //ExtendedWindowStyles.WS_EX_TOOLWINDOW = 0x00000080
if (Properties.Settings.Default.ClickThrough)
WindowStyleHelper.ExStyle |= 0x00000020; //ExtendedWindowStyles.WS_EX_TRANSPARENT = 0x00000020
}

/// <summary>
/// 循环检测玩家状态.
Expand Down Expand Up @@ -146,7 +158,6 @@ private void OnWork(object sender, DoWorkEventArgs e)
Thread.Sleep(50);
}
}

private void StatusChange(short newStatus)
{
switch (newStatus)
Expand Down Expand Up @@ -200,7 +211,6 @@ private void StatusChange(short newStatus)
break;
}*/
}

private void BuffCheck(IntPtr buffTablePtr)
{
if (!Status.IsActive)
Expand Down Expand Up @@ -234,7 +244,6 @@ private void BuffCheck(IntPtr buffTablePtr)
Status.End();
}
}

private void WeatherCheck(IntPtr weatherPtr)
{
var currentWeather = Scanner.ReadByte(weatherPtr);
Expand All @@ -256,6 +265,8 @@ private void WindowDragMove(object sender, MouseButtonEventArgs e)
if (e.LeftButton == MouseButtonState.Pressed)
DragMove();
}
//由于Win10的bug,全屏程序在托盘打开的ContextMenu可能不会正确失去焦点。这里令左键点击托盘图标时强制关闭其弹出的右键菜单。
private void TaskbarIcon_TrayLeftMouseDown(object sender, RoutedEventArgs e) => CurrentMainWindow.TrayIcon.ContextMenu.IsOpen = false;

private void Settings_Click(object sender, RoutedEventArgs e)
{
Expand All @@ -272,35 +283,17 @@ private void Settings_Click(object sender, RoutedEventArgs e)
}
}

private void FishTracker_Click(object sender, RoutedEventArgs e)
{
Process.Start("http://fish.senriakane.com/");
}
private void FishCake_Click(object sender, RoutedEventArgs e)
{
Process.Start("https://ricecake404.gitee.io/ff14-list");
}
private void FishTracker_Click(object sender, RoutedEventArgs e) => Process.Start("http://fish.senriakane.com/");

private void Exit_Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
private void FishCake_Click(object sender, RoutedEventArgs e) => Process.Start("https://ricecake404.gitee.io/ff14-list");

private void Exit_Click(object sender, RoutedEventArgs e) => Application.Current.Shutdown();

private void SaveLocation(object sender, EventArgs e)
{
if (WindowState != WindowState.Minimized)
Properties.Settings.Default.Location = new System.Drawing.Point((int) Left, (int) Top);
Properties.Settings.Default.Save();
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
WindowStyleHelper.ExStyle |= 0x00000080; //ExtendedWindowStyles.WS_EX_TOOLWINDOW = 0x00000080
if (Properties.Settings.Default.ClickThrough)
WindowStyleHelper.ExStyle |= 0x00000020; //ExtendedWindowStyles.WS_EX_TRANSPARENT = 0x00000020
}

//由于Win10的bug,全屏程序在托盘打开的ContextMenu可能不会正确失去焦点。这里令左键点击托盘图标时强制关闭其弹出的右键菜单。
private void TaskbarIcon_TrayLeftMouseDown(object sender, RoutedEventArgs e) => CurrentMainWindow.TrayIcon.ContextMenu.IsOpen = false;
}
}
4 changes: 2 additions & 2 deletions 渔人的直感/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.7.1")]
[assembly: AssemblyFileVersion("1.3.7.1")]
[assembly: AssemblyVersion("1.3.8.0")]
[assembly: AssemblyFileVersion("1.3.8.0")]
4 changes: 0 additions & 4 deletions 渔人的直感/Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
<TextBlock TextWrapping="Wrap" Text="抛竿颜色" Margin="4" Width="110" />
<TextBox Text="{Binding Path=TimerColor,Source={x:Static Properties:Settings.Default}}" Width="80" Margin="4" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Text="抛竿颜色" Margin="4" Width="110" />
<TextBox Text="{Binding Path=TimerColor,Source={x:Static Properties:Settings.Default}}" Width="80" Margin="4" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Text="轻杆颜色" Margin="4" Width="110" />
<TextBox Text="{Binding Path=LTugColor,Source={x:Static Properties:Settings.Default}}" Width="80" Margin="4" />
Expand Down
1 change: 1 addition & 0 deletions 渔人的直感/渔人的直感.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
Expand Down

0 comments on commit 6665e91

Please sign in to comment.