コード例 #1
0
        public ServerSettings(string ServerName, MaterialForm childForm)
        {
            consoleOverlay = new ConsoleOverlay(ServerName);
            consoleOverlay.OnReceiveConsoleInfo += OnOverlayRequest;

            this.ServerName = ServerName;
            this.Username   = MoonResource.SettingsManager.Username;

            string s = serverModifier.IsOnline(Username, ServerName);

            //Start File
            string startFile_Request = serverModifier.CheckSetting(Username, ServerName, "STARTFILE");

            if (startFile_Request == "true")
            {
                StartFile = serverModifier.ReadSetting(Username, ServerName, "STARTFILE");
            }

            //Server Args
            string ServerArgs_Request = serverModifier.CheckSetting(Username, ServerName, "SERVERARGS");

            if (ServerArgs_Request == "true")
            {
                ServerArgs = serverModifier.ReadSetting(Username, ServerName, "SERVERARGS");
            }

            materialTextBox1.Text = ServerArgs;
            materialTextBox2.Text = StartFile;

            InitializeComponent();
        }
コード例 #2
0
        public void OnLoad()
        {
            // create overlay and insert into HDT overlay
            AutoUpdate();
            CreateDateFileEnviroment();

            _overlay = new BgMatchOverlay();
            _view    = new View();
            _tribes  = new TribesOverlay();
            _inGameDisconectorOverlay = new InGameDisconectorOverlay();

            _console       = new ConsoleOverlay();
            _simpleOverlay = new SimpleOverlay();

            BgMatchData._overlay             = _overlay;
            BgMatchData._view                = _view;
            BgMatchData._tribes              = _tribes;
            BgMatchData._cheatButtonForNoobs = _inGameDisconectorOverlay;

            //BgMatchData._console = _console;
            BgMatchData._simpleOverlay = _simpleOverlay;

            // Triggered upon startup and when the user ticks the plugin on
            GameEvents.OnGameStart.Add(BgMatchData.GameStart);
            GameEvents.OnInMenu.Add(BgMatchData.InMenu);
            GameEvents.OnTurnStart.Add(BgMatchData.TurnStart);
            GameEvents.OnGameEnd.Add(BgMatchData.GameEnd);



            BgMatchData.OnLoad(_config);



            if (_config.showStatsOverlay)
            {
                MountOverlay();
            }
            _overlayManager      = new OverlayManager(_overlay, _config);
            _tribeOverlayManager = new TriverOverlayManager(_tribes, _config);

            BgMatchData._input      = _overlayManager;
            BgMatchData._tribeInput = _tribeOverlayManager;


            Canvas.SetTop(_overlay, _config.posTop);
            Canvas.SetLeft(_overlay, _config.posLeft);

            Canvas.SetTop(_inGameDisconectorOverlay, 50);
            Canvas.SetLeft(_inGameDisconectorOverlay, 300);

            Canvas.SetTop(_tribes, _config.tribePosTop);
            Canvas.SetLeft(_tribes, _config.tribePosLeft);



            _settingsFlyout          = new Flyout();
            _settingsFlyout.Name     = "BgSettingsFlyout";
            _settingsFlyout.Position = Position.Left;
            Panel.SetZIndex(_settingsFlyout, 100);
            _settingsFlyout.Header  = "BoonwinsBattlegroundTracker Settings";
            _settingsControl        = new SettingsControl(_config, MountOverlay, UnmountOverlay);
            _settingsFlyout.Content = _settingsControl;
            //_settingsFlyout.ClosingFinished += (sender, args) =>
            //{
            //    config.save();
            //};
            Core.MainWindow.Flyouts.Items.Add(_settingsFlyout);
        }