상속: MonoBehaviour
예제 #1
0
            private void InitializeGeneralComponent()
            {
                this.Size =
                    new Size((this.ChatBackground.Width -
                              (2 * NoInternetConnectionSandBox.from_the_edge)) / 2,
                             (this.ChatBackground.Width / 10));
                this.GoldenIcon = GameIcon.GenerateFakeIcon(FakeIcons.s_golden_btn_chat);
                //this.ImageAlign = ContentAlignment.MiddleCenter;
                //---------------------------------------------
                //---------------------------------------------
                //News:
                this.UnlimitedPointWorks = new Point[]
                {
                    new Point(0, 0),          // 1
                    new Point(Width, 0),      // 2
                    new Point(Width, Height), // 3
                    new Point(0, Height),     // 4
                };
                this.PaintColors = new Color[]
                {
                    Color.Transparent,
                };
                this.PaintBrushes = new Brush[]
                {
                    new SolidBrush(this.PaintColors[0]),
                };
                //---------------------------------------------
                //Names:
                this.SetLabelName(Channel.ToString());
                //TabIndexes
                //FontAndTextAligns:
                this.Font =
                    new Font(ThereIsConstants.Forming.TheMainForm.PrivateFonts.Families[1],
                             13.4f, FontStyle.Bold);
                this.TextAlign = ContentAlignment.MiddleCenter;
                //Sizes:


                //Locations:


                //Colors:
                this.SetColorTransparent();
                this.SetTextColor(Color.Black);
                this.SetLabelText();
                this.SetLabelSoundEffects(Noises.ClickNoise);
                //ComboBoxes:
                //Enableds:
                //Texts:
                //AddRanges:
                //ToolTipSettings:
                //GraphicWorks:
                //Effects:
                //---------------------------------------------
                //Events:
                //---------------------------------------------

                //---------------------------------------------
                //Final Blows:
            }
예제 #2
0
 protected MapElement(IRes myRes, Map map, GameIcon icon) : base(myRes)
 {
     Movements = ElementMovements.NoMovements;
     Map       = map;
     TheIcon   = icon;
     FFramable = true;
     HasIcon   = true;
     InitializeComponent();
 }
예제 #3
0
 protected MapElement(IRes myRes, Map map, GameIcon icon,
                      ElementMovements movements,
                      EventHandler @event, bool isBackground = false) : base(myRes)
 {
     Movements      = movements;
     MovementWorker = @event;
     Map            = map;
     TheIcon        = icon;
     FFramable      =
         Movements == ElementMovements.NoMovements;
     IsBackgroundElement = isBackground;
     HasIcon             = true;
     InitializeComponent();
 }
예제 #4
0
        public static MapElement GetMapElement(IRes res, GameIcon elementIcon, Map theMap,
                                               bool clickedImage, ElementMovements movements,
                                               EventHandler @event, bool isBackground = false)
        {
            MapElement element = new MapElement(res, theMap, elementIcon, movements, @event, isBackground)
            {
                DontUseClickedImage = !clickedImage,
            };

            element.SetPictureName(element.ElementInMapType.ToString());
            element.SetPicture();
            element.SetSrcRectangle();
            return(element);
        }
예제 #5
0
 //Fill Canvas with Images
 private void FillWithBoxes()
 {
     for (int i = 0; i < MsGame.UpperMatrix.Count; i++)
     {
         for (int j = 0; j < MsGame.UpperMatrix[i].Count; j++)
         {
             string   imageName = MsGame.UpperMatrix[i][j].IconName;
             GameIcon image     = new GameIcon(GameIcons[imageName]);
             Canvas.SetLeft(image, j * GameIcon.SIZE);
             Canvas.SetTop(image, i * GameIcon.SIZE);
             gameCanvas.Children.Add(image);
         }
     }
 }
예제 #6
0
    /// <summary>
    /// Save the game to the json string.
    /// String should be written into a file or send to server
    /// </summary>
    /// <returns>game save</returns>
    public string Save()
    {
        foreach (AbstractObject itm in AbstractObject.m_sEverything)
        {
            switch (itm.GetType().FullName)
            {
            case nameof(Science): m_allScience.Add(itm as Science); break;

            case nameof(Population): m_population = itm as Population; break;

            case nameof(Items): m_allItems.Add(itm as Items); break;

            case nameof(GameMaterial): m_allMaterails.Add(itm as GameMaterial); break;

            case nameof(Buildings): m_allBuildings.Add(itm as Buildings); break;

            case nameof(Army): m_allArmy.Add(itm as Army); break;

            case nameof(Resource): m_allResources.Add(itm as Resource); break;

            case nameof(Process): m_allProcesses.Add(itm as Process); break;

            case nameof(WildAnimal): m_allWildAnimals.Add(itm as WildAnimal); break;

            case nameof(DomesticAnimal): m_allDomestic.Add(itm as DomesticAnimal); break;
            }
        }

        foreach (GameObject go in MainScript.m_sAllItems)
        {
            IconScript ics = go.GetComponent <IconScript>();
            GameIcon   gic = new GameIcon();
            gic.m_pos     = ics.transform.position;
            gic.m_itmName = ics.m_thisItem.m_name;
            m_allGameIcons.Add(gic);
        }

        TimeScript tsc = Camera.main.GetComponent <TimeScript>();

        m_speed = tsc.m_speed;
        m_day   = tsc.m_day;
        m_year  = tsc.m_year;

        m_canShowTooltips = LearningTip.m_sCanShow;

        string json = JsonUtility.ToJson(this);

        return(json);
    }
