Esempio n. 1
0
        public void ContactCarrousel()
        {
            var catalogue = new CataloguePage(driver);

            driver.Url = Url.Deautos.Views.Catalog.Main;
            catalogue.ContactCarrouselHome();
        }
Esempio n. 2
0
        public void GoToVipFromCarrousel()
        {
            driver.Url = Url.Deautos.Views.Catalog.Main;
            var catalogue = new CataloguePage(driver);

            catalogue.GoToVipFromCarrousel();
        }
Esempio n. 3
0
 private void AppendIndexNode(CataloguePage childTab)
 {
     m_Data.Add(true);
     m_Data.Add(childTab.Data.IconColour);
     m_Data.Add(childTab.Data.IconImage);
     m_Data.Add(childTab.Data.Id);
     m_Data.Add(childTab.Data.PageLink);
     m_Data.Add(childTab.Data.Caption);
 }
Esempio n. 4
0
        private void RecursiveIndexNode(CataloguePage parentTab)
        {
            var childTabs = CatalogueManager.Instance.GetPages(parentTab.Data.Id, rank, hasClub);

            m_Data.Add(childTabs.Count);

            foreach (var childTab in childTabs)
            {
                AppendIndexNode(childTab);
                RecursiveIndexNode(childTab);
            }
        }
 public void Refresh(CataloguePage pCataloguePage)
 {
     for (int i = 0; i < CatalogueBtnScs.Length; i++)
     {
         CatalogueBtnScs[i].gameObject.SetActive(false);
         CatalogueBtnScs[i].bookInfomationSc = null;
     }
     if (pCataloguePage != null)
     {
         //Debug.Log("currTab = " + pCataloguePage.PageTab);
         for (int i = 0; i < pCataloguePage.CatalogueItems.Count && i < CatalogueBtnScs.Length; i++)
         {
             CatalogueBtnScs[i].TargetPageTab = pCataloguePage.CatalogueItems[i].IndexOfIDList;
             CatalogueBtnScs[i].gameObject.SetActive(true);
             CatalogueBtnScs[i].bookInfomationSc = bookInfomationSc;
         }
     }
 }
Esempio n. 6
0
    public void Initialize(CataloguePage cp)
    {
        //Debug.Log(cp.PictureUrl);
        StartCoroutine(LoadPic(cp.PictureUrl));
        for (int i = 0; i < cp.CatalogueItems.Count; i++)
        {
            switch (cp.CatalogueItems[i].rank)
            {
            case ClgRank.First: PageHeads[i].fontSize = firstFontSize;
                break;

            case ClgRank.Second: PageHeads[i].fontSize = secondFontSize;
                break;

            case ClgRank.Thirdly: PageHeads[i].fontSize = thirdlyFontSize;
                break;
            }
            //Debug.Log("(int)rank = " + cp.CatalogueItems[i].rank.ToString());
            PageHeads[i].gameObject.transform.position =
                new Vector3(f_initX + 0.5f * (int)cp.CatalogueItems[i].rank, PageHeads[i].gameObject.transform.position.y,
                            PageHeads[i].gameObject.transform.position.z);
            PageHeads[i].text = cp.CatalogueItems[i].Head;
            PageTabs[i].text  = (cp.CatalogueItems[i].IndexOfIDList + 1).ToString();
            PageHeads[i].gameObject.SetActive(true);
            PageTabs[i].gameObject.SetActive(true);
        }
        if (cp.CatalogueItems.Count < PageHeads.Length)
        {
            for (int i = cp.CatalogueItems.Count; i < PageHeads.Length; i++)
            {
                PageHeads[i].gameObject.SetActive(false);
                PageTabs[i].gameObject.SetActive(false);
            }
        }
        if (cp.PageTab == 0)
        {
            HeadTab.SetActive(true);
        }
        else
        {
            HeadTab.SetActive(false);
        }
    }
