コード例 #1
0
ファイル: ManageResearch.cs プロジェクト: zi-yu/orionsbelt
        /// <summary>Pinta o controlo</summary>
        protected override void OnLoad(EventArgs args)
        {
            base.OnLoad(args);
            Ruler ruler = getRuler();

            if (ruler == null)
            {
                throw new Exception("ShowPlanets:OnLoad : Ruler doesn't exists");
            }

            //MasterSkinInfo masterSkinInfo = (MasterSkinInfo)Context.Items["MasterSkinInfo"];
            string  controlPath = OrionGlobals.AppPath + "skins/planetaria/controls/ManageResearch.ascx";
            Control control     = Page.LoadControl(controlPath);

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

            if (queue != null)
            {
                queue.Title                = info.getContent("researchQueueTitle");
                queue.Manager              = ruler;
                queue.Category             = "Research";
                queue.ShowQuantity         = false;
                queue.ShowProductionFactor = true;
            }

            QueueErrorReport queueError = (QueueErrorReport)control.FindControl("queueError");

            initResearchList(ruler, control, queueError, "tech");
            initResearchList(ruler, control, queueError, "planet");
            initResearchList(ruler, control, queueError, "exploration");
            initResearchList(ruler, control, queueError, "fleet");

            HyperLink availableResearch = (HyperLink)control.FindControl("availableResearch");

            availableResearch.NavigateUrl = string.Format("{0}?category=Research", OrionGlobals.getSectionBaseUrl("docs"));
            availableResearch.Text        = info.getContent("you_can_use_docs");
            availableResearch.CssClass    = "docs";

            HyperLink researchHelp = (HyperLink)control.FindControl("researchHelp");

            researchHelp.NavigateUrl = Wiki.GetUrl("Research", "Research");
            researchHelp.Text        = info.getContent("go_to_research_wiki");
            researchHelp.CssClass    = "docs";

            HyperLink aboutThisPage = (HyperLink)control.FindControl("aboutThisPage");

            aboutThisPage.NavigateUrl = Wiki.GetUrl("FilaDeEspera");
            aboutThisPage.Text        = info.getContent("wiki_FilaDeEspera");
            aboutThisPage.CssClass    = "docs";

            Controls.Add(control);

            OrionGlobals.RegisterRequest(MessageType.ResearchManagement, info.getContent("section_research"));
        }
コード例 #2
0
ファイル: ManageResearch.cs プロジェクト: zi-yu/orionsbelt
 /// <summary>Inicializa o controlo de construco de pesquisas</summary>
 private void initResearchList( Ruler ruler, Control control, QueueErrorReport queueError, string cat )
 {
     Resources resources = (Resources) control.FindControl(cat);
     if( resources == null ) {
         return;
     }
     resources.Manager = ruler;
     resources.Cost = null;
     resources.ShowDemolish = false;
     resources.ShowQuantity = false;
     resources.QueueError = queueError;
     resources.Title = string.Format("<b>{0}</b> - {1}", info.getContent(cat), info.getContent("researchTitle"));
     resources.Category = "Research";
     resources.ShowDocumentation = true;
     resources.ShowDuration = true;
     resources.CategoryDescription = cat;
 }
コード例 #3
0
ファイル: ManageBuildings.cs プロジェクト: zi-yu/orionsbelt
        /// <summary>Escreve a lista de edificios</summary>
        private void writeBuildingList(Chronos.Core.Planet planet, Control planetSkin, string cat, bool keys)
        {
            Resources resources = (Resources)planetSkin.FindControl(cat);

            resources.Manager             = planet;
            resources.ShowSpaceCost       = true;
            resources.ShowDocumentation   = true;
            resources.AllowKeywords       = keys;
            resources.Tooltip             = "modifiers";
            resources.Title               = string.Format("<b>{0}</b> - {1}", info.getContent("recursos"), info.getContent(cat));
            resources.ShowDuration        = true;
            resources.CategoryDescription = cat;
            resources.ShowDemolish        = keys;

            QueueErrorReport queueError = (QueueErrorReport)planetSkin.FindControl("queueError");

            resources.QueueError = queueError;
        }
コード例 #4
0
ファイル: ManageResearch.cs プロジェクト: zi-yu/orionsbelt
        /// <summary>Inicializa o controlo de construco de pesquisas</summary>
        private void initResearchList(Ruler ruler, Control control, QueueErrorReport queueError, string cat)
        {
            Resources resources = (Resources)control.FindControl(cat);

            if (resources == null)
            {
                return;
            }
            resources.Manager             = ruler;
            resources.Cost                = null;
            resources.ShowDemolish        = false;
            resources.ShowQuantity        = false;
            resources.QueueError          = queueError;
            resources.Title               = string.Format("<b>{0}</b> - {1}", info.getContent(cat), info.getContent("researchTitle"));
            resources.Category            = "Research";
            resources.ShowDocumentation   = true;
            resources.ShowDuration        = true;
            resources.CategoryDescription = cat;
        }
コード例 #5
0
ファイル: Resources.cs プロジェクト: zi-yu/orionsbelt
 /// <summary>Ctor</summary>
 public Resources()
 {
     title                = string.Empty;
     category             = "Building";
     cost                 = DefaultCost;
     ShowQuantity         = true;
     showSpaceCost        = false;
     allowKeywords        = false;
     ShowDemolish         = true;
     showDuration         = false;
     askBuildQuantity     = false;
     showDocumentation    = true;
     ShowRareResourceCost = false;
     command              = null;
     postID               = null;
     showImagePreview     = false;
     resource             = null;
     includeOnMouseOver   = true;
     categoryDesc         = null;
     queue                = null;
 }
コード例 #6
0
ファイル: Resources.cs プロジェクト: zi-yu/orionsbelt
 /// <summary>Ctor</summary>
 public Resources()
 {
     title = string.Empty;
     category = "Building";
     cost = DefaultCost;
     ShowQuantity = true;
     showSpaceCost = false;
     allowKeywords = false;
     ShowDemolish = true;
     showDuration = false;
     askBuildQuantity = false;
     showDocumentation = true;
     ShowRareResourceCost = false;
     command = null;
     postID = null;
     showImagePreview = false;
     resource = null;
     includeOnMouseOver = true;
     categoryDesc = null;
     queue = null;
 }