Example #1
0
        private void AddLightsetButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            d.InitialDirectory = CoreGlobals.getSaveLoadPaths().mGameArtDirectory + "\\lightsets";

            d.Filter      = "ES Lightset File (*.gls)|*.gls";
            d.FilterIndex = 0;

            if (d.ShowDialog() == DialogResult.OK)
            {
                string filename = d.FileName.Replace(CoreGlobals.getWorkPaths().mGameArtDirectory, "");

                // Remove extension
                filename = filename.Remove(filename.Length - 4);

                //kill leading \\
                filename = filename.TrimStart(new char[] { '\\' });

                // Check to see if this is a duplicate
                if (!CoreGlobals.getGameResources().ContainsLightset(filename))
                {
                    // Add to data
                    EditorLightset set = CoreGlobals.getGameResources().AddLightset(filename);

                    // Pause painting
                    LightsetListBox.BeginUpdate();

                    // Add to list box
                    LightsetListBox.Items.Add(set.getIDString());

                    // Assign list box selection to the new objective
                    LightsetListBox.SelectedIndex = LightsetListBox.Items.IndexOf(filename);

                    // Resume painting
                    LightsetListBox.EndUpdate();
                }
                else
                {
                    MessageBox.Show("The Lightset you have selected is already on the list");
                }
            }

            SettingsChanged();
        }
Example #2
0
        private void generateFLSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (LightsetListBox.SelectedItem == null)
            {
                return;
            }

            EditorLightset ls = CoreGlobals.getGameResources().getLightset(LightsetListBox.SelectedIndex);

            if (ls.ObjectIDForFLSGen == -1)
            {
                MessageBox.Show("You must specify a light probe object before generating an FLS file");
                return;
            }

            EditorObject eo = SimGlobals.getSimMain().GetEditorObjectByID(ls.ObjectIDForFLSGen);

            if (eo == null)
            {
                MessageBox.Show("The specified light probe object does not exist. Please select a new one.");
                ls.ObjectPropertyForFLSGen = "";
                return;
            }

            HelperPositionObject hao = eo as HelperPositionObject;

            if (hao == null)
            {
                MessageBox.Show("Error converting EditorObject to HelperPositionObject");
                ls.ObjectPropertyForFLSGen = "";
                return;
            }

            Vector3 pos = hao.getPosition();

            string lightsetFile = CoreGlobals.getWorkPaths().mGameArtDirectory + "\\" + LightsetListBox.SelectedItem.ToString().Split('#')[1];
            string flsName      = lightsetFile + ".fls";

            CoreGlobals.getEditorMain().mIGUI.doQuickView();

            System.Threading.Thread.Sleep(8000);
            XFSInterface.generateFLS(pos.X, pos.Y, pos.Z, flsName);
        }
Example #3
0
        private void setFLSGenLocationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (LightsetListBox.SelectedIndex == -1)
            {
                return;
            }

            PopupEditor        pe  = new PopupEditor();
            BetterPropertyGrid bpg = new BetterPropertyGrid();

            bpg.Height = 40;

            EditorLightset ls = CoreGlobals.getGameResources().getLightset(LightsetListBox.SelectedIndex);

            bpg.IgnoreProperties("EditorLightset", new string[] { "ID", "Name" });
            bpg.SetTypeEditor("EditorLightset", "ObjectPropertyForFLSGen", typeof(PositionHelperObject));
            bpg.SelectedObject = ls;

            pe.ShowPopup(this, bpg);
        }
