rabi_display
Copy Liu 8 years ago
parent 52458e06df
commit 443b002812
No known key found for this signature in database
GPG Key ID: 63A453DBF23409AF
  1. 38
      rabi_splitter_WPF/MainContext.cs
  2. 10
      rabi_splitter_WPF/MainWindow.xaml
  3. 32
      rabi_splitter_WPF/MainWindow.xaml.cs

@ -4,10 +4,33 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Data;
using rabi_splitter_WPF.Annotations;
namespace rabi_splitter_WPF
{
[ValueConversion(typeof(bool), typeof(bool))]
public class InverseBooleanConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
if (targetType != typeof(bool))
throw new InvalidOperationException("The target must be a boolean");
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
#endregion
}
public class BossData:INotifyPropertyChanged
{
private int _bossIdx;
@ -122,7 +145,7 @@ namespace rabi_splitter_WPF
private string _gameVer;
private string _gameMusic;
private bool _igt;
public bool _autoReset;
public bool Noah1Reload
{
get { return _noah1Reload; }
@ -277,6 +300,18 @@ namespace rabi_splitter_WPF
}
}
public bool AutoReset
{
get { return _autoReset; }
set
{
if (value == _autoReset) return;
_autoReset = value;
OnPropertyChanged(nameof(AutoReset));
}
}
public string oldtitle;
public int veridx;
@ -304,6 +339,7 @@ namespace rabi_splitter_WPF
this.ServerPort = 16834;
this.Igt = true;
this.Noah1Reload = false;
this.AutoReset = true;
}

@ -5,13 +5,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:rabi_splitter_WPF"
mc:Ignorable="d" SizeToContent="Width"
Title="Irisu is watching you" d:DataContext="{d:DesignData local:MainContext}" d:DesignWidth="835.476" Height="391.628">
Title="Irisu is watching you" d:DataContext="{d:DesignData local:MainContext}" d:DesignWidth="835.476" Height="403.069">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<local:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
</Window.Resources>
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left">
<TextBlock Text="v0.3" Margin="0,0,30,0" VerticalAlignment="Top" />
<TextBlock Text="v0.3.1" Margin="0,0,30,0" VerticalAlignment="Top" />
<TextBlock Text="GitHub" MouseUp="TextBlock_MouseUp" Cursor="Hand" Foreground="Blue" TextDecorations="Underline" VerticalAlignment="Top" />
</StackPanel>
<DockPanel Margin="5" DockPanel.Dock="Top">
@ -31,11 +32,12 @@
<CheckBox Content="Split when the computer is found" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Computer, Mode=TwoWay}"/>
<CheckBox Content="Split when Miru despawns" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding MiruDe, Mode=TwoWay}"/>
<CheckBox Content="Ignore the Side Chapter" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding SideCh, Mode=TwoWay}"/>
<CheckBox Content="Ignore the next &quot;SUDDEN DEATH&quot; (Ignore Alius I)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding AliusI, Mode=TwoWay}" IsEnabled="False"/>
<CheckBox Content="Ignore the &quot;M.R.&quot; (Reload on Noah 1)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Noah1Reload, Mode=TwoWay}" IsEnabled="False"/>
<CheckBox Content="Ignore the next &quot;SUDDEN DEATH&quot; (Ignore Alius I)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding AliusI, Mode=TwoWay}" IsEnabled="{Binding AutoReset, Converter={StaticResource InverseBooleanConverter},Mode=TwoWay}" />
<CheckBox Content="Ignore the &quot;M.R.&quot; (Reload on Noah 1)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Noah1Reload, Mode=TwoWay}" IsEnabled="{Binding AutoReset, Converter={StaticResource InverseBooleanConverter},Mode=TwoWay}"/>
<CheckBox Content="Split when Town Member +2 or Nixie despawns" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Tm2, Mode=TwoWay}"/>
<CheckBox Content="Ignore Irisu Phase 1" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Irisu1, Mode=TwoWay}"/>
<CheckBox Content="Track In-Game Time" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Igt, Mode=TwoWay}"/>
<CheckBox Content="Reset timer when returning to title screen" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding AutoReset, Mode=TwoWay}"/>
<CheckBox Content="Show debug area" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding DebugArea, Mode=TwoWay}"/>
</StackPanel>
<DockPanel Visibility="{Binding DebugArea, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}" >

@ -80,11 +80,6 @@ namespace rabi_splitter_WPF
{
sendigt((float)igt / 60);
}
if (igt > 0 && igt < 3600)
{
mainContext.AliusI = true;
mainContext.Noah1Reload = false;
}
#endregion
@ -128,6 +123,16 @@ namespace rabi_splitter_WPF
DebugLog("new music:" + musicid + ":" + StaticData.MusicNames[musicid]);
mainContext.GameMusic = StaticData.MusicNames[musicid];
if ((musicid == 45 || musicid == 46 || musicid == 53) && mainContext.AutoReset)
{
//reset
sendreset();
mainContext.AliusI = true;
mainContext.Noah1Reload = false;
}
else
{
var bossmusicflag = StaticData.BossMusics.Contains(musicid);
if (bossmusicflag)
{
@ -215,6 +220,7 @@ namespace rabi_splitter_WPF
}
}
}
}
mainContext.lastmusicid = musicid;
}
@ -391,6 +397,22 @@ namespace rabi_splitter_WPF
}
}
private void sendreset()
{
if (tcpclient != null && tcpclient.Connected)
{
try
{
var b = Encoding.UTF8.GetBytes("reset\r\n");
networkStream.Write(b, 0, b.Length);
}
catch (Exception)
{
disconnect();
}
}
}
private void sendigt(float time)
{
if (tcpclient != null && tcpclient.Connected)

Loading…
Cancel
Save