Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();

            sideInfoLbl.Text = "Modded by ZeroFox" + "\n" + version;

            positionsControl = new PositionsControl();
            Form settingsForm = new Form(this, positionsControl);

            positionsControl.Paint += PositionsControl_Paint;

            settingsForm.RegHotkeys(this);

            controls    = new Dictionary <UserGameInfo, GameControl>();
            gameManager = new GameManager();

            optionsControl = new PlayerOptionsControl();
            jsControl      = new JSUserInputControl();

            positionsControl.OnCanPlayUpdated += StepCanPlay;
            optionsControl.OnCanPlayUpdated   += StepCanPlay;
            jsControl.OnCanPlayUpdated        += StepCanPlay;

            // selects the list of games, so the buttons look equal
            list_Games.Select();

            //list_Games.AutoScroll = false;
            //int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
            //list_Games.Padding = new Padding(0, 0, vertScrollWidth, 0);
        }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();

            controls    = new Dictionary <UserGameInfo, GameControl>();
            gameManager = new GameManager();

            countControl     = new PlayerCountControl();
            positionsControl = new PositionsControl();
            optionsControl   = new PlayerOptionsControl();

            countControl.OnCanPlay     += StepCanPlay;
            positionsControl.OnCanPlay += StepCanPlay;
            optionsControl.OnCanPlay   += StepCanPlay;
        }
Esempio n. 3
0
        public MainForm(string[] args)
        {
            InitializeComponent();

            this.Text = string.Format("Nucleus Coop v{0}", Globals.Version);

            controls = new Dictionary <UserGameInfo, GameControl>();

            configFile  = new CoopConfigInfo("config.json");
            gameManager = new GameManager(configFile);

            positionsControl = new PositionsControl();
            optionsControl   = new PlayerOptionsControl();
            jsControl        = new JSUserInputControl();

            positionsControl.OnCanPlayUpdated += StepCanPlay;
            optionsControl.OnCanPlayUpdated   += StepCanPlay;
            jsControl.OnCanPlayUpdated        += StepCanPlay;

            // selects the list of games, so the buttons look equal
            list_Games.Select();
            list_Games.AutoScroll       = false;
            list_Games.SelectedChanged += list_Games_SelectedChanged;
            //int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
            //list_Games.Padding = new Padding(0, 0, vertScrollWidth, 0);

            if (args != null)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    string argument = args[i];
                    if (string.IsNullOrEmpty(argument))
                    {
                        continue;
                    }

                    string extension = Path.GetExtension(argument);
                    if (extension.ToLower().EndsWith("nc"))
                    {
                        // try installing
                        gameManager.RepoManager.InstallPackage(argument);
                    }
                }
            }
        }
Esempio n. 4
0
        public MainForm()
        {
            InitializeComponent();

            controls    = new Dictionary <UserGameInfo, GameControl>();
            gameManager = new GameManager();

            positionsControl = new PositionsControl();
            optionsControl   = new PlayerOptionsControl();
            jsControl        = new JSUserInputControl();

            positionsControl.OnCanPlayUpdated += StepCanPlay;
            optionsControl.OnCanPlayUpdated   += StepCanPlay;
            jsControl.OnCanPlayUpdated        += StepCanPlay;

            // selects the list of games, so the buttons look equal
            list_Games.Select();
        }
Esempio n. 5
0
        public MainForm()
        {
            InitializeComponent();

            controls = new Dictionary <UserGameInfo, GameControl>();

            configFile  = new CoopConfig("config.js");
            gameManager = new GameManager(configFile);

            positionsControl = new PositionsControl();
            optionsControl   = new PlayerOptionsControl();
            jsControl        = new JSUserInputControl();

            positionsControl.OnCanPlayUpdated += StepCanPlay;
            optionsControl.OnCanPlayUpdated   += StepCanPlay;
            jsControl.OnCanPlayUpdated        += StepCanPlay;

            // selects the list of games, so the buttons look equal
            list_Games.Select();
            list_Games.AutoScroll = false;
            //int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
            //list_Games.Padding = new Padding(0, 0, vertScrollWidth, 0);
        }
Esempio n. 6
0
        public MainForm(string[] args)
        {
            InitializeComponent();

            overlay         = new GameRunningOverlay();
            overlay.OnStop += Overlay_OnStop;

            this.Text = string.Format("Nucleus Coop v{0}", Globals.Version);

            controls = new Dictionary <UserGameInfo, GameControl>();

            configFile  = new CoopConfigInfo("config.json");
            gameManager = new GameManager(configFile);

            positionsControl = new PositionsControl();
            optionsControl   = new PlayerOptionsControl();
            jsControl        = new JSUserInputControl();

            positionsControl.OnCanPlayUpdated += StepCanPlay;
            optionsControl.OnCanPlayUpdated   += StepCanPlay;
            jsControl.OnCanPlayUpdated        += StepCanPlay;

            // selects the list of games, so the buttons look equal
            list_Games.Select();
            list_Games.AutoScroll       = false;
            list_Games.SelectedChanged += list_Games_SelectedChanged;
            //int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
            //list_Games.Padding = new Padding(0, 0, vertScrollWidth, 0);


            if (args != null)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    string argument = args[i];
                    if (string.IsNullOrEmpty(argument))
                    {
                        continue;
                    }

                    string extension = Path.GetExtension(argument);
                    if (extension.ToLower().EndsWith("nc"))
                    {
                        // try installing if user allows it
                        if (MessageBox.Show("Would you like to install " + argument + "?", "Question", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            gameManager.RepoManager.InstallPackage(argument);
                        }
                    }
                }
            }

            if (!gameManager.User.Options.RequestedToAssociateFormat)
            {
                gameManager.User.Options.RequestedToAssociateFormat = true;

                if (MessageBox.Show("Would you like to associate Nucleus Package Files (*.nc) to the application?", "Question", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    string startLocation = Process.GetCurrentProcess().MainModule.FileName;
                    if (!FileAssociations.SetAssociation(".nc", "NucleusCoop", "Nucleus Package Files", startLocation))
                    {
                        MessageBox.Show("Failed to set association");
                        gameManager.User.Options.RequestedToAssociateFormat = false;
                    }
                }

                gameManager.User.Save();
            }
        }