/// <summary>
        /// This Constructor should be used for all values in ChatTabs
        /// </summary>
        public OldChatTab(ChatTab tab, OldChatRenderer parentRenderer, bool selected = false)
            : base(null, null, parentRenderer)
        {
            WhichTab = tab;

            tabLabel = new XNALabel(new Rectangle(14, 2, 1, 1), Constants.FontSize08);
            tabLabel.SetParent(this);

            switch (WhichTab)
            {
            case ChatTab.Local: tabLabel.Text = "scr";  break;

            case ChatTab.Global: tabLabel.Text = "glb"; break;

            case ChatTab.Group: tabLabel.Text = "grp"; break;

            case ChatTab.System: tabLabel.Text = "sys"; break;

            case ChatTab.Private1:
            case ChatTab.Private2:
                tabLabel.Text = "[priv " + ((int)WhichTab + 1) + "]";
                break;
            }
            Selected = selected;

            relativeTextPos = new Vector2(20, 3);

            //568 331
            scrollBar = new OldScrollBar(parent, new Vector2(467, 2), new Vector2(16, 97), ScrollBarColors.LightOnMed)
            {
                Visible       = selected,
                LinesToRender = 7
            };
            OldWorld.IgnoreDialogs(scrollBar);
        }
        public OldEOPartyPanel(XNAPanel parent)
            : base(null, null, parent)
        {
            _setSize(parent.BackgroundImage.Width, parent.BackgroundImage.Height);

            m_removeTexture = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 43);
            m_buttons       = new List <XNAButton>();

            //will tint this different colors for health bar and fill a rectangle
            m_healthBar             = new Texture2D[4];
            m_healthBar[HP_OUTLINE] = Game.Content.Load <Texture2D>("Party\\hp-outline");
            m_healthBar[HP_RED]     = Game.Content.Load <Texture2D>("Party\\hp-red");
            m_healthBar[HP_YELLOW]  = Game.Content.Load <Texture2D>("Party\\hp-yellow");
            m_healthBar[HP_GREEN]   = Game.Content.Load <Texture2D>("Party\\hp-green");

            m_numMembers = new XNALabel(new Rectangle(455, 2, 27, 14), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                ForeColor = ColorConstants.LightGrayText,
                TextAlign = LabelAlignment.MiddleRight
            };
            m_numMembers.SetParent(this);

            m_scrollBar = new OldScrollBar(this, new Vector2(467, 20), new Vector2(16, 97), ScrollBarColors.LightOnMed)
            {
                LinesToRender = 7,
                Visible       = true
            };
            m_scrollBar.SetParent(this);
            OldWorld.IgnoreDialogs(m_scrollBar);
        }