Esempio n. 7
0
    /// <summary>
    /// 初始化或者刷新页的显示
    /// </summary>
    /// <param name="pBookPage"></param>
    public void RefreshData(Page pBookPage)
    {
        Page pg;

        //Debug.Log("RefreshData");
        if (pBookPage is Page)
        {
            pg = (Page)pBookPage;
            if (pg.Catalogue)   //  如果是目录
            {
                CataloguePage clp = (CataloguePage)pg;
                if (TestCode)
                {
                    CatalogueSc = Contents[pBookPage.ModelNumber] as Catalogue;
                }
                else
                {
                    CatalogueSc = ModelNumDic[pBookPage.ModelNumber] as Catalogue;
                }

                CatalogueSc.gameObject.SetActive(true);
                CatalogueSc.Initialize(clp);
                CatalogueSc.PageTab.text = (clp.PageTab + 1).ToString();
            }
            else
            {
                PageTab.text = "- " + (pBookPage.PageTab + 1).ToString() + " -";
                //Debug.Log("RefreshData-> " + pg.Catalogue);
                if (TestCode)
                {
                    //Debug.Log("RefreshData-> is Test : contents array");
                    //Debug.Log(Contents[pBookPage.ModelNumber] == null);
                    Contents[pBookPage.ModelNumber].SetContent(pBookPage);
                }
                else
                {
                    ModelNumDic[pBookPage.ModelNumber].SetContent(pBookPage);
                }
            }
        }
    }
Esempio n. 8
0
    /// <summary>
    /// 创建目录按钮列表
    /// </summary>
    /// <param name="pCataloguePage"></param>
    public void CreateCatalogueBtn(CataloguePage pCataloguePage)
    {
        GameObject   obj;
        CatalogueBtn cb = null;

        for (int i = 0; i < pCataloguePage.CatalogueItems.Count; i++)
        {
            obj = Instantiate(CatalogueBtnPrefabs,
                              CatalogueBtnPrefabs.transform.position, CatalogueBtnPrefabs.transform.rotation) as GameObject;
            cb = obj.GetComponent <CatalogueBtn>();
            cb.SelfText.text     = pCataloguePage.CatalogueItems[i].Head + "  " + pCataloguePage.CatalogueItems[i].PageTab;
            cb.TargetPageTab     = pCataloguePage.CatalogueItems[i].IndexOfIDList;
            obj.transform.parent = CatalogueBtnContentSc.gameObject.transform;
            CatalogueBtnContentSc.CatalogueBtns.Add(cb);
            obj.transform.localScale = Vector3.one;
            obj.SetActive(true);
        }
        if (cb != null)
        {
            CatalogueBtn.CatalogueBtnContentSc = CatalogueBtnContentSc;
        }
    }
