public void init(int quest, int position)
 {
     this.clearControls();
     if ((position & 1) == 0)
     {
         this.backgroundImage.Image = (Image)GFXLibrary.quest_screen_bar1;
     }
     else
     {
         this.backgroundImage.Image = (Image)GFXLibrary.quest_screen_bar2;
     }
     this.backgroundImage.Position = new Point(60, 11);
     base.addControl(this.backgroundImage);
     NewQuests.NewQuestDefinition definition = NewQuests.getNewQuestDef(quest);
     this.Size                = new Size(0x1bc, 60);
     this.questImage.Image    = (Image)GFXLibrary.quest_icons[Math.Min(definition.questType, GFXLibrary.quest_icons.Length - 1)];
     this.questImage.Position = new Point(0, 6);
     base.addControl(this.questImage);
     this.lblQuestName.Text      = SK.NoStoreText("Z_QUESTS_" + definition.tagString);
     this.lblQuestName.Color     = ARGBColors.Black;
     this.lblQuestName.Position  = new Point(9, 0);
     this.lblQuestName.Size      = new Size(400, this.backgroundImage.Height);
     this.lblQuestName.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.lblQuestName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.backgroundImage.addControl(this.lblQuestName);
 }
 public void init(Form parent, bool forQuestList, string questTag, int questID)
 {
     this.m_parent = parent;
     base.clearControls();
     this.isQuestList = forQuestList;
     this.questText   = questTag;
     this._questID    = questID;
     this.mainBackgroundImage.Image    = (Image)GFXLibrary.mail2_mail_panel_middle_middle;
     this.mainBackgroundImage.ClipRect = new Rectangle(new Point(), base.Size);
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size     = base.Size;
     base.addControl(this.mainBackgroundImage);
     this.questsScrollArea.Position = new Point(0x1b, 30);
     this.questsScrollArea.Size     = new Size(0x199, 0x130);
     this.questsScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x199, 0x130));
     this.mainBackgroundImage.addControl(this.questsScrollArea);
     this.questsScrollBar.Position = new Point(0x1bc, 0x23);
     this.questsScrollBar.Size     = new Size(0x18, 0x126);
     this.mainBackgroundImage.addControl(this.questsScrollBar);
     this.questsScrollBar.Value           = 0;
     this.questsScrollBar.Max             = 100;
     this.questsScrollBar.NumVisibleLines = 0x19;
     this.questsScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom);
     this.questsScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved));
     this.mouseWheelOverlay.Position = this.questsScrollArea.Position;
     this.mouseWheelOverlay.Size     = this.questsScrollArea.Size;
     this.mouseWheelOverlay.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved));
     this.mainBackgroundImage.addControl(this.mouseWheelOverlay);
     this.overlayImage.Image    = (Image)GFXLibrary.char_achievementOverlay;
     this.overlayImage.Position = new Point(0, 0);
     this.mainBackgroundImage.addControl(this.overlayImage);
     this.closeButton.ImageNorm  = (Image)GFXLibrary.int_button_close_normal;
     this.closeButton.ImageOver  = (Image)GFXLibrary.int_button_close_over;
     this.closeButton.ImageClick = (Image)GFXLibrary.int_button_close_in;
     this.closeButton.Position   = new Point(base.Width - 40, 0);
     this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "NewQuestsCompletedPanel_close");
     this.overlayImage.addControl(this.closeButton);
     if (forQuestList)
     {
         this.headerLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         this.headerLabel.Text = SK.Text("QUESTS_CompletedQuests", "Completed Quests");
     }
     else
     {
         this.headerLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
         this.headerLabel.Text = SK.NoStoreText("Z_QUESTS_" + this.questText) + " - ";
         this.headerLabel.Text = this.headerLabel.Text + SK.Text("QUESTS_FurtherDetails", "Further Information");
     }
     this.headerLabel.Position        = new Point(0, 0);
     this.headerLabel.Size            = new Size(base.Width, 30);
     this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.headerLabel.Color           = ARGBColors.White;
     this.headerLabel.DropShadowColor = ARGBColors.Black;
     this.overlayImage.addControl(this.headerLabel);
     this.rebuild();
 }
