コード例 #1
0
ファイル: CraftGumpItem.cs プロジェクト: kyuhwas/ServUO
        public CraftGumpItem(Mobile from, CraftSystem craftSystem, CraftItem craftItem, ITool tool)
            : base(40, 40)
        {
            this.m_From        = from;
            this.m_CraftSystem = craftSystem;
            this.m_CraftItem   = craftItem;
            this.m_Tool        = tool;

            from.CloseGump(typeof(CraftGump));
            from.CloseGump(typeof(CraftGumpItem));

            AddPage(0);
            AddBackground(0, 0, 530, 417, 5054);
            AddImageTiled(10, 10, 510, 22, 2624);
            AddImageTiled(10, 37, 150, 148, 2624);
            AddImageTiled(165, 37, 355, 90, 2624);
            AddImageTiled(10, 190, 155, 22, 2624);
            AddImageTiled(10, 240, 150, 57, 2624);
            AddImageTiled(165, 132, 355, 80, 2624);
            AddImageTiled(10, 325, 150, 57, 2624);
            AddImageTiled(165, 217, 355, 80, 2624);
            AddImageTiled(165, 302, 355, 80, 2624);
            AddImageTiled(10, 387, 510, 22, 2624);
            AddAlphaRegion(10, 10, 510, 399);

            AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor, false, false); // ITEM
            AddHtmlLocalized(10, 217, 150, 22, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized(10, 302, 150, 22, 1044056, LabelColor, false, false); // <CENTER>OTHER</CENTER>

            if (craftSystem.GumpTitleNumber > 0)
            {
                this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
            }
            else
            {
                this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
            }

            bool needsRecipe = (craftItem.Recipe != null && from is PlayerMobile && !((PlayerMobile)from).HasRecipe(craftItem.Recipe));

            if (needsRecipe)
            {
                this.AddButton(405, 387, 4005, 4007, 0, GumpButtonType.Page, 0);
                this.AddHtmlLocalized(440, 390, 150, 18, 1044151, GreyLabelColor, false, false); // MAKE NOW
            }
            else
            {
                this.AddButton(405, 387, 4005, 4007, 1, GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(445, 390, 150, 18, 1044151, LabelColor, false, false); // MAKE NOW
            }

            #region Stygian Abyss
            AddButton(265, 387, 4005, 4007, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(300, 390, 150, 18, 1112623, LabelColor, false, false); //MAKE NUMBER

            AddButton(135, 387, 4005, 4007, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(170, 390, 150, 18, 1112624, LabelColor, false, false); //MAKE MAX
            #endregion

            this.AddButton(15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor, false, false); // BACK

            if (craftItem.NameNumber > 0)
            {
                this.AddHtmlLocalized(330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false);
            }
            else
            {
                this.AddLabel(330, 40, LabelHue, craftItem.NameString);
            }

            if (craftItem.UseAllRes)
            {
                this.AddHtmlLocalized(170, 302 + (this.m_OtherCount++ *20), 310, 18, 1048176, LabelColor, false, false);  // Makes as many as possible at once
            }
            this.DrawItem();
            this.DrawSkill();
            this.DrawResource();

            /*
             * if( craftItem.RequiresSE )
             * AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
             * */

            if (craftItem.RequiredExpansion != Expansion.None)
            {
                bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion(craftItem.RequiredExpansion));
                TextDefinition.AddHtmlText(this, 170, 302 + (this.m_OtherCount++ *20), 310, 18, this.RequiredExpansionMessage(craftItem.RequiredExpansion), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue);
            }

            if (craftItem.RequiredThemePack != ThemePack.None)
            {
                TextDefinition.AddHtmlText(this, 170, 302 + (this.m_OtherCount++ *20), 310, 18, this.RequiredThemePackMessage(craftItem.RequiredThemePack), false, false, LabelColor, LabelHue);
            }

            if (needsRecipe)
            {
                this.AddHtmlLocalized(170, 302 + (this.m_OtherCount++ *20), 310, 18, 1073620, RedLabelColor, false, false);  // You have not learned this recipe.
            }
        }
コード例 #2
0
ファイル: BaseQuestGump.cs プロジェクト: twlizer/runuo
 public void AddDescription(MLQuest quest)
 {
     AddHtmlLocalized(98, 140, 312, 16, (quest.IsChainTriggered || quest.NextQuest != null) ? 1075024 : 1072202, 0x2710, false, false);                 // Description [(quest chain)]
     TextDefinition.AddHtmlText(this, 98, 156, 312, 240, quest.Description, false, true, 0x15F90, 0xBDE784);
 }
コード例 #3
0
ファイル: BaseQuestGump.cs プロジェクト: twlizer/runuo
 public void AddConversation(TextDefinition text)
 {
     TextDefinition.AddHtmlText(this, 98, 140, 312, 180, text, false, true, 0x15F90, 0xBDE784);
 }
コード例 #4
0
        public CraftGumpItem(Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool) : base(40, 40)
        {
            m_From        = from;
            m_CraftSystem = craftSystem;
            m_CraftItem   = craftItem;
            m_Tool        = tool;

            from.CloseGump <CraftGump>();
            from.CloseGump <CraftGumpItem>();

            AddPage(0);
            AddBackground(0, 0, 530, 417, 5054);
            AddImageTiled(10, 10, 510, 22, 2624);
            AddImageTiled(10, 37, 150, 148, 2624);
            AddImageTiled(165, 37, 355, 90, 2624);
            AddImageTiled(10, 190, 155, 22, 2624);
            AddImageTiled(10, 217, 150, 53, 2624);
            AddImageTiled(165, 132, 355, 80, 2624);
            AddImageTiled(10, 275, 155, 22, 2624);
            AddImageTiled(10, 302, 150, 53, 2624);
            AddImageTiled(165, 217, 355, 80, 2624);
            AddImageTiled(10, 360, 155, 22, 2624);
            AddImageTiled(165, 302, 355, 80, 2624);
            AddImageTiled(10, 387, 510, 22, 2624);
            AddAlphaRegion(10, 10, 510, 399);

            AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor); // ITEM
            AddHtmlLocalized(10, 192, 150, 22, 1044054, LabelColor); // <CENTER>SKILLS</CENTER>
            AddHtmlLocalized(10, 277, 150, 22, 1044055, LabelColor); // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized(10, 362, 150, 22, 1044056, LabelColor); // <CENTER>OTHER</CENTER>

            if (craftSystem.GumpTitleNumber > 0)
            {
                AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor);
            }
            else
            {
                AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString);
            }

            AddButton(15, 387, 4014, 4016, 0);
            AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor); // BACK

            bool needsRecipe = craftItem.Recipe != null && from is PlayerMobile mobile &&
                               !mobile.HasRecipe(craftItem.Recipe);

            if (needsRecipe)
            {
                AddButton(270, 387, 4005, 4007, 0, GumpButtonType.Page);
                AddHtmlLocalized(305, 390, 150, 18, 1044151, GreyLabelColor); // MAKE NOW
            }
            else
            {
                AddButton(270, 387, 4005, 4007, 1);
                AddHtmlLocalized(305, 390, 150, 18, 1044151, LabelColor); // MAKE NOW
            }

            if (craftItem.NameNumber > 0)
            {
                AddHtmlLocalized(330, 40, 180, 18, craftItem.NameNumber, LabelColor);
            }
            else
            {
                AddLabel(330, 40, LabelHue, craftItem.NameString);
            }

            if (craftItem.UseAllRes)
            {
                AddHtmlLocalized(170, 302 + m_OtherCount++ *20, 310, 18, 1048176, LabelColor); // Makes as many as possible at once
            }
            DrawItem();
            DrawSkill();
            DrawResource();

            /*
             * if (craftItem.RequiresSE)
             * AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
             * */

            if (craftItem.RequiredExpansion != Expansion.None)
            {
                bool supportsEx = from.NetState?.SupportsExpansion(craftItem.RequiredExpansion) == true;
                TextDefinition.AddHtmlText(this, 170, 302 + m_OtherCount++ *20, 310, 18,
                                           RequiredExpansionMessage(craftItem.RequiredExpansion), false, false,
                                           supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue);
            }

            if (needsRecipe)
            {
                AddHtmlLocalized(170, 302 + m_OtherCount++ *20, 310, 18, 1073620, RedLabelColor); // You have not learned this recipe.
            }
        }
