Ejemplo n.º 1
0
 public OfficerPreviewForm(Questions questions)
 {
     try
     {
         string path = new Settings().TiePath + "\\RESOURCE\\";
         _empire = new LfdFile(path + "EMPIRE.LFD");
         _talk = new LfdFile(path + "TALK.LFD");
     }
     catch (System.IO.FileNotFoundException)
     {
         MessageBox.Show("TIE resource files not found, preview unavailable", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Close();
     }
     _questions = questions;
     InitializeComponent();
     #region Pltt assignments
     Pltt standard = (Pltt)_empire.Resources["PLTTstandard"];
     Pltt offcr21 = (Pltt)_talk.Resources["PLTToffcr21"];
     Pltt offbak = (Pltt)_talk.Resources["PLTToffbak"];
     Pltt ssrobe9 = (Pltt)_talk.Resources["PLTTssrobe9"];
     Pltt ssbak = (Pltt)_talk.Resources["PLTTssbak"];
     Pltt doffbak = (Pltt)_talk.Resources["PLTTdoffbak"];
     Pltt dssbak = (Pltt)_talk.Resources["PLTTdssbak"];
     ColorPalette brf_off = Pltt.ConvertToPalette(new Pltt[] { standard, offcr21, offbak });
     ColorPalette brf_ss = Pltt.ConvertToPalette(new Pltt[] { standard, ssrobe9, ssbak });
     ColorPalette dbrf_off = Pltt.ConvertToPalette(new Pltt[] { standard, offcr21, doffbak });
     ColorPalette dbrf_ss = Pltt.ConvertToPalette(new Pltt[] { standard, ssrobe9, dssbak });
     ((Delt)_talk.Resources["DELToffbak"]).Palette = brf_off;
     Delt temp = (Delt)_talk.Resources["DELTofftxt"];
     temp.Palette = brf_off;
     temp.Image.MakeTransparent(Color.Black);
     ((Delt)_talk.Resources["DELTdoffbak"]).Palette = dbrf_off;
     temp = (Delt)_talk.Resources["DELTdofftxt"];
     temp.Palette = dbrf_off;
     temp.Image.MakeTransparent(Color.Black);
     temp = (Delt)_talk.Resources["DELToffcr21"];
     temp.Palette = brf_off;
     temp.Image.MakeTransparent(Color.Black);
     ((Anim)_talk.Resources["ANIMeyes"]).SetPalette(brf_off);
     ((Anim)_talk.Resources["ANIMmouth"]).SetPalette(brf_off);
     ((Delt)_talk.Resources["DELTssbak"]).Palette = brf_ss;
     temp = (Delt)_talk.Resources["DELTsstxt"];
     temp.Palette = brf_ss;
     temp.Image.MakeTransparent(Color.Black);
     ((Delt)_talk.Resources["DELTdssbak"]).Palette = dbrf_ss;
     temp = (Delt)_talk.Resources["DELTdsstxt"];
     temp.Palette = dbrf_ss;
     temp.Image.MakeTransparent(Color.Black);
     temp = (Delt)_talk.Resources["DELTssrobe9"];
     temp.Palette = brf_ss;
     temp.Image.MakeTransparent(Color.Black);
     ((Anim)_talk.Resources["ANIMssface"]).SetPalette(brf_ss);
     // offcr21, eyes, mouth, ssrobe9 and ssface technically change between brf and dbrf, but not really
     ((LfdReader.Font)_empire.Resources[_fontID]).SetColor(_normalText);
     #endregion
     #region array declarations
     _opts[0] = optPreOff;
     _opts[1] = optPreSec;
     _opts[2] = optPostOff;
     _opts[3] = optPostSec;
     for(int i = 0; i < 4; i++) _opts[i].CheckedChanged += new EventHandler(optsArr_CheckedChanged);
     _opts[0].Checked = true;
     #endregion
 }
Ejemplo n.º 2
0
 void _initialize()
 {
     OfficersPresent = BriefingOfficers.FlightOfficer;
     _invalidError = _invalidError.Replace("{0}", "TIE");
     _iffHostile[0] = true;
     _iffNameIndexer = new IffNameIndexer(this);
     _iffHostileIndexer = new Indexer<bool>(_iffHostile, new bool[]{true, true, false, false, false, false});
     _endOfMissionIndexer = new Indexer<string>(_endOfMissionMessages, 63);
     FlightGroups = new FlightGroupCollection();
     Messages = new MessageCollection();
     GlobalGoals = new Globals();
     Briefing = new Briefing();
     BriefingQuestions = new Questions();
 }