Exemplo n.º 1
0
        public void OnFontLargeRadioButtonUpdate(GumpEntry gumpComponent, object param)
        {
            var radio = gumpComponent as GumpRadio;

            if (radio != null)
            {
                if (radio.InitialState)
                {
                    FontSize = FontHandling.FontSize.Large;
                }
            }
        }
Exemplo n.º 2
0
 public HyperLink(Point2D location, int hue, bool underlined, bool italicized, bool bold, GumpResponse callback, int callbackParam, string text, FontHandling.FontSize size = FontHandling.FontSize.Medium)
 {
     Location      = location;
     Hue           = hue;
     Underlined    = underlined;
     Italicized    = italicized;
     Bold          = bold;
     Callback      = callback;
     CallbackParam = callbackParam;
     Size          = size;
     DisplayText   = text;
 }
Exemplo n.º 3
0
        public void OnFontSmallRadioButtonUpdate(IGumpComponent gumpComponent, object param)
        {
            GumpRadio radio = gumpComponent as GumpRadio;

            if (radio != null)
            {
                if (radio.InitialState)
                {
                    FontSize = FontHandling.FontSize.Small;
                }
            }
        }
Exemplo n.º 4
0
 public WebColoredHyperLink(
     Point2D location,
     string htmlColor,
     bool underlined,
     bool italicized,
     bool bold,
     Action <GumpButton, int> callback,
     int callbackParam,
     string text,
     FontHandling.FontSize size = FontHandling.FontSize.Medium)
     : base(location, 0, underlined, italicized, bold, callback, callbackParam, text, size)
 {
     HtmlColor = htmlColor;
 }
Exemplo n.º 5
0
 public static void AddHtmlLabel(
     this Gump gump,
     int x,
     int y,
     FontHandling.FontSize size,
     bool bold,
     bool italicized,
     bool underlined,
     string webColor,
     string text)
 {
     gump.AddHtmlTextRectangle(
         x,
         y,
         size,
         bold,
         italicized,
         underlined,
         webColor,
         text,
         FontHandling.CalculateTextLengthInPixels(text, size, italicized, bold),
         FontHandling.FONT_LINE_HEIGHT);
 }
Exemplo n.º 6
0
		public override void Deserialize(XElement xml)
		{
			try
			{
				base.Deserialize(xml);

				GumpLink = HttpUtility.HtmlDecode(xml.Descendants("GumpLink").First().Value);
				WebColor = HttpUtility.HtmlDecode(xml.Descendants("WebColor").First().Value);
				Text = HttpUtility.HtmlDecode(xml.Descendants("Text").First().Value);

				try
				{
					Underlined = Convert.ToBoolean(xml.Descendants("Underlined").First().Value);
					Italicized = Convert.ToBoolean(xml.Descendants("Italicized").First().Value);
					Bold = Convert.ToBoolean(xml.Descendants("Bold").First().Value);

					FontSize = (FontHandling.FontSize)Convert.ToInt32(xml.Descendants("FontSize").First().Value);
				}
				catch (Exception e)
				{
					Console.WriteLine("An error occured while loading Hyperlink element");
					Console.WriteLine(e);
				}
			}
			catch (Exception e)
			{
				throw new Exception("Failed to parse LabelElement xml", e);
			}
		}
Exemplo n.º 7
0
		public void OnFontSmallRadioButtonUpdate(GumpEntry gumpComponent, object param)
		{
			var radio = gumpComponent as GumpRadio;

			if (radio != null)
			{
				if (radio.InitialState)
				{
					FontSize = FontHandling.FontSize.Small;
				}
			}
		}
Exemplo n.º 8
0
        public void OnFontMediumRadioButtonUpdate(IGumpComponent gumpComponent, object param)
        {
            GumpRadio radio = gumpComponent as GumpRadio;

            if (radio != null)
            {
                if (radio.InitialState)
                {
                    FontSize = FontHandling.FontSize.Medium;
                }
            }
        }