示例#1
0
        public SkillsPanel(
            IRenderWindow renderWindow,
            Func <eHero, int, IButton> createTreeButton,
            Func <eButtonType, IButton> createButton)
        {
            this.renderWindow = renderWindow;

            panelSprite = renderWindow.LoadSprite(ResourcePaths.GetHeroSkillPanel(hero), Palettes.Act1, FrameType.GetOffset(), true);

            treeButtons = Enumerable.Range(0, 3).Select(o =>
            {
                var btn        = createTreeButton(hero, o);
                btn.Location   = FrameType.GetOffset();
                btn.OnActivate = () => { ActivePanelIndex = o; };
                return(btn);
            }).ToArray();
        }
        public InventoryPanel(IRenderWindow renderWindow,
                              IItemManager itemManager,
                              Func <eItemContainerType, IItemContainer> createItemContainer,
                              Func <eButtonType, IButton> createButton)
        {
            this.renderWindow = renderWindow;

            panelSprite = renderWindow.LoadSprite(ResourcePaths.InventoryCharacterPanel, Palettes.Units, FrameType.GetOffset(), true);

            closeButton            = createButton(eButtonType.Close);
            closeButton.Location   = panelSprite.Location + new Size(18, 384);
            closeButton.OnActivate = () => OnPanelClosed?.Invoke(this);

            secondaryLeftButton                  = createButton(eButtonType.SecondaryInvHand);
            secondaryLeftButton.Location         = panelSprite.Location + new Size(15, 22);
            secondaryLeftButton.OnActivate       = ToggleWeaponsSlot;
            secondaryLeftButton.ClickableRect    = new Size(0, 20);
            secondaryLeftButton.AllowFrameChange = false;

            secondaryRightButton                  = createButton(eButtonType.SecondaryInvHand);
            secondaryRightButton.Location         = panelSprite.Location + new Size(246, 22);
            secondaryRightButton.OnActivate       = ToggleWeaponsSlot;
            secondaryRightButton.ClickableRect    = new Size(0, 20);
            secondaryRightButton.AllowFrameChange = false;

            goldButton            = createButton(eButtonType.GoldCoin);
            goldButton.Location   = panelSprite.Location + new Size(84, 391);
            goldButton.OnActivate = OpenGoldDrop;

            helmContainer          = createItemContainer(eItemContainerType.Helm);
            helmContainer.Location = panelSprite.Location + new Size(135, 5);

            amuletContainer          = createItemContainer(eItemContainerType.Amulet);
            amuletContainer.Location = panelSprite.Location + new Size(209, 34);

            armorContainer          = createItemContainer(eItemContainerType.Armor);
            armorContainer.Location = panelSprite.Location + new Size(135, 75);

            leftHandContainer          = createItemContainer(eItemContainerType.Weapon);
            leftHandContainer.Location = panelSprite.Location + new Size(20, 47);

            rightHandContainer          = createItemContainer(eItemContainerType.Weapon);
            rightHandContainer.Location = panelSprite.Location + new Size(253, 47);

            secondaryLeftHandContainer          = createItemContainer(eItemContainerType.Weapon);
            secondaryLeftHandContainer.Location = panelSprite.Location + new Size(24, 45);

            secondaryRightHandContainer          = createItemContainer(eItemContainerType.Weapon);
            secondaryRightHandContainer.Location = panelSprite.Location + new Size(257, 45);

            beltContainer          = createItemContainer(eItemContainerType.Belt);
            beltContainer.Location = panelSprite.Location + new Size(136, 178);

            ringtLeftContainer          = createItemContainer(eItemContainerType.Ring);
            ringtLeftContainer.Location = panelSprite.Location + new Size(95, 179);

            ringtRightContainer          = createItemContainer(eItemContainerType.Ring);
            ringtRightContainer.Location = panelSprite.Location + new Size(209, 179);

            gloveContainer          = createItemContainer(eItemContainerType.Glove);
            gloveContainer.Location = panelSprite.Location + new Size(20, 179);

            bootsContainer          = createItemContainer(eItemContainerType.Boots);
            bootsContainer.Location = panelSprite.Location + new Size(251, 178);
        }
