示例#1
0
		public Title(
			string maleTitle,
			string femalTitle,
			TitleRarity rarity = TitleRarity.Common,
			TitleDisplay display = TitleDisplay.BeforeName)
			: base(rarity)
		{
			MaleTitle = maleTitle;
			FemaleTitle = femalTitle;

			Display = display;
		}
示例#2
0
		public TitleHue(int hue, TitleRarity rarity = TitleRarity.Common)
			: base(rarity)
		{
			Hue = hue;
		}
示例#3
0
		public static TitleHue CreateHue(int value, TitleRarity rarity, out string result)
		{
			if (HueRegistry.Values.Any(x => x.Hue == value))
			{
				result = "The hue '" + value + "' already exists in the registry.";
				return null;
			}

			var hue = new TitleHue(value, rarity);

			HueRegistry.Add(hue.UID, hue);

			foreach (TitleProfile p in
				Profiles.Values.AsParallel()
						.Where(p => p != null && p.Owner != null && p.Owner.AccessLevel >= AccessLevel.GameMaster))
			{
				p.Add(hue);
			}

			result = "The Hue: '" + hue + "' was successfully added to the registry.";
			return hue;
		}
示例#4
0
		public static Title CreateTitle(
			string maleValue, string femaleValue, TitleRarity rarity, TitleDisplay display, out string result)
		{
			if (String.IsNullOrWhiteSpace(maleValue))
			{
				result = "The male title can not be whitespace.";
				return null;
			}

			if (String.IsNullOrWhiteSpace(femaleValue))
			{
				femaleValue = maleValue;
				//result = "The female title can not be whitespace.";
				//return null;
			}

			//Allow female and male titles to be the same to specify gender neutral titles
			/*if (maleValue == femaleValue)
			{
				result = "The male and female titles must differ.";
				return null;
			}*/

			if (TitleRegistry.Any(x => x.Value.MaleTitle == maleValue))
			{
				result = "The male title '" + maleValue + "' already exists in the registry.";
				return null;
			}

			if (TitleRegistry.Any(x => x.Value.FemaleTitle == femaleValue))
			{
				result = "The female title '" + femaleValue + "' already exists in the registry.";
				return null;
			}

			var title = new Title(maleValue, femaleValue, rarity, display);

			TitleRegistry.Add(title.UID, title);

			foreach (TitleProfile p in
				Profiles.Values.AsParallel()
						.Where(p => p != null && p.Owner != null && p.Owner.AccessLevel >= AccessLevel.GameMaster))
			{
				p.Add(title);
			}

			result = "The title '" + title + "' was successfully added to the registry.";
			return title;
		}
示例#5
0
        public TitleObject(TitleRarity rarity)
        {
            UID = new TitleObjectSerial();

            Rarity = rarity;
        }
示例#6
0
        private void CompileHueViewLayout(SuperGumpLayout layout)
        {
            layout.Add("label/chest/hue/title", () => AddLabel(105, 120, 44, "Hues"));
            layout.Add("label/chest/hue/selected/title", () => AddLabel(215, 120, 44, "Current Hue: "));
            layout.Add(
                "label/chest/hue/selected/value",
                () =>
            {
                int hue = _TitleProfile.SelectedHue != null ? _TitleProfile.SelectedHue.Hue - 1 : -1;

                if (hue >= 0)
                {
                    AddLabel(305, 120, hue, "##### " + (hue + 1));
                }
            });

            layout.Add(
                "button/chest/hue/clear",
                () => AddButton(
                    405,
                    120,
                    22150,
                    22151,
                    btn =>
            {
                _TitleProfile.SelectedHue = null;
                Refresh(true);
            }));

            layout.Add("label/chest/hue/switch", () => AddLabel(450, 115, 44, "To Titles: "));
            layout.Add(
                "button/chest/hue/switch",
                () => AddButton(
                    515,
                    115,
                    4006,
                    4005,
                    b =>
            {
                _View = ViewMode.Title;
                Refresh(true);
            }));

            layout.Add("image/body/hue/Hbar", () => AddImageTiled(101, 140, 452, 1, 0x2458));

            CompileRarityLayout(layout);

            if (User.AccessLevel < CustomTitles.Access)
            {
                return;
            }

            layout.Add("image/body/hue/Hbaradmintop", () => AddImageTiled(78, 325, 500, 1, 9304));
            //layout.Add("label/body/hue/create", () => AddLabel(105, 330, 44, "Create New Hue"));
            //layout.Add("image/body/hue/Hbarnewunderline", () => AddImageTiled(107, 347, 100, 1, 9304));

            layout.Add("label/body/hue/value", () => AddLabel(105, 330, 100, "Hue Value"));
            layout.Add("background/body/hue/value", () => AddBackground(105, 355, 125, 25, 9350));
            layout.Add(
                "textentry/body/hue/value",
                () => AddTextEntryLimited(
                    108,
                    360,
                    125,
                    25,
                    100,
                    _AddHue.ToString(CultureInfo.InvariantCulture),
                    15,
                    (b, t) =>
            {
                if (String.IsNullOrWhiteSpace(t))
                {
                    return;
                }

                int value;

                if (Int32.TryParse(t, out value))
                {
                    _AddHue = value;
                }
            }));

            layout.Add("background/body/hue/rarity", () => AddBackground(365, 355, 125, 25, 9350));
            layout.Add(
                "menu/body/hue/rarity",
                () => AddEnumSelect(
                    365,
                    355,
                    4005,
                    4007,
                    35,
                    2,
                    25,
                    90,
                    _AddRarity.AsHue(),
                    _AddRarity,
                    r =>
            {
                _AddRarity = r;
                Refresh(true);
            }));

            layout.Add("button/body/hue/help", () => AddButton(495, 360, 22153, 22154, b => DisplayHelp()));
            layout.Add("button/body/hue/accept", () => AddButton(525, 357, 4024, 4025, b => AddHue()));
        }
