Exemplo n.º 1
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (!ProducesWaste)
            {
                return;
            }

            var prop = new StringBuilder();

            if (UpdateTimer.Running && Parent == null && !ProductReady)
            {
                prop.AppendFormat("Producing: {0}", NextProduction.ToSimpleString(@"!h\h m\m"));
            }

            if (ProductsMax > 0)
            {
                prop.AppendFormat("{0}Units: {1:#,0} / {2:#,0}", prop.Length > 0 ? "\n" : String.Empty, Products, ProductsMax);
            }
            else if (Products > 0)
            {
                prop.AppendFormat("{0}Units: {1:#,0}", prop.Length > 0 ? "\n" : String.Empty, Products);
            }

            var s = prop.ToString();

            if (!String.IsNullOrWhiteSpace(s))
            {
                list.Add(s.WrapUOHtmlColor(Color.Cyan));
            }
        }
Exemplo n.º 2
0
        public override void OnSingleClick(Mobile m)
        {
            base.OnSingleClick(m);

            if (!ProducesWaste)
            {
                return;
            }

            if (UpdateTimer.Running && Parent == null && !ProductReady)
            {
                LabelTo(m, "Producing: {0}", NextProduction.ToSimpleString(@"!h\h m\m"));
            }

            if (ProductsMax > 0)
            {
                LabelTo(m, "Units: {0:#,0} / {1:#,0}", Products, ProductsMax);
            }
            else if (Products > 0)
            {
                LabelTo(m, "Units: {0:#,0}", Products);
            }
        }