Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            controls = new Dictionary<UserGameInfo, GameControl>();
            gameManager = new GameManager();
        }
Пример #2
0
        public MainForm()
        {
            InitializeComponent();
            this.groupBox2.Enabled = false;

            GameManager = new GameManager();
            Dictionary<string, GameInfo> allGames = GameManager.Games;
            for (int i = 0; i < allGames.Count; i++)
            {
                GameInfo info = allGames[i];
                this.combo_Games.Items.Add(info);
            }

            Panels = new List<Panel>();
            Players = new List<PlayerInfo>();
            Screens = new List<ScreenControl>();

            Screen[] screens = Screen.AllScreens;
            int MinX = 0;
            int MinY = 0;
            int factor = 10;
            for (int i = 0; i < screens.Length; i++)
            {
                Screen scr = screens[i];

                int width = scr.Bounds.Width;
                int height = scr.Bounds.Height;
                int X = scr.Bounds.X;
                int Y = scr.Bounds.Y;
                if (X < MinX)
                {
                    MinX += Math.Abs(X);
                }
                if (Y < MinY)
                {
                    MinY += Math.Abs(Y);
                }

                width /= factor;
                height /= factor;
                X /= factor;
                Y /= factor;

                ScreenControl scrPanel = new ScreenControl();
                Screens.Add(scrPanel);
                scrPanel.Size = new Size(width, height);
                scrPanel.Location = new Point(X, Y);
                scrPanel.SetName(scr.DeviceName.Remove(0, scr.DeviceName.Length - 1));
                this.panel1.Controls.Add(scrPanel);
            }

            for (int i = 0; i < Screens.Count; i++)
            {
                ScreenControl con = Screens[i];
                con.Location = new Point(con.Location.X + (MinX / factor), con.Location.Y + (MinY / factor));
            }

            num_Players_ValueChanged(null, null);
        }
Пример #3
0
        public GameManager()
        {
            instance = this;
            games = new Dictionary<string, GameInfo>();
            gameInfos = new Dictionary<string, GameInfo>();

            Initialize();
            LoadUser();
        }
Пример #4
0
        public GameManager()
        {
            instance = this;
            games = new Dictionary<string, GameInfo>();
            gameInfos = new Dictionary<string, GameInfo>();

            string appData = GetAppDataPath();
            Directory.CreateDirectory(appData);

            Initialize();
            LoadUser();
        }
Пример #5
0
        static void Main(string[] args)
        {
            GameManager manager = new GameManager();

            GameInfo borderlands2 = manager.Games["720CE71B-FCBF-46C8-AC9D-C4B2BF3169E3"];
            UserGameInfo borderInfo = manager.AddGame(borderlands2, @"C:\Program Files (x86)\Steam\steamapps\common\Borderlands 2\Binaries\Win32\Borderlands2.exe");

            GameProfile profile = new GameProfile();
            profile.InitializeDefault(borderlands2);

            PlayerInfo p1 = new PlayerInfo();
            p1.monitorBounds = new Rectangle(0, 0, 960, 540);
            p1.screenIndex = 0;
            profile.PlayerData.Add(p1);

            PlayerInfo p2 = new PlayerInfo();
            p2.monitorBounds = new Rectangle(0, 540, 960, 540);
            p2.screenIndex = 0;
            profile.PlayerData.Add(p2);

            borderInfo.Profiles.Add(profile);

            manager.WaitSave();

            // try to play game with custom profile
            handler = manager.MakeHandler(borderlands2);

            handler.Initialize(borderInfo, profile);

            ThreadPool.QueueUserWorkItem(Play);
            //handler.Play();

            for (; ; )
            {
                Thread.Sleep(16);
                handler.Update(16);

                if (handler.HasEnded)
                {
                    break;
                }
            }
        }
Пример #6
0
 public FindGameForm(GameManager manager)
 {
     this.gameManager = manager;
     InitializeComponent();
 }
Пример #7
0
        public GamesViewer()
        {
            FormUtil.MainForm = this;
#if TEST
            Assembly ass = Assembly.GetEntryAssembly();
            LogsFolder = Path.Combine(Path.GetDirectoryName(ass.Location), "Logs");
            if (!Directory.Exists(LogsFolder))
            {
                Directory.CreateDirectory(LogsFolder);
            }

            // log all the information we can
            string allLogPath = Path.Combine(LogsFolder, "Log.log");
            using (StreamWriter writer = new StreamWriter(File.OpenWrite(allLogPath)))
            {
                writer.WriteLine("Nucleus Log");
                writer.WriteLine();
                writer.WriteLine("Monitors found");
                Screen[] allScreens = Screen.AllScreens;
                for (int i = 0; i < allScreens.Length; i++)
                {
                    Screen s = allScreens[i];
                    writer.WriteLine(s.DeviceName + " " + s.BitsPerPixel + "BPP  Bounds" + s.Bounds.ToString());
                }

                writer.WriteLine();
                writer.WriteLine("System");
                writer.WriteLine(Environment.OSVersion);
                writer.WriteLine(Environment.Is64BitOperatingSystem ? "64 bits" : "32 bits");
                writer.WriteLine(Environment.ProcessorCount + " Logical Processors");
            }
#endif

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            this.ControlAdded += GamesViewer_ControlAdded;
            this.MouseHover += GamesViewer_MouseHover;

            addSteps = new List<Control>();

            InitializeComponent();

            this.toolTip1.SetToolTip(this.pic_Keyboard, "Is Keyboard Supported?");
            this.toolTip1.SetToolTip(this.pic_gamePad, "How Many Gamepads Are Supported?");

            this.ActiveControl = this.label_Library;

            gameManager = new GameManager();

            steps = new Dictionary<int, Control>();
            steps.Add(0, this.playerCount1);
            steps.Add(1, this.monitorControl1);
            steps.Add(2, this.playerOptions1);

            list_Games.DataSource = gameManager.User.Games;
            label_title.Text = this.playerCount1.StepTitle;

            list_Games.SelectedIndex = -1;
            if (list_Games.Items.Count > 0)
            {
                list_Games.SelectedIndex = 0;
            }
        }