コード例 #5
0
ファイル: BaseReward.cs プロジェクト: jaedan/runuo
 public void WriteToGump(Gump g, int x, ref int y)
 {
     TextDefinition.AddHtmlText(g, x, y, 280, LabelHeight, m_Name, false, false, 0x15F90, 0xBDE784);
 }
コード例 #6
0
            public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell) : base(50, 50)
            {
                m_Caster = caster;
                m_Spell  = spell;

                #region Heritage Items
                AddPage(0);

                AddBackground(0, 0, 520, 404, 0x13BE);
                AddImageTiled(10, 10, 500, 20, 0xA40);
                AddImageTiled(10, 40, 500, 324, 0xA40);
                AddImageTiled(10, 374, 500, 20, 0xA40);
                AddAlphaRegion(10, 10, 500, 384);
                AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF, false, false);                  // CANCEL
                AddHtmlLocalized(14, 12, 500, 20, 1063394, 0x7FFF, false, false);                   // <center>Animal Form Selection Menu</center>

                double ninjitsu = caster.Skills.Ninjitsu.Value;
                int    count    = 0;
                int    y        = 44;

                for (int i = 0; i < entries.Length; i++)
                {
                    bool enabled = (ninjitsu >= entries[i].ReqSkill);

                    if (i >= 12 && i <= 15 && (caster.Talisman == null || caster.Talisman.GetType() != entries[i].Type))
                    {
                        enabled = false;
                    }

                    if (enabled)
                    {
                        if (count % 10 == 0)
                        {
                            AddPage(count / 10 + 1);

                            y = 44;
                        }
                        else if (count > 10 && count % 10 == 1)
                        {
                            AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, count / 10);
                            AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false);                               // Back
                        }
                        else if (count % 10 == 9)
                        {
                            AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, count / 10 + 2);
                            AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false);                               // Next
                        }

                        int x = count % 2 == 0 ? 14 : 264;

                        AddImageTiledButton(x, y, 0x918, 0x919, 0x64 + i, GumpButtonType.Reply, 0, entries[i].ItemID, 0x0, entries[i].X, entries[i].Y);

                        if (entries[i].Tooltip > 0)
                        {
                            AddTooltip(entries[i].Tooltip);
                        }

                        TextDefinition.AddHtmlText(this, x + 84, y, 250, 60, entries[i].Name, false, false, 0x7FFF, 0x7FFF);

                        if (count % 2 == 1)
                        {
                            y += 64;
                        }

                        count += 1;
                    }
                }
                #endregion
            }
