Exemple #1
0
 public EMM_GameDetector(IGameDefault game)
 {
     InitializeComponent();
     HorizontalAlignment = HorizontalAlignment.Stretch;
     VerticalAlignment = VerticalAlignment.Stretch;
     ResetGUI();
     GameDefault = game;
     gameIcon.Source = Assistant.LoadGameImage(GameDefault.Id.ToString());
     gameName.Text = GameDefault.Name;
 }
        private void ConfirmGameDetection(IGameDefault g, Border border)
        {
            border.Dispatcher.BeginInvoke((Action)(() =>
            {
                (_gameDefaults as IList <IGameDefault>).Remove(g);

                if (_gameDefaults.Count() > 0)
                {
                    var parentStkPanel = border.Parent as StackPanel;
                    Border newBorder = new Border()
                    {
                        Style = mainGrid.TryFindResource("GameDetectionBorderStyle") as Style,
                        Child = new Button()
                        {
                            Style = mainGrid.TryFindResource("GameAdditionButtonTemplate") as Style
                        }
                    };
                    if (parentStkPanel.Children.Count < Defined.MAX_GAME_DETECTORS_IN_COLUMN)
                    {
                        parentStkPanel.Children.Add(newBorder);
                    }
                    else
                    {
                        StackPanel newStkPanel = new StackPanel()
                        {
                            Style = mainGrid.TryFindResource("GameDetectorsStackPanelStyle") as Style
                        };
                        newStkPanel.Children.Add(newBorder);
                        gameDetectorsParent.Children.Add(newStkPanel);
                    }
                }
                EMM_GameDetector currDetectorControl = new EMM_GameDetector(g);

                _gameSeachers.Add(new GameSearcher(g, currDetectorControl, _games));
                currDetectorControl.Searcher = _gameSeachers.LastOrDefault();
                currDetectorControl.Searcher.StartSearch();
                border.Child = currDetectorControl;
                border.Background = Defined.Colors.AlternateBackground;

                if (_gameSeachers.Count == 1)
                {
                    thumbnail.Visibility = Visibility.Visible;
                }
            }), DispatcherPriority.Background);
        }
Exemple #3
0
 public A(IGameDefault g)
 {
     Orientation = Orientation.Horizontal;
     Children.Add(new Image()
     {
         Source            = Assistant.LoadGameImage(g.Id.ToString()),
         VerticalAlignment = VerticalAlignment.Center,
         Height            = 75,
         Width             = 75,
         Margin            = new Thickness(0, 0, 10, 0)
     });
     Children.Add(new TextBlock()
     {
         Text = g.Id.ToString(),
         VerticalAlignment = VerticalAlignment.Center,
         FontSize          = 30
     });
     GameDefault = g;
 }
Exemple #4
0
 public GameSearcher(IGameDefault def, EMM_GameDetector control, List <Game> games)
 {
     GameDefault    = def;
     GuiControl     = control;
     ConfirmedGames = games;
 }
 /// <summary>
 /// Full Constructor
 /// </summary>
 /// <param name="iPath">Installation path</param>
 /// <param name="dPath">Game data path (to which you install mods)</param>
 /// <param name="exePath">Executable path</param>
 /// <param name="n">Full name of the game</param>
 /// <param name="nApi">Name of the game in Nexus Mods' API</param>
 /// <param name="nReg">Display name of the game in the registry (under Uninstall)</param>
 /// <param name="id">Nexus Mods' generated ID for the game</param>
 /// <param name="isCurr">Whether this game is the current one</param>
 public Game(string iPath, string dPath, string exePath,
             IGameDefault def, string nReg, bool isCurr) :
     this(iPath, dPath, exePath, def.Name, def.Name_API, def.Name_Nexus, nReg, def.Id, def.KnownExecutables, def.PluginFileExtension)
 {
     IsCurrent = isCurr;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="iPath">Installation Path</param>
 /// <param name="def">Default settings of the game</param>
 /// <param name="regN">Registry name of the game</param>
 public Game(string iPath, IGameDefault def, string regN) :
     this(iPath, $"{iPath}{def.RelativeDataPath}", GetExecutablePath(def.ExecutableName, iPath),
          def.Name, def.Name_API, def.Name_Nexus, regN, def.Id, def.KnownExecutables, def.PluginFileExtension)
 {
 }
 /// <summary>
 /// Creates a Game object by its name (of the game)
 /// </summary>
 /// <param name="n">The name of the game</param>
 /// <param name="iPath">Where the game is installed</param>
 /// <param name="regN">The name of the game in the registry</param>
 /// <returns></returns>
 public static Game CreateByName(string iPath, string regN, IGameDefault def)
 => new Game(iPath, def, regN);