예제 #3
0
        public override void setData(GetReport_ReturnType returnData)
        {
            base.setData(returnData);
            switch (returnData.reportType)
            {
            case 100:
            {
                base.lblSubTitle.Text = SK.Text("Reports_Quest_Complete", "Completed Quest") + " :";
                NewQuests.NewQuestDefinition definition = NewQuests.getNewQuestDef(returnData.genericData1);
                base.lblSecondaryText.Text = SK.NoStoreText("Z_QUESTS_" + definition.tagString);
                goto Label_0242;
            }

            case 0x65:
            {
                base.lblSubTitle.Text = SK.Text("Reports_Quest Failed", "Failed Quest") + " :";
                NewQuests.NewQuestDefinition definition2 = NewQuests.getNewQuestDef(returnData.genericData1);
                base.lblSecondaryText.Text = SK.NoStoreText("Z_QUESTS_" + definition2.tagString);
                goto Label_0242;
            }

            case 0x66:
                base.lblSubTitle.Text      = SK.Text("Reports_Spins", "Wheel Spin Prize");
                base.lblSecondaryText.Text = Wheel.getRewardText(returnData.genericData1, returnData.genericData2, base.nfi);
                return;

            case 0x81:
            case 130:
            case 0x83:
                if (returnData.reportType != 0x81)
                {
                    if (returnData.reportType == 0x83)
                    {
                        base.lblSubTitle.Text = SK.Text("Reports_AI_Spins_capture", "Wheel Spin Bonus from AI Capture");
                    }
                    else
                    {
                        base.lblSubTitle.Text = SK.Text("Reports_Forage_Spins", "Wheel Spin Bonus from Foraging");
                    }
                    break;
                }
                base.lblSubTitle.Text = SK.Text("Reports_AI_Spins", "Wheel Spin Bonus from AI Razing");
                break;

            default:
                goto Label_0242;
            }
            switch (returnData.genericData1)
            {
            case 2:
                base.lblSecondaryText.Text = SK.Text("REPORTS_SeasonalWheelSpins2", "Tier 2 Wheel Spin");
                return;

            case 3:
                base.lblSecondaryText.Text = SK.Text("REPORTS_SeasonalWheelSpins3", "Tier 3 Wheel Spin");
                return;

            case 4:
                base.lblSecondaryText.Text = SK.Text("REPORTS_SeasonalWheelSpins4", "Tier 4 Wheel Spin");
                return;

            case 5:
                base.lblSecondaryText.Text = SK.Text("REPORTS_SeasonalWheelSpins5", "Tier 5 Wheel Spin");
                return;

            default:
                base.lblSecondaryText.Text = SK.Text("REPORTS_SeasonalWheelSpins1", "Tier 1 Wheel Spin");
                return;
            }
Label_0242:
            base.btnUtility.Visible   = true;
            base.btnUtility.Text.Text = SK.Text("GENERIC_Quests", "Quests");
        }