Example #4
0
        public void isActive()
        {
            isLoading = true;
            minXBounds.Setup(0, TerrainGlobals.getTerrain().getNumXVerts(), false);
            maxXBounds.Setup(0, TerrainGlobals.getTerrain().getNumXVerts(), false);
            minZBounds.Setup(0, TerrainGlobals.getTerrain().getNumXVerts(), false);
            maxZBounds.Setup(0, TerrainGlobals.getTerrain().getNumXVerts(), false);


            minXBounds.NumericValue = CoreGlobals.mPlayableBoundsMinX;
            maxXBounds.NumericValue = CoreGlobals.mPlayableBoundsMaxX;
            minZBounds.NumericValue = CoreGlobals.mPlayableBoundsMinZ;
            maxZBounds.NumericValue = CoreGlobals.mPlayableBoundsMaxZ;

            textBox1.Text = CoreGlobals.ScenarioMinimapTextureFilename;

            string[] temp = new string[CoreGlobals.ScenarioSoundbankFilenames.Count];
            for (int i = 0; i < CoreGlobals.ScenarioSoundbankFilenames.Count; i++)
            {
                temp[i] = CoreGlobals.ScenarioSoundbankFilenames[i];
            }
            soundBankBox.Lines = temp;

            //-- DJB: Yeah this is ugly, but we're at the end of the project, and it's not gonna change.
            worldComboBox.Items.Clear();
            worldComboBox.Items.Add("");
            worldComboBox.Items.Add("Harvest");
            worldComboBox.Items.Add("Arcadia");
            worldComboBox.Items.Add("SWI");
            worldComboBox.Items.Add("SWE");

            worldComboBox.Text = CoreGlobals.ScenarioWorld;

            cinematicListBox.Items.Clear();
            talkingHeadVideos.Items.Clear();

            int count = CoreGlobals.getGameResources().getNumCinematics();

            for (int i = 0; i < count; i++)
            {
                EditorCinematic ecin = CoreGlobals.getGameResources().getCinematic(i);
                cinematicListBox.Items.Add(ecin.Name);
            }


            count = CoreGlobals.getGameResources().getNumTalkingHeadVideos();
            for (int i = 0; i < count; i++)
            {
                EditorCinematic ecin = CoreGlobals.getGameResources().getTalkingHeadVideo(i);
                talkingHeadVideos.Items.Add(ecin.Name);
            }

            count = CoreGlobals.getGameResources().getNumLightsets();

            LightsetListBox.Items.Clear();

            for (int i = 0; i < count; i++)
            {
                EditorLightset ecin = CoreGlobals.getGameResources().getLightset(i);
                LightsetListBox.Items.Add(ecin.getIDString());
            }

            comboBox1.Items.Clear();
            comboBox2.Items.Clear();
            int numSplatTex = TerrainGlobals.getTexturing().getActiveTextureCount();

            for (int i = 0; i < numSplatTex; i++)
            {
                if (TerrainGlobals.getTexturing().getActiveTexture(i) == null)
                {
                    if (mbThisErrorOnce1 == false)
                    {
                        mbThisErrorOnce1 = true;
                        CoreGlobals.ShowMessage("Please report this error to Andrew and Colt: invalid index in isActive ");
                    }

                    continue;
                }
                comboBox1.Items.Add(Path.GetFileName(TerrainGlobals.getTexturing().getActiveTexture(i).mFilename));
                comboBox2.Items.Add(Path.GetFileName(TerrainGlobals.getTexturing().getActiveTexture(i).mFilename));
            }
            if (CoreGlobals.ScenarioBuildingTextureIndexUNSC >= comboBox1.Items.Count)
            {
                CoreGlobals.ScenarioBuildingTextureIndexUNSC = 0;
            }
            comboBox1.SelectedIndex = CoreGlobals.ScenarioBuildingTextureIndexUNSC;

            if (CoreGlobals.ScenarioBuildingTextureIndexCOVN >= comboBox1.Items.Count)
            {
                CoreGlobals.ScenarioBuildingTextureIndexCOVN = 0;
            }
            comboBox2.SelectedIndex = CoreGlobals.ScenarioBuildingTextureIndexCOVN;

            VeterancyCheck.Checked = CoreGlobals.mbAllowVeterancy;
            LoadVisRepBox.Checked  = CoreGlobals.mbLoadTerrainVisRep;


            GlobalExcludeUnitsOptionChooser.Enabled = true;
            GlobalExcludeUnitsOptionChooser.SetOptions(TriggerSystemMain.mSimResources.mObjectTypeData.mObjectTypeList);
            GlobalExcludeUnitsOptionChooser.BoundSelectionList = SimGlobals.getSimMain().GlobalExcludeObjects;
            GlobalExcludeUnitsOptionChooser.AllowRepeats       = false;
            GlobalExcludeUnitsOptionChooser.AutoSort           = true;

            isLoading = false;
        }