servuo/Scripts/Items/Books/BaseJournal.cs
TrueUO fb1802305f Bug Fixes
- Removed unneeded usings
- World chat log now has a Config option. Turned off by default now.
- Added two new timer priorities.
- Fixed a crash with box of ropes.
- Consolidation of the Pathing movements and algorithms.
- Correctly makes sure you are inside the house you are trying to place addons in.
2020-09-21 09:53:44 -04:00

90 lines
No EOL
2.2 KiB
C#

using Server.Gumps;
namespace Server.Items
{
public class BaseJournalGump : Gump
{
public BaseJournalGump(TextDefinition title, TextDefinition body)
: base(10, 10)
{
AddImage(0, 0, 0x761C);
int y = 20;
if (title != null)
{
if (title.Number > 0)
{
AddHtmlLocalized(50, y, 450, 20, 1154645, string.Format("#{0}", title.Number.ToString()), 0, false, false);
y += 30;
}
else
{
AddHtml(50, y, 450, 20, string.Format("<CENTER>{0}</CENTER>", title.String), false, false);
y += 30;
}
}
if (body.Number > 0)
{
AddHtmlLocalized(95, y, 380, 600, body.Number, 1, false, true);
}
else
{
AddHtml(95, y, 380, 600, body.String, false, true);
}
}
}
public abstract class BaseJournal : Item
{
public abstract TextDefinition Title { get; }
public abstract TextDefinition Body { get; }
public BaseJournal()
: base(0xFBE)
{
}
public BaseJournal(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile m)
{
if (IsChildOf(m.Backpack))
{
m.SendGump(new BaseJournalGump(Title, Body));
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (Title != null)
{
if (Title.Number > 0)
{
list.Add(Title.Number);
}
else
{
list.Add(Title.String);
}
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // Version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}