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

388 lines
9.5 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));
}
}
8 years ago
public void Log(string message)
{
this.DebugLog += message + "\n";
}
8 years ago
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
class MainContext : INotifyPropertyChanged
{
8 years ago
public string oldtitle;
public int veridx;
8 years ago
private int _serverPort;
private string _gameVer;
private string _gameMusic;
private bool _igt;
8 years ago
private string _text1;
private string _text2;
private string _text3;
private string _text4;
private string _text5;
private string _text6;
private string _text7;
private string _text8;
private string _text9;
private string _text10;
private string _text11;
private string _text12;
private string _text13;
private string _text14;
private string _text15;
public string Text1
{
get { return _text1; }
set
{
if (value == _text1) return;
_gameVer = value;
OnPropertyChanged(nameof(Text1));
}
}
public string Text2
{
get { return _text2; }
set
{
if (value == _text2) return;
_gameVer = value;
OnPropertyChanged(nameof(Text2));
}
}
public string Text3
8 years ago
{
8 years ago
get { return _text3; }
8 years ago
set
{
8 years ago
if (value == _text3) return;
_gameVer = value;
OnPropertyChanged(nameof(Text3));
8 years ago
}
}
8 years ago
public string Text4
8 years ago
{
8 years ago
get { return _text4; }
8 years ago
set
{
8 years ago
if (value == _text4) return;
_gameVer = value;
OnPropertyChanged(nameof(Text4));
8 years ago
}
}
8 years ago
public string Text5
8 years ago
{
8 years ago
get { return _text5; }
8 years ago
set
{
8 years ago
if (value == _text5) return;
_gameVer = value;
OnPropertyChanged(nameof(Text5));
8 years ago
}
}
8 years ago
public string Text6
8 years ago
{
8 years ago
get { return _text6; }
8 years ago
set
{
8 years ago
if (value == _text6) return;
_gameVer = value;
OnPropertyChanged(nameof(Text6));
8 years ago
}
}
8 years ago
public string Text7
8 years ago
{
8 years ago
get { return _text7; }
8 years ago
set
{
8 years ago
if (value == _text7) return;
_gameVer = value;
OnPropertyChanged(nameof(Text7));
}
}
public string Text8
{
get { return _text8; }
set
{
if (value == _text8) return;
_gameVer = value;
OnPropertyChanged(nameof(Text8));
8 years ago
}
}
8 years ago
public string Text9
8 years ago
{
8 years ago
get { return _text9; }
8 years ago
set
{
8 years ago
if (value == _text9) return;
_gameVer = value;
OnPropertyChanged(nameof(Text9));
8 years ago
}
}
8 years ago
public string Text10
8 years ago
{
8 years ago
get { return _text10; }
8 years ago
set
{
8 years ago
if (value == _text10) return;
_gameVer = value;
OnPropertyChanged(nameof(Text10));
8 years ago
}
}
8 years ago
public string Text11
8 years ago
{
8 years ago
get { return _text11; }
8 years ago
set
{
8 years ago
if (value == _text11) return;
_gameVer = value;
OnPropertyChanged(nameof(Text11));
8 years ago
}
}
8 years ago
public string Text12
8 years ago
{
8 years ago
get { return _text12; }
8 years ago
set
{
8 years ago
if (value == _text12) return;
_gameVer = value;
OnPropertyChanged(nameof(Text12));
8 years ago
}
}
8 years ago
public string Text13
{
8 years ago
get { return _text13; }
set
{
8 years ago
if (value == _text13) return;
_gameVer = value;
OnPropertyChanged(nameof(Text13));
}
}
8 years ago
public string Text14
8 years ago
{
8 years ago
get { return _text14; }
8 years ago
set
{
8 years ago
if (value == _text14) return;
_gameVer = value;
OnPropertyChanged(nameof(Text14));
8 years ago
}
}
8 years ago
public string Text15
{
get { return _text15; }
set
{
if (value == _text15) return;
_gameVer = value;
OnPropertyChanged(nameof(Text15));
}
}
8 years ago
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));
}
}
8 years ago
8 years ago
public MainContext()
{
this.ServerPort = 16834;
this.Igt = true;
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}