Exemple #1
0
        public void Init()
        {
            //Erase all previous value
            Erase();
            sizeMultplier = Zoom * UIScale * ScreenMult;
            skillTree.ResetConnection();
            allConnection = new List <Connection>();
            allBasePanel  = new List <SkillPanel>();
            allText       = new List <SkillText>();



            backGround = new UIPanel();
            backGround.SetPadding(0);
            backGround.Left.Set(0, 0f);
            backGround.Top.Set(0, 0f);
            backGround.Width.Set(Main.screenWidth, 0f);
            backGround.Height.Set(Main.screenHeight, 0f);
            backGround.BackgroundColor = new Color(73, 94, 171, 150);
            Append(backGround);

            RPGPlayer rPGPlayer = Main.player[Main.myPlayer].GetModPlayer <RPGPlayer>();

            skillPointsLeft = new UIText("Skill Points : " + rPGPlayer.GetSkillPoints + " / " + (rPGPlayer.GetLevel() - 1));
            skillPointsLeft.Left.Set(150, 0f);
            skillPointsLeft.Top.Set(150, 0f);
            backGround.Append(skillPointsLeft);

            ResetText = new UIText("RESET", 1 * ScreenMult, true)
            {
                TextColor = Color.Gray
            };
            ResetText.Left.Set(150 * ScreenMult, 0f);
            ResetText.Top.Set(250 * ScreenMult, 0f);
            ResetText.Width.Set(0, 0f);
            ResetText.Height.Set(0, 0f);
            ResetText.OnClick     += new MouseEvent(ResetStats);
            ResetText.OnMouseOver += new MouseEvent(ResetTextHover);
            ResetText.OnMouseOut  += new MouseEvent(ResetTextOut);
            backGround.Append(ResetText);

            backGround.OnMouseDown   += new UIElement.MouseEvent(DragStart);
            backGround.OnMouseUp     += new UIElement.MouseEvent(DragEnd);
            backGround.OnScrollWheel += new ScrollWheelEvent(ScrollUpDown);

            Instance = this;
            for (int i = 0; i < skillTree.nodeList.nodeList.Count; i++)
            {
                SkillInit(skillTree.nodeList.nodeList[i]);
            }



            //
        }
Exemple #2
0
 public override void OnInitialize()
 {
     Instance = this;
 }