示例#3
0
        public InventoryPanel(IRenderWindow renderWindow,
                              IItemManager itemManager,
                              IMapRenderer mapRenderer,
                              ISessionManager sessionManager,
                              Func <eItemContainerType, IItemContainer> createItemContainer,
                              IGameState gameState,
                              Func <eButtonType, IButton> createButton)
        {
            this.renderWindow = renderWindow;
            this.mapRenderer  = mapRenderer;
            this.gameState    = gameState;

            sessionManager.OnFocusOnPlayer   += OnFocusOnPlayer;
            sessionManager.OnPlayerInfo      += OnPlayerInfo;
            sessionManager.OnChangeEquipment += OnChangeEquipment;

            panelSprite = renderWindow.LoadSprite(ResourcePaths.InventoryCharacterPanel, Palettes.Units, FrameType.GetOffset(), true);

            closeButton            = createButton(eButtonType.Close);
            closeButton.Location   = panelSprite.Location + new Size(18, 384);
            closeButton.OnActivate = () => OnPanelClosed?.Invoke(this);

            secondaryLeftButton            = createButton(eButtonType.SecondaryInvHand);
            secondaryLeftButton.Location   = panelSprite.Location + new Size(15, 22);
            secondaryLeftButton.OnActivate = ToggleWeaponsSlot;

            secondaryRightButton            = createButton(eButtonType.SecondaryInvHand);
            secondaryRightButton.Location   = panelSprite.Location + new Size(246, 22);
            secondaryRightButton.OnActivate = ToggleWeaponsSlot;

            goldButton            = createButton(eButtonType.GoldCoin);
            goldButton.Location   = panelSprite.Location + new Size(84, 391);
            goldButton.OnActivate = OpenGoldDrop;

            headContainer          = createItemContainer(eItemContainerType.Helm);
            headContainer.Location = panelSprite.Location + new Size(135, 5);
            headContainer.Slot     = "head";

            neckContainer          = createItemContainer(eItemContainerType.Amulet);
            neckContainer.Location = panelSprite.Location + new Size(209, 34);
            neckContainer.Slot     = "neck";

            torsoContainer          = createItemContainer(eItemContainerType.Armor);
            torsoContainer.Location = panelSprite.Location + new Size(135, 75);
            torsoContainer.Slot     = "tors";

            rightHandContainer          = createItemContainer(eItemContainerType.Weapon);
            rightHandContainer.Location = panelSprite.Location + new Size(20, 47);
            rightHandContainer.Slot     = "rarm";

            leftHandContainer          = createItemContainer(eItemContainerType.Weapon);
            leftHandContainer.Location = panelSprite.Location + new Size(253, 47);
            leftHandContainer.Slot     = "larm";

            secondaryLeftHandContainer          = createItemContainer(eItemContainerType.Weapon);
            secondaryLeftHandContainer.Location = panelSprite.Location + new Size(24, 45);

            secondaryRightHandContainer          = createItemContainer(eItemContainerType.Weapon);
            secondaryRightHandContainer.Location = panelSprite.Location + new Size(257, 45);

            beltContainer          = createItemContainer(eItemContainerType.Belt);
            beltContainer.Location = panelSprite.Location + new Size(136, 178);
            beltContainer.Slot     = "belt";

            ringLeftContainer          = createItemContainer(eItemContainerType.Ring);
            ringLeftContainer.Location = panelSprite.Location + new Size(95, 179);
            ringLeftContainer.Slot     = "rrin";

            ringRightContainer          = createItemContainer(eItemContainerType.Ring);
            ringRightContainer.Location = panelSprite.Location + new Size(209, 179);
            ringRightContainer.Slot     = "lrin";

            gloveContainer          = createItemContainer(eItemContainerType.Glove);
            gloveContainer.Location = panelSprite.Location + new Size(20, 179);
            gloveContainer.Slot     = "glov";

            bootsContainer          = createItemContainer(eItemContainerType.Boots);
            bootsContainer.Location = panelSprite.Location + new Size(251, 178);
            bootsContainer.Slot     = "feet";
        }
示例#4
0
        public CharacterPanel(
            IRenderWindow renderWindow,
            Func <eButtonType, IButton> createButton)
        {
            this.renderWindow = renderWindow;

            panelSprite = renderWindow.LoadSprite(ResourcePaths.InventoryCharacterPanel, Palettes.Act1, FrameType.GetOffset(), true);

            closeButton            = createButton(eButtonType.Close);
            closeButton.Location   = panelSprite.Location + new Size(128, 388);
            closeButton.OnActivate = () => OnPanelClosed?.Invoke(this);
        }