// Use this for initialization void Start() { FoodRegisterButton.onClick.AddListener(FoodRegisterButtonClicked); BuildButton.onClick.AddListener(BuildButtonClicked); AchevementButton.onClick.AddListener(AchevementButtonClicked); StatusButton.onClick.AddListener(StatusButtonClicked); FoodRegisterPageIsShowing = false; FoodRegisterPage.SetActive(FoodRegisterPageIsShowing); BuildPageIsShowing = false; BuildPage.SetActive(BuildPageIsShowing); AchevementPageIsShowing = false; AchevementPage.SetActive(AchevementPageIsShowing); StatusPageIsShowing = false; StatusPage.SetActive(StatusPageIsShowing); }
private BuildGump(Mobile from, BuildSystem buildSystem, BaseBuildingTool tool, object notice, BuildPage page) : base(40, 40) { m_From = from; m_BuildSystem = buildSystem; m_Tool = tool; m_Page = page; BuildContext context = buildSystem.GetContext(from); from.CloseGump(typeof(BuildGump)); from.CloseGump(typeof(BuildGumpItem)); AddPage(0); AddBackground(0, 0, 530, 437, 5054); AddImageTiled(10, 10, 510, 22, 2624); AddImageTiled(10, 292, 150, 45, 2624); AddImageTiled(165, 292, 355, 45, 2624); AddImageTiled(10, 342, 510, 85, 2624); AddImageTiled(10, 37, 200, 250, 2624); AddImageTiled(215, 37, 305, 250, 2624); AddAlphaRegion(10, 10, 510, 417); if (buildSystem.GumpTitleNumber > 0) { AddHtmlLocalized(10, 12, 510, 20, buildSystem.GumpTitleNumber, LabelColor, false, false); } else { AddHtml(10, 12, 510, 20, MakeTitle(buildSystem.GumpTitleString), false, false); } AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER> AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER> AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER> AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 405, 150, 18, 1011441, LabelColor, false, false); // EXIT AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 405, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST // Mark option if (buildSystem.MarkOption) { AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM } // **************************************** // Resmelt option if (buildSystem.Resmelt) { AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0); AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM } // **************************************** // Repair option if (buildSystem.Repair) { AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM } // **************************************** // Enhance option if (buildSystem.CanEnhance) { AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0); AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM } // **************************************** if (notice is int && (int)notice > 0) { AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false); } else if (notice is string) { AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false); } // If the system has more than one resource if (buildSystem.BuildSubRes.Init) { string nameString = buildSystem.BuildSubRes.NameString; int nameNumber = buildSystem.BuildSubRes.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex); Type resourceType = buildSystem.BuildSubRes.ResType; if (resIndex > -1) { BuildSubRes subResource = buildSystem.BuildSubRes.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 362, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** // For dragon scales if (buildSystem.BuildSubRes2.Init) { string nameString = buildSystem.BuildSubRes2.NameString; int nameNumber = buildSystem.BuildSubRes2.NameNumber; int resIndex = (context == null ? -1 : context.LastResourceIndex2); Type resourceType = buildSystem.BuildSubRes.ResType; if (resIndex > -1) { BuildSubRes subResource = buildSystem.BuildSubRes2.GetAt(resIndex); nameString = subResource.NameString; nameNumber = subResource.NameNumber; resourceType = subResource.ItemType; } int resourceCount = 0; if (from.Backpack != null) { Item[] items = from.Backpack.FindItemsByType(resourceType, true); for (int i = 0; i < items.Length; ++i) { resourceCount += items[i].Amount; } } AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0); if (nameNumber > 0) { AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false); } else { AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount)); } } // **************************************** CreateGroupList(); if (page == BuildPage.PickResource) { CreateResList(false); } else if (page == BuildPage.PickResource2) { CreateResList(true); } else if (context != null && context.LastGroupIndex > -1) { CreateItemList(context.LastGroupIndex); } }
public override void SetPermissions(IPermissionDefinitionContext context) { var buildPage = new BuildPage(context, _isMultiTenancyEnabled); buildPage.BuildPages(); }