コード例 #1
0
		public EOPartyPanel(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 = Constants.LightGrayText,
				TextAlign = LabelAlignment.MiddleRight
			};
			m_numMembers.SetParent(this);

			m_scrollBar = new ScrollBar(this, new Vector2(467, 20), new Vector2(16, 97), ScrollBarColors.LightOnMed)
			{
				LinesToRender = 7,
				Visible = true
			};
			m_scrollBar.SetParent(this);
			World.IgnoreDialogs(m_scrollBar);
		}
コード例 #2
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 = Constants.LightGrayText
			};
			caption.SetParent(this);

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

			m_scrollBar = new ScrollBar(this, new Vector2(252, 44), new Vector2(16, 99), ScrollBarColors.LightOnMed);
			m_scrollBar.SetParent(this);
			SmallItemStyleMaxItemDisplay = 6;
		}
コード例 #3
0
		public EOOnlineList(XNAPanel parent)
			: base(null, null, parent)
		{
			m_onlineList = new List<ClientOnlineEntry>();
			//this enables scrolling with mouse wheel and mouseover for parent
			_setSize(parent.BackgroundImage.Width, parent.BackgroundImage.Height);

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

			m_scrollBar = new ScrollBar(this, new Vector2(467, 20), new Vector2(16, 97), ScrollBarColors.LightOnMed)
			{
				LinesToRender = 7,
				Visible = true
			};
			m_scrollBar.SetParent(this);
			World.IgnoreDialogs(m_scrollBar);

			m_filterClick = new Rectangle(2 + DrawAreaWithOffset.X, 2 + DrawAreaWithOffset.Y, 14, 14);

			Texture2D weirdOffsets = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 27, true);
			for (int i = 0; i < m_filterTextures.Length; ++i)
			{
				Rectangle offsetsSource = new Rectangle(i % 2 == 0 ? 0 : 12, i >= 2 ? 246 : 233, 12, 13);

				m_filterTextures[i] = new Texture2D(EOGame.Instance.GraphicsDevice, 12, 13);
				Color[] dat = new Color[12*13];
				weirdOffsets.GetData(0, offsetsSource, dat, 0, dat.Length);
				m_filterTextures[i].SetData(dat);
			}
		}