Esempio n. 9
0
 public override void receiveLeftClick(int x, int y, bool playSound = true)
 {
     if (!this.placingStructure)
     {
         this.heldItem = this.inventory.leftClick(x, y, this.heldItem, true);
         for (int index = 0; index < this.sideTabs.Count; ++index)
         {
             if (this.sideTabs[index].containsPoint(x, y) && this.currentTab != index)
             {
                 Game1.playSound("smallSelect");
                 if (index == 3)
                 {
                     this.placingStructure = true;
                     this.demolishing      = true;
                     this.parent.invisible = true;
                 }
                 else
                 {
                     this.sideTabs[this.currentTab].bounds.X -= CataloguePage.widthToMoveActiveTab;
                     this.currentTab = index;
                     this.sideTabs[index].bounds.X += CataloguePage.widthToMoveActiveTab;
                 }
             }
         }
         foreach (ClickableComponent key in this.blueprintButtons[this.currentTab].Keys)
         {
             if (key.containsPoint(x, y))
             {
                 if (this.blueprintButtons[this.currentTab][key].doesFarmerHaveEnoughResourcesToBuild())
                 {
                     this.structureForPlacement = this.blueprintButtons[this.currentTab][key];
                     this.placingStructure      = true;
                     this.parent.invisible      = true;
                     if (this.currentTab == 1)
                     {
                         this.upgrading = true;
                     }
                     Game1.playSound("smallSelect");
                     break;
                 }
                 Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:BlueprintsMenu.cs.10002"), Color.Red, 3500f));
                 break;
             }
         }
     }
     else if (this.demolishing)
     {
         if (!(Game1.currentLocation is Farm))
         {
             return;
         }
         if (Game1.IsClient)
         {
             Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10148"), Color.Red, 3500f));
         }
         else
         {
             Vector2  vector2    = new Vector2((float)((Game1.viewport.X + Game1.getOldMouseX()) / Game1.tileSize), (float)((Game1.viewport.Y + Game1.getOldMouseY()) / Game1.tileSize));
             Building buildingAt = ((BuildableGameLocation)Game1.currentLocation).getBuildingAt(vector2);
             if (Game1.IsMultiplayer && buildingAt != null && buildingAt.indoors.farmers.Count > 0)
             {
                 Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10149"), Color.Red, 3500f));
             }
             else if (buildingAt != null && ((BuildableGameLocation)Game1.currentLocation).destroyStructure(buildingAt))
             {
                 int num = buildingAt.tileY + buildingAt.tilesHigh;
                 for (int index = 0; index < buildingAt.texture.Bounds.Height / Game1.tileSize; ++index)
                 {
                     GameLocation currentLocation             = Game1.currentLocation;
                     Texture2D    texture                     = buildingAt.texture;
                     Microsoft.Xna.Framework.Rectangle bounds = buildingAt.texture.Bounds;
                     int x1 = bounds.Center.X;
                     bounds = buildingAt.texture.Bounds;
                     int y1     = bounds.Center.Y;
                     int width  = Game1.tileSize / 16;
                     int height = Game1.tileSize / 16;
                     Microsoft.Xna.Framework.Rectangle sourcerectangle = new Microsoft.Xna.Framework.Rectangle(x1, y1, width, height);
                     int xTile           = buildingAt.tileX + Game1.random.Next(buildingAt.tilesWide);
                     int yTile           = buildingAt.tileY + buildingAt.tilesHigh - index;
                     int numberOfChunks  = Game1.random.Next(20, 45);
                     int groundLevelTile = num;
                     Game1.createRadialDebris(currentLocation, texture, sourcerectangle, xTile, yTile, numberOfChunks, groundLevelTile);
                 }
                 Game1.playSound("explosion");
                 Utility.spreadAnimalsAround(buildingAt, (Farm)Game1.currentLocation);
                 if (!Game1.IsServer)
                 {
                     return;
                 }
                 MultiplayerUtility.broadcastBuildingChange((byte)1, vector2, "", Game1.currentLocation.name, Game1.player.uniqueMultiplayerID);
             }
             else
             {
                 this.parent.invisible = false;
                 this.placingStructure = false;
                 this.demolishing      = false;
             }
         }
     }
     else if (this.upgrading && Game1.currentLocation is Farm)
     {
         (Game1.currentLocation as Farm).tryToUpgrade(((BuildableGameLocation)Game1.getLocationFromName("Farm")).getBuildingAt(new Vector2((float)((Game1.viewport.X + Game1.getOldMouseX()) / Game1.tileSize), (float)((Game1.viewport.Y + Game1.getOldMouseY()) / Game1.tileSize))), this.structureForPlacement);
     }
     else if (!CataloguePage.canPlaceThisBuildingOnTheCurrentMap(this.structureForPlacement, Game1.currentLocation))
     {
         Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:CataloguePage.cs.10152"), Color.Red, 3500f));
     }
     else if (!this.structureForPlacement.doesFarmerHaveEnoughResourcesToBuild())
     {
         Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:BlueprintsMenu.cs.10002"), Color.Red, 3500f));
     }
     else if (this.tryToBuild())
     {
         this.structureForPlacement.consumeResources();
         if (this.structureForPlacement.blueprintType.Equals("Animals"))
         {
             return;
         }
         Game1.playSound("axe");
     }
     else
     {
         if (Game1.IsClient)
         {
             return;
         }
         Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:BlueprintsMenu.cs.10016"), Color.Red, 3500f));
     }
 }
