Exemplo n.º 1
0
        public void DrawIf(SpriteBatch sb, HUDDrawData hudDrawData)
        {
            /*if( Main.InGameUI.CurrentState != null ) {
             *      return;
             * }*/
            if (Main.LocalPlayer.mouseInterface)                //not HUDLibraries.IsMouseInterfacingWithUI; inventory always == true
            {
                return;
            }
            if (HUDElementsLibAPI.GetDraggingElement() != null)
            {
                return;
            }

            if (hudDrawData.IsPreAimMode)
            {
                this.DrawPreAimCursor(sb, hudDrawData.AimPercent);
            }
            else if (hudDrawData.IsAimMode)
            {
                this.DrawAimCursor(sb);
            }
            else if (hudDrawData.HasGun)
            {
                this.DrawUnaimCursor(sb);
            }
        }
Exemplo n.º 2
0
        ////

        public override void PostSetupContent()
        {
            if (!Main.dedServ && Main.netMode != NetmodeID.Server)
            {
                this.AmmoHUD = AmmoDisplayHUD.CreateDefault();

                HUDElementsLibAPI.AddWidget(this.AmmoHUD);
            }
        }
Exemplo n.º 3
0
        ////////////////

        internal static void LoadVanillaElements()
        {
            foreach (VanillaHUDElementDefinition def in VanillaHUDElement.VanillaHUDInfo)
            {
                var elem = new VanillaHUDElement(def);

                HUDElementsLibAPI.AddWidget(elem);
            }
        }
        ////////////////

        private void LoadWidget()
        {
            var dim = new Vector2(176f, 52f);
            var pos = new Vector2(
                ((float)Main.screenWidth - dim.X) * 0.5f,
                (float)Main.screenHeight - dim.Y - 32f
                );

            //

            this.ObjectivesProgressHUD = new CompletionStatHUD(
                pos: pos,
                dim: dim,
                title: "Objectives",
                stat: () => {
                var mngr = ModContent.GetInstance <ObjectiveManager>();
                ICollection <Objective> objs = mngr.CurrentObjectives.Values;
                int complete = objs.Count(o => o.IsComplete == true);

                return(complete, objs.Count - complete);
            },
                enabler: () => Main.playerInventory
                );

            //

            this.ObjectivesProgressHUD.TitleColor = ObjectiveManager.GetTextColor(false);

            this.ObjectivesProgressHUD.OnClick += (_, __) => {
                UtilityPanelsTabs.OpenTab(ObjectivesMod.UtilityPanelsName);
            };

            //

            HUDElementsLibAPI.AddWidget(this.ObjectivesProgressHUD);
        }
Exemplo n.º 5
0
        private void InitializeUI()
        {
            this.AnkhHUD = AnkhHUD.CreateDefault();

            HUDElementsLibAPI.AddWidget(this.AnkhHUD);
        }