コード例 #1
0
        public AboutWindow()
        {
            // Pull out some useful variables.
            var        dedicationManager = new DedicationManager();
            Dedication dedication        = dedicationManager.CurrentDedication;

            // Set the title to the longer title with the program name.
            const string programName = "Author Intrusion";
            const string windowTitle = "About " + programName;

            Title = windowTitle;

            // Create the rest of the GUI.
            CreateGui(programName, dedication);
            ShowAll();

            //			Version = dedication.ToString();

            //			Comments = dedication.Html;

            //			Copyright = "2013, Moonfire Games";

            //			License = @"Copyright (c) 2013, Moonfire Games
            //
            //Permission is hereby granted, free of charge, to any person obtaining a copy
            //of this software and associated documentation files (the ""Software""), to deal
            //in the Software without restriction, including without limitation the rights
            //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
            //copies of the Software, and to permit persons to whom the Software is
            //furnished to do so, subject to the following conditions:
            //
            //The above copyright notice and this permission notice shall be included in
            //all copies or substantial portions of the Software.
            //
            //THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
            //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
            //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
            //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
            //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
            //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
            //THE SOFTWARE.";

            //			Authors = new[]
            //			{
            //				"Dylan R. E. Moonfire"
            //			};
        }
コード例 #2
0
        private void CreateGui(
            string programName,
            Dedication dedication)
        {
            // Create the title and version labels.
            var programLabel = new Label
            {
                Markup = "<b><span size='100'>" + programName + "</span></b>"
            };
            var versionLabel = new Label
            {
                Markup = "<b><span size='80'>" + dedication.Version + "</span></b>"
            };
            var authorLabel = new Label
            {
                Markup = "<b><span size='80'>" + dedication.Author + "</span></b>"
            };

            // Set up the dedication text.
            string html = string.Join("\n", dedication.Lines);
            string text = html + "- " + dedication.Dedicator;

            // Create an HTML display widget with the text.
            var dedicationView = new TextView
            {
                Buffer =
                {
                    Text = text
                },
                WrapMode         = WrapMode.Word,
                PixelsBelowLines = 10,
                RightMargin      = 8,
                LeftMargin       = 4,
                Justification    = Justification.Fill,
                Sensitive        = false,
            };

            var dedicatorTag = new TextTag("dedicator");

            dedicatorTag.Style         = Pango.Style.Italic;
            dedicatorTag.Justification = Justification.Right;
            dedicationView.Buffer.TagTable.Add(dedicatorTag);

            TextIter dedicatorIterBegin =
                dedicationView.Buffer.GetIterAtOffset(html.Length);
            TextIter dedicatorIterEnd = dedicationView.Buffer.GetIterAtOffset(
                text.Length);

            dedicationView.Buffer.ApplyTag(
                dedicatorTag, dedicatorIterBegin, dedicatorIterEnd);

            // Wrap it in a scroll window with some additional spacing.
            var dedicationScroll = new ScrolledWindow
            {
                BorderWidth = 4
            };

            dedicationScroll.Add(dedicationView);

            // Create the notebook we'll be using for the larger text tabs.
            var notebook = new Notebook();

            notebook.SetSizeRequest(512, 256);
            notebook.BorderWidth = 4;

            notebook.AppendPage(dedicationScroll, new Label("Dedication"));

            // Arrange everything in the vertical box.
            VBox.PackStart(programLabel, false, false, 4);
            VBox.PackStart(versionLabel, false, false, 4);
            VBox.PackStart(authorLabel, false, false, 4);
            VBox.PackStart(notebook, true, true, 4);

            // Set up the buttons.
            Modal = true;

            AddButton("Close", ResponseType.Close);
        }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        shop   = GameObject.FindGameObjectWithTag("shop").GetComponent <Shop>();          // Gör så man kan komma åt Shop scriptet
        points = GameObject.FindGameObjectWithTag("score").GetComponent <Points>().score; // Kommer åt Points scriptet
        if (points >= 1 && PlayerPrefs.GetInt("achievement1gotten") == 0)                 //Om man når kraven för achievementen så får man det. Gäller alla nedan ner till if(startanim...
        {
            Dedication?.Invoke();
        }

        if (points >= 10 && PlayerPrefs.GetInt("achievement2gotten") == 0)
        {
            Slurper?.Invoke();
        }

        if (shop.Clicker >= 1 && PlayerPrefs.GetInt("achievement3gotten") == 0)
        {
            Auto?.Invoke();
        }
        if (shop.Clicker >= 1 || shop.CentupleClicker >= 1 || shop.DecupleClicker >= 1 || shop.TenXClicker >= 1 || shop.doubleClicker >= 1 || shop.HundredXClicker >= 1)
        {
            if (PlayerPrefs.GetInt("achievement4gotten") == 0)
            {
                Buy?.Invoke();
            }
        }
        if (shop.Clicker >= 1 && shop.CentupleClicker >= 1 && shop.DecupleClicker >= 1 && shop.TenXClicker >= 1 && shop.doubleClicker >= 1 && shop.HundredXClicker >= 1 && PlayerPrefs.GetInt("achievement5gotten") == 0)
        {
            Each.Invoke();
        }
        if (points >= 50000000 && PlayerPrefs.GetInt("achievement6gotten") == 0)
        {
            Half.Invoke();
        }
        if (startanimation1 == true) // om man animationen startat så sätter den achievementgotten till 1 och spelar upp animationen.
        {
            animator1.SetBool("start", true);
            StartCoroutine(AnimatorWait());
            PlayerPrefs.SetInt("achievement1gotten", 1);
        }
        if (startanimation2 == true)
        {
            animator2.SetBool("start", true);
            StartCoroutine(AnimatorWait2());
            PlayerPrefs.SetInt("achievement2gotten", 1);
        }
        if (startanimation3 == true)
        {
            animator3.SetBool("start", true);
            StartCoroutine(AnimatorWait3());
            PlayerPrefs.SetInt("achievement3gotten", 1);
        }
        if (startanimation4 == true)
        {
            animator4.SetBool("start", true);
            StartCoroutine(AnimatorWait4());
            PlayerPrefs.SetInt("achievement4gotten", 1);
        }
        if (startanimation5 == true)
        {
            animator5.SetBool("start", true);
            StartCoroutine(AnimatorWait5());
            PlayerPrefs.SetInt("achievement5gotten", 1);
        }
        if (startanimation6 == true)
        {
            animator6.SetBool("start", true);
            StartCoroutine(AnimatorWait6());
            PlayerPrefs.SetInt("achievement6gotten", 1);
        }
    }