public void init(bool tutorialOpened)
 {
     instance = this;
     this.customPanel.init(tutorialOpened, this);
     Form parentForm = InterfaceMgr.Instance.ParentForm;
     base.Location = new Point((parentForm.Location.X + (parentForm.Width / 2)) - (base.Width / 2), (parentForm.Location.Y + (parentForm.Height / 2)) - (base.Height / 2));
 }
 public static void CreatePostTutorialWindow(bool fromTutorial)
 {
     InterfaceMgr.Instance.openGreyOutWindow(false);
     PostTutorialWindow window = new PostTutorialWindow();
     window.init(fromTutorial);
     window.Show(InterfaceMgr.Instance.getGreyOutWindow());
 }
Esempio n. 3
0
        public void init(bool tutorialOpened)
        {
            instance = this;
            this.customPanel.init(tutorialOpened, this);
            Form parentForm = InterfaceMgr.Instance.ParentForm;

            base.Location = new Point((parentForm.Location.X + (parentForm.Width / 2)) - (base.Width / 2), (parentForm.Location.Y + (parentForm.Height / 2)) - (base.Height / 2));
        }
Esempio n. 4
0
        public static void CreatePostTutorialWindow(bool fromTutorial)
        {
            InterfaceMgr.Instance.openGreyOutWindow(false);
            PostTutorialWindow window = new PostTutorialWindow();

            window.init(fromTutorial);
            window.Show(InterfaceMgr.Instance.getGreyOutWindow());
        }