Esempio n. 10
0
    /// <summary>
    /// 根据参数换模板
    /// </summary>
    /// <param name="pIndex"></param>
    public void SetCurrentModel(Page pBookPage)
    {
        if (pBookPage != null)
        {
            CataloguePage caPage = pBookPage is CataloguePage ? (CataloguePage)pBookPage : null;
            if (CatalogueModel != null)
            {
                if (caPage == null)
                {
                    PageModel.SetActive(true);
                    CatalogueModel.SetActive(false);
                }
                else
                {
                    CatalogueModel.SetActive(true);
                    PageModel.SetActive(false);
                }
            }

            // 显示对应的项
            if (pBookPage.ModelNumber >= 0 && pBookPage.ModelNumber < NummberMax)
            {
                Model md = null;
                if (pBookPage.Catalogue)
                {
                    md = _catalogueModelSc;
                }
                else
                {
                    md = _pageModelSc;
                }
                Debug.Log("caPage == null ? " + (caPage == null));
                if (caPage == null)
                {
                    if (md.TestCode)
                    {
                        for (int i = 0; i < md.Contents.Count; i++)
                        {
                            if (md.Contents[i].ModleNum == pBookPage.ModelNumber)
                            {
                                md.Contents[i].gameObject.SetActive(true);
                            }
                            else
                            {
                                md.Contents[i].gameObject.SetActive(false);
                            }
                        }
                    }
                    else
                    {
                        foreach (Content con in md.ModelNumDic.Values)
                        {
                            if (con.ModleNum == pBookPage.ModelNumber)
                            {
                                con.gameObject.SetActive(true);
                            }
                            else
                            {
                                con.gameObject.SetActive(false);
                            }
                        }
                    }
                }
                //  显示按钮
                DisplayButtons(pBookPage.ModelNumber, pBookPage.ModelNumber);

                // 刷新对应的模板数据
                md.RefreshData(pBookPage);
            }
            else
            {
                Debug.Log("Numm:" + pBookPage.ModelNumber);
            }
        }
    }
Esempio n. 11
0
 public CataloguePageComposer(CataloguePage page)
 {
     this.page = page;
 }
Esempio n. 12
0
 public static void Serialize_CataloguePage(dynamic menu, CataloguePage page, Point mousePosition)
 {
     menu.menuType = "cataloguePage";
 }
