//--------------------------------------------- #region Initialize Region private void InitializeComponent(EventHandler profileClickEventHandler) { this.SuspendLayout(); this.Size = new Size(Father.Width, 48 * (Father.Height / 236)); //----------------------------------------- //News: this.ProfileBarLabelControl = new ProfileBarLabelControl(this); this.UnlimitedPointWorks = new Point[] { new Point(0, Height / 2), // 1 new Point((Width / 2) - (Height / 2), Height / 2), // 2 new Point(Width / 2, 0), // 3 new Point((Width / 2) + (Height / 2), Height / 2), // 4 new Point(Width, Height / 2), // 5 new Point(Width, Height), // 6 new Point(0, Height), // 7 new Point(Width / 2, Height), // 8 }; this.PaintColors = new Color[] { Color.FromArgb(220, Color.Black), Color.FromArgb(230, Color.LightGoldenrodYellow), }; this.PaintBrushes = new Brush[] { new SolidBrush(this.PaintColors[0]), }; this.PaintPens = new Pen[] { new Pen(this.PaintColors[1], 1.4f), }; this.Icons = new GameIcon[] { GameIcon.GenerateIcon(Main_Icons.s_main_map_go), // index : 0 GameIcon.GenerateIcon(Game_Main_Icons.s_nav_icon_1), // index : 1 GameIcon.GenerateIcon(Game_Main_Icons.s_nav_icon_5), // index : 2 GameIcon.GenerateIcon(Game_Main_Icons.s_play_icon_27), // index : 3 GameIcon.GenerateIcon(Game_Main_Icons.s_play_icon_19), // index : 4 GameIcon.GenerateIcon(Game_Main_Icons.s_nav_icon_3), // index : 5 GameIcon.GenerateIcon(Game_Main_Icons.s_nav_icon_6), // index : 6 }; this.SurfaceLabels = new IconLabelControl[] { new IconLabelControl(this, this.Icons[0]), // main map, index : 0 new IconLabelControl(this, this.Icons[1]), // main map, index : 1 new IconLabelControl(this, this.Icons[2]), // main map, index : 2 new IconLabelControl(this, this.Icons[3]), // main map, index : 3 new IconLabelControl(this, this.Icons[4]), // main map, index : 4 new IconLabelControl(this, this.Icons[5]), // main map, index : 5 new IconLabelControl(this, this.Icons[6]), // main map, index : 6 }; //----------------------------------------- //Names: this.SurfaceLabels[0].SetLabelName(Map_Go_IconNameInRes); this.SurfaceLabels[1].SetLabelName(Heroes_IconNameInRes); this.SurfaceLabels[2].SetLabelName(Recruit_IconNameInRes); this.SurfaceLabels[3].SetLabelName(Arena_IconNameInRes); this.SurfaceLabels[4].SetLabelName(Dungeons_IconNameInRes); this.SurfaceLabels[5].SetLabelName(Bag_IconNameInRes); this.SurfaceLabels[6].SetLabelName(Guild_IconNameInRes); //TabIndexes: //FontAndTextAligns: //Sizes: int sideWidth = UnlimitedPointWorks[1].X - UnlimitedPointWorks[0].X; // left and right have the same width. this.SurfaceLabels[0].Size = new Size(UnlimitedPointWorks[3].X - UnlimitedPointWorks[1].X, Height); this.SurfaceLabels[1].Size = this.SurfaceLabels[2].Size = this.SurfaceLabels[3].Size = this.SurfaceLabels[4].Size = this.SurfaceLabels[5].Size = this.SurfaceLabels[6].Size = new Size(sideWidth / 4, Height - UnlimitedPointWorks[1].Y); this.SurfaceLabels[0].SetIconSize(); this.SurfaceLabels[1].SetIconSize(); this.SurfaceLabels[2].SetIconSize(); this.SurfaceLabels[3].SetIconSize(); this.SurfaceLabels[4].SetIconSize(); this.SurfaceLabels[5].SetIconSize(); this.SurfaceLabels[6].SetIconSize(); this.SurfaceLabels[0].SetIconSize(1.2f * this.SurfaceLabels[0].IconSizeF.Width, 1.2f * this.SurfaceLabels[0].IconSizeF.Height); //Locations: this.SurfaceLabels[0].Location = new Point(UnlimitedPointWorks[1].X, UnlimitedPointWorks[2].Y); this.SurfaceLabels[1].Location = new Point((sideWidth / 3) - this.SurfaceLabels[1].Width, UnlimitedPointWorks[0].Y); this.SurfaceLabels[2].Location = new Point((2 * (sideWidth / 3)) - this.SurfaceLabels[2].Width, SurfaceLabels[1].Location.Y); this.SurfaceLabels[3].Location = new Point((3 * (sideWidth / 3)) - this.SurfaceLabels[3].Width, SurfaceLabels[2].Location.Y); this.SurfaceLabels[4].Location = new Point(UnlimitedPointWorks[3].X, SurfaceLabels[3].Location.Y); this.SurfaceLabels[5].Location = new Point(UnlimitedPointWorks[3].X + (1 * (sideWidth / 3)), SurfaceLabels[4].Location.Y); this.SurfaceLabels[6].Location = new Point(UnlimitedPointWorks[3].X + (2 * (sideWidth / 3)), SurfaceLabels[5].Location.Y); this.ProfileBarLabelControl.Location = default; // 0, 0 this.SurfaceLabels[0].SetIconLocation(); this.SurfaceLabels[1].SetIconLocation(); this.SurfaceLabels[2].SetIconLocation(); this.SurfaceLabels[3].SetIconLocation(); this.SurfaceLabels[4].SetIconLocation(); this.SurfaceLabels[5].SetIconLocation(); this.SurfaceLabels[6].SetIconLocation(); //Colors: this.SetColorTransparent(); //ComboBoxes: //Enableds: this.ProfileBarLabelControl.AvatarIconLabel.SingleClick = true; //Texts: this.SurfaceLabels[0].SetLabelText(); this.SurfaceLabels[1].SetLabelText(); this.SurfaceLabels[2].SetLabelText(); this.SurfaceLabels[3].SetLabelText(); this.SurfaceLabels[4].SetLabelText(); this.SurfaceLabels[5].SetLabelText(); this.SurfaceLabels[6].SetLabelText(); //AddRanges: //ToolTipSettings: //ImageSettings: //----------------------------------------- //Events: this.Paint -= HomeBarLabelControl_Paint; this.ProfileBarLabelControl.AvatarIconLabel.Click -= profileClickEventHandler; this.Paint += HomeBarLabelControl_Paint; this.ProfileBarLabelControl.AvatarIconLabel.Click += profileClickEventHandler; //----------------------------------------- this.Controls.AddRange(this.SurfaceLabels); this.Father.Controls.Add(this.ProfileBarLabelControl); //----------------------------------------- this.ResumeLayout(); }
//--------------------------------------------- //--------------------------------------------- #region Constructors Region internal PlayerResourcesLabelControl(IRes myRes, PlayerResourceType resourceType) : base(myRes, GameIcon.GenerateIcon(Basis_Icons.s_prg_track_2)) { ResourceType = resourceType; InitializeComponent(); }
//--------------------------------------------- #region Initialize Region private void InitializeComponent() { this.Size = new Size(this.BackLabel.Width, this.BackLabel.Height / 12); this.Location = new Point(0, this.BackLabel.Height - this.Height); //--------------------------------------------- //--------------------------------------------- //News: this.EmojiIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Main_Icons.s_main_chat_emoji)); this.ChatBoxControl = new TextBoxControl(); this.SendLabelControl = new IconLabelControl(this, GameIcon.GenerateFakeIcon(FakeIcons.s_chat_send_fake)); //--------------------------------------------- //Names: //TabIndexes //FontAndTextAligns: this.ChatBoxControl.Font = new Font(this.ChatBoxControl.Font.FontFamily, 13f, FontStyle.Regular); //Sizes: this.ChatBoxControl.Size = new Size((3 * (this.Width / 4)) - (NoInternetConnectionSandBox.from_the_edge / 2), this.ChatBoxControl.Height); this.EmojiIconLabel.SetIconSize(); this.EmojiIconLabel.Size = Size.Round(this.EmojiIconLabel.IconSizeF); this.SendLabelControl.Size = new Size(3 * (this.Height / 5), 3 * (this.Height / 5)); this.SendLabelControl.SetIconSize(this.SendLabelControl.Size); //Locations: this.ChatBoxControl.Location = new Point(NoInternetConnectionSandBox.from_the_edge / 2, (this.Height / 2) - (this.ChatBoxControl.Height / 2)); this.EmojiIconLabel.SetIconLocation(); this.EmojiIconLabel.Location = new Point(this.ChatBoxControl.Location.X + this.ChatBoxControl.Width + NoInternetConnectionSandBox.from_the_edge, (this.Height / 2) - (this.EmojiIconLabel.Height / 2)); this.SendLabelControl.SetIconLocation(); this.SendLabelControl.Location = new Point(this.EmojiIconLabel.Location.X + this.EmojiIconLabel.Width + (NoInternetConnectionSandBox.from_the_edge / 2), (this.Height / 2) - (this.SendLabelControl.Height / 2)); //Colors: this.BackColor = Color.WhiteSmoke; //ComboBoxes: //Enableds: this.ChatBoxControl.AcceptsReturn = false; //Texts: //AddRanges: //ToolTipSettings: //GraphicWorks: //Effects: //--------------------------------------------- //Events: //--------------------------------------------- this.Controls.Add(this.ChatBoxControl); this.Controls.AddRange(new LabelControl[] { this.EmojiIconLabel, this.SendLabelControl }); //--------------------------------------------- //Final Blows: }
//--------------------------------------------- //--------------------------------------------- //--------------------------------------------- #region Initialize Region private void InitializeComponent() { this.SuspendLayout(); //----------------------------------------- //News: this.Profile_NavIcon = GameIcon.GenerateIcon(Main_Icons.s_main_role_bg); this.Profile_NavIconLabel = new IconLabelControl(this, this.Profile_NavIcon); this.AvatarIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(ThereIsServer.GameObjects.MyProfile.PlayerAvatar, AvatarFormat.Format02)); this.ExpTrackIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Main_Icons.s_main_exp_track)); this.ExpThumbIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Main_Icons.s_main_exp_thumb)); this.TimeIconLabel = new IconLabelControl(this, GameIcon.GenerateFakeIcon(FakeIcons.s_time_icon_fake)); this.DiamondResIconLabel = new PlayerResourcesLabelControl(this, PlayerResourceType.Diamond); this.CouponResIconLabel = new PlayerResourcesLabelControl(this, PlayerResourceType.Coupon); this.CoinResIconLabel = new PlayerResourcesLabelControl(this, PlayerResourceType.Coin); this.ManaResIconLabel = new PlayerResourcesLabelControl(this, PlayerResourceType.Mana); this.PlayerNameLabelControl = new LabelControl(this); this.PlayerLvlLabelControl = new LabelControl(this); this.GameTimeTrigger = new Trigger() { Index = 0, Enabled = false, Running_Worker = false, SingleLineWorker = true, Interval = 1000, Name = GameTimeTriggerName, }; //----------------------------------------- //Names: //TabIndexes: //FontAndTextAligns: this.PlayerNameLabelControl.Font = this.TimeIconLabel.Font = new Font(ThereIsConstants.Forming.TheMainForm.PrivateFonts.Families[1], 15, FontStyle.Bold); this.PlayerLvlLabelControl.Font = new Font(ThereIsConstants.Forming.TheMainForm.PrivateFonts.Families[1], 11, FontStyle.Bold); this.ExpThumbIconLabel.Font = new Font(ThereIsConstants.Forming.TheMainForm.PrivateFonts.Families[1], 12, FontStyle.Bold); this.PlayerNameLabelControl.TextAlign = ContentAlignment.MiddleLeft; this.PlayerLvlLabelControl.TextAlign = ContentAlignment.BottomCenter; this.ExpThumbIconLabel.TextAlign = ContentAlignment.TopRight; this.TimeIconLabel.TextAlign = ContentAlignment.MiddleCenter; this.TimeIconLabel.Image = Image.FromFile(ThereIsConstants.Path.Datas_Path + ThereIsConstants.Path.DoubleSlash + this.MyRes.GetString(GameTimerBGNameInRes)); //Sizes: Size roundedSize = Size.Round(Profile_NavIconLabel.IconSizeF); // rounded size of nav Icon. this.Profile_NavIconLabel.SetIconSize(); this.ExpTrackIconLabel.SetIconSize(); this.TimeIconLabel.SetIconSize(); this.AvatarIconLabel.SetIconSize(Profile_NavIconLabel.IconSizeF.Height - (2 * (NoInternetConnectionSandBox.from_the_edge / 5)), Profile_NavIconLabel.IconSizeF.Height - (2 * (NoInternetConnectionSandBox.from_the_edge / 5))); this.Size = this.Profile_NavIconLabel.Size = new Size(roundedSize.Width + NoInternetConnectionSandBox.from_the_edge, roundedSize.Height + NoInternetConnectionSandBox.from_the_edge); this.AvatarIconLabel.Size = new Size(Profile_NavIconLabel.Height - NoInternetConnectionSandBox.from_the_edge, Profile_NavIconLabel.Height); this.PlayerNameLabelControl.Size = new Size(roundedSize.Width - roundedSize.Height, (10 * (roundedSize.Height / 16))); this.PlayerLvlLabelControl.Size = new Size((12 * (roundedSize.Height / 16)), (6 * (roundedSize.Height / 16))); this.ExpTrackIconLabel.Size = new Size(roundedSize.Width - PlayerLvlLabelControl.Width, PlayerLvlLabelControl.Height); float test = (float)ThereIsServer.GameObjects.MyProfile.GetAdvancingExp(); this.ExpThumbIconLabel.TheIcon.FixOriginalIcon(new RectangleF(0, 0, (((float)ThereIsServer.GameObjects.MyProfile.GetAdvancingExp()) * ExpTrackIconLabel.IconSizeF.Width), ExpThumbIconLabel.TheIcon.OriginalImage.Height)); this.ExpThumbIconLabel.SetIconSize(); this.ExpThumbIconLabel.Size = ExpTrackIconLabel.Size; this.TimeIconLabel.Size = this.TimeIconLabel.TheIcon.OriginalImage.Size; //Locations: this.Profile_NavIconLabel.SetIconLocation(NoInternetConnectionSandBox.from_the_edge, NoInternetConnectionSandBox.from_the_edge); this.AvatarIconLabel.SetIconLocation(default);
//--------------------------------------------- #region Initialize Region private void InitializeComponent() { this.Size = new Size(this.Father.Width / 3, this.Father.Height); //--------------------------------------------- //--------------------------------------------- //News: this.FlashIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Chat_Icons.s_chat_btn_zoom)); this.ChatIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Main_Icons.s_main_anx_chat)); this.ChatBackgroundLabel = new ChatBackgroundLabel(this, this.Father, this); this.SystemChatBar = new ChatBarLabel(this, this, ChatChannels.System_Chat); this.CrossChatBar = new ChatBarLabel(this, this, ChatChannels.Cross_Chat); this.GeneralChatBar = new ChatBarLabel(this, this, true); this.KingdomChatBar = new ChatBarLabel(this, this.ChatBackgroundLabel, ThereIsServer.GameObjects.MyProfile.KingdomInfo.GetKingdomChannel(), true); this.GuildChatBar = new ChatBarLabel(this, this.ChatBackgroundLabel, ChatChannels.Guild_Chat); this.InputControl = new ChatInputControl(this, this); this.ReloadUPW(); this.PaintColors = new Color[] { Color.FromArgb(190, Color.DarkGray), }; this.PaintBrushes = new Brush[] { new SolidBrush(this.PaintColors[0]), }; //--------------------------------------------- //Names: //TabIndexes //FontAndTextAligns: //Sizes: this.FlashIconLabel.SetIconSize(); this.ChatIconLabel.SetIconSize(); this.ChatIconLabel.Size = Size.Round(this.ChatIconLabel.IconSizeF); this.FlashIconLabel.Size = Size.Round(this.FlashIconLabel.IconSizeF); //Locations: this.FlashIconLabel.SetIconLocation(); this.ChatIconLabel.SetIconLocation(); this.FlashIconLabel.Location = new Point(this.Location.X + this.Width, this.Location.Y + (this.Height / 2) - (this.FlashIconLabel.Height / 2)); this.ChatIconLabel.Location = new Point( (2 * NoInternetConnectionSandBox.from_the_edge), ((this.BackLabel.UnlimitedPointWorks[3].Y - this.BackLabel.UnlimitedPointWorks[2].Y) / 2) - (this.ChatIconLabel.Height / 2)); this.SystemChatBar.Location = new Point(NoInternetConnectionSandBox.from_the_edge / 2, NoInternetConnectionSandBox.from_the_edge); this.CrossChatBar.Location = new Point(this.SystemChatBar.Location.X, this.SystemChatBar.Location.Y + this.SystemChatBar.Height + (NoInternetConnectionSandBox.from_the_edge / 2)); this.GeneralChatBar.Location = new Point(this.CrossChatBar.Location.X, this.CrossChatBar.Location.Y + this.CrossChatBar.Height + (NoInternetConnectionSandBox.from_the_edge / 2)); this.KingdomChatBar.Location = new Point(NoInternetConnectionSandBox.from_the_edge, 0); this.GuildChatBar.Location = new Point(KingdomChatBar.Location.X + KingdomChatBar.Width, 0); //Colors: this.SetColorTransparent(); //ComboBoxes: //Enableds: this.FlashIconLabel.SingleClick = true; this.ChatIconLabel.SingleClick = true; //Texts: //AddRanges: //ToolTipSettings: //GraphicWorks: //Effects: //--------------------------------------------- //Events: this.ChatIconLabel.Click += ChatIconLabel_Click; this.FlashIconLabel.Click += FlashIconLabel_Click; this.InputControl.SendLabelControl.Click += SendLabelControl_Click; //--------------------------------------------- // AddRanges: this.Controls.AddRange( this.ChatBackgroundLabel, this.InputControl, this.SystemChatBar, this.CrossChatBar, this.GeneralChatBar ); this.ChatBackgroundLabel.Controls.AddRange( this.KingdomChatBar, this.GuildChatBar ); //--------------------------------------------- //Final Blows: this.LoadAllChannels(); }
//--------------------------------------------- private void InitializeComponent() { //---------------------------------- //News: this.PlusResIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(Basis_Icons.s_btn_plus)); this.ResIconLabel = new IconLabelControl(this, GameIcon.GenerateIcon(this.ResourceType)); //---------------------------------- //Names: //TabIndexes //FontAndTextAligns: this.Font = new Font(ThereIsConstants.Forming.TheMainForm.PrivateFonts.Families[1], 13, FontStyle.Bold); this.TextAlign = ContentAlignment.MiddleCenter; //Sizes: this.SetIconSize(); this.SetIconSize(ResBackWidthRate * this.IconSizeF.Width, ResBackHeightRate * this.IconSizeF.Height); this.PlusResIconLabel.SetIconSize(this.IconSizeF.Height, this.IconSizeF.Height); this.ResIconLabel.SetIconSize(this.IconSizeF.Height, this.IconSizeF.Height); this.Size = new Size((int)(this.IconSizeF.Width + this.PlusResIconLabel.IconSizeF.Width + this.ResIconLabel.IconSizeF.Width), (int)this.IconSizeF.Height); this.PlusResIconLabel.Size = Size.Round(this.PlusResIconLabel.IconSizeF); this.ResIconLabel.Size = Size.Round(this.ResIconLabel.IconSizeF); //Locations: this.SetIconLocation(); this.PlusResIconLabel.SetIconLocation(); this.ResIconLabel.SetIconLocation(); this.PlusResIconLabel.Location = new Point(this.Width - this.PlusResIconLabel.Width, 0); this.ResIconLabel.Location = default; //Rectangles: this.SetStringRectangle(new RectangleF( this.ResIconLabel.Location.X + this.ResIconLabel.Width, this.IconLocationF.Y, this.Width - this.ResIconLabel.Width - this.PlusResIconLabel.Width, this.Height)); //Colors: this.SetTextColor(Color.GhostWhite); this.ResIconLabel.SetColorTransparent(); //SoundEffects: this.ResIconLabel.SetLabelSoundEffects(Noises.NoNoise); this.SetLabelSoundEffects(Noises.NoNoise); //ComboBoxes: //Enableds: //Texts: this.SetLabelText( ThereIsServer.GameObjects.MyProfile.PlayerResources[ResourceType].ToString()); //AddRanges: //ToolTipSettings: //---------------------------------- //Events: //---------------------------------- //AddRanges: this.Controls.AddRange(new IconLabelControl[] { this.PlusResIconLabel, this.ResIconLabel, }); this.Refresh(); }