Esempio n. 5
0
 public static void close()
 {
     try
     {
         if (instance != null)
         {
             InterfaceMgr.Instance.closeGreyOut();
             instance.Close();
             instance = null;
         }
     }
     catch (Exception)
     {
     }
 }
 public static void close()
 {
     try
     {
         if (instance != null)
         {
             InterfaceMgr.Instance.closeGreyOut();
             instance.Close();
             instance = null;
         }
     }
     catch (Exception)
     {
     }
 }
 public void closePopup(bool exit, bool tutorial)
 {
     if (exit)
     {
         this.closeClick();
     }
     else
     {
         this.resultsMode = true;
         this.speedButton.Visible = false;
         this.updateButtons();
     }
     if (tutorial)
     {
         PostTutorialWindow.CreatePostTutorialWindow(true);
     }
 }
        private void menu1Callback(int id)
        {
            string str;

            GameEngine.Instance.playInterfaceSound("WorldMapScreen_menu_item_selected");
            this.fixCommandSent = false;
            switch (id)
            {
            case 0x5207:
                castleCopyMode = true;
                return;

            case 0x5208:
            case 0x19c9:
            case 0x44f:
            case 0x450:
            case 0x451:
            case 0x452:
            case 0x453:
            case 0x454:
            case 0x259:
            case 0x25a:
            case 0xde:
            case 3:
            case 4:
            case 6:
            case 7:
            case 8:
            case 10:
            case 0x68:
            case 0x6a:
            case 110:
            case 0x6f:
            case 0x71:
            case 0x72:
            case 0x73:
            case 0x74:
            case 0x75:
            case 0x76:
            case 0x77:
            case 120:
                return;

            case 0x5209:
            {
                string fileName = (URLs.AccountInfoURL + "?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower();
                try
                {
                    Process.Start(fileName);
                }
                catch (Exception)
                {
                    MyMessageBox.Show(SK.Text("ERROR_Browser1", "Stronghold Kingdoms encountered an error when trying to open your system's Default Web Browser. Please check that your web browser is working correctly and there are no unresponsive copies showing in task manager->Processes and then try again.") + Environment.NewLine + Environment.NewLine + SK.Text("ERROR_Browser2", "If this problem persists, please contact support."), SK.Text("ERROR_Browser3", "Error opening Web Browser"));
                }
                return;
            }

            case 0x520a:
            {
                string str4 = (URLs.InviteAFriendURL + "?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower();
                try
                {
                    Process.Start(str4);
                }
                catch (Exception)
                {
                    MyMessageBox.Show(SK.Text("ERROR_Browser1", "Stronghold Kingdoms encountered an error when trying to open your system's Default Web Browser. Please check that your web browser is working correctly and there are no unresponsive copies showing in task manager->Processes and then try again.") + Environment.NewLine + Environment.NewLine + SK.Text("ERROR_Browser2", "If this problem persists, please contact support."), SK.Text("ERROR_Browser3", "Error opening Web Browser"));
                }
                return;
            }

            case 0x520b:
            {
                string str5 = (URLs.AccountInfoURL + "?section=codes&u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower();
                try
                {
                    Process.Start(str5);
                }
                catch (Exception)
                {
                    MyMessageBox.Show(SK.Text("ERROR_Browser1", "Stronghold Kingdoms encountered an error when trying to open your system's Default Web Browser. Please check that your web browser is working correctly and there are no unresponsive copies showing in task manager->Processes and then try again.") + Environment.NewLine + Environment.NewLine + SK.Text("ERROR_Browser2", "If this problem persists, please contact support."), SK.Text("ERROR_Browser3", "Error opening Web Browser"));
                }
                return;
            }

            case 0x5211:
                CreateVacationWindow.showVacationMode();
                return;

            case 0x2a2f:
                try
                {
                    string str2 = "http://login.strongholdkingdoms.com/support/?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "") + "&lang=" + Program.mySettings.languageIdent;
                    new Process {
                        StartInfo = { FileName = str2 }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x23f2:
                this.nextPlaybackCountries = false;
                if (!GameEngine.Instance.World.gotPlaybackData())
                {
                    this.retrieveGameStats();
                    return;
                }
                GameEngine.Instance.World.playbackProvinces();
                return;

            case 0x23f3:
                GameEngine.Instance.World.stopPlayback();
                return;

            case 0x4b1:
                PostTutorialWindow.CreatePostTutorialWindow(false);
                return;

            case 0x8ab:
            {
                if (!GameEngine.Instance.World.MapEditing)
                {
                    GameEngine.Instance.World.MapEditing = true;
                    return;
                }
                int villageID = GameEngine.Instance.World.lastClickedVillage();
                if (GameEngine.Instance.World.isCountyCapital(villageID) && !GameEngine.Instance.World.isVillageVisible(villageID))
                {
                    RemoteServices.Instance.CompleteVillageCastle(villageID, 0x15);
                }
                GameEngine.Instance.World.MapEditing = false;
                return;
            }

            case 0x44d:
                InterfaceMgr.Instance.getMainTabBar().selectDummyTab(2);
                GameEngine.Instance.InitCastleAttackSetup();
                return;

            case 0x44e:
                GameEngine.Instance.SkipVillageTab();
                InterfaceMgr.Instance.getMainTabBar().changeTab(1);
                InterfaceMgr.Instance.getVillageTabBar().changeTab(1);
                CastleMap.CreateMode = true;
                return;

            case 0x455:
                GameEngine.Instance.playInterfaceSound("Options_resume_tutorial");
                GameEngine.Instance.World.resumeTutorial();
                return;

            case 0x456:
            case 0x457:
            case 0x458:
            case 0x459:
            case 0x45a:
            case 0x45b:
            case 0x45c:
            case 0x45d:
            case 0x45e:
            case 0x45f:
                CastleMap.FakeKeep = (id - 0x456) + 1;
                return;

            case 0x460:
            case 0x461:
            case 0x462:
            case 0x463:
                CastleMap.FakeDefensiveMode = id - 0x460;
                return;

            case 0x3e9:
                InterfaceMgr.Instance.ParentForm.Close();
                return;

            case 0xe7:
                GameEngine.Instance.World.DrawDebugNames        = !GameEngine.Instance.World.DrawDebugNames;
                GameEngine.Instance.World.DrawDebugVillageNames = false;
                return;

            case 0xe8:
                GameEngine.Instance.World.DrawDebugVillageNames = !GameEngine.Instance.World.DrawDebugVillageNames;
                GameEngine.Instance.World.DrawDebugNames        = false;
                return;

            case 300:
                InterfaceMgr.Instance.getMainTabBar().selectDummyTab(60);
                return;

            case 0xdd:
                this.createIngameMessage();
                return;

            case 0xdf:
                this.clearIngameMessage();
                return;

            case 0xd1:
            {
                MessageBoxButtons yesNo = MessageBoxButtons.YesNo;
                if (MyMessageBox.Show("This call is not entirely 'game friendly'. Only use sparingly and at quiet game times and make sure no one else is using them same function!", "Admin Warning!", yesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2, 0) == DialogResult.Yes)
                {
                    this.fixCommandSent = true;
                    RemoteServices.Instance.set_CompleteVillageCastle_UserCallBack(new RemoteServices.CompleteVillageCastle_UserCallBack(this.CompleteVillageCastleCallBack));
                    RemoteServices.Instance.CompleteVillageCastle(InterfaceMgr.Instance.getSelectedMenuVillage(), 15);
                }
                return;
            }

            case 0x97:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.TermsAndConditions }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x98:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.PrivacyPolicy }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0xc9:
                AdminInfoPopup.showAdminEdit();
                return;

            case 0xca:
                this.nextPlaybackCountries = true;
                if (!GameEngine.Instance.World.gotPlaybackData())
                {
                    this.retrieveGameStats();
                    return;
                }
                GameEngine.Instance.World.playbackCountries();
                return;

            case 0xcb:
                this.retrieveGameInfo();
                return;

            case 1:
                GameEngine.Instance.playInterfaceSound("Options_open");
                OptionsPopup.openSettings();
                return;

            case 2:
                InterfaceMgr.Instance.openLogoutWindow(true);
                return;

            case 5:
                InterfaceMgr.Instance.getMainTabBar().selectDummyTab(10);
                return;

            case 9:
            {
                if (!RemoteServices.Instance.Admin || !GameEngine.Instance.World.DrawDebugVillageNames)
                {
                    int ownSelectedVillage = InterfaceMgr.Instance.OwnSelectedVillage;
                    if (((ownSelectedVillage >= 0) && !GameEngine.Instance.World.isCapital(ownSelectedVillage)) && GameEngine.Instance.World.isUserVillage(ownSelectedVillage))
                    {
                        RenameVillagePopup popup2 = new RenameVillagePopup();
                        popup2.setVillageID(ownSelectedVillage, GameEngine.Instance.World.getVillageNameOnly(ownSelectedVillage));
                        popup2.Show(InterfaceMgr.Instance.ParentForm);
                        return;
                    }
                    MyMessageBox.Show(SK.Text("MENU_Cannot_Rename", "You cannot rename this village."), SK.Text("MENU_Rename_Error", "Rename Error"));
                    return;
                }
                int selectedVillage      = InterfaceMgr.Instance.SelectedVillage;
                RenameVillagePopup popup = new RenameVillagePopup();
                popup.setVillageID(selectedVillage, GameEngine.Instance.World.getVillageNameOnly(selectedVillage));
                popup.Show(InterfaceMgr.Instance.ParentForm);
                return;
            }

            case 11:
            {
                int num3 = InterfaceMgr.Instance.OwnSelectedVillage;
                if (((num3 < 0) || GameEngine.Instance.World.isCapital(num3)) || !GameEngine.Instance.World.isUserVillage(num3))
                {
                    MyMessageBox.Show(SK.Text("MENU_Cannot_Abandon", "You cannot abandon this village."), SK.Text("GENERIC_Error", "Error"));
                    return;
                }
                GameEngine.Instance.villageToAbandon = num3;
                return;
            }

            case 12:
            {
                int num4 = InterfaceMgr.Instance.OwnSelectedVillage;
                if (((num4 < 0) || GameEngine.Instance.World.isCapital(num4)) || !GameEngine.Instance.World.isUserVillage(num4))
                {
                    return;
                }
                InterfaceMgr.Instance.changeTab(1);
                VillageMap map = GameEngine.Instance.getVillage(num4);
                if ((map == null) || (map.m_nextMapTypeChange <= VillageMap.getCurrentServerTime()))
                {
                    InterfaceMgr.Instance.openBuyVillageWindow(num4, false);
                    return;
                }
                TimeSpan span = (TimeSpan)(map.m_nextMapTypeChange - VillageMap.getCurrentServerTime());
                str = "";
                if (span.Days <= 0)
                {
                    str = string.Format("{0:D1} " + SK.Text("MENU_hours_short", "hrs") + ", {1:D2} " + SK.Text("MENU_minutes_short", "mins"), span.Hours, span.Minutes);
                    break;
                }
                str = string.Format("{0:D2} " + SK.Text("MENU_days", "days") + ", {1:D2} " + SK.Text("MENU_hours_short", "hrs") + ", {2:D2} " + SK.Text("MENU_minutes_short", "mins"), span.Days, span.Hours, span.Minutes);
                break;
            }

            case 0x65:
                new Process {
                    StartInfo = { FileName = "readme.txt" }
                }.Start();
                return;

            case 0x66:
            {
                AboutPopup popup3 = new AboutPopup();
                popup3.init();
                popup3.Show();
                return;
            }

            case 0x67:
                AdminInfoPopup.showMessage();
                return;

            case 0x69:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.FireflyHomepage }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x6b:
                try
                {
                    new Process {
                        StartInfo = { FileName = "http://login.strongholdkingdoms.com/forum/?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "") + "&lang=" + Program.mySettings.languageIdent }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x6c:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.WikiPage }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x6d:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.IPSharingPage }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x70:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.TechnicalFAQPage }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            case 0x79:
                try
                {
                    new Process {
                        StartInfo = { FileName = URLs.WikiPage }
                    }.Start();
                }
                catch (Exception)
                {
                }
                return;

            default:
                return;
            }
            MyMessageBox.Show(SK.Text("MENU_Cannot_Change_Type", "You cannot change this Village's Type for") + " : " + str, SK.Text("MENU_Change_Type_Error", "Change Village Type Error"));
        }
 public void init(bool fromTutorial, PostTutorialWindow parent)
 {
     this.m_parent = parent;
     base.clearControls();
     int total = 10;
     if ((GameEngine.Instance.World.isBigpointAccount || Program.bigpointInstall) || (Program.aeriaInstall || Program.bigpointPartnerInstall))
     {
         total = 9;
     }
     this.transparentBackground.Size = base.Size;
     this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
     base.addControl(this.transparentBackground);
     this.background.Position = new Point(0, 0);
     this.background.Image = (Image) GFXLibrary.worldSelect_Background;
     this.background.Size = new Size(this.background.Image.Width, this.background.Image.Height);
     base.addControl(this.background);
     this.backgroundArea.Position = new Point(0, 0);
     this.backgroundArea.Size = new Size(0x271, 0x29c);
     this.background.addControl(this.backgroundArea);
     if (fromTutorial)
     {
         this.header3Label.Text = SK.Text("PT_TUT_header1", "Congratulations!");
         this.header3Label.Position = new Point(8, 0xd8);
         this.header3Label.Size = new Size(this.backgroundArea.Width, 150);
         this.header3Label.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         this.header3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.header3Label.Color = ARGBColors.Black;
         this.header3Label.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.header3Label);
         this.header1Label.Text = SK.Text("PT_TUT_header2", "You have completed the Stronghold Kingdoms Tutorial.");
         this.header1Label.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
     }
     else
     {
         this.header1Label.Text = SK.Text("PT_header1", "Welcome to the Stronghold Kingdoms Player Guide");
         this.header1Label.Font = FontManager.GetFont("Arial", 11f, FontStyle.Bold);
     }
     this.header1Label.Position = new Point(8, 0x100);
     this.header1Label.Size = new Size(this.backgroundArea.Width, 150);
     this.header1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.header1Label.Color = ARGBColors.Black;
     this.header1Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header1Label);
     this.header2Label.Text = SK.Text("PT_header2", "Here are a few suggestions for what to do next") + ":";
     this.header2Label.Position = new Point(0x6c, 0x115);
     this.header2Label.Size = new Size(this.backgroundArea.Width - 200, 0x22);
     this.header2Label.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.header2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.header2Label.Color = ARGBColors.Black;
     this.header2Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header2Label);
     int num2 = 0;
     this.feature1Button.ImageNorm = (Image) GFXLibrary.pt_Research;
     this.feature1Button.ImageOver = (Image) GFXLibrary.pt_Research_over;
     this.feature1Button.ImageClick = (Image) GFXLibrary.pt_Research_down;
     this.feature1Button.Position = this.getIconPosition(num2++, total);
     this.feature1Button.Data = 0;
     this.feature1Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature1Button.CustomTooltipID = 0x10cc;
     this.background.addControl(this.feature1Button);
     this.feature2Button.ImageNorm = (Image) GFXLibrary.pt_rank;
     this.feature2Button.ImageOver = (Image) GFXLibrary.pt_rank_over;
     this.feature2Button.ImageClick = (Image) GFXLibrary.pt_rank_down;
     this.feature2Button.Position = this.getIconPosition(num2++, total);
     this.feature2Button.Data = 1;
     this.feature2Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature2Button.CustomTooltipID = 0x10cd;
     this.background.addControl(this.feature2Button);
     this.feature3Button.ImageNorm = (Image) GFXLibrary.pt_Achievements;
     this.feature3Button.ImageOver = (Image) GFXLibrary.pt_Achievements_over;
     this.feature3Button.ImageClick = (Image) GFXLibrary.pt_Achievements_down;
     this.feature3Button.Position = this.getIconPosition(num2++, total);
     this.feature3Button.Data = 2;
     this.feature3Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature3Button.CustomTooltipID = 0x10ce;
     this.background.addControl(this.feature3Button);
     this.feature4Button.ImageNorm = (Image) GFXLibrary.pt_Quests;
     this.feature4Button.ImageOver = (Image) GFXLibrary.pt_Quests_over;
     this.feature4Button.ImageClick = (Image) GFXLibrary.pt_Quests_down;
     this.feature4Button.Position = this.getIconPosition(num2++, total);
     this.feature4Button.Data = 3;
     this.feature4Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature4Button.CustomTooltipID = 0x10cf;
     this.background.addControl(this.feature4Button);
     this.feature5Button.ImageNorm = (Image) GFXLibrary.pt_Reports;
     this.feature5Button.ImageOver = (Image) GFXLibrary.pt_Reports_over;
     this.feature5Button.ImageClick = (Image) GFXLibrary.pt_Reports_down;
     this.feature5Button.Position = this.getIconPosition(num2++, total);
     this.feature5Button.Data = 4;
     this.feature5Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature5Button.CustomTooltipID = 0x10d0;
     this.background.addControl(this.feature5Button);
     this.feature6Button.ImageNorm = (Image) GFXLibrary.pt_Coat_of_Arms;
     this.feature6Button.ImageOver = (Image) GFXLibrary.pt_Coat_of_Arms_over;
     this.feature6Button.ImageClick = (Image) GFXLibrary.pt_Coat_of_Arms_down;
     this.feature6Button.Position = this.getIconPosition(num2++, total);
     this.feature6Button.Data = 5;
     this.feature6Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature6Button.CustomTooltipID = 0x10d1;
     this.background.addControl(this.feature6Button);
     this.feature7Button.ImageNorm = (Image) GFXLibrary.pt_Avatar;
     this.feature7Button.ImageOver = (Image) GFXLibrary.pt_Avatar_over;
     this.feature7Button.ImageClick = (Image) GFXLibrary.pt_Avatar_down;
     this.feature7Button.Position = this.getIconPosition(num2++, total);
     this.feature7Button.Data = 6;
     this.feature7Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature7Button.CustomTooltipID = 0x10d2;
     this.background.addControl(this.feature7Button);
     if (total == 10)
     {
         this.feature8Button.ImageNorm = (Image) GFXLibrary.pt_Invite_a_Friend;
         this.feature8Button.ImageOver = (Image) GFXLibrary.pt_Invite_a_Friend_over;
         this.feature8Button.ImageClick = (Image) GFXLibrary.pt_Invite_a_Friend_down;
         this.feature8Button.Position = this.getIconPosition(num2++, total);
         this.feature8Button.Data = 7;
         this.feature8Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
         this.feature8Button.CustomTooltipID = 0x10d3;
         this.background.addControl(this.feature8Button);
     }
     this.feature9Button.ImageNorm = (Image) GFXLibrary.pt_Parish_Wall;
     this.feature9Button.ImageOver = (Image) GFXLibrary.pt_Parish_Wall_over;
     this.feature9Button.ImageClick = (Image) GFXLibrary.pt_Parish_Wall_down;
     this.feature9Button.Position = this.getIconPosition(num2++, total);
     this.feature9Button.Data = 8;
     this.feature9Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature9Button.CustomTooltipID = 0x10d4;
     this.background.addControl(this.feature9Button);
     this.feature10Button.ImageNorm = (Image) GFXLibrary.pt_Mail;
     this.feature10Button.ImageOver = (Image) GFXLibrary.pt_Mail_over;
     this.feature10Button.ImageClick = (Image) GFXLibrary.pt_Mail_down;
     this.feature10Button.Position = this.getIconPosition(num2++, total);
     this.feature10Button.Data = 9;
     this.feature10Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
     this.feature10Button.CustomTooltipID = 0x10d5;
     this.background.addControl(this.feature10Button);
     this.btnLogout.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
     this.btnLogout.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
     this.btnLogout.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
     this.btnLogout.Position = new Point(0xf5, 0x204);
     this.btnLogout.Text.Text = SK.Text("GENERIC_Close", "Close");
     this.btnLogout.TextYOffset = -2;
     this.btnLogout.Text.Color = ARGBColors.White;
     this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
     this.btnLogout.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
     this.btnLogout.Text.Position = new Point(-3, 0);
     this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
     this.btnLogout.Enabled = true;
     this.backgroundArea.addControl(this.btnLogout);
     this.showCheck.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.showCheck.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.showCheck.Position = new Point(0xe1, 0x1ee);
     this.showCheck.Checked = Program.mySettings.showGameFeaturesScreenIcon;
     this.showCheck.CBLabel.Text = SK.Text("PT_show_icon", "Show Player Guide icon");
     this.showCheck.CBLabel.Color = ARGBColors.Black;
     this.showCheck.CBLabel.Position = new Point(20, -1);
     this.showCheck.CBLabel.Size = new Size(360, 0x23);
     this.showCheck.CBLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.showCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.checkToggled));
     this.backgroundArea.addControl(this.showCheck);
 }