示例#7
0
        private void CompileTitleViewLayout(SuperGumpLayout layout)
        {
            layout.Add("label/chest/title/title", () => AddLabel(105, 120, 44, "Titles"));
            layout.Add("label/chest/title/selected/title", () => AddLabel(215, 120, 44, "Current Title: "));
            layout.Add(
                "label/chest/title/selected/value",
                () =>
            {
                TitleHue selectedHue = _TitleProfile.SelectedHue;
                Title selectedTitle  = _TitleProfile.SelectedTitle;
                Mobile owner         = _TitleProfile.Owner ?? User;

                int hue      = selectedHue != null ? selectedHue.Hue - 1 : CustomTitles.CMOptions.DefaultTitleHue;
                string title = selectedTitle != null ? selectedTitle.ToString(owner.Female) : String.Empty;

                if (!String.IsNullOrWhiteSpace(title))
                {
                    AddLabel(305, 120, hue, title);
                }
            });

            layout.Add(
                "button/chest/title/clear/",
                () => AddButton(
                    405,
                    120,
                    22150,
                    22151,
                    btn =>
            {
                _TitleProfile.SelectedTitle = null;
                Refresh(true);
            }));

            layout.Add("label/chest/title/switch", () => AddLabel(450, 115, 44, "To Hues: "));
            layout.Add(
                "button/chest/title/switch",
                () => AddButton(
                    515,
                    115,
                    4006,
                    4005,
                    b =>
            {
                _View = ViewMode.Hue;
                Refresh(true);
            }));

            layout.Add("image/body/title/Hbar", () => AddImageTiled(101, 140, 452, 1, 0x2458));

            CompileRarityLayout(layout);

            if (User.AccessLevel < CustomTitles.Access)
            {
                return;
            }

            layout.Add("image/body/title/Hbaradmintop", () => AddImageTiled(78, 325, 500, 1, 9304));
            //layout.Add("label/body/title/create", () => AddLabel(105, 330, 44, "Create New Title"));
            //layout.Add("image/body/title/Hbarnewunderline", () => AddImageTiled(107, 347, 100, 1, 9304));

            layout.Add("label/body/title/male", () => AddLabel(105, 330, 100, "Male Title"));
            layout.Add("background/body/title/male", () => AddBackground(105, 355, 125, 25, 9350));
            layout.Add(
                "textentry/body/title/male",
                () => AddTextEntryLimited(
                    108,
                    360,
                    125,
                    25,
                    100,
                    _AddTitleMale,
                    15,
                    (b, t) =>
            {
                if (!String.IsNullOrWhiteSpace(t))
                {
                    _AddTitleMale = t;
                }
            }));

            layout.Add("label/body/title/female", () => AddLabel(235, 330, 100, "Female Title"));
            layout.Add("background/body/female", () => AddBackground(235, 355, 125, 25, 9350));
            layout.Add(
                "textentry/body/title/female",
                () => AddTextEntryLimited(
                    238,
                    360,
                    125,
                    25,
                    100,
                    _AddTitleFemale,
                    15,
                    (b, t) =>
            {
                if (!String.IsNullOrWhiteSpace(t))
                {
                    _AddTitleFemale = t;
                }
            }));

            layout.Add("background/body/title/display", () => AddBackground(365, 330, 125, 25, 9350));
            layout.Add(
                "textentry/body/title/display",
                () => AddEnumSelect(
                    365,
                    330,
                    4005,
                    4007,
                    35,
                    2,
                    25,
                    90,
                    TextHue,
                    _AddDisplay,
                    d =>
            {
                _AddDisplay = d;
                Refresh(true);
            }));

            layout.Add("background/body/title/rarity", () => AddBackground(365, 355, 125, 25, 9350));
            layout.Add(
                "menu/body/title/rarity",
                () => AddEnumSelect(
                    365,
                    355,
                    4005,
                    4007,
                    35,
                    2,
                    25,
                    90,
                    _AddRarity.AsHue(),
                    _AddRarity,
                    r =>
            {
                _AddRarity = r;
                Refresh(true);
            }));

            layout.Add("button/body/title/help", () => AddButton(495, 360, 22153, 22154, b => DisplayHelp()));
            layout.Add("button/body/title/accept", () => AddButton(525, 357, 4024, 4025, b => AddTitle()));
        }