v0.3.1 fix #7
This commit is contained in:
parent
52458e06df
commit
443b002812
@ -4,10 +4,33 @@ using System.Collections.ObjectModel;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Windows.Data;
|
||||||
using rabi_splitter_WPF.Annotations;
|
using rabi_splitter_WPF.Annotations;
|
||||||
|
|
||||||
namespace rabi_splitter_WPF
|
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
|
public class BossData:INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
private int _bossIdx;
|
private int _bossIdx;
|
||||||
@ -122,7 +145,7 @@ namespace rabi_splitter_WPF
|
|||||||
private string _gameVer;
|
private string _gameVer;
|
||||||
private string _gameMusic;
|
private string _gameMusic;
|
||||||
private bool _igt;
|
private bool _igt;
|
||||||
|
public bool _autoReset;
|
||||||
public bool Noah1Reload
|
public bool Noah1Reload
|
||||||
{
|
{
|
||||||
get { return _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 string oldtitle;
|
||||||
public int veridx;
|
public int veridx;
|
||||||
@ -304,6 +339,7 @@ namespace rabi_splitter_WPF
|
|||||||
this.ServerPort = 16834;
|
this.ServerPort = 16834;
|
||||||
this.Igt = true;
|
this.Igt = true;
|
||||||
this.Noah1Reload = false;
|
this.Noah1Reload = false;
|
||||||
|
this.AutoReset = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,14 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:rabi_splitter_WPF"
|
xmlns:local="clr-namespace:rabi_splitter_WPF"
|
||||||
mc:Ignorable="d" SizeToContent="Width"
|
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>
|
<Window.Resources>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
|
<local:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left">
|
<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" />
|
<TextBlock Text="GitHub" MouseUp="TextBlock_MouseUp" Cursor="Hand" Foreground="Blue" TextDecorations="Underline" VerticalAlignment="Top" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<DockPanel Margin="5" DockPanel.Dock="Top">
|
<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 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="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 Side Chapter" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding SideCh, Mode=TwoWay}"/>
|
||||||
<CheckBox Content="Ignore the next "SUDDEN DEATH" (Ignore Alius I)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding AliusI, Mode=TwoWay}" IsEnabled="False"/>
|
<CheckBox Content="Ignore the next "SUDDEN DEATH" (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 "M.R." (Reload on Noah 1)" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding Noah1Reload, Mode=TwoWay}" IsEnabled="False"/>
|
<CheckBox Content="Ignore the "M.R." (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="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="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="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}"/>
|
<CheckBox Content="Show debug area" HorizontalAlignment="Left" FontSize="15" Margin="0,0,0,4" IsChecked="{Binding DebugArea, Mode=TwoWay}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<DockPanel Visibility="{Binding DebugArea, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}" >
|
<DockPanel Visibility="{Binding DebugArea, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}" >
|
||||||
|
@ -80,11 +80,6 @@ namespace rabi_splitter_WPF
|
|||||||
{
|
{
|
||||||
sendigt((float)igt / 60);
|
sendigt((float)igt / 60);
|
||||||
}
|
}
|
||||||
if (igt > 0 && igt < 3600)
|
|
||||||
{
|
|
||||||
mainContext.AliusI = true;
|
|
||||||
mainContext.Noah1Reload = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -128,90 +123,101 @@ namespace rabi_splitter_WPF
|
|||||||
DebugLog("new music:" + musicid + ":" + StaticData.MusicNames[musicid]);
|
DebugLog("new music:" + musicid + ":" + StaticData.MusicNames[musicid]);
|
||||||
mainContext.GameMusic = StaticData.MusicNames[musicid];
|
mainContext.GameMusic = StaticData.MusicNames[musicid];
|
||||||
|
|
||||||
var bossmusicflag = StaticData.BossMusics.Contains(musicid);
|
if ((musicid == 45 || musicid == 46 || musicid == 53) && mainContext.AutoReset)
|
||||||
if (bossmusicflag)
|
|
||||||
{
|
{
|
||||||
if (mainContext.bossbattle)
|
//reset
|
||||||
{
|
sendreset();
|
||||||
if (mainContext.Noah1Reload && (mainContext.lastmusicid == 52 || musicid == 52))
|
mainContext.AliusI = true;
|
||||||
{
|
mainContext.Noah1Reload = false;
|
||||||
DebugLog("noah 1 reload? ignore");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (mainContext.MusicStart || mainContext.MusicEnd)
|
|
||||||
{
|
|
||||||
sendsplit();
|
|
||||||
DebugLog("new boss music, split");
|
|
||||||
|
|
||||||
}
|
|
||||||
if (musicid == 37)
|
|
||||||
{
|
|
||||||
mainContext.Noah1Reload = true;
|
|
||||||
DebugLog("noah1 music start, ignore MR forever");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mainContext.lastmusicid = musicid;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!mainContext.bossbattle)
|
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
var bossmusicflag = StaticData.BossMusics.Contains(musicid);
|
||||||
if (musicid == 54 && mainContext.AliusI)
|
if (bossmusicflag)
|
||||||
{
|
{
|
||||||
mainContext.bossbattle = false;
|
if (mainContext.bossbattle)
|
||||||
mainContext.AliusI = false;
|
|
||||||
DebugLog("Alius music, ignore once");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (musicid == 42 && mapid == 1 && mainContext.Irisu1)
|
|
||||||
{
|
|
||||||
mainContext.bossbattle = false;
|
|
||||||
DebugLog("Irisu P1, ignore");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (bossmusicflag)
|
|
||||||
{
|
{
|
||||||
if (mapid == 5 && musicid == 44 && mainContext.SideCh)
|
if (mainContext.Noah1Reload && (mainContext.lastmusicid == 52 || musicid == 52))
|
||||||
{
|
{
|
||||||
mainContext.bossbattle = false;
|
DebugLog("noah 1 reload? ignore");
|
||||||
DebugLog("sidechapter, ignore");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mainContext.bossbattle = true;
|
if (mainContext.MusicStart || mainContext.MusicEnd)
|
||||||
mainContext.lastbosslist = new List<int>();
|
{
|
||||||
mainContext.lastnoah3hp = -1;
|
sendsplit();
|
||||||
|
DebugLog("new boss music, split");
|
||||||
|
|
||||||
|
}
|
||||||
if (musicid == 37)
|
if (musicid == 37)
|
||||||
{
|
{
|
||||||
mainContext.Noah1Reload = true;
|
mainContext.Noah1Reload = true;
|
||||||
DebugLog("noah1 music start, ignore MR forever");
|
DebugLog("noah1 music start, ignore MR forever");
|
||||||
}
|
}
|
||||||
if (mainContext.MusicStart)
|
}
|
||||||
{
|
|
||||||
sendsplit();
|
|
||||||
DebugLog("music start, split");
|
|
||||||
|
|
||||||
|
mainContext.lastmusicid = musicid;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!mainContext.bossbattle)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (musicid == 54 && mainContext.AliusI)
|
||||||
|
{
|
||||||
|
mainContext.bossbattle = false;
|
||||||
|
mainContext.AliusI = false;
|
||||||
|
DebugLog("Alius music, ignore once");
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (musicid == 42 && mapid == 1 && mainContext.Irisu1)
|
||||||
|
{
|
||||||
|
mainContext.bossbattle = false;
|
||||||
|
DebugLog("Irisu P1, ignore");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bossmusicflag)
|
||||||
|
{
|
||||||
|
if (mapid == 5 && musicid == 44 && mainContext.SideCh)
|
||||||
|
{
|
||||||
|
mainContext.bossbattle = false;
|
||||||
|
DebugLog("sidechapter, ignore");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mainContext.bossbattle = true;
|
||||||
|
mainContext.lastbosslist = new List<int>();
|
||||||
|
mainContext.lastnoah3hp = -1;
|
||||||
|
if (musicid == 37)
|
||||||
|
{
|
||||||
|
mainContext.Noah1Reload = true;
|
||||||
|
DebugLog("noah1 music start, ignore MR forever");
|
||||||
|
}
|
||||||
|
if (mainContext.MusicStart)
|
||||||
|
{
|
||||||
|
sendsplit();
|
||||||
|
DebugLog("music start, split");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!bossmusicflag) //boss music end!
|
|
||||||
{
|
{
|
||||||
mainContext.bossbattle = false;
|
if (!bossmusicflag) //boss music end!
|
||||||
if (mainContext.MusicEnd)
|
|
||||||
{
|
{
|
||||||
sendsplit();
|
mainContext.bossbattle = false;
|
||||||
DebugLog("music end, split");
|
if (mainContext.MusicEnd)
|
||||||
|
{
|
||||||
|
sendsplit();
|
||||||
|
DebugLog("music end, split");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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)
|
private void sendigt(float time)
|
||||||
{
|
{
|
||||||
if (tcpclient != null && tcpclient.Connected)
|
if (tcpclient != null && tcpclient.Connected)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user