示例#1
0
        /// <summary>Escreve um planeta</summary>
        private void writePlanet(Chronos.Core.Planet planet)
        {
            MasterSkinInfo masterSkinInfo = (MasterSkinInfo)Context.Items["MasterSkinInfo"];
            string         control        = OrionGlobals.AppPath + masterSkinInfo.masterSkinName + "/controls/" + controlToLoad;

            Control planetPage = Page.LoadControl(control);

            Image img = (Image)planetPage.FindControl("img");

            if (img != null)
            {
                img.ImageUrl        = OrionGlobals.getCommonImagePath("planets/" + planet.Info.Id + ".jpg");
                img.EnableViewState = false;
            }

            ResourcesList resources = (ResourcesList)planetPage.FindControl("resourcesList");

            if (resources != null)
            {
                resources.Manager           = planet;
                resources.Title             = info.getContent("planetResources");
                resources.Category          = "Intrinsic";
                resources.ShowImages        = true;
                resources.ShowOnlyQuantity  = false;
                resources.ShowZeroQuantity  = true;
                resources.ShowDocumentation = false;
            }

            writeGeneral(planet, planetPage);

            Controls.Add(planetPage);
        }
示例#2
0
 /// <summary>Inicializa o controlo de listagem de pesquisas</summary>
 private void initResearchOwned(Ruler ruler, ResourcesList resources)
 {
     resources.Manager           = ruler;
     resources.Title             = info.getContent("rulerResearch");
     resources.Category          = "Research";
     resources.ShowImages        = false;
     resources.ShowOnlyQuantity  = true;
     resources.ShowZeroQuantity  = false;
     resources.ShowQuantity      = false;
     resources.ShowDocumentation = true;
 }
示例#3
0
 /// <summary>Inicializa o controlo de listagem de pesquisas</summary>
 private void initResearchOwned( Ruler ruler, ResourcesList resources )
 {
     resources.Manager = ruler;
     resources.Title = info.getContent("rulerResearch");
     resources.Category = "Research";
     resources.ShowImages = false;
     resources.ShowOnlyQuantity = true;
     resources.ShowZeroQuantity = false;
     resources.ShowQuantity = false;
     resources.ShowDocumentation = true;
 }
示例#4
0
        /// <summary>Pinta o Controlo</summary>
        protected void writeControl(Chronos.Core.Ruler ruler, Chronos.Core.Planet planet)
        {
            //MasterSkinInfo masterSkinInfo = (MasterSkinInfo)Context.Items["MasterSkinInfo"];
            string  control    = OrionGlobals.AppPath + "skins/planetaria/controls/ManageBuildings.ascx";
            Control planetSkin = Page.LoadControl(control);

            ResourcesList resources = (ResourcesList)planetSkin.FindControl("resourcesList");

            if (resources != null)
            {
                resources.Manager           = planet;
                resources.Title             = info.getContent("planetResources");
                resources.Category          = "Intrinsic";
                resources.ShowImages        = true;
                resources.ShowDocumentation = false;
                resources.ResourcesToShow   = new string[] {
                    "gold", "mp", "food", "labor", "housing", "energy", "culture", "polution"
                };
                resources.ShowSpace = true;
            }

            QueueNotifier queue = (QueueNotifier)planetSkin.FindControl("queue");

            if (queue != null)
            {
                queue.Manager      = planet;
                queue.Category     = "Building";
                queue.Title        = info.getContent("inProduction");
                queue.EmptyMessage = info.getContent("buildingsQueueEmpty");
            }

            PlanetNavigation nav = (PlanetNavigation)planetSkin.FindControl("planetNavigation");

            if (null != nav)
            {
                nav.Player  = ruler;
                nav.Current = planet;
                nav.Section = "Buildings";
            }

            writeBuildingList(planet, planetSkin, "general", true);
            writeBuildingList(planet, planetSkin, "upgrade", false);

            HyperLink intrinsicHelp = (HyperLink)planetSkin.FindControl("intrinsicHelp");

            intrinsicHelp.NavigateUrl = Wiki.GetUrl("Intrinsic", "Intrinsic");
            intrinsicHelp.Text        = info.getContent("wiki_Intrinsecos");

            HyperLink buildingHelp = (HyperLink)planetSkin.FindControl("buildingHelp");

            buildingHelp.NavigateUrl = Wiki.GetUrl("Building", "Building");
            buildingHelp.Text        = info.getContent("wiki_Edificios");

            HyperLink queueHelp = (HyperLink)planetSkin.FindControl("queueHelp");

            queueHelp.NavigateUrl = Wiki.GetUrl("FilaDeEspera");
            queueHelp.Text        = info.getContent("wiki_FilaDeEspera");

            Controls.Add(planetSkin);

            OrionGlobals.RegisterRequest(Chronos.Messaging.MessageType.PlanetManagement, string.Format("{1} - {0}", info.getContent("section_buildings"), planet.Name));
        }