Experimental stuff for now. Don't think too much about it. Branched off Rabi-Ribi Autosplitter.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rabiribi-display/rabi_splitter_WPF/MainContext.cs

387 lines
9.7 KiB

8 years ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
8 years ago
using System.Windows.Data;
8 years ago
using rabi_splitter_WPF.Annotations;
namespace rabi_splitter_WPF
{
8 years ago
[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
}
8 years ago
public class BossData:INotifyPropertyChanged
{
8 years ago
private int _bossIdx;
private int _bossId;
private int _bossHp;
8 years ago
8 years ago
public int BossIdx
{
get { return _bossIdx; }
set
{
if (value == _bossIdx) return;
_bossIdx = value;
OnPropertyChanged(nameof(BossIdx));
}
}
public int BossID
{
get { return _bossId; }
set
{
if (value == _bossId) return;
_bossId = value;
OnPropertyChanged(nameof(BossID));
}
}
public int BossHP
{
get { return _bossHp; }
set
{
if (value == _bossHp) return;
_bossHp = value;
OnPropertyChanged(nameof(BossHP));
}
}
8 years ago
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
class DebugContext : INotifyPropertyChanged
{
private bool _bossEvent;
private string _debugLog;
public ObservableCollection<BossData> BossList = new ObservableCollection<BossData>();
8 years ago
public DebugContext()
{
BossList=new ObservableCollection<BossData>();
for (int i = 0; i < 50; i++)
{
BossList.Add(new BossData()
{
BossIdx = i
});
}
}
8 years ago
public bool BossEvent
{
get { return _bossEvent; }
set
{
if (value == _bossEvent) return;
_bossEvent = value;
OnPropertyChanged(nameof(BossEvent));
}
}
public string DebugLog
{
get { return _debugLog; }
set
{
if (value == _debugLog) return;
_debugLog = value;
OnPropertyChanged(nameof(DebugLog));
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
class MainContext : INotifyPropertyChanged
{
private bool _musicStart;
private bool _musicEnd;
private bool _computer;
private bool _miruDe;
private bool _sideCh;
private bool _aliusI;
private bool _tm2;
private bool _irisu1;
private bool _dontSplitOnReload;
8 years ago
private bool _debugArea;
private int _serverPort;
private string _gameVer;
private string _gameMusic;
private bool _igt;
8 years ago
public bool _autoReset;
public bool _autoStart;
8 years ago
public bool Noah1Reload
{
get { return _noah1Reload; }
set
{
if (value == _noah1Reload) return;
_noah1Reload = value;
OnPropertyChanged(nameof(Noah1Reload));
}
}
8 years ago
public bool MusicStart
{
get { return _musicStart; }
set
{
if (value == _musicStart) return;
_musicStart = value;
OnPropertyChanged(nameof(MusicStart));
}
}
public bool MusicEnd
{
get { return _musicEnd; }
set
{
if (value == _musicEnd) return;
_musicEnd = value;
OnPropertyChanged(nameof(MusicEnd));
}
}
public bool Computer
{
get { return _computer; }
set
{
if (value == _computer) return;
_computer = value;
OnPropertyChanged(nameof(Computer));
}
}
public bool MiruDe
{
get { return _miruDe; }
set
{
if (value == _miruDe) return;
_miruDe = value;
OnPropertyChanged(nameof(MiruDe));
}
}
public bool SideCh
{
get { return _sideCh; }
set
{
if (value == _sideCh) return;
_sideCh = value;
OnPropertyChanged(nameof(SideCh));
}
}
public bool AliusI
{
get { return _aliusI; }
set
{
if (value == _aliusI) return;
_aliusI = value;
OnPropertyChanged(nameof(AliusI));
}
}
public bool Tm2
{
get { return _tm2; }
set
{
if (value == _tm2) return;
_tm2 = value;
OnPropertyChanged(nameof(Tm2));
}
}
public bool Irisu1
{
get { return _irisu1; }
set
{
if (value == _irisu1) return;
_irisu1 = value;
OnPropertyChanged(nameof(Irisu1));
}
}
public bool DontSplitOnReload
{
get { return _dontSplitOnReload; }
set
{
if (value == _dontSplitOnReload) return;
_dontSplitOnReload = value;
OnPropertyChanged(nameof(DontSplitOnReload));
}
}
8 years ago
public bool DebugArea
{
get { return _debugArea; }
set
{
if (value == _debugArea) return;
_debugArea = value;
OnPropertyChanged(nameof(DebugArea));
}
}
public int ServerPort
{
get { return _serverPort; }
set
{
if (value == _serverPort) return;
_serverPort = value;
OnPropertyChanged(nameof(ServerPort));
}
}
public string GameVer
{
get { return _gameVer; }
set
{
if (value == _gameVer) return;
_gameVer = value;
OnPropertyChanged(nameof(GameVer));
}
}
public string GameMusic
{
get { return _gameMusic; }
set
{
if (value == _gameMusic) return;
_gameMusic = value;
OnPropertyChanged(nameof(GameMusic));
}
}
public bool Igt
{
get { return _igt; }
set
{
if (value == _igt) return;
_igt = value;
OnPropertyChanged(nameof(Igt));
}
}
public bool AutoStart
{
get { return _autoStart; }
set
{
if (value == _autoStart) return;
_autoStart = value;
OnPropertyChanged(nameof(AutoStart));
}
}
8 years ago
public bool AutoReset
{
get { return _autoReset; }
set
{
if (value == _autoReset) return;
_autoReset = value;
OnPropertyChanged(nameof(AutoReset));
}
}
public int previousBlackness = -1;
8 years ago
public string oldtitle;
public int veridx;
public int lastmoney;
public int lastmapid;
public int lastmusicid;
public int lastplaytime = 0;
8 years ago
public bool bossbattle;
public List<int> lastbosslist;
public int lastnoah3hp;
public int lastTM;
public DateTime LastTMAddTime;
8 years ago
private bool _noah1Reload;
8 years ago
public MainContext()
{
this.MusicEnd = true;
this.MusicStart = false;
this.Computer = true;
this.MiruDe = true;
this.SideCh = true;
this.AliusI = true;
this.Tm2 = true;
this.Irisu1 = true;
this.DontSplitOnReload = false;
8 years ago
this.DebugArea = false;
this.ServerPort = 16834;
this.Igt = true;
8 years ago
this.Noah1Reload = false;
this.AutoStart = false;
8 years ago
this.AutoReset = true;
8 years ago
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}