예제 #4
0
        public void init(int questID, int villageID, NewQuestsPanel questPanel, NewQuestRewardPopup parent)
        {
            this.m_questID    = questID;
            this.m_villageID  = -1;
            this.m_questPanel = questPanel;
            base.clearControls();
            bool flag = false;

            if (GameEngine.Instance.World.YourHouse > 0)
            {
                flag = true;
            }
            if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1)
            {
                flag = false;
            }
            List <int> list   = GameEngine.Instance.World.getUserVillageIDList();
            int        height = 200;

            NewQuests.NewQuestDefinition def = NewQuests.getNewQuestDef(questID);
            this.fb_questID = def.questType - 1;
            NumberFormatInfo nFI = GameEngine.NFI;

            if (def.parameter > 0)
            {
                this.fb_questCaption = SK.NoStoreText("Z_QUEST_DESCRIPTIONS_" + def.tagString) + " : " + def.parameter.ToString("N", nFI);
            }
            else
            {
                this.fb_questCaption = SK.NoStoreText("Z_QUEST_DESCRIPTIONS_" + def.tagString);
            }
            if ((((def.reward_apples > 0) || (def.reward_stone > 0)) || (def.reward_wood > 0)) && (list.Count > 1))
            {
                if ((def.getRewardGlory() > 0) && flag)
                {
                    height = 0x1ec;
                }
                else
                {
                    height = 410;
                }
            }
            else if ((def.getRewardGlory() > 0) && flag)
            {
                height = 270;
            }
            else
            {
                height = 200;
            }
            parent.Size = new Size(550, height);
            this.headerBarImage.Position = new Point(0, 0);
            this.headerBarImage.Size     = new Size(base.Width, 30);
            base.addControl(this.headerBarImage);
            this.headerBarImage.Create((Image)GFXLibrary.messageboxtop_left, (Image)GFXLibrary.messageboxtop_middle, (Image)GFXLibrary.messageboxtop_right);
            this.backgroundImage.SpecialGradient = true;
            this.backgroundImage.Position        = new Point(0, 30);
            this.backgroundImage.Size            = new Size(base.Width, height - 30);
            base.addControl(this.backgroundImage);
            this.captureLabel.Text      = SK.Text("QuestLine_Collect_Reward", "Collect Reward");
            this.captureLabel.Color     = ARGBColors.White;
            this.captureLabel.Position  = new Point(13, 7);
            this.captureLabel.Size      = new Size(0x14f, 20);
            this.captureLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.captureLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.headerBarImage.addControl(this.captureLabel);
            this.strip1.Image    = (Image)GFXLibrary.quest_popup_hz_strip_02;
            this.strip1.Position = new Point(4, 4);
            this.backgroundImage.addControl(this.strip1);
            this.questIcon.Image    = (Image)GFXLibrary.quest_icons[Math.Min(def.questType, GFXLibrary.quest_icons.Length - 1)];
            this.questIcon.Position = new Point(12, 12);
            this.backgroundImage.addControl(this.questIcon);
            this.fb_questString         = this.lblQuestName.Text = SK.NoStoreText("Z_QUESTS_" + def.tagString);
            this.lblQuestName.Color     = ARGBColors.Black;
            this.lblQuestName.Position  = new Point(70, 0x1a);
            this.lblQuestName.Size      = new Size(700, 30);
            this.lblQuestName.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.lblQuestName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.backgroundImage.addControl(this.lblQuestName);
            this.facebookShareButton.ImageNorm      = (Image)GFXLibrary.facebookBlueNorm;
            this.facebookShareButton.ImageOver      = (Image)GFXLibrary.facebookBlueOver;
            this.facebookShareButton.ImageClick     = (Image)GFXLibrary.facebookBlueClick;
            this.facebookShareButton.Position       = new Point(0xeb, height - 0x4b);
            this.facebookShareButton.UseTextSize    = true;
            this.facebookShareButton.Text.Text      = SK.Text("FACEBOOK_Share", "Share");
            this.facebookShareButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
            this.facebookShareButton.Text.Position  = new Point(20, 2);
            this.facebookShareButton.Text.Size      = new Size(110, 0x15);
            this.facebookShareButton.Text.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.facebookShareButton.TextYOffset    = 0;
            this.facebookShareButton.Text.Color     = ARGBColors.Black;
            this.facebookShareButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.facebookShareClicked));
            this.backgroundImage.addControl(this.facebookShareButton);
            this.strip2.Image    = (Image)GFXLibrary.quest_popup_hz_strip_01;
            this.strip2.Position = new Point(0x18, 0x4f);
            this.backgroundImage.addControl(this.strip2);
            NewQuestsPanel.addRewardIcons(this.backgroundImage, new Point(30, 80), def, 0);
            this.collectButton.ImageNorm  = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
            this.collectButton.ImageOver  = (Image)GFXLibrary.mail2_button_blue_141wide_over;
            this.collectButton.ImageClick = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
            this.collectButton.Position   = new Point(0x181, 0x57);
            this.collectButton.Text.Text  = SK.Text("QUESTS_Collect", "Collect");
            this.collectButton.Text.Font  = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.collectButton.Text.Color = ARGBColors.Black;
            this.collectButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.okClicked), "NewQuests_Collect_Clicked");
            this.backgroundImage.addControl(this.collectButton);
            if (def.reward_charges.Length > 0)
            {
                this.chargesImage.Image           = (Image)GFXLibrary.quest_rewards[9];
                this.chargesImage.Position        = new Point(0x19, height - 0x52);
                this.chargesImage.CustomTooltipID = 0xc8c;
                this.backgroundImage.addControl(this.chargesImage);
            }
            if (((def.reward_apples > 0) || (def.reward_stone > 0)) || (def.reward_wood > 0))
            {
                if (list.Count > 1)
                {
                    this.strip4.Image    = (Image)GFXLibrary.quest_popup_hz_strip_03;
                    this.strip4.Position = new Point(0x18, 0x97);
                    this.backgroundImage.addControl(this.strip4);
                    this.collectButton.Enabled = false;
                    this.villageIcon.Image     = (Image)GFXLibrary.char_village_icons[5];
                    this.villageIcon.Position  = new Point(30, 0x94);
                    this.backgroundImage.addControl(this.villageIcon);
                    if (Program.mySettings.LanguageIdent == "fr")
                    {
                        this.targetVillageLabel.Text = "Village Cible";
                    }
                    else
                    {
                        this.targetVillageLabel.Text = SK.Text("VillageArmiesPanel_Target_Village", "Target Village");
                    }
                    this.targetVillageLabel.Color     = ARGBColors.Black;
                    this.targetVillageLabel.Position  = new Point(0, 130);
                    this.targetVillageLabel.Size      = new Size(base.Width, 30);
                    this.targetVillageLabel.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                    this.targetVillageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
                    this.backgroundImage.addControl(this.targetVillageLabel);
                    this.villageNameLabel.Text      = SK.Text("QUESTS_Pick_a_Village", "Pick a Village");
                    this.villageNameLabel.Color     = ARGBColors.Black;
                    this.villageNameLabel.Position  = new Point(90, 0x92);
                    this.villageNameLabel.Size      = new Size(base.Width - 90, this.villageIcon.Height);
                    this.villageNameLabel.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                    this.villageNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
                    this.backgroundImage.addControl(this.villageNameLabel);
                    this.questsScrollArea.Position = new Point(0x3d, 200);
                    this.questsScrollArea.Size     = new Size(390, 0x73);
                    this.questsScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(390, 0x73));
                    this.backgroundImage.addControl(this.questsScrollArea);
                    this.insetImage.Position = new Point(0x37, 0xc6);
                    this.insetImage.Size     = new Size(440, 0x77);
                    this.backgroundImage.addControl(this.insetImage);
                    this.insetImage.Create((Image)GFXLibrary.quest_popup_inset_top, (Image)GFXLibrary.quest_popup_inset_middle, (Image)GFXLibrary.quest_popup_inset_bottom);
                    this.questsScrollBar.Position = new Point(0x1cd, 0xcd);
                    this.questsScrollBar.Size     = new Size(0x18, 0x69);
                    this.backgroundImage.addControl(this.questsScrollBar);
                    this.questsScrollBar.Value           = 0;
                    this.questsScrollBar.Max             = 100;
                    this.questsScrollBar.NumVisibleLines = 0x19;
                    this.questsScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom);
                    this.questsScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved));
                    this.mouseWheelOverlay.Position = this.questsScrollArea.Position;
                    this.mouseWheelOverlay.Size     = this.questsScrollArea.Size;
                    this.mouseWheelOverlay.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved));
                    this.backgroundImage.addControl(this.mouseWheelOverlay);
                    this.addVillages(true);
                }
                else if (list.Count > 0)
                {
                    this.m_villageID = list[0];
                }
            }
            if ((def.getRewardGlory() > 0) && flag)
            {
                this.orLabel.Text      = SK.Text("QUESTS_or", "Or");
                this.orLabel.Color     = ARGBColors.Black;
                this.orLabel.Position  = new Point(0, height - 0x91);
                this.orLabel.Size      = new Size(base.Width, 30);
                this.orLabel.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                this.orLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
                this.backgroundImage.addControl(this.orLabel);
                this.strip3.Image    = (Image)GFXLibrary.quest_popup_hz_strip_01;
                this.strip3.Position = new Point(0x18, (height - 0x7b) - 1);
                this.backgroundImage.addControl(this.strip3);
                NewQuestsPanel.addRewardIcons(this.backgroundImage, new Point(30, height - 0x7b), def, -1);
                this.collectGloryButton.ImageNorm  = (Image)GFXLibrary.misc_button_blue_210wide_normal;
                this.collectGloryButton.ImageOver  = (Image)GFXLibrary.misc_button_blue_210wide_over;
                this.collectGloryButton.ImageClick = (Image)GFXLibrary.misc_button_blue_210wide_pushed;
                this.collectGloryButton.Position   = new Point(0x13c, ((height - 0x7b) + 8) - 1);
                this.collectGloryButton.Text.Text  = SK.Text("QUESTS_Collect_Glory", "Collect Glory");
                this.collectGloryButton.Text.Font  = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
                this.collectGloryButton.Text.Color = ARGBColors.Black;
                this.collectGloryButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.okGloryClicked), "NewQuests_Collect_Glory_Clicked");
                this.backgroundImage.addControl(this.collectGloryButton);
            }
            this.cancelButton.ImageNorm  = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
            this.cancelButton.ImageOver  = (Image)GFXLibrary.mail2_button_blue_141wide_over;
            this.cancelButton.ImageClick = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
            this.cancelButton.Position   = new Point(0x181, height - 0x4b);
            this.cancelButton.Text.Text  = SK.Text("GENERIC_Cancel", "Cancel");
            this.cancelButton.Text.Font  = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.cancelButton.Text.Color = ARGBColors.Black;
            this.cancelButton.setClickDelegate(delegate {
                InterfaceMgr.Instance.closeNewQuestRewardPopup();
                InterfaceMgr.Instance.ParentForm.TopMost = true;
                InterfaceMgr.Instance.ParentForm.TopMost = false;
            }, "NewQuests_Cancel");
            this.backgroundImage.addControl(this.cancelButton);
            base.Invalidate();
            parent.Invalidate();
        }
        public void rebuild()
        {
            int[] completedQuests = null;
            int   y = 0;

            this.questsScrollArea.clearControls();
            if (this.isQuestList)
            {
                if (this.completedQuests == null)
                {
                    NewQuestsData data = GameEngine.Instance.World.getNewQuestData();
                    if (data == null)
                    {
                        return;
                    }
                    completedQuests = data.completedQuests;
                }
                else
                {
                    completedQuests = this.completedQuests.ToArray();
                }
                for (int i = 0; i < completedQuests.Length; i++)
                {
                    int          quest   = completedQuests[i];
                    NewQuestLine control = new NewQuestLine();
                    if (y != 0)
                    {
                        y += 5;
                    }
                    control.Position = new Point(0, y);
                    control.init(quest, i);
                    this.questsScrollArea.addControl(control);
                    y += control.Height;
                }
            }
            else
            {
                CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel();
                switch (this._questID)
                {
                case 0x22:
                case 0x30:
                case 4:
                case 0x10:
                case 0x65:
                case 0x7a:
                case 0x40:
                case 0x54:
                    if ((!GameEngine.Instance.World.isBigpointAccount && !Program.aeriaInstall) && (!Program.bigpointPartnerInstall && !Program.arcInstall))
                    {
                        label.Text = SK.Text("QUESTS_IAF_Help1", "Learn about how inviting your friends to the game can earn you up to $160 worth of crowns.");
                    }
                    else
                    {
                        label.Text = SK.Text("QUESTS_IAF_Help2", "Why not invite a friend to play Kingdoms? They can fight alongside you and you will help us to further develop the game. ");
                    }
                    break;

                default:
                    label.Text = SK.NoStoreText("Z_QUEST_HELP_" + this.questText);
                    break;
                }
                label.Color     = ARGBColors.Black;
                label.Position  = new Point(0x24, 30);
                label.Size      = new Size(this.questsScrollArea.Width, this.questsScrollArea.Height);
                label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
                label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
                this.mainBackgroundImage.addControl(label);
            }
            this.questsScrollArea.Size = new Size(this.questsScrollArea.Width, y);
            if (y < this.questsScrollBar.Height)
            {
                this.questsScrollBar.Visible = false;
            }
            else
            {
                this.questsScrollBar.Visible         = true;
                this.questsScrollBar.NumVisibleLines = this.questsScrollBar.Height;
                this.questsScrollBar.Max             = y - this.questsScrollBar.Height;
            }
            this.questsScrollArea.invalidate();
            this.questsScrollBar.invalidate();
            this.mainBackgroundImage.invalidate();
        }