예제 #7
0
        private void SetUpBackgroundAndIcon()
        {
            background = new Background("menu_background");

            gameIcon = new GameIcon(
                Skin.GetConfigStartPosition("main_menu", "Properties", "IconStartPos"),
                GetSkinnablePropertyAnchor("IconAnchor"));

            Vector2 offset = new Vector2(
                GetSkinnablePropertyInt("IconX"),
                GetSkinnablePropertyInt("IconY"));

            gameIcon.Move(offset);

            version = new VersionCounter(AnchorUtil.FindScreenPosition(Anchor.BottomRight));
        }
예제 #8
0
        public static MapElement GetMapElement(IRes res, GameIcon elementIcon, Map theMap,
                                               bool clickedImage = false)
        {
            MapElement element = new MapElement(res, theMap, elementIcon)
            {
                DontUseClickedImage = !clickedImage,
            };

            element.SetPicture();
            if (clickedImage)
            {
                element.SetClickedPicture();
            }
            element.SetSrcRectangle();
            return(element);
        }
예제 #9
0
        private void GameDetails_Load(object sender, EventArgs e)
        {
            GameIcon.Load(TitleMetaData.Icons[0]);

            Regex rgx = new Regex(@"[^0-9a-zA-Z +.:']");

            TitleName.Text = rgx.Replace(TitleMetaData.Names[0], "");
            NPTitleID.Text = TitleMetaData.NPTitleID;

            Category.Text      = TitleMetaData.Category;
            PSVR.Text          = TitleMetaData.PSVR > 0 ? "true" : "false";
            ProEnhanced.Text   = TitleMetaData.NEOEnable > 0 ? "true" : "false";
            PatchRevision.Text = TitleMetaData.PatchRevision.ToString();

            ContentID.Text = TitleMetaData.ContentID;
        }
예제 #10
0
            /// <summary>
            /// WARNING -- WARNING
            /// danger zone: please use this method only when you are
            /// really have to change the Icon of this IconLabel.
            /// don't use it if you know nothing about it.
            /// <!--You know nothing John Snow.-->
            /// </summary>
            public void ChangeTheIcon(GameIcon gameIcon)
            {
                this.SuspendLayout();
                this.Paint -= IconLabelControl_Paint;

                //---------------------------------------------
                //---------------------------------------------
                //News:
                using (var icon = TheIcon)
                {
                    TheIcon = gameIcon;
                    icon.Dispose();
                }
                //---------------------------------------------
                //Names:
                //TabIndexes
                //FontAndTextAligns:
                //Sizes:
                this.SetIconSize();
                //Locations:
                this.SetIconLocation();
                //Colors:
                //ComboBoxes:
                //Enableds:
                //Texts:
                //AddRanges:
                //ToolTipSettings:
                //GraphicWorks:
                //Effects:
                //---------------------------------------------
                //Events:
                this.Paint += IconLabelControl_Paint;
                //---------------------------------------------
                //---------------------------------------------
                //Final Blows:
            }
예제 #11
0
 //---------------------------------------------
 #region Constructors Region
 public IconLabelControl(IRes myRes, GameIcon theIcon) : base(myRes)
 {
     TheIcon = theIcon;
     InitializeComponent();
 }
예제 #12
0
            //---------------------------------------------
            #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();
            }
예제 #13
0
            //---------------------------------------------

            //---------------------------------------------
            #region Constructors Region
            internal PlayerResourcesLabelControl(IRes myRes, PlayerResourceType resourceType)
                : base(myRes, GameIcon.GenerateIcon(Basis_Icons.s_prg_track_2))
            {
                ResourceType = resourceType;
                InitializeComponent();
            }
예제 #14
0
            //---------------------------------------------
            #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:
            }
예제 #15
0
            //---------------------------------------------
            #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();
            }
예제 #16
0
            //---------------------------------------------

            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();
            }
예제 #17
0
            //---------------------------------------------
            //---------------------------------------------
            //---------------------------------------------
            #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);