Esempio n. 1
0
        public static RewardBookType RandomType()
        {
            System.Collections.Generic.List <string[]> list = BookContents.Where(strList => !String.IsNullOrEmpty(strList[2])).ToList();

            int ran = Utility.Random(list.Count);

            ColUtility.Free(list);

            return((RewardBookType)ran);
        }
Esempio n. 2
0
        public static RewardBookType RandomType()
        {
            var list = BookContents.Where(strList => !string.IsNullOrEmpty(strList[2])).ToList();

            var ran = Utility.Random(list.Count);

            ColUtility.Free(list);

            return((RewardBookType)ran);
        }
Esempio n. 3
0
        static void DoLayout()
        {
            OpenBook();
            //book = application.ActiveBook;
            contents = book.BookContents;

            //ExportBook(false);

            //Console.WriteLine("Repaginating of " + book.Name);
            //book.Repaginate();

            int sideBarMax   = 0;
            int sideBarCount = 0;

            //foreach (BookContent bookContent in contents)

            int skipTo = 1;

            for (int i = skipTo; i <= contents.Count; i++)
            {
                BookContent bookContent = contents[i];

                application.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

                string name = bookContent.FullName;

                Console.WriteLine("Processing " + name);

                Document document = (Document)application.Open(name, true);

                string sSideBarMax = GetConfig(document.Name.Replace(".indd", ""), "SideBarMax");
                if (sSideBarMax != null && sSideBarMax.Length > 0)
                {
                    sideBarMax   = Int32.Parse(sSideBarMax);
                    sideBarCount = 1;
                }
                else
                {
                    sideBarCount++;
                }


                Guide guide = new Guide(application, document);
                guide.bookContent  = bookContent;
                guide.sideBarMax   = sideBarMax;
                guide.sideBarCount = sideBarCount;

                guide.LayoutGuide(forceUpdate || argslist.Contains(document.Name));
            }

            ExportBook(false);

            // close book
            book.Close(idSaveOptions.idYes, miss, miss, true);
        }
Esempio n. 4
0
        static void DoLayout()
        {
            OpenBook();
            //book = application.ActiveBook;
            contents = book.BookContents;

            //ExportBook(false);

            //Console.WriteLine("Repaginating of " + book.Name);
            //book.Repaginate();

            int sideBarMax = 0;
            int sideBarCount = 0;

            //foreach (BookContent bookContent in contents)

            int skipTo = 1;

            for (int i=skipTo; i<=contents.Count; i++)
            {
                BookContent bookContent = contents[i];

                application.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

                string name = bookContent.FullName;

                Console.WriteLine("Processing " + name);

                Document document = (Document) application.Open(name, true);

                string sSideBarMax = GetConfig(document.Name.Replace(".indd",""), "SideBarMax");
                if (sSideBarMax != null && sSideBarMax.Length > 0)
                {
                    sideBarMax = Int32.Parse(sSideBarMax);
                    sideBarCount = 1;
                }
                else
                    sideBarCount++;

                Guide guide = new Guide(application, document);
                guide.bookContent = bookContent;
                guide.sideBarMax = sideBarMax;
                guide.sideBarCount = sideBarCount;

                guide.LayoutGuide(forceUpdate || argslist.Contains(document.Name) );

            }

            ExportBook(false);

            // close book
            book.Close(idSaveOptions.idYes, miss, miss, true);
        }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        cont = GetComponent <BookContents>();

        interactions = GetComponent <VRTK_InteractableObject>();

        frontCanvas  = transform.Find("CanvasFront").gameObject;
        backCanvas   = transform.Find("CanvasBack").gameObject;
        spineCanvas  = transform.Find("CanvasSpine").gameObject;
        spineCanvas2 = transform.Find("CanvasSpine2").gameObject;

        if (frontCanvas)
        {
            frontCanvas.SetActive(false);
        }
        else
        {
            bError = true;
        }

        if (backCanvas)
        {
            backCanvas.SetActive(false);
        }
        else
        {
            bError = true;
        }

        if (spineCanvas)
        {
            spineCanvas.SetActive(false);
        }
        else
        {
            bError = true;
        }

        if (spineCanvas2)
        {
            spineCanvas2.SetActive(false);
        }
        else
        {
            bError = true;
        }

        rb = GetComponent <Rigidbody>();
    }
Esempio n. 6
0
        static void Resize()
        {
            OpenBook();
            contents = book.BookContents;

            foreach (BookContent bookContent in contents)
            {
                application.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

                string name = bookContent.FullName;

                Console.WriteLine("Processing " + name);

                if (name.ToLower().Contains(@"c:\guides\craglets\book\"))
                {
                    string newname = name.Replace("book", "book 6by9");

                    Console.WriteLine("Replacing " + name + " with " + newname);

                    book.BookContents.Add(newname, book.BookContents.Count);

                    //bookContent.Replace( newname );
                    name = newname;
                }

                Document document = (Document)application.Open(name, true);

                Console.WriteLine("Resizing " + name);
                document.DocumentPreferences.PageHeight = 229;
                document.DocumentPreferences.PageWidth  = 152;

                if (document.Modified)
                {
                    Console.WriteLine("Saving " + document.Name);
                    document.Save(miss, false, miss, true);
                    document.Close(idSaveOptions.idNo, miss, miss, false);
                }

                //document.
            }

            // close book
            book.Close(idSaveOptions.idYes, miss, miss, true);
        }
Esempio n. 7
0
        private static void UpdateTOC()
        {
            BookContents contents = book.BookContents;
            string       name     = ((BookContent)contents.FirstItem()).FullName;

            DoUpdateTOC(name, "CragletsTOC");

            name = ((BookContent)contents[contents.Count - 1]).FullName;
            if (name.Contains("Grade Index"))
            {
                DoUpdateTOC(name, "GradeIndexCraglets");
            }

            name = ((BookContent)contents[contents.Count]).FullName;
            if (name.Contains("Name Index"))
            {
                DoUpdateTOC(name, "NameIndexCraglets");
            }
        }
Esempio n. 8
0
        static void Resize()
        {
            OpenBook();
            contents = book.BookContents;

            foreach (BookContent bookContent in contents)
            {
                application.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

                string name = bookContent.FullName;

                Console.WriteLine("Processing " + name);

                if (name.ToLower().Contains(@"c:\guides\craglets\book\") )
                {
                    string newname = name.Replace("book","book 6by9");

                    Console.WriteLine("Replacing " + name + " with " + newname);

                    book.BookContents.Add(newname, book.BookContents.Count);

                    //bookContent.Replace( newname );
                    name = newname;
                }

                Document document = (Document)application.Open(name, true);

                Console.WriteLine("Resizing " + name);
                document.DocumentPreferences.PageHeight = 229;
                document.DocumentPreferences.PageWidth = 152;

                if (document.Modified)
                {
                    Console.WriteLine("Saving " + document.Name);
                    document.Save(miss, false, miss, true);
                    document.Close(idSaveOptions.idNo, miss, miss, false);
                }

                //document.
            }

            // close book
            book.Close(idSaveOptions.idYes, miss, miss, true);
        }