Esempio n. 10
0
        private void iconClicked()
        {
            if (base.ClickedControl != null)
            {
                switch (base.ClickedControl.Data)
                {
                case 0:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(3);
                    PostTutorialWindow.close();
                    return;

                case 1:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(4);
                    PostTutorialWindow.close();
                    return;

                case 2:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(4);
                    PostTutorialWindow.close();
                    return;

                case 3:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(5);
                    PostTutorialWindow.close();
                    return;

                case 4:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(7);
                    PostTutorialWindow.close();
                    return;

                case 5:
                    Process.Start(URLs.shieldDesignerURL + "?UserGUID=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&SessionGUID=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "") + "&lang=" + Program.mySettings.LanguageIdent.ToLower());
                    return;

                case 6:
                    InterfaceMgr.Instance.getMainTabBar().selectDummyTab(10);
                    PostTutorialWindow.close();
                    return;

                case 7:
                {
                    string fileName = (URLs.InviteAFriendURL + "?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower();
                    try
                    {
                        Process.Start(fileName);
                    }
                    catch (Exception)
                    {
                        MyMessageBox.Show(SK.Text("ERROR_Browser1", "Stronghold Kingdoms encountered an error when trying to open your system's Default Web Browser. Please check that your web browser is working correctly and there are no unresponsive copies showing in task manager->Processes and then try again.") + Environment.NewLine + Environment.NewLine + SK.Text("ERROR_Browser2", "If this problem persists, please contact support."), SK.Text("ERROR_Browser3", "Error opening Web Browser"));
                    }
                    return;
                }

                case 8:
                    InterfaceMgr.Instance.getMainTabBar().changeTab(2);
                    PostTutorialWindow.close();
                    return;

                case 9:
                    if (!InterfaceMgr.Instance.isMailDocked())
                    {
                        if (InterfaceMgr.Instance.mailScreenNeedsOpening())
                        {
                            InterfaceMgr.Instance.initMailSubTab(0);
                        }
                        else
                        {
                            InterfaceMgr.Instance.mailScreenRePop();
                        }
                        break;
                    }
                    InterfaceMgr.Instance.getMainTabBar().selectDummyTab(0x15);
                    break;

                default:
                    return;
                }
                PostTutorialWindow.close();
            }
        }
Esempio n. 11
0
 private void logoutClick()
 {
     PostTutorialWindow.close();
 }
Esempio n. 12
0
        public void init(bool fromTutorial, PostTutorialWindow parent)
        {
            this.m_parent = parent;
            base.clearControls();
            int total = 10;

            if ((GameEngine.Instance.World.isBigpointAccount || Program.bigpointInstall) || (Program.aeriaInstall || Program.bigpointPartnerInstall))
            {
                total = 9;
            }
            this.transparentBackground.Size      = base.Size;
            this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
            base.addControl(this.transparentBackground);
            this.background.Position = new Point(0, 0);
            this.background.Image    = (Image)GFXLibrary.worldSelect_Background;
            this.background.Size     = new Size(this.background.Image.Width, this.background.Image.Height);
            base.addControl(this.background);
            this.backgroundArea.Position = new Point(0, 0);
            this.backgroundArea.Size     = new Size(0x271, 0x29c);
            this.background.addControl(this.backgroundArea);
            if (fromTutorial)
            {
                this.header3Label.Text            = SK.Text("PT_TUT_header1", "Congratulations!");
                this.header3Label.Position        = new Point(8, 0xd8);
                this.header3Label.Size            = new Size(this.backgroundArea.Width, 150);
                this.header3Label.Font            = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
                this.header3Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
                this.header3Label.Color           = ARGBColors.Black;
                this.header3Label.DropShadowColor = ARGBColors.LightGray;
                this.backgroundArea.addControl(this.header3Label);
                this.header1Label.Text = SK.Text("PT_TUT_header2", "You have completed the Stronghold Kingdoms Tutorial.");
                this.header1Label.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            }
            else
            {
                this.header1Label.Text = SK.Text("PT_header1", "Welcome to the Stronghold Kingdoms Player Guide");
                this.header1Label.Font = FontManager.GetFont("Arial", 11f, FontStyle.Bold);
            }
            this.header1Label.Position        = new Point(8, 0x100);
            this.header1Label.Size            = new Size(this.backgroundArea.Width, 150);
            this.header1Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.header1Label.Color           = ARGBColors.Black;
            this.header1Label.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.header1Label);
            this.header2Label.Text            = SK.Text("PT_header2", "Here are a few suggestions for what to do next") + ":";
            this.header2Label.Position        = new Point(0x6c, 0x115);
            this.header2Label.Size            = new Size(this.backgroundArea.Width - 200, 0x22);
            this.header2Label.Font            = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.header2Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
            this.header2Label.Color           = ARGBColors.Black;
            this.header2Label.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.header2Label);
            int num2 = 0;

            this.feature1Button.ImageNorm  = (Image)GFXLibrary.pt_Research;
            this.feature1Button.ImageOver  = (Image)GFXLibrary.pt_Research_over;
            this.feature1Button.ImageClick = (Image)GFXLibrary.pt_Research_down;
            this.feature1Button.Position   = this.getIconPosition(num2++, total);
            this.feature1Button.Data       = 0;
            this.feature1Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature1Button.CustomTooltipID = 0x10cc;
            this.background.addControl(this.feature1Button);
            this.feature2Button.ImageNorm  = (Image)GFXLibrary.pt_rank;
            this.feature2Button.ImageOver  = (Image)GFXLibrary.pt_rank_over;
            this.feature2Button.ImageClick = (Image)GFXLibrary.pt_rank_down;
            this.feature2Button.Position   = this.getIconPosition(num2++, total);
            this.feature2Button.Data       = 1;
            this.feature2Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature2Button.CustomTooltipID = 0x10cd;
            this.background.addControl(this.feature2Button);
            this.feature3Button.ImageNorm  = (Image)GFXLibrary.pt_Achievements;
            this.feature3Button.ImageOver  = (Image)GFXLibrary.pt_Achievements_over;
            this.feature3Button.ImageClick = (Image)GFXLibrary.pt_Achievements_down;
            this.feature3Button.Position   = this.getIconPosition(num2++, total);
            this.feature3Button.Data       = 2;
            this.feature3Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature3Button.CustomTooltipID = 0x10ce;
            this.background.addControl(this.feature3Button);
            this.feature4Button.ImageNorm  = (Image)GFXLibrary.pt_Quests;
            this.feature4Button.ImageOver  = (Image)GFXLibrary.pt_Quests_over;
            this.feature4Button.ImageClick = (Image)GFXLibrary.pt_Quests_down;
            this.feature4Button.Position   = this.getIconPosition(num2++, total);
            this.feature4Button.Data       = 3;
            this.feature4Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature4Button.CustomTooltipID = 0x10cf;
            this.background.addControl(this.feature4Button);
            this.feature5Button.ImageNorm  = (Image)GFXLibrary.pt_Reports;
            this.feature5Button.ImageOver  = (Image)GFXLibrary.pt_Reports_over;
            this.feature5Button.ImageClick = (Image)GFXLibrary.pt_Reports_down;
            this.feature5Button.Position   = this.getIconPosition(num2++, total);
            this.feature5Button.Data       = 4;
            this.feature5Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature5Button.CustomTooltipID = 0x10d0;
            this.background.addControl(this.feature5Button);
            this.feature6Button.ImageNorm  = (Image)GFXLibrary.pt_Coat_of_Arms;
            this.feature6Button.ImageOver  = (Image)GFXLibrary.pt_Coat_of_Arms_over;
            this.feature6Button.ImageClick = (Image)GFXLibrary.pt_Coat_of_Arms_down;
            this.feature6Button.Position   = this.getIconPosition(num2++, total);
            this.feature6Button.Data       = 5;
            this.feature6Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature6Button.CustomTooltipID = 0x10d1;
            this.background.addControl(this.feature6Button);
            this.feature7Button.ImageNorm  = (Image)GFXLibrary.pt_Avatar;
            this.feature7Button.ImageOver  = (Image)GFXLibrary.pt_Avatar_over;
            this.feature7Button.ImageClick = (Image)GFXLibrary.pt_Avatar_down;
            this.feature7Button.Position   = this.getIconPosition(num2++, total);
            this.feature7Button.Data       = 6;
            this.feature7Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature7Button.CustomTooltipID = 0x10d2;
            this.background.addControl(this.feature7Button);
            if (total == 10)
            {
                this.feature8Button.ImageNorm  = (Image)GFXLibrary.pt_Invite_a_Friend;
                this.feature8Button.ImageOver  = (Image)GFXLibrary.pt_Invite_a_Friend_over;
                this.feature8Button.ImageClick = (Image)GFXLibrary.pt_Invite_a_Friend_down;
                this.feature8Button.Position   = this.getIconPosition(num2++, total);
                this.feature8Button.Data       = 7;
                this.feature8Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
                this.feature8Button.CustomTooltipID = 0x10d3;
                this.background.addControl(this.feature8Button);
            }
            this.feature9Button.ImageNorm  = (Image)GFXLibrary.pt_Parish_Wall;
            this.feature9Button.ImageOver  = (Image)GFXLibrary.pt_Parish_Wall_over;
            this.feature9Button.ImageClick = (Image)GFXLibrary.pt_Parish_Wall_down;
            this.feature9Button.Position   = this.getIconPosition(num2++, total);
            this.feature9Button.Data       = 8;
            this.feature9Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature9Button.CustomTooltipID = 0x10d4;
            this.background.addControl(this.feature9Button);
            this.feature10Button.ImageNorm  = (Image)GFXLibrary.pt_Mail;
            this.feature10Button.ImageOver  = (Image)GFXLibrary.pt_Mail_over;
            this.feature10Button.ImageClick = (Image)GFXLibrary.pt_Mail_down;
            this.feature10Button.Position   = this.getIconPosition(num2++, total);
            this.feature10Button.Data       = 9;
            this.feature10Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconClicked));
            this.feature10Button.CustomTooltipID = 0x10d5;
            this.background.addControl(this.feature10Button);
            this.btnLogout.ImageNorm            = (Image)GFXLibrary.worldSelect_swap_norm;
            this.btnLogout.ImageOver            = (Image)GFXLibrary.worldSelect_swap_over;
            this.btnLogout.ImageClick           = (Image)GFXLibrary.worldSelect_swap_pushed;
            this.btnLogout.Position             = new Point(0xf5, 0x204);
            this.btnLogout.Text.Text            = SK.Text("GENERIC_Close", "Close");
            this.btnLogout.TextYOffset          = -2;
            this.btnLogout.Text.Color           = ARGBColors.White;
            this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
            this.btnLogout.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnLogout.Text.Position        = new Point(-3, 0);
            this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
            this.btnLogout.Enabled = true;
            this.backgroundArea.addControl(this.btnLogout);
            this.showCheck.CheckedImage     = (Image)GFXLibrary.reports_checkbox_checked;
            this.showCheck.UncheckedImage   = (Image)GFXLibrary.reports_checkbox_empty;
            this.showCheck.Position         = new Point(0xe1, 0x1ee);
            this.showCheck.Checked          = Program.mySettings.showGameFeaturesScreenIcon;
            this.showCheck.CBLabel.Text     = SK.Text("PT_show_icon", "Show Player Guide icon");
            this.showCheck.CBLabel.Color    = ARGBColors.Black;
            this.showCheck.CBLabel.Position = new Point(20, -1);
            this.showCheck.CBLabel.Size     = new Size(360, 0x23);
            this.showCheck.CBLabel.Font     = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.showCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.checkToggled));
            this.backgroundArea.addControl(this.showCheck);
        }
 private void closeCallbackClicked()
 {
     PostTutorialWindow.CreatePostTutorialWindow(true);
 }