Exemple #1
0
        public formCSM(string quoteNumber, QuoteTypes quoteType)
        {
            InitializeComponent();

            this.Text       = "Quote Number: " + quoteNumber;
            lblMessage.Text = "";

            _quoteType     = quoteType;
            _csmController = new CSMController(quoteNumber);

            // North American CSM data
            if (GetAllNorthAmericanCsmData() == 0)
            {
                this.Close();
            }
            if (GetNorthAmericanCsmDataForQuote() == 0)
            {
                this.Close();
            }

            // Non-North American CSM data
            if (GetNonNorthAmericanCsmData() == 0)
            {
                this.Close();
            }
        }
Exemple #2
0
        public formQuoteMaintenance(string quoteNumber, DateTime?sop, DateTime?eop, int?rowId, QuoteTypes quoteType)
        {
            InitializeComponent();

            _context = new QuoteLogContext();

            _quoteType = quoteType;
            _sop       = sop;
            _eop       = eop;
            _rowID     = rowId;

            _quoteMaintenanceController = new QuoteMaintenanceController(quoteNumber, quoteType, this);

            if (_quoteType != QuoteTypes.ModifyExisting)
            {
                gbxLTA.Visible  = btnCSM.Visible = false;
                lblMessage.Text = "CSM and LTA sections will become available after saving.";
            }
            else
            {
                lblMessage.Text = "";
            }

            printDocStatus    = PrintDocStatus.NoActionTaken;
            cbxRepeat.Visible = false;
        }
Exemple #3
0
        private void SaveNewQuote()
        {
            string result;

            // Save changes made to the QuoteLog entity
            result = _quoteMaintenanceController.SaveContext();
            if (result != "")
            {
                MessageBox.Show(result, "SaveNewQuote()");
                return;
            }

            // LTAs
            _quoteMaintenanceController.UpdateLtas(); // Exec procedure to update LTA effective dates based on the saved model year
            _quoteMaintenanceController.SaveLTAs();   // Save LTA context (save LTA percentages)
            _quoteMaintenanceController.GetLTAs();    // Refresh LTA grid

            // Tie Print to Quote
            if (printDocStatus == PrintDocStatus.PrintAdded)
            {
                SavePrint();
            }

            // Tie Customer Quote Document (PDF) to Quote
            if (customerQuoteDocStatus == CustomerQuoteDocStatus.QuoteAdded)
            {
                SaveCustomerQuoteDocument();
            }

            // Allow changes to this newly saved quote
            gbxLTA.Visible  = btnCSM.Visible = true;
            _quoteType      = QuoteTypes.ModifyExisting;
            lblMessage.Text = "";
        }
Exemple #4
0
 private void rbtnBomModification_CheckedChanged(object sender, EventArgs e)
 {
     if (rbtnBomModification.Checked)
     {
         QuoteType = QuoteTypes.BomMod;
     }
 }
Exemple #5
0
 private void rbtnPriceChange_CheckedChanged(object sender, EventArgs e)
 {
     if (rbtnPriceChange.Checked)
     {
         QuoteType = QuoteTypes.PriceChange;
     }
 }
Exemple #6
0
 private void rbtnCopyQuote_CheckedChanged(object sender, EventArgs e)
 {
     if (rbtnCopyQuote.Checked)
     {
         QuoteType = QuoteTypes.Copy;
     }
 }
Exemple #7
0
 private void rbtnModifyExisting_CheckedChanged(object sender, EventArgs e)
 {
     if (rbtnModifyExisting.Checked)
     {
         QuoteType = QuoteTypes.ModifyExisting;
     }
 }
Exemple #8
0
 public Quotation(string shortDescription, string fullText, double positionInSource, QuoteTypes type)
 {
     _shortDescription = shortDescription;
     _fullText         = fullText;
     _positionInSource = positionInSource;
     _type             = type;
 }
