public override void Initialize()
        {
            this._okButton          = new Button(this.UI, this.UI.Path(this.ID, "btnOk"), null);
            this._okButton.Clicked += new EventHandler(this._okButton_Clicked);
            this._playerHeader      = new EspionagePlayerHeader(this._game, this.ID);
            this._descLabel         = new Label(this.UI, this.UI.Path(this.ID, "lblIntelDesc"));
            this._intelDdls         = new DropDownList[3]
            {
                new DropDownList(this.UI, this.UI.Path(this.ID, "ddlIntel1")),
                new DropDownList(this.UI, this.UI.Path(this.ID, "ddlIntel2")),
                new DropDownList(this.UI, this.UI.Path(this.ID, "ddlIntel3"))
            };
            foreach (DropDownList intelDdl in this._intelDdls)
            {
                intelDdl.SelectionChanged += new EventHandler(this.IntelDDLSelectionChanged);
            }
            this._blameDdl = new DropDownList(this.UI, this.UI.Path(this.ID, "ddlBlame"));
            this._blameDdl.SelectionChanged += new EventHandler(this.BlameDDLSelectionChanged);
            this.AddPanels((PanelBinding)this._okButton, (PanelBinding)this._playerHeader, (PanelBinding)this._descLabel, (PanelBinding)this._blameDdl);
            this.AddPanels((PanelBinding[])this._intelDdls);
            PlayerInfo playerInfo = this._game.GameDatabase.GetPlayerInfo(this._targetPlayer);

            this._playerHeader.UpdateFromPlayerInfo(this._game.LocalPlayer.ID, playerInfo);
            DiplomacyUI.SyncPanelColor(this._app, this.ID, playerInfo.PrimaryColor);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(App.Localize("@UI_DIPLOMACY_INTEL_CRITICAL_SUCCESS_TITLE") + "\n");
            stringBuilder.Append(string.Format(App.Localize("@UI_DIPLOMACY_INTEL_INFO_DESC_TARGET") + "\n", (object)playerInfo.Name));
            this._descLabel.SetText(stringBuilder.ToString());
            this.RepopulateIntelDDLs((DropDownList)null);
            this.RepopulateBlameDDL();
        }
Esempio n. 2
0
 public IntelMissionDialog(GameSession game, int targetPlayer)
     : base(game.App, "dialogIntelSummary")
 {
     this._targetPlayer          = targetPlayer;
     this._game                  = game;
     this._descLabel             = new Label(this.UI, this.UI.Path(this.ID, "lblIntelDesc"));
     this._okButton              = new Button(this.UI, this.UI.Path(this.ID, "btnOk"), null);
     this._okButton.Clicked     += new EventHandler(this._okButton_Clicked);
     this._cancelButton          = new Button(this.UI, this.UI.Path(this.ID, "btnCancel"), null);
     this._cancelButton.Clicked += new EventHandler(this._cancelButton_Clicked);
     this._playerHeader          = new EspionagePlayerHeader(this._game, this.ID);
     this.AddPanels((PanelBinding)this._descLabel, (PanelBinding)this._okButton, (PanelBinding)this._cancelButton, (PanelBinding)this._playerHeader);
 }