Пример #1
0
        private void DrawEquipButton(SkillDefinition def)
        {
            DBTPlayer dbtPlayer = Main.LocalPlayer.GetModPlayer <DBTPlayer>();

            if (EquipButton != null)
            {
                EquipButton.Remove();
            }

            EquipButton = InitializeButton(EquipButtonTexture, new MouseEvent((evt, element) => TrySelectingSkill(def, evt, element)), 550, 510, BackPanel);
            if (dbtPlayer.HasAcquiredSkill(def))
            {
                EquipButton.SetVisibility(1f, 0.8f);
            }
            else
            {
                EquipButton.SetVisibility(0.3f, 0.1f);
            }
        }
Пример #2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            DBTPlayer dbtPlayer = Main.LocalPlayer.GetModPlayer <DBTPlayer>();

            foreach (KeyValuePair <SkillDefinition, UIImagePair> kvp in _skillImagePairs)
            {
                bool unlockable = kvp.Key.DoesDisplayInTechniqueMenu(dbtPlayer);
                bool visible    = kvp.Key.DoesDisplayInTechniqueMenu(dbtPlayer);

                if (!visible)
                {
                    kvp.Value.button.Width  = StyleDimension.Empty;
                    kvp.Value.button.Height = StyleDimension.Empty;
                    kvp.Value.button.SetVisibility(0f, 0f);
                }

                kvp.Value.lockedImage.ImageScale = visible && dbtPlayer.HasAcquiredSkill(kvp.Key) ? 0f : 1f;

                //Main.NewText(kvp.Key.ToString() + "'s unknown image is at" + kvp.Value.unknownImage.ImageScale);
                //Main.NewText(kvp.Key.ToString() + "'s unknown image gray is at" + kvp.Value.unknownImageGray.ImageScale);
                //Main.NewText(kvp.Key.ToString() + "'s locked image is at" + kvp.Value.lockedImage.ImageScale);
            }
        }