Exemple #9
0
        public QuoteMaintenanceController(string quoteNumber, QuoteTypes QuoteType, formQuoteMaintenance frmQuoteMaintenance)
        {
            string errorMessage;
            string errorMethod;

            _theView     = frmQuoteMaintenance;
            _quoteNumber = quoteNumber;
            _quoteType   = QuoteType;

            _context = new QuoteLogContext();
            _nqn     = new DataLayerNewQuoteNumber();
            _empireMarketDataLayer = new DataLayerEmpireMarket();

            // Get quote header data, get a new quote number and reset the _quoteNumber variable if necessary
            GetQuoteHeaderData(out errorMessage, out errorMethod);
            if (errorMessage != "")
            {
                ShowError(errorMessage, errorMethod);
                return;
            }

            // Bind all the LookupEdit columns in the grid
            LoadLookupColumns();
            BindDataSources();


            // Quote LTA data
            if (_quoteType == QuoteTypes.ModifyExisting)
            {
                // Existing quote, so update LTA data for it
                _ltaController         = new LTAController(_quoteNumber, false);
                _theView.LtaDataSource = _ltaController.GetLtaData(out errorMessage);
                if (errorMessage != "")
                {
                    ShowError(errorMessage, "GetLtaData()");
                    return;
                }
            }
            else
            {
                // New quote, so bypass LTA functions until the quote is saved
                _ltaController = new LTAController(_quoteNumber, true);
            }


            // Quote Print document and Customer Quote document
            _fileController = new FileController(_quoteNumber);
            if (_quoteType == QuoteTypes.ModifyExisting)
            {
                _theView.QuotePrintFile    = _fileController.GetQuotePrint();
                _theView.QuotePrintNo      = _fileController.GetPrintNo();
                _theView.QuotePrintDate    = _fileController.GetPrintDate();
                _theView.CustomerQuoteFile = _fileController.GetCustomerQuote();
            }
            else
            {
                _theView.ExistsQuotePrint = _theView.ExistsCustomerQuote = false;
            }
        }
        private void SaveNewQuote()
        {
            string result;

            if (layoutView1.GetRowCellValue(0, "ModelYear") == null)
            {
                MessageBox.Show("You must enter a Model Year.");
                return;
            }

            // Save changes made to the QuoteLog entity
            result = _quoteMaintenanceController.SaveContext();
            if (result != "")
            {
                MessageBox.Show(result, "SaveNewQuote()");
                return;
            }

            // LTAs
            //_quoteMaintenanceController.UpdateLtas();  // Exec procedure to update LTA effective dates based on the saved model year
            _quoteMaintenanceController.SaveLTAs(QuoteNumber); // Create LTA records based off the quote's model year with default percentages of zero
            _quoteMaintenanceController.GetLTAs();             // Refresh LTA grid

            // Tie Print to Quote
            if (printDocStatus == PrintDocStatus.PrintAdded)
            {
                SavePrint();
            }

            // Tie Customer Quote Document (PDF) to Quote
            if (customerQuoteDocStatus == CustomerQuoteDocStatus.QuoteAdded)
            {
                SaveCustomerQuoteDocument();
            }

            // Allow changes to this newly saved quote
            gridControl3.Enabled = btnCSM.Visible = true;
            _quoteType           = QuoteTypes.ModifyExisting;
            lblMessage.Text      = "";
        }
        public override void Load()
        {
            if (IsLoaded)
            {
                return;
            }

            IsLoaded = true;

            fntFinlanderFont           = Content.Load <SpriteFont>("Fonts/Finlander Font");
            sprBarExtraLargeBackground = Content.Load <Texture2D>("Battle/Bars/Extra Long Bar");
            sprBarExtraLargeEN         = Content.Load <Texture2D>("Battle/Bars/Extra Long Energy");
            sprBarExtraLargeHP         = Content.Load <Texture2D>("Battle/Bars/Extra Long Health");
            sprInfinity = Content.Load <Texture2D>("Battle/Infinity");

            foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline)))
            {
                if (Timeline.Value is AnimationOriginTimeline)
                {
                    continue;
                }

                DicTimeline.Add(Timeline.Key, Timeline.Value);
            }

            foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(DeathmatchMapTimeline), this, Content))
            {
                DicTimeline.Add(Timeline.Key, Timeline.Value);
            }

            base.Load();

            InitRessources();

            Unit ActiveUnit = AttackingSquad.CurrentLeader;
            Unit EnemyUnit  = EnemySquad.CurrentLeader;

            for (int L = ListAnimationLayer.Count - 1; L >= 0; --L)
            {
                #region Markers

                foreach (List <Timeline> ListActiveEvent in ListAnimationLayer[L].DicTimelineEvent.Values)
                {
                    foreach (Timeline ActiveTimeline in ListActiveEvent)
                    {
                        MarkerTimeline ActiveMarkerEvent = ActiveTimeline as MarkerTimeline;
                        if (ActiveMarkerEvent == null)
                        {
                            continue;
                        }

                        string AnimationPath = "";

                        switch (ActiveMarkerEvent.MarkerType)
                        {
                        case "Support Stand":
                        case "Support Standing":
                        case "Enemy Standing":
                        case "Enemy Stand":
                        case "Enemy Default":
                            ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemyUnit.Animations.Default.AnimationName);
                            break;

                        case "Enemy Wingman A Standing":
                        case "Enemy Wingman 1 Standing":
                            if (EnemySquad.CurrentWingmanA != null)
                            {
                                ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemySquad.CurrentWingmanA.Animations.Default.AnimationName);
                            }
                            break;

                        case "Enemy Wingman B Standing":
                        case "Enemy Wingman 2 Standing":
                            if (EnemySquad.CurrentWingmanB != null)
                            {
                                ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemySquad.CurrentWingmanB.Animations.Default.AnimationName);
                            }
                            break;

                        case "Enemy Hit":
                            if (BattleResult.ArrayResult[0].AttackMissed)
                            {
                                AnimationPath = EnemyUnit.Animations.Default.AnimationName;
                            }
                            else
                            {
                                AnimationPath = EnemyUnit.Animations.Hit.AnimationName;
                            }
                            if (File.Exists("Content/Animations/" + AnimationPath + ".pea"))
                            {
                                ActiveMarkerEvent.AnimationMarker = new AnimationClass(AnimationPath);
                            }
                            else
                            {
                                ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemyUnit.Animations.Default.AnimationName);
                            }
                            break;

                        case "Player Stand":
                        case "Player Standing":
                        case "Player Default":
                            ActiveMarkerEvent.AnimationMarker = new AnimationClass(ActiveUnit.Animations.Default.AnimationName);
                            break;

                        default:
                            AnimationPath = EnemyUnit.Animations.Default.AnimationName;
                            if (ActiveMarkerEvent.MarkerType.StartsWith("Player "))
                            {
                                AnimationPath = ActiveMarkerEvent.MarkerType.Split(new string[] { "Player " }, StringSplitOptions.RemoveEmptyEntries)[0];
                            }
                            ActiveMarkerEvent.AnimationMarker = new AnimationClass(AnimationPath);
                            break;
                        }
                        ActiveMarkerEvent.AnimationMarker.DicTimeline = DicTimeline;
                        ActiveMarkerEvent.AnimationMarker.Load();
                    }
                }

                #endregion

                #region Quotes

                foreach (QuoteSetTimeline.QuoteSetKeyFrame ActiveKeyFrame in ((QuoteSetTimeline)ListAnimationLayer.EngineLayer.DicTimelineEvent[0][1]).DicAnimationKeyFrame.Values)
                {
                    Quote ActiveQuote   = ActiveKeyFrame.QuoteSet;
                    int   QuoteSetIndex = 0;
                    int   QuoteSetCount = 0;

                    //Once a Quote is selected, keep it, if random quotes are needed, use multiple QuoteSet.
                    //If the number of QuoteSet changed, assume the user did something wrong and get a new index.
                    if (ActiveQuote.ListQuoteSet.Count > 1 && QuoteSetCount != ActiveQuote.ListQuoteSet.Count)
                    {
                        QuoteSetCount = ActiveQuote.ListQuoteSet.Count;
                        QuoteSetIndex = Random.Next(ActiveQuote.ListQuoteSet.Count);
                        ActiveQuote.SelectedQuoteSet = QuoteSetIndex;
                    }

                    Quote.Targets ActiveTarget   = ActiveQuote.Target;
                    QuoteSet      ActiveQuoteSet = ActiveQuote.ActiveQuoteSet;

                    Character ActivePilot = ActiveUnit.Pilot;
                    Character EnemyPilot  = EnemyUnit.Pilot;
                    if (ActiveTarget == Quote.Targets.Defender)
                    {
                        ActivePilot = EnemyUnit.Pilot;
                        EnemyPilot  = ActiveUnit.Pilot;
                    }

                    bool UseRandomIndex             = !ActiveQuoteSet.QuoteSetUseLast && ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Random;
                    QuoteSet.QuoteStyles QuoteStyle = ActiveQuoteSet.QuoteStyle;
                    int QuoteIndex = 0;
                    if (ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Fixed)
                    {
                        QuoteIndex = ActiveQuoteSet.QuoteSetChoiceValue;
                    }

                    Tuple <string, string> ActiveQuoteTuple;

                    switch (QuoteStyle)
                    {
                    case QuoteSet.QuoteStyles.Reaction:
                        QuoteTypes ActiveQuoteType = QuoteTypes.Damaged;
                        ActiveQuoteTuple         = GetQuote(ActiveQuoteType, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText   = ActiveQuoteTuple.Item2;
                        ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1;
                        break;

                    case QuoteSet.QuoteStyles.QuoteSet:
                        ActiveQuoteTuple         = GetAttackQuote(ActiveQuoteSet.QuoteSetName, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText   = ActiveQuoteTuple.Item2;
                        ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1;
                        break;

                    case QuoteSet.QuoteStyles.Custom:
                        ActiveQuote.ActiveText = ActiveQuoteSet.CustomText;
                        break;

                    case QuoteSet.QuoteStyles.MoveIn:
                        ActiveQuoteTuple         = GetQuote(QuoteTypes.BattleStart, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText   = ActiveQuoteTuple.Item2;
                        ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1;
                        break;
                    }

                    if (!string.IsNullOrEmpty(ActiveQuote.PortraitPath))
                    {
                        if (ActiveQuote.PortraitPath.StartsWith("Animations"))
                        {
                            ActiveQuote.ActiveCharacter = new SimpleAnimation("", ActiveQuote.PortraitPath, new AnimationLooped(ActiveQuote.PortraitPath));
                            ActiveQuote.ActiveCharacter.ActiveAnimation.Content = Content;
                            ActiveQuote.ActiveCharacter.ActiveAnimation.Load();
                        }
                        else
                        {
                            ActiveQuote.ActiveCharacter = new SimpleAnimation("", ActiveQuote.PortraitPath, Content.Load <Texture2D>(ActiveQuote.PortraitPath));
                        }
                    }
                }

                #endregion

                #region Init renderTarget

                ListAnimationLayer[L].renderTarget = new RenderTarget2D(
                    GraphicsDevice,
                    GraphicsDevice.PresentationParameters.BackBufferWidth,
                    GraphicsDevice.PresentationParameters.BackBufferHeight);

                #endregion
            }
        }
        public Tuple <string, string> GetQuote(QuoteTypes QuoteType, Character ActivePilot, Character EnemyPilot, bool UseRandomIndex, ref int QuoteIndex)
        {
            Character.QuoteSet Quote = null;
            switch (QuoteType)
            {
            case QuoteTypes.BattleStart:
                Quote = ActivePilot.QuoteSetBattleStart;
                break;

            case QuoteTypes.Dodge:
                Quote = ActivePilot.QuoteSetDodge;
                break;

            case QuoteTypes.Damaged:
                Quote = ActivePilot.QuoteSetDamaged;
                break;

            case QuoteTypes.Destroyed:
                Quote = ActivePilot.QuoteSetDestroyed;
                break;

            case QuoteTypes.SupportAttack:
                Quote = ActivePilot.QuoteSetSupportAttack;
                break;

            case QuoteTypes.SupportDefend:
                Quote = ActivePilot.QuoteSetSupportDefend;
                break;
            }

            List <string> ListQuote = null;
            bool          IsVersus  = false;

            if (ActivePilot.ListQuoteSetVersusName.Contains(EnemyPilot.Name))
            {
                IsVersus = true;
            }

            //Versus.
            if (IsVersus)
            {
                //Calculate if it should use a base quote or a Versus quote, favorising the versus ones.
                int RandomQuoteIndex = Random.Next(Quote.ListQuote.Count + (int)(Quote.ListQuoteVersus.Count * 2.5f));

                //Use one of the base quote.
                if (RandomQuoteIndex < Quote.ListQuote.Count)
                {
                    //Get a random index if needed.
                    if (UseRandomIndex)
                    {
                        QuoteIndex = Random.Next(ListQuote.Count);
                    }
                    else if (QuoteIndex >= ListQuote.Count)
                    {
                        return(new Tuple <string, string>(Quote.PortraitPath, Quote.ListQuote[0]));
                    }

                    return(new Tuple <string, string>(Quote.PortraitPath, Quote.ListQuote[QuoteIndex]));
                }
                //Use a versus quote.
                else if (Quote.ListQuoteVersus.Count > 0)
                {
                    //Get a random index if needed.
                    if (UseRandomIndex)
                    {
                        QuoteIndex = Random.Next(Quote.ListQuoteVersus.Count);
                    }
                    else if (QuoteIndex >= Quote.ListQuoteVersus.Count)
                    {
                        return(new Tuple <string, string>(Quote.PortraitPath, Quote.ListQuoteVersus[0]));
                    }

                    return(new Tuple <string, string>(Quote.PortraitPath, Quote.ListQuoteVersus[QuoteIndex]));
                }
            }
            else//Not versus.
            {
                if (IsVersus)
                {
                    ListQuote = Quote.ListQuoteVersus;
                }
                else
                {
                    ListQuote = Quote.ListQuote;
                }

                if (ListQuote.Count == 0)
                {
                    return(new Tuple <string, string>("", ""));
                }

                //Get a random index if needed.
                if (UseRandomIndex)
                {
                    QuoteIndex = Random.Next(ListQuote.Count);
                }
                else if (QuoteIndex >= ListQuote.Count)
                {
                    return(new Tuple <string, string>(Quote.PortraitPath, Quote.ListQuote[0]));
                }

                return(new Tuple <string, string>(Quote.PortraitPath, ListQuote[QuoteIndex]));
            }

            return(new Tuple <string, string>("", ""));
        }
        public formQuoteMaintenance(string quoteNumber, DateTime?sop, DateTime?eop, int?rowId, QuoteTypes quoteType, string customer,
                                    string customerRfqNumber, string customerPartNumber, string eeiPartNumber, string notes, string oem, string applicationCode,
                                    string applicationName, string functionName, string eau, string program, string nameplate, string programManagerInitials,
                                    string engineeringInitials, string salesInitials, string engineeringMaterialsInitials, string quoteReviewInitials,
                                    string quotePricingInitials, string customerQuoteInitials, string modelYear, string packageNumber, string quoteReason,
                                    string productLine, string printFilePath, string customerQuoteFilePath, string marketSegment, string marketSubsegment,
                                    string minimumOrderQuantity, string awarded, string awardedDate, string straightMaterialCost, string stdHours,
                                    string tooling, string quotePrice, string prototypePrice)
        {
            InitializeComponent();

            _context = new QuoteLogContext();

            _quoteType                    = quoteType;
            _sop                          = sop;
            _eop                          = eop;
            _customer                     = customer;
            _customerRfqNumber            = customerRfqNumber;
            _customerPartNumber           = customerPartNumber;
            _eeiPartNumber                = eeiPartNumber;
            _notes                        = notes;
            _oem                          = oem;
            _applicationCode              = applicationCode;
            _applicationName              = applicationName;
            _functionName                 = functionName;
            _eau                          = eau;
            _program                      = program;
            _nameplate                    = nameplate;
            _programManagerInitials       = programManagerInitials;
            _engineeringInitials          = engineeringInitials;
            _salesInitials                = salesInitials;
            _engineeringMaterialsInitials = engineeringMaterialsInitials;
            _quoteReviewInitials          = quoteReviewInitials;
            _quotePricingInitials         = quotePricingInitials;
            _customerQuoteInitials        = customerQuoteInitials;
            _modelYear                    = modelYear;
            _packageNumber                = packageNumber;
            _quoteReason                  = quoteReason;
            _productLine                  = productLine;
            _printFilePath                = printFilePath;
            _customerQuoteFilePath        = customerQuoteFilePath;
            _marketSegment                = marketSegment;
            _marketSubsegment             = marketSubsegment;
            _awarded                      = awarded;
            _awardedDate                  = awardedDate;
            _straightMaterialCost         = straightMaterialCost;
            _stdHours                     = stdHours;
            _tooling                      = tooling;
            _quotePrice                   = quotePrice;
            _prototypePrice               = prototypePrice;
            _minimumOrderQuantity         = minimumOrderQuantity;
            _rowID                        = rowId;

            _quoteMaintenanceController = new QuoteMaintenanceController(quoteNumber, quoteType, this);

            if (_quoteType != QuoteTypes.ModifyExisting)
            {
                gridControl3.Enabled = btnCSM.Visible = false;
                lblMessage.Text      = "CSM and LTA sections will become available after saving.";
            }
            else
            {
                lblMessage.Text = "";
            }

            printDocStatus    = PrintDocStatus.NoActionTaken;
            cbxRepeat.Visible = false;

            // File Management
            ShowQuotePrintFileInfo();
            ShowCustomerQuoteFileInfo();
        }
        public override void Load()
        {
            if (IsLoaded)
            {
                return;
            }

            IsLoaded = true;

            fntFinlanderFont           = Content.Load <SpriteFont>("Fonts/Finlander Font");
            sprBarExtraLargeBackground = Content.Load <Texture2D>("Battle/Bars/Extra Long Bar");
            sprBarExtraLargeEN         = Content.Load <Texture2D>("Battle/Bars/Extra Long Energy");
            sprBarExtraLargeHP         = Content.Load <Texture2D>("Battle/Bars/Extra Long Health");
            sprInfinity = Content.Load <Texture2D>("Battle/Infinity");

            foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline)))
            {
                if (Timeline.Value is AnimationOriginTimeline)
                {
                    continue;
                }

                DicTimeline.Add(Timeline.Key, Timeline.Value);
            }

            foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(DeathmatchMapTimeline), this, Content))
            {
                DicTimeline.Add(Timeline.Key, Timeline.Value);
            }

            base.Load();

            InitRessources();

            Unit ActiveUnit = AttackingSquad.CurrentLeader;
            Unit EnemyUnit  = EnemySquad.CurrentLeader;

            for (int L = ListAnimationLayer.Count - 1; L >= 0; --L)
            {
                InitMarkers(ListAnimationLayer[L], AttackingSquad, EnemySquad);

                #region Quotes

                foreach (QuoteSetTimeline.QuoteSetKeyFrame ActiveKeyFrame in ((QuoteSetTimeline)ListAnimationLayer.EngineLayer.DicTimelineEvent[0][1]).DicAnimationKeyFrame.Values)
                {
                    Quote ActiveQuote   = ActiveKeyFrame.QuoteSet;
                    int   QuoteSetIndex = 0;
                    int   QuoteSetCount = 0;

                    //Once a Quote is selected, keep it, if random quotes are needed, use multiple QuoteSet.
                    //If the number of QuoteSet changed, assume the user did something wrong and get a new index.
                    if (ActiveQuote.ListQuoteSet.Count > 1 && QuoteSetCount != ActiveQuote.ListQuoteSet.Count)
                    {
                        QuoteSetCount = ActiveQuote.ListQuoteSet.Count;
                        QuoteSetIndex = Random.Next(ActiveQuote.ListQuoteSet.Count);
                        ActiveQuote.SelectedQuoteSet = QuoteSetIndex;
                    }

                    Quote.Targets ActiveTarget   = ActiveQuote.Target;
                    QuoteSet      ActiveQuoteSet = ActiveQuote.ActiveQuoteSet;

                    Character ActivePilot = ActiveUnit.Pilot;
                    Character EnemyPilot  = EnemyUnit.Pilot;
                    if (ActiveTarget == Quote.Targets.Defender)
                    {
                        ActivePilot = EnemyUnit.Pilot;
                        EnemyPilot  = ActiveUnit.Pilot;
                    }

                    bool UseRandomIndex             = !ActiveQuoteSet.QuoteSetUseLast && ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Random;
                    QuoteSet.QuoteStyles QuoteStyle = ActiveQuoteSet.QuoteStyle;
                    int QuoteIndex = 0;
                    if (ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Fixed)
                    {
                        QuoteIndex = ActiveQuoteSet.QuoteSetChoiceValue;
                    }

                    Tuple <string, string> ActiveQuoteTuple;

                    switch (QuoteStyle)
                    {
                    case QuoteSet.QuoteStyles.Reaction:
                        QuoteTypes ActiveQuoteType = QuoteTypes.Damaged;
                        if (BattleResult.ArrayResult[0].AttackMissed)
                        {
                            ActiveQuoteType = QuoteTypes.Dodge;
                        }

                        ActiveQuoteTuple                = GetQuote(ActiveQuoteType, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText          = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500);
                        ActiveQuote.PortraitPath        = ActiveQuoteTuple.Item1;
                        ActiveQuote.ActiveCharacterName = ActivePilot.Name;
                        break;

                    case QuoteSet.QuoteStyles.QuoteSet:
                        ActiveQuoteTuple                = GetAttackQuote(ActiveQuoteSet.QuoteSetName, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText          = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500);
                        ActiveQuote.PortraitPath        = ActiveQuoteTuple.Item1;
                        ActiveQuote.ActiveCharacterName = ActivePilot.Name;
                        break;

                    case QuoteSet.QuoteStyles.Custom:
                        ActiveQuote.ActiveText = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteSet.CustomText, 500);
                        break;

                    case QuoteSet.QuoteStyles.BattleStart:
                        ActiveQuoteTuple                = GetQuote(QuoteTypes.BattleStart, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex);
                        ActiveQuote.ActiveText          = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500);
                        ActiveQuote.PortraitPath        = ActiveQuoteTuple.Item1;
                        ActiveQuote.ActiveCharacterName = ActivePilot.Name;
                        break;
                    }

                    if (!string.IsNullOrEmpty(ActiveQuote.PortraitPath))
                    {
                        if (ActiveQuote.PortraitPath.StartsWith("Animations"))
                        {
                            ActiveQuote.ActiveCharacterSprite = new SimpleAnimation("", ActiveQuote.PortraitPath, new AnimationLooped(ActiveQuote.PortraitPath));
                            ActiveQuote.ActiveCharacterSprite.ActiveAnimation.Content = Content;
                            ActiveQuote.ActiveCharacterSprite.ActiveAnimation.Load();
                        }
                        else
                        {
                            ActiveQuote.ActiveCharacterSprite = new SimpleAnimation("", ActiveQuote.PortraitPath, Content.Load <Texture2D>(ActiveQuote.PortraitPath));
                        }
                    }
                }

                #endregion

                #region Init renderTarget

                ListAnimationLayer[L].renderTarget = new RenderTarget2D(
                    GraphicsDevice,
                    ScreenWidth,
                    ScreenHeight);

                #endregion
            }
        }