Beispiel #3
0
        public ScrollingListDialog(PacketAPI api = null)
            : base(api)
        {
            _setBackgroundTexture(((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 52));

            //defaults
            LargeItemStyleMaxItemDisplay = 5;
            SmallItemStyleMaxItemDisplay = 12;

            m_titleText = new XNALabel(new Rectangle(16, 13, 253, 19), Constants.FontSize08pt75)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            m_titleText.SetParent(this);

            m_scrollBar = new OldScrollBar(this, new Vector2(252, 44), new Vector2(16, 199), ScrollBarColors.LightOnMed);

            Center(Game.GraphicsDevice);
            DrawLocation = new Vector2(DrawLocation.X, 15);
            endConstructor(false);
        }
Beispiel #4
0
        private QuestDialog(PacketAPI api)
            : base(api)
        {
            DialogClosing += (o, e) =>
            {
                if (e.Result == XNADialogResult.OK)
                {
                    if (!m_api.RespondToQuestDialog(_stateInfo, DialogReply.Ok))
                    {
                        ((EOGame)Game).DoShowLostConnectionDialogAndReturnToMainMenu();
                    }
                }
                Instance = null;
            };

            _dialogNames = new Dictionary <short, string>();
            _links       = new Dictionary <short, string>();
            _pages       = new List <string>();

            _setBackgroundTexture(((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 67));

            caption = new XNALabel(new Rectangle(16, 16, 255, 18), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            caption.SetParent(this);

            m_scrollBar.SetParent(null);
            m_scrollBar.Close();

            m_scrollBar = new OldScrollBar(this, new Vector2(252, 44), new Vector2(16, 99), ScrollBarColors.LightOnMed);
            m_scrollBar.SetParent(this);
            SmallItemStyleMaxItemDisplay = 6;
        }
Beispiel #5
0
        public TradeDialog(PacketAPI apiHandle)
            : base(apiHandle)
        {
            bgTexture = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 50);
            _setSize(bgTexture.Width, bgTexture.Height);

            Instance       = this;
            DialogClosing += (sender, args) => Instance = null;
            m_main         = OldWorld.Instance.MainPlayer.ActiveCharacter;

            m_leftItems  = new List <ListDialogItem>();
            m_rightItems = new List <ListDialogItem>();

            m_leftPlayerID  = 0;
            m_rightPlayerID = 0;

            m_leftPlayerName = new XNALabel(new Rectangle(20, 14, 166, 20), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            m_leftPlayerName.SetParent(this);
            m_rightPlayerName = new XNALabel(new Rectangle(285, 14, 166, 20), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            m_rightPlayerName.SetParent(this);
            m_leftPlayerStatus = new XNALabel(new Rectangle(195, 14, 79, 20), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                Text      = OldWorld.GetString(EOResourceID.DIALOG_TRADE_WORD_TRADING),
                ForeColor = ColorConstants.LightGrayText
            };
            m_leftPlayerStatus.SetParent(this);
            m_rightPlayerStatus = new XNALabel(new Rectangle(462, 14, 79, 20), Constants.FontSize08pt5)
            {
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                Text      = OldWorld.GetString(EOResourceID.DIALOG_TRADE_WORD_TRADING),
                ForeColor = ColorConstants.LightGrayText
            };
            m_rightPlayerStatus.SetParent(this);

            m_leftScroll = new OldScrollBar(this, new Vector2(252, 44), new Vector2(16, 199), ScrollBarColors.LightOnMed)
            {
                LinesToRender = 5
            };
            m_rightScroll = new OldScrollBar(this, new Vector2(518, 44), new Vector2(16, 199), ScrollBarColors.LightOnMed)
            {
                LinesToRender = 5
            };

            //BUTTONSSSS
            XNAButton ok = new XNAButton(smallButtonSheet, new Vector2(356, 252), _getSmallButtonOut(SmallButton.Ok),
                                         _getSmallButtonOver(SmallButton.Ok));

            ok.OnClick += _buttonOkClicked;
            ok.SetParent(this);
            dlgButtons.Add(ok);
            XNAButton cancel = new XNAButton(smallButtonSheet, new Vector2(449, 252), _getSmallButtonOut(SmallButton.Cancel),
                                             _getSmallButtonOver(SmallButton.Cancel));

            cancel.OnClick += _buttonCancelClicked;
            cancel.SetParent(this);
            dlgButtons.Add(cancel);

            Timer localTimer = new Timer(state =>
            {
                if (m_recentPartnerRemoves > 0)
                {
                    m_recentPartnerRemoves--;
                }
            }, null, 0, 5000);

            DialogClosing += (o, e) =>
            {
                if (e.Result == XNADialogResult.Cancel)
                {
                    if (!m_api.TradeClose())
                    {
                        ((EOGame)Game).DoShowLostConnectionDialogAndReturnToMainMenu();
                    }
                    ((EOGame)Game).Hud.SetStatusLabel(EOResourceID.STATUS_LABEL_TYPE_ACTION, EOResourceID.STATUS_LABEL_TRADE_ABORTED);
                }

                localTimer.Dispose();
            };

            Center(Game.GraphicsDevice);
            DrawLocation = new Vector2(DrawLocation.X, 30);
            endConstructor(false);
        }
Beispiel #6
0
        public OldActiveSpells(XNAPanel parent, PacketAPI api)
            : base(null, null, parent)
        {
            _api = api;

            _childItems = new List <ISpellIcon>(SPELL_NUM_ROWS * SPELL_ROW_LENGTH);
            RemoveAllSpells();

            var localSpellSlotMap = new Dictionary <int, int>();

            _spellsKey = _tryGetCharacterRegKey();
            if (_spellsKey != null)
            {
                const string spellFmt = "item{0}";
                for (int i = 0; i < SPELL_ROW_LENGTH * 4; ++i)
                {
                    int id;
                    try
                    {
                        id = Convert.ToInt32(_spellsKey.GetValue(String.Format(spellFmt, i)));
                    }
                    catch { continue; }
                    localSpellSlotMap.Add(i, id);
                }
            }

            var localSpells = OldWorld.Instance.MainPlayer.ActiveCharacter.Spells;

            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var spell in localSpells)
            {
                var rec  = OldWorld.Instance.ESF[spell.ID];
                int slot = localSpellSlotMap.ContainsValue(spell.ID)
                    ? localSpellSlotMap.First(_pair => _pair.Value == spell.ID).Key
                    : _getNextOpenSlot();

                if (slot < 0 || !_addNewSpellToSlot(slot, rec, spell.Level))
                {
                    EOMessageBox.Show("You have too many spells! They don't all fit.", "Warning", EODialogButtons.Ok, EOMessageBoxStyle.SmallDialogSmallHeader);
                    break;
                }

                if (slot >= SPELL_ROW_LENGTH * (SPELL_NUM_ROWS / 2))
                {
                    _childItems.Last().Visible = false;
                }
            }

            _setSize(parent.DrawArea.Width, parent.DrawArea.Height);

            _functionKeyGraphics       = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 58, true);
            _functionKeyRow1SourceRect = new Rectangle(148, 51, 18, 13);
            _functionKeyRow2SourceRect = new Rectangle(148 + 18 * 8, 51, 18, 13);

            _selectedSpellName = new XNALabel(new Rectangle(9, 50, 81, 13), Constants.FontSize08pt5)
            {
                Visible   = false,
                Text      = "",
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleCenter,
                ForeColor = ColorConstants.LightGrayText
            };
            _selectedSpellName.SetParent(this);

            _selectedSpellLevel = new XNALabel(new Rectangle(32, 78, 42, 15), Constants.FontSize08pt5)
            {
                Visible   = true,
                Text      = "0",
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            _selectedSpellLevel.SetParent(this);

            var skillPoints = OldWorld.Instance.MainPlayer.ActiveCharacter.Stats.SkillPoints;

            _totalSkillPoints = new XNALabel(new Rectangle(32, 96, 42, 15), Constants.FontSize08pt5)
            {
                Visible   = true,
                Text      = skillPoints.ToString(),
                AutoSize  = false,
                TextAlign = LabelAlignment.MiddleLeft,
                ForeColor = ColorConstants.LightGrayText
            };
            _totalSkillPoints.SetParent(this);

            var buttonSheet = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 27, true);

            _levelUpButton1 = new XNAButton(buttonSheet, new Vector2(71, 77), new Rectangle(215, 386, 19, 15), new Rectangle(234, 386, 19, 15))
            {
                FlashSpeed = 500,
                Visible    = false
            };
            _levelUpButton1.OnClick += LevelUp_Click;
            _levelUpButton1.SetParent(this);
            _levelUpButton2 = new XNAButton(buttonSheet, new Vector2(71, 95), new Rectangle(215, 386, 19, 15), new Rectangle(234, 386, 19, 15))
            {
                FlashSpeed = 500,
                Visible    = false
            };
            _levelUpButton2.OnClick += LevelUp_Click;
            _levelUpButton2.SetParent(this);

            _scroll = new OldScrollBar(this, new Vector2(467, 2), new Vector2(16, 115), ScrollBarColors.LightOnMed)
            {
                LinesToRender = 2
            };
            _scroll.UpdateDimensions(4);

            foreach (var child in children.Where(x => !(x is EmptySpellIcon)))
            {
                OldWorld.IgnoreDialogs(child);
            }
        }