Exemplo n.º 1
0
        public void CleaningUp()
        {
#if DIALOG
            Father_ControlCollection.Remove(CharacterNameLabel);
            Father_ControlCollection.Remove(DialogLabel);
            if (Father_ControlCollection.Contains(LeftCharacterPicture))
            {
                Father_ControlCollection.Remove(LeftCharacterPicture);
            }
            if (Father_ControlCollection.Contains(RightCharacterPicture))
            {
                Father_ControlCollection.Remove(LeftCharacterPicture);
            }
            //---------------------------------
            CharacterNameLabel.Dispose();
            DialogLabel.Dispose();
            CharacterNameLabel = null;
            DialogLabel        = null;
            if (LeftCharacterPicture != null)
            {
                LeftCharacterPicture.Dispose();
                LeftCharacterPicture = null;
            }
            if (RightCharacterPicture != null)
            {
                RightCharacterPicture.Dispose();
                RightCharacterPicture = null;
            }
#endif
            GC.Collect();
        }
        //---------------------------------------------
        #region Initialize Region
        private void InitializeComponent()
        {
            this.CurrentStepOfDialog     = 1;
            this.IsRightPictureBoxActive =
                (bool)(CharactersHashTable[IsRight_CODE + CurrentStepOfDialog.ToString()]);
            //----------------------------------------
            //News:
            this.MyRes = new WotoRes(typeof(DialogBoxProvider));
#if DIALOG
            this.DialogLabel           = new GameControls.DialogBoxBackGround(this);
            this.CharacterNameLabel    = new GameControls.LabelControl(this, GameControls.LabelControlSpecies.CharacterNameInDialog);
            this.LeftCharacterPicture  = new GameControls.PictureBoxControl(this);
            this.RightCharacterPicture = new GameControls.PictureBoxControl(this);
            //Names:

            //TabIndexes:
            //Fonts And TextAligns:
            this.DialogLabel.Font = new Font(
                ThereIsConstants.Forming.GameClient.PrivateFonts.Families[1], 19, FontStyle.Bold);
            this.CharacterNameLabel.Font =
                new Font(ThereIsConstants.Forming.GameClient.PrivateFonts.Families[1], 14, FontStyle.Bold);
            this.DialogLabel.TextAlign        = ContentAlignment.MiddleLeft;
            this.CharacterNameLabel.TextAlign = ContentAlignment.MiddleCenter;
            //Sizes:

            if (IsRightPictureBoxActive)
            {
                this.RightCharacterPicture.Size =
                    new Size(ThereIsConstants.Forming.GameClient.Width / 5,
                             ThereIsConstants.Forming.GameClient.Height / 3);
                this.LeftCharacterPicture.Size =
                    new Size(ThereIsConstants.Forming.GameClient.Width / 6,
                             ThereIsConstants.Forming.GameClient.Height / 4);
            }
            else
            {
                this.LeftCharacterPicture.Size =
                    new Size(ThereIsConstants.Forming.GameClient.Width / 5,
                             ThereIsConstants.Forming.GameClient.Height / 3);
                this.RightCharacterPicture.Size =
                    new Size(ThereIsConstants.Forming.GameClient.Width / 6,
                             ThereIsConstants.Forming.GameClient.Height / 4);
            }
            //this.LeftCharacterPicture.BackColor = Color.Red;
            //Locations:
            this.DialogLabel.Location =
                new Point((ThereIsConstants.Forming.GameClient.Width / 2) -
                          (DialogLabel.Width / 2), ThereIsConstants.Forming.GameClient.Height - DialogLabel.Height);
            this.LeftCharacterPicture.Location =
                new Point(DialogLabel.Location.X +
                          (4 * (DialogLabel.Width / 80)) +
                          (2 * (DialogLabel.Width / 80)) +
                          (2 * (DialogLabel.Height / 16)),
                          DialogLabel.Location.Y -
                          LeftCharacterPicture.Height);
            this.RightCharacterPicture.Location =
                new Point(DialogLabel.Location.X + DialogLabel.Width -
                          RightCharacterPicture.Width -
                          (4 * (DialogLabel.Width / 80)) -
                          (2 * (DialogLabel.Width / 80)) -
                          (2 * (DialogLabel.Height / 16)),
                          DialogLabel.Location.Y -
                          RightCharacterPicture.Height);
            if (IsRightPictureBoxActive)
            {
                this.CharacterNameLabel.Location =
                    new Point(RightCharacterPicture.Location.X -
                              (CharacterNameLabel.Width + NoInternetConnectionSandBox.from_the_edge),
                              DialogLabel.Location.Y - (CharacterNameLabel.Height / 2));
            }
            else
            {
                this.CharacterNameLabel.Location =
                    new Point(LeftCharacterPicture.Location.X +
                              LeftCharacterPicture.Width + NoInternetConnectionSandBox.from_the_edge,
                              DialogLabel.Location.Y - (CharacterNameLabel.Height / 2));
            }
            //Colors:
            /* this.DialogLabel.BackColor = Color.FromArgb(179, Color.Black); */
            /*this.DialogLabel.ForeColor = Color.White;*/
            //this.CharacterNameLabel.BackColor = Color.White;
            //ComboBoxes:
            //Enableds:
            this.DialogLabel.SingleClick = true;
            //Texts:
            this.DialogLabel.SetLabelText(
                (string)(CharactersHashTable[DialogStrings_CODE + CurrentStepOfDialog.ToString()]));
            this.CharacterNameLabel.SetLabelText(
                ((CharacterInfo)CharactersHashTable[
                     ((string)CharactersHashTable[CharHashTable_CODE + CurrentStepOfDialog.ToString()])]).CharacterBlankName);
            //Images:
            this.LeftCharacterPicture.SizeMode      =
                this.RightCharacterPicture.SizeMode = PictureBoxSizeMode.StretchImage;
            if (IsRightPictureBoxActive)
            {
                this.RightCharacterPicture.Image =
                    ((CharacterInfo)CharactersHashTable[
                         ((string)CharactersHashTable[CharHashTable_CODE + CurrentStepOfDialog.ToString()])]).GetCharacterImage();
            }
            else
            {
                this.LeftCharacterPicture.Image =
                    ((CharacterInfo)CharactersHashTable[
                         ((string)CharactersHashTable[CharHashTable_CODE + CurrentStepOfDialog.ToString()])]).GetCharacterImage();
            }
            //AddRanges:
            //ToolTipSettings:
            //Events:
            this.DialogLabel.Click += Owner_Click;
            this.DialogLabel.MessageLabel1.Click      += Owner_Click;
            this.Father_ControlCollection.Owner.Click += Owner_Click;
            this.CharacterNameLabel.Click             += Owner_Click;
            this.LeftCharacterPicture.Click           += Owner_Click;
            this.RightCharacterPicture.Click          += Owner_Click;
            //----------------------------------------

            //----------------------------------------
            Father_ControlCollection.AddRange(new Control[]
            {
                this.CharacterNameLabel,
                this.DialogLabel,
                this.RightCharacterPicture,
                this.LeftCharacterPicture
            });
#endif
        }