public UICore(UIWindow mainWindow, BattlelogBase battlelog, Config config) { this.mainWindow = mainWindow; this.battlelog = battlelog; this.config = config; this.managedOrigin = new Origin(); }
public UIOfflineIndicator() { string[] args = Environment.GetCommandLineArgs(); if (args.Length <= 1) { MessageBox.Show("Invalid Commandline Parameters - BF3 for Battlefield 3, BF4 for Battlefield 4"); Environment.Exit(1); } Config config = new Config(); switch(args[1]){ case "BF3": this.battlelog = new Battlefield3(); break; case "BF4": this.battlelog = new Battlefield4(); break; case "MOHW": this.battlelog = new MedalOfHonorWarfighter(); break; case "BFH": this.battlelog = new BattlefieldHardline(); break; default: MessageBox.Show("Invalid Commandline Parameters - bf3 for Battlefield 3, bf4 for Battlefield 4,,bfh for Hardline, mohw for Medal of Honor Warfighter"); Environment.Exit(1); break; } InitializeComponent(); this.gameLabel.Content = "You are playing "+battlelog.battlefieldName+" Campaign. Please log in to Origin when prompted."; this.gameIcon.Source = new BitmapImage(new Uri("pack://*****:*****@"pack://application:,,/images/"+battlelog.battlefieldShortname+"/icon.ico")); this.KeyDown += (s, e) => { if (e.Key == Key.Enter) this.WindowState = WindowState.Minimized; }; this.SourceInitialized += (s, e) => { this.HideWindowButtons(); WindowChrome.SetWindowChrome(this, new WindowChrome() { CaptionHeight = 14D, ResizeBorderThickness = new Thickness(0) }); }; var origin = new OfflineOrigin(this.battlelog.gameId); origin.OriginUnexpectedClose += (s) => this.Dispatcher.Invoke(() => this.Close()); this.battlelog.GameQuit += (s, e) => { origin.KillOrigin(); this.Dispatcher.Invoke(() => this.Close()); }; origin.StartOrigin(); }
public UIConfig(Config config) { InitializeComponent(); this.config = config; this.Closing += UIConfig_Closing; //Load General Settings this.checkUpdates_input.IsChecked = this.config.CheckUpdates; this.manageOrigin_input.IsChecked = config.ManageOrigin; //Load Window Settings this.fullscreenMode_input.IsChecked = config.FullscreenMode; this.rightClickDrag_input.IsChecked = config.RightClickDrag; this.disableHardwareAccel_input.IsChecked = config.DisableHardwareAccel; }