Пример #1
0
        private void compile()
        {
            FOCommon.Maps.MapHeader hd = new FOCommon.Maps.MapHeader();
            if (Config.NeverShowHeaderForm)
            {
                hd.NoLogOut  = false;
                hd.Time      = "-1";
                hd.DayTime   = "300  600  1140 1380";
                hd.DayColor0 = "18  18  53 ";
                hd.DayColor1 = "128 128 128";
                hd.DayColor2 = "103 95  86 ";
                hd.DayColor3 = "51  40  29 ";
            }
            else
            {
                HeaderForm frm = new HeaderForm();
                frm.ShowDialogCenter(this);
                if (frm.OK)
                {
                    hd.ScriptModule = frm.Module;
                    hd.ScriptFunc   = frm.Function;
                    hd.NoLogOut     = frm.NoLogOut;
                    hd.Time         = frm.Time;
                    hd.DayTime      = frm.DayTime;
                    hd.DayColor0    = frm.DayColor0;
                    hd.DayColor1    = frm.DayColor1;
                    hd.DayColor2    = frm.DayColor2;
                    hd.DayColor3    = frm.DayColor3;
                }
                else
                {
                    return;
                }
            }

            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter           = "FOnline map (*.fomap)|*.fomap";
            dlg.RestoreDirectory = true;
            DialogResult ret = dlg.ShowDialog(this);

            if (ret != DialogResult.OK)
            {
                return;
            }
            try
            {
                map.Compile(dlg.FileName, hd);
            }
            catch (CompilerException e)
            {
                ErrorBox("The following error was encountered:\n" + e.Text,
                         "Error compiling map!");
            }
        }
Пример #2
0
        private void compile()
        {
            FOCommon.Maps.MapHeader hd = new FOCommon.Maps.MapHeader();
            if (Config.NeverShowHeaderForm)
            {
                hd.NoLogOut = false;
                hd.Time = "-1";
                hd.DayTime = "300  600  1140 1380";
                hd.DayColor0 = "18  18  53 ";
                hd.DayColor1 = "128 128 128";
                hd.DayColor2 = "103 95  86 ";
                hd.DayColor3 = "51  40  29 ";
            }
            else
            {
                HeaderForm frm = new HeaderForm();
                frm.ShowDialogCenter(this);
                if (frm.OK)
                {
                    hd.ScriptModule = frm.Module;
                    hd.ScriptFunc = frm.Function;
                    hd.NoLogOut = frm.NoLogOut;
                    hd.Time = frm.Time;
                    hd.DayTime = frm.DayTime;
                    hd.DayColor0 = frm.DayColor0;
                    hd.DayColor1 = frm.DayColor1;
                    hd.DayColor2 = frm.DayColor2;
                    hd.DayColor3 = frm.DayColor3;
                }
                else return;
            }

            SaveFileDialog dlg = new SaveFileDialog();
            dlg.Filter = "FOnline map (*.fomap)|*.fomap";
            dlg.RestoreDirectory = true;
            DialogResult ret = dlg.ShowDialog(this);
            if (ret != DialogResult.OK) return;
            try
            {
                map.Compile(dlg.FileName, hd);
            }
            catch (CompilerException e)
            {
                ErrorBox("The following error was encountered:\n" + e.Text,
                    "Error compiling map!");
            }
        }