コード例 #7
0
            public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell) : base(50, 50)
            {
                m_Caster = caster;
                m_Spell  = spell;

                #region Mondain's Legacy
                AddPage(0);

                AddBackground(0, 0, 520, 84 + EntriesPerPage * EntryHeight / 2, 0x13BE);
                AddImageTiled(10, 10, 500, 20, 0xA40);
                AddImageTiled(10, 40, 500, 4 + EntriesPerPage * EntryHeight / 2, 0xA40);
                AddImageTiled(10, 54 + EntriesPerPage * EntryHeight / 2, 500, 20, 0xA40);
                AddAlphaRegion(10, 10, 500, 64 + EntriesPerPage * EntryHeight / 2);
                AddButton(10, 54 + EntriesPerPage * EntryHeight / 2, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(45, 56 + EntriesPerPage * EntryHeight / 2, 450, 20, 1060051, 0x7FFF, false, false); // CANCEL
                AddHtmlLocalized(14, 12, 500, 20, 1063394, 0x7FFF, false, false);                                    // <center>Animal Form Selection Menu</center>

                double ninjitsu = caster.Skills.Ninjitsu.Value;

                Dictionary <int, AnimalFormEntry> list = new Dictionary <int, AnimalFormEntry>();

                for (int i = 0; i < entries.Length; i++)
                {
                    bool enabled = (ninjitsu >= entries[i].ReqSkill);

                    if (entries[i].Talisman != null && (caster.Talisman == null || caster.Talisman.GetType() != entries[i].Talisman))
                    {
                        enabled = false;
                    }

                    if (enabled)
                    {
                        list.Add(i, entries[i]);
                    }
                }

                AnimalFormEntry entry;
                int             pages = list.Count / EntriesPerPage + 1;
                int             relative, page;
                int             idx = 0, x = 0, y = 44;

                foreach (KeyValuePair <int, AnimalFormEntry> kvp in list)
                {
                    entry    = kvp.Value;
                    relative = idx % EntriesPerPage;
                    x        = idx % 2 == 0 ? 14 : 264;

                    if (relative == 0)
                    {
                        page = idx / EntriesPerPage + 1;
                        y    = 44;
                        AddPage(page);

                        if (idx > 0)
                        {
                            AddButton(300, 54 + EntriesPerPage * EntryHeight / 2, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
                            AddHtmlLocalized(340, 56 + EntriesPerPage * EntryHeight / 2, 60, 20, 1011393, 0x7FFF, false, false);                               // Back
                        }

                        if (page < pages)
                        {
                            AddButton(400, 54 + EntriesPerPage * EntryHeight / 2, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page + 1);
                            AddHtmlLocalized(440, 56 + EntriesPerPage * EntryHeight / 2, 60, 20, 1043353, 0x7FFF, false, false);                               // Next
                        }
                    }

                    AddImageTiledButton(x, y, 0x918, 0x919, 0x64 + kvp.Key, GumpButtonType.Reply, 0, entry.ItemID, 0x0, entry.Width, entry.Height);

                    if (entry.Tooltip > 0)
                    {
                        AddTooltip(entry.Tooltip);
                    }

                    TextDefinition.AddHtmlText(this, x + 84, y, 250, 60, entry.Name, false, false, 0x7FFF, 0x7FFF);

                    if (idx % 2 == 1)
                    {
                        y += EntryHeight;
                    }

                    idx++;
                }
                #endregion
            }
コード例 #8
0
        public BuildGumpItem(Mobile from, BuildSystem buildSystem, BuildItem buildItem, BaseBuildingTool tool) : base(40, 40)
        {
            m_From        = from;
            m_BuildSystem = buildSystem;
            m_BuildItem   = buildItem;
            m_Tool        = tool;

            from.CloseGump(typeof(BuildGump));
            from.CloseGump(typeof(BuildGumpItem));

            AddPage(0);
            AddBackground(0, 0, 530, 417, 5054);
            AddImageTiled(10, 10, 510, 22, 2624);
            AddImageTiled(10, 37, 150, 148, 2624);
            AddImageTiled(165, 37, 355, 90, 2624);
            AddImageTiled(10, 190, 155, 22, 2624);
            AddImageTiled(10, 217, 150, 53, 2624);
            AddImageTiled(165, 132, 355, 80, 2624);
            AddImageTiled(10, 275, 155, 22, 2624);
            AddImageTiled(10, 302, 150, 53, 2624);
            AddImageTiled(165, 217, 355, 80, 2624);
            AddImageTiled(10, 360, 155, 22, 2624);
            AddImageTiled(165, 302, 355, 80, 2624);
            AddImageTiled(10, 387, 510, 22, 2624);
            AddAlphaRegion(10, 10, 510, 399);

            AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor, false, false);                                // ITEM
            AddHtmlLocalized(10, 192, 150, 22, 1070722, "<CENTER>ABILITIIES</CENTER>", LabelColor, false, false); // ABILITIIES
            //AddHtmlLocalized(10, 192, 150, 22, 1060857, LabelColor, false, false); // Primary LokaiSkill
            AddHtmlLocalized(10, 277, 150, 22, 1044055, LabelColor, false, false);                                // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized(10, 362, 150, 22, 1044056, LabelColor, false, false);                                // <CENTER>OTHER</CENTER>

            if (buildSystem.GumpTitleNumber > 0)
            {
                AddHtmlLocalized(10, 12, 510, 20, buildSystem.GumpTitleNumber, LabelColor, false, false);
            }
            else
            {
                AddHtml(10, 12, 510, 20, buildSystem.GumpTitleString, false, false);
            }

            AddButton(15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor, false, false);               // BACK

            bool needsRecipe = false;

            if (needsRecipe)
            {
                AddButton(270, 387, 4005, 4007, 0, GumpButtonType.Page, 0);
                AddHtmlLocalized(305, 390, 150, 18, 1044151, GreyLabelColor, false, false);                   // MAKE NOW
            }
            else
            {
                AddButton(270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(305, 390, 150, 18, 1044151, LabelColor, false, false);                   // MAKE NOW
            }

            if (buildItem.NameNumber > 0)
            {
                AddHtmlLocalized(330, 40, 180, 18, buildItem.NameNumber, LabelColor, false, false);
            }
            else
            {
                AddLabel(330, 40, LabelHue, buildItem.NameString);
            }

            if (buildItem.UseAllRes)
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1048176, LabelColor, false, false);                    // Makes as many as possible at once
            }
            DrawItem();
            DrawLokaiSkill();
            DrawRessource();

            /*
             * if( buildItem.RequiresSE )
             *      AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
             * */

            if (buildItem.RequiredExpansion != Expansion.None)
            {
                bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion(buildItem.RequiredExpansion));
                TextDefinition.AddHtmlText(this, 170, 302 + (m_OtherCount++ *20), 310, 18, RequiredExpansionMessage(buildItem.RequiredExpansion), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue);
            }

            if (needsRecipe)
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1073620, RedLabelColor, false, false);                    // You have not learned this recipe.
            }
        }