示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (mLightSet.getObjectIDForFLSGen() == -1)
            {
                MessageBox.Show("You must specify a light probe object before generating an FLS file");
                return;
            }

            EditorObject eo = SimGlobals.getSimMain().GetEditorObjectByID(mLightSet.getObjectIDForFLSGen());

            if (eo == null)
            {
                return;
            }

            HelperPositionObject hao = eo as HelperPositionObject;

            string lightsetFile = Path.Combine(CoreGlobals.ScenarioDirectory, CoreGlobals.ScenarioLightsetFilename);
            string flsName      = Path.ChangeExtension(lightsetFile, ".fls");

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

            //  System.Threading.Thread.Sleep(10000);
            XFSInterface.generateFLS(hao.getPosition().X, hao.getPosition().Y, hao.getPosition().Z, flsName);
        }
示例#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);
        }