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(); }
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; }