Esempio n. 1
0
        public GatheringBot(GatheringConfig config, List <Waypoint> waypointList)
        {
            this.timer          = new System.Windows.Forms.Timer();
            this.timer.Interval = SettingsSingleton.Instance.timings.movementUpdateTick;
            this.timer.Tick    += new System.EventHandler(this.tickGather);

            this.gatheringConfig = config;
            this.waypointList    = waypointList;
            this.gkeys           = this.gatheringConfig.movement;
        }
        private void renderGatheringConfig(GatheringConfig config)
        {
            this.matureTreeBox.Checked          = (config.matureTree == 1);
            this.lushVegetationPatchBox.Checked = (config.lushVegetationPatch == 1);
            this.mineralDepositBox.Checked      = (config.mineralDeposit == 1);
            this.rockyOutcropBox.Checked        = (config.rockyOutcrop == 1);

            this.renderComboboxWithKeys(this.forwardComboBox, config.movement.forward);
            this.renderComboboxWithKeys(this.backwardComboBox, config.movement.backward);
            this.renderComboboxWithKeys(this.rotateLeftComboBox, config.movement.rotateLeft);
            this.renderComboboxWithKeys(this.rotateRightComboBox, config.movement.rotateRight);
            this.renderComboboxWithKeys(this.actionComboBox, config.movement.action);
        }
        private void saveButton_Click(object sender, EventArgs e)
        {
            GeneralKeys generalKeys = new GeneralKeys();

            generalKeys.forward     = (UseableKeys)this.forwardComboBox.SelectedItem;
            generalKeys.backward    = (UseableKeys)this.backwardComboBox.SelectedItem;
            generalKeys.rotateLeft  = (UseableKeys)this.rotateLeftComboBox.SelectedItem;
            generalKeys.rotateRight = (UseableKeys)this.rotateRightComboBox.SelectedItem;
            generalKeys.action      = (UseableKeys)this.actionComboBox.SelectedItem;

            GatheringConfig gatheringConfig = new GatheringConfig();

            gatheringConfig.movement            = generalKeys;
            gatheringConfig.matureTree          = this.matureTreeBox.Checked? 1 : 0;
            gatheringConfig.lushVegetationPatch = this.lushVegetationPatchBox.Checked ? 1 : 0;
            gatheringConfig.mineralDeposit      = this.mineralDepositBox.Checked ? 1 : 0;
            gatheringConfig.rockyOutcrop        = this.rockyOutcropBox.Checked ? 1 : 0;

            this.configHolder.gatheringConfig = gatheringConfig;

            SaveConfigForm form = new SaveConfigForm(this.configHolder, this.saveConfigFormFinished);

            form.ShowDialog();
        }