Esempio n. 13
0
    /// <summary>
    /// 解析内页和目录信息
    /// </summary>
    /// <param name="param"></param>
    public void AnalysisClgAndPageInfo(XmlParam param)
    {
        XmlElement xmlRoot = GetXmlElement(param.xmlStr);

        #region 目录信息
        int                  i = 0, pageTab = 0, tmpelateNum = 0;
        CataloguePage        cp       = null;
        List <CatalogueItem> ClgItems = null;
        Debug.Log("AnalysisClgAndPageInfo:" + param.xmlStr);
        if (xmlRoot["brochure_info"] != null && xmlRoot["brochure_info"].ChildNodes.Count > 0 &&
            xmlRoot["brochure_info"].ChildNodes[0].Attributes["brochure_file_url"] != null)
        {
            param.book.catalog_file_url = xmlRoot["brochure_info"].ChildNodes[0].Attributes["brochure_file_url"].Value;
        }
        //Debug.Log("ClgInfo:\n" + param.xmlStr);
        if (xmlRoot["catalog_list"] != null)
        {
            foreach (XmlNode firstNode in xmlRoot["catalog_list"].ChildNodes)
            {
                tmpelateNum = int.Parse(firstNode.Attributes["catalog_templet_id"].Value);
                if (ClgItems == null || i % TemplateOfItems[tmpelateNum] == 0)
                {
                    if (cp != null)
                    {
                        param.book.PageList.Add(cp);
                    }

                    ClgItems      = new List <CatalogueItem>();
                    cp            = new CataloguePage(tmpelateNum, pageTab, "", ClgItems);
                    cp.PictureUrl = param.book.catalog_file_url;
                    cp.Catalogue  = true;
                    //cp.Items = new Dictionary<string, UiItem>();
                    pageTab++;
                }
                ClgItems.Add(new CatalogueItem(firstNode.Attributes["catalog_name"].Value, "", "", ClgRank.First, firstNode.Attributes["catalog_page_id"].Value));
                //Debug.Log(firstNode.Attributes["catalog_page_id"].Value);
                i++;
                foreach (XmlNode secondNode in firstNode.ChildNodes)
                {
                    tmpelateNum = int.Parse(secondNode.Attributes["catalog_templet_id"].Value);
                    if (i % TemplateOfItems[tmpelateNum] == 0)
                    {
                        if (cp != null)
                        {
                            param.book.PageList.Add(cp);
                        }

                        ClgItems      = new List <CatalogueItem>();
                        cp            = new CataloguePage(tmpelateNum, pageTab, "", ClgItems);
                        cp.PictureUrl = param.book.catalog_file_url;
                        cp.Catalogue  = true;
                        pageTab++;
                    }
                    ClgItems.Add(new CatalogueItem(secondNode.Attributes["catalog_name"].Value, "", "", ClgRank.Second, secondNode.Attributes["catalog_page_id"].Value));
                    //Debug.Log(secondNode.Attributes["catalog_page_id"].Value);
                    i++;
                    foreach (XmlNode thirdlyNode in secondNode.ChildNodes)
                    {
                        tmpelateNum = int.Parse(firstNode.Attributes["catalog_templet_id"].Value);
                        if (i % TemplateOfItems[tmpelateNum] == 0)
                        {
                            if (cp != null)
                            {
                                param.book.PageList.Add(cp);
                            }

                            ClgItems      = new List <CatalogueItem>();
                            cp            = new CataloguePage(tmpelateNum, pageTab, "", ClgItems);
                            cp.PictureUrl = param.book.catalog_file_url;
                            cp.Catalogue  = true;
                            pageTab++;
                        }
                        ClgItems.Add(new CatalogueItem(thirdlyNode.Attributes["catalog_name"].Value, "", "", ClgRank.Thirdly, thirdlyNode.Attributes["catalog_page_id"].Value));
                        //Debug.Log(thirdlyNode.Attributes["catalog_page_id"].Value);
                        i++;
                    }
                }
                param.book.CatalogueLen = pageTab;
            }
            if (cp != null)
            {
                param.book.PageList.Add(cp);
            }
            if (param.book.PageList.Count % 2 != 0)
            {
                ClgItems = new List <CatalogueItem>();
                cp       = new CataloguePage(tmpelateNum, pageTab, (param.book.PageList[param.book.PageList.Count - 1] as CataloguePage).PictureUrl, ClgItems);
                param.book.PageList.Add(cp);
            }
        }

        #endregion

        #region 内页ID信息
        BookInfo bf      = null;
        long     maxCode = 0;
        //Debug.Log("Page_Info = " + param.xmlStr);
        if (xmlRoot["page_list"] != null)
        {
            foreach (XmlNode row in xmlRoot["page_list"].ChildNodes)
            {
                bf = new BookInfo(row.Attributes["page_id"].Value,
                                  row.Attributes["sequ"].Value,
                                  row.Attributes["page_templet_code"].Value,
                                  row.Attributes["page_name"].Value,
                                  row.Attributes["page_code"].Value);
                if (maxCode < bf.PageCode)
                {
                    maxCode = bf.PageCode;
                }
                if (row.Attributes["res_audio_url"] != null)
                {
                    bf.AudioUrl = row.Attributes["res_audio_url"].Value;
                }
                param.book.IDList.Add(bf);
                //Debug.Log("Getxml: id = " + bf.PageID + ";  Order = " + bf.Ordinal);
            }
            param.book.maxPageCode = maxCode;
            param.book.SortIDList();
            param.book.maxOrdinal = param.book.IDList[param.book.IDList.Count - 1].Ordinal;
            //Debug.Log("count = " + param.book.IDList.Count);
            // 对应目录和内页ID列表中的索引

            param.book.InitCataloguePage();
        }

        #endregion


        //  最后一本书加载完成
        if (_book[_book.Count - 1].ID == param.book.ID)
        {
            StartCoroutine(LoadBookLeyouts(_book));
            Camera.main.GetComponent <MsgCenter_h>().TestText.text += "\nBook = _book";
            Book = _book;
        }
    }