void GameSetupWindow_Loaded(object sender, RoutedEventArgs e) { cbPlayground.IsChecked = Webb.Playbook.Data.GameSetting.Instance.ShowPlayground; cbColor.IsChecked = Webb.Playbook.Data.GameSetting.Instance.EnableColor; cbTitle.IsChecked = Webb.Playbook.Data.GameSetting.Instance.EnableTitle; cbSymbolColor.IsChecked = Webb.Playbook.Data.GameSetting.Instance.EnableSymbolColor; canvasDrawing.Clip = new RectangleGeometry(new Rect(0, 0, canvasDrawing.ActualWidth, canvasDrawing.ActualHeight)); string strSample = AppDomain.CurrentDomain.BaseDirectory + @"\Offensive\Formation\Offensive\WEBB LIBRARY\DIAMOND LEFT.Form"; if (System.IO.File.Exists(strSample)) { draw = Webb.Playbook.Geometry.Drawing.Load(strSample, canvasDrawing); } else { draw = new Webb.Playbook.Geometry.Drawing(canvasDrawing); PlayersCreator pc = new PlayersCreator(); Webb.Playbook.Data.Personnel personnel = new Webb.Playbook.Data.Personnel(); personnel.ScoutType = Webb.Playbook.Data.ScoutTypes.Offensive; personnel.Positions.Clear(); personnel.Positions.AddRange(PersonnelEditor.Setting.GetOffensePositions()); pc.CreatePlayers(draw, personnel, true, 0); } draw.SetPlaygroundVisible(cbPlayground.IsChecked.Value ? Visibility.Visible : Visibility.Hidden); if (cbTitle.IsChecked.Value) { draw.Add(label); } draw.SetPlaygroundColor(cbColor.IsChecked.Value ? Webb.Playbook.Data.PlaygroundColors.Color : Webb.Playbook.Data.PlaygroundColors.BlackAndWhite); draw.SetFiguresColor(cbSymbolColor.IsChecked.Value); }
private void Awake() { Instance = this; ChangePlayer(); }