Ejemplo n.º 1
0
        void MoveUpButtonClick(object sender, EventArgs e)
        {
            DataGridViewRow currentRow = scenariosTable.CurrentRow;

            if (currentRow == null)
            {
                return;                                  // No row currently selected.
            }
            int currentIndex = scenariosTable.CurrentRow.Index;

            if (currentIndex == 0)
            {
                return;                                 // Avoid pointlessly updating the data.
            }
            int newIndex = currentIndex - 1;

            scenariosTable.Rows.RemoveAt(currentIndex);
            scenariosTable.Rows.Insert(newIndex, currentRow);
            scenariosTable.CurrentCell = currentRow.Cells[0];

            List <CampaignScenario> scenarios       = campaign.Scenarios;
            CampaignScenario        currentScenario = campaign.Scenarios[currentIndex];

            scenarios.RemoveAt(currentIndex);
            scenarios.Insert(newIndex, currentScenario);
        }
Ejemplo n.º 2
0
        void MoveDownButtonClick(object sender, EventArgs e)
        {
            DataGridViewRow currentRow = scenariosTable.CurrentRow;

            if (currentRow == null)
            {
                return;
            }

            int currentIndex = scenariosTable.CurrentRow.Index;
            int count        = scenariosTable.Rows.Count;

            if (currentIndex == count - 1)
            {
                return;
            }
            int newIndex = currentIndex + 1;

            scenariosTable.Rows.RemoveAt(currentIndex);
            scenariosTable.Rows.Insert(newIndex, currentRow);
            scenariosTable.CurrentCell = currentRow.Cells[0];

            List <CampaignScenario> scenarios       = campaign.Scenarios;
            CampaignScenario        currentScenario = campaign.Scenarios[currentIndex];

            scenarios.RemoveAt(currentIndex);
            scenarios.Insert(newIndex, currentScenario);
        }
Ejemplo n.º 3
0
        void AddButtonClick(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog()) {
                dialog.CheckPathExists = true;
                dialog.CheckFileExists = true;
                dialog.Filter          = "AoE II scenarios (*.scn, *.scx)|*.scn;*.scx";
                dialog.Title           = "Add scenario..";
                DialogResult result = dialog.ShowDialog();

                if (result == DialogResult.OK)
                {
                    string scenarioName     = Path.GetFileNameWithoutExtension(dialog.FileName);
                    string scenarioFilename = Path.GetFileName(dialog.FileName);
                    using (FileStream fs = File.OpenRead(dialog.FileName)) {
                        int    length = (int)fs.Length;
                        byte[] data   = new byte[length];
                        fs.Read(data, 0, data.Length);

                        CampaignScenario scenario = new CampaignScenario();
                        scenario.Data     = data;
                        scenario.Name     = scenarioName;
                        scenario.Filename = scenarioFilename;
                        campaign.Scenarios.Add(scenario);
                        int index = scenariosTable.Rows.Add();
                        scenariosTable.Rows[index].Cells[0].Value = scenarioName;
                    }
                }
            }
        }
Ejemplo n.º 4
0
    private void OnQuicksave(ConfigNode qsNode)
    {
        Debug.Log("Preforming modified quicksave");
        ConfigNode configNode = new ConfigNode("ModdedSaveFile");

        qsNode.AddNode(configNode);
        CampaignScenario cur_Scenario = PilotSaveManager.currentScenario;
        Campaign         cur_Campaign = PilotSaveManager.currentCampaign;

        configNode.SetValue <string>("scenarioID", cur_Scenario.scenarioID);

        /*configNode.SetValue<string>("scenarioName", cur_Scenario.scenarioName);
         * configNode.SetValue<string>("scenarioID", cur_Scenario.scenarioID);
         * configNode.SetValue<string>("mapID", VTMapManager.fetch.map.mapID);
         * configNode.SetValue<string>("scenarioDescription", cur_Scenario.description);*/
        if (cur_Campaign != null)
        {
            configNode.SetValue <string>("campaignID", cur_Campaign.campaignID);
            if (cur_Campaign.isBuiltIn)
            {
                configNode.SetValue <string>("campaignType", "builtIn");
            }
            else if (cur_Campaign.isSteamworksStandalone)
            {
                configNode.SetValue <string>("campaignType", "SSS");
            }
            else if (cur_Campaign.isStandaloneScenarios)
            {
                configNode.SetValue <string>("campaignType", "SS");
            }
            else
            {
                configNode.SetValue <string>("campaignType", "other");
            }
        }
    }
Ejemplo n.º 5
0
 public PublicApiStep(IWebDriver driver, FeatureContext featureContext) : base(driver, featureContext)
 {
     authenticationScenario = new AuthenticationScenario();
     campaignScenario       = new CampaignScenario();
 }