Exemplo n.º 1
0
        public void OnCreate(MonoBehaviour parentScene)
        {
            App.ChatUI.Show (false);
            repoListPopup = new GameObject ("Repo List").AddComponent<UIListPopup> ();
            repoListPopup.transform.parent = parentScene.transform;
            repoListPopup.Init (new Rect((float)Screen.width/15.0f+(float)Screen.width/35.0f, (float)Screen.height/5.0f+(float)Screen.height/30.0f+40.0f, (float)Screen.width/4.5f, (float)Screen.height/6.0f*4.0f-(float)Screen.height/15.0f-80.0f), false, true, repoManager.repositories, this, null, null, false, true, true, true, null, true, false);
            repoListPopup.enabled = true;
            repoListPopup.SetOpacity(1f);
            if (repoManager.repositories.Count > 0)
                repoListPopup.setSelectedItem (repoManager.repositories [0]);

            downloadableListPopup = new GameObject ("Downloadable List").AddComponent<UIListPopup> ();
            downloadableListPopup.transform.parent = parentScene.transform;
            if (repoManager.repositories.Count > 0)
                downloadableListPopup.Init (new Rect((float)Screen.width/15.0f+(float)Screen.width/35.0f*1.5f+(float)Screen.width/4.5f, (float)Screen.height/5.0f+(float)Screen.height/30.0f+40.0f, (float)Screen.width/4.1f, (float)Screen.height/6.0f*4.0f-(float)Screen.height/15.0f-80.0f), false, true, repoManager.getModListForRepo((Repo)repoListPopup.selectedItem()), this, null, null, true, true, true, true, null, true, false);
            else
                downloadableListPopup.Init (new Rect((float)Screen.width/15.0f+(float)Screen.width/35.0f*1.5f+(float)Screen.width/4.5f, (float)Screen.height/5.0f+(float)Screen.height/30.0f+40.0f, (float)Screen.width/4.1f, (float)Screen.height/6.0f*4.0f-(float)Screen.height/15.0f-80.0f), false, true, new List<Item>(), this, null, null, true, true, true, true, null, true, false);

            downloadableListPopup.enabled = true;
            downloadableListPopup.SetOpacity(1f);

            modListPopup = new GameObject ("Mod List").AddComponent<UIListPopup> ();
            modListPopup.transform.parent = parentScene.transform;
            modListPopup.Init (new Rect((float)Screen.width/15.0f*9.5f+(float)Screen.width/35.0f, (float)Screen.height/5.0f+(float)Screen.height/30.0f+40.0f, (float)Screen.width/15.0f*4.5f-(float)Screen.width/35.0f*2.0f, (float)Screen.height/6.0f*4.0f-(float)Screen.height/15.0f-80.0f), false, true, modManager.installedMods, this, null, null, true, true, true, true, null, true, true);
            modListPopup.enabled = true;
            modListPopup.SetOpacity(1f);
            modListPopup.setSelectedItems(modManager.installedMods.FindAll(delegate (Item mod) {
                return (mod as LocalMod).enabled;
            }));
        }
Exemplo n.º 2
0
        public void OnGUI()
        {
            GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), ResourceManager.LoadTexture("DeckBuilder/bg"));
            new ScrollsFrame(new Rect((float)Screen.width / 15.0f, (float)Screen.height / 5.0f, (float)Screen.width / 15.0f * 8.0f, (float)Screen.height / 6.0f * 4.0f)).AddNinePatch(ScrollsFrame.Border.LIGHT_CURVED, NinePatch.Patches.CENTER).Draw();
            new ScrollsFrame(new Rect((float)Screen.width / 15.0f * 9.5f, (float)Screen.height / 5.0f, (float)Screen.width / 15.0f * 4.5f, (float)Screen.height / 6.0f * 4.0f)).AddNinePatch(ScrollsFrame.Border.LIGHT_CURVED, NinePatch.Patches.CENTER).Draw();

            Color textColor = GUI.skin.label.normal.textColor;

            GUI.skin.label.normal.textColor = Color.white;

            GUI.skin.label.fontSize = (int)(((float)(0x1c * Screen.height)) / 1080f);
            GUI.Label(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f + (float)Screen.width / 4.5f / 2.0f - (float)Screen.width / 8.0f / 2.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f, (float)Screen.width / 8.0f, 35.0f), "Repositories");
            GUI.Label(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f * 1.5f + (float)Screen.width / 4.5f + (float)Screen.width / 4.1f / 2.0f - (float)Screen.width / 8.0f / 2.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f, (float)Screen.width / 8.0f, 35.0f), "Downloadable Mods");
            GUI.Label(new Rect((float)Screen.width / 15.0f * 9.5f + (float)Screen.width / 35.0f + ((float)Screen.width / 15.0f * 4.5f - (float)Screen.width / 35.0f * 2.0f) / 2.0f - (float)Screen.width / 8.0f / 2.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f, (float)Screen.width / 8.0f, 35.0f), "Installed Mods");

            GUI.skin.label.fontSize = 18;
            if (GUI.Button(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 9.0f - 1.0f, (float)Screen.width / 35.0f), string.Empty))
            {
                //App.Popups.ShowTextEntry (this, "http://", "WARNING: Other repositories are NOT trusted by Scrollsguide.", "addRepo", "Add Repository", "Please enter the URL of the repository you want to add", "Add");
                App.Popups.ShowTextEntry(this, "addRepo", "Add Repository", "WARNING: Other repositories are NOT trusted by Scrollsguide.", "Add", "Please enter the URL of the repository you want to add", "http://");
            }
            GUI.Label(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 9.0f - 1.0f, (float)Screen.width / 35.0f), "Add Repository");

            if (GUI.Button(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f + (float)Screen.width / 9.0f + 1.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 9.0f - 1.0f, (float)Screen.width / 35.0f), string.Empty))
            {
                try {
                    if (repoListPopup.selectedItem().Equals(repoManager.repositories[0]))
                    {
                        App.Popups.ShowOk(this, "remWarning", "Invalid Operation", "You cannot remove Scrollsguide from your repository list", "OK");
                    }
                    else
                    {
                        repoManager.removeRepository((Repo)repoListPopup.selectedItem());
                        repoListPopup.SetItemList(repoManager.repositories);
                        repoListPopup.setSelectedItem(repoManager.repositories[0]);
                        downloadableListPopup.SetItemList(repoManager.getModListForRepo((Repo)repoListPopup.selectedItem()));
                    }
                } catch {}
            }
            GUI.Label(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f + (float)Screen.width / 9.0f + 1.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 9.0f - 1.0f, (float)Screen.width / 35.0f), "Remove Repository");

            if (GUI.Button(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f * 1.5f + (float)Screen.width / 4.5f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 4.1f, (float)Screen.width / 35.0f), string.Empty))
            {
                App.Popups.ShowInfo("Downloading", "Please wait while the requested mods are being downloaded");
                new Thread(downloadMods).Start();
            }
            GUI.Label(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f * 1.5f + (float)Screen.width / 4.5f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 4.1f, (float)Screen.width / 35.0f), "Download");

            if (GUI.Button(new Rect((float)Screen.width / 15.0f * 9.5f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 15.0f * 4.5f - (float)Screen.width / 35.0f * 2.0f, (float)Screen.width / 35.0f), string.Empty))
            {
                loader.repatch();
            }
            GUI.Label(new Rect((float)Screen.width / 15.0f * 9.5f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f, (float)Screen.width / 15.0f * 4.5f - (float)Screen.width / 35.0f * 2.0f, (float)Screen.width / 35.0f), "Apply (Restarts Scrolls)");

            TextAnchor alignment = GUI.skin.label.alignment;

            GUI.skin.label.alignment        = TextAnchor.MiddleRight;
            GUI.skin.label.normal.textColor = Color.Lerp(Color.white, Color.yellow, 0.4f);

            GUI.Label(new Rect(Screen.width * 0.5f, Screen.height * 0.90f, Screen.width * 0.48f, Screen.height * 0.04f), "The Summoner ModLoader v" + ModLoader.getVersion() + " is not an official Scrolls feature");
            GUI.Label(new Rect(Screen.width * 0.5f, Screen.height * 0.94f, Screen.width * 0.48f, Screen.height * 0.04f), "Read and submit bugs on http://www.scrollsguide.com/summoner");

            GUI.skin.label.normal.textColor = textColor;
            GUI.skin.label.fontSize         = defaultTextSize;
            GUI.skin.label.alignment        = alignment;
        }
Exemplo n.º 3
0
 public void ItemClicked(UIListPopup popup, Item card)
 {
     if (popup == repoListPopup)
     {
         repoListPopup.setSelectedItem(card);
         downloadableListPopup.SetItemList(repoManager.getModListForRepo((Repo)repoListPopup.selectedItem()));
     }
     if (popup == downloadableListPopup)
     {
         System.Diagnostics.Process.Start((repoListPopup.selectedItem() as Repo).url + "mod/" + (downloadableListPopup.selectedItem() as Mod).id);
     }
     if (popup == modListPopup)
     {
         if (modListPopup.selectedItems().Contains(card))
         {
             modManager.enableMod((LocalMod)card);
         }
         else
         {
             modManager.disableMod((LocalMod)card);
         }
         modListPopup.SetItemList(modManager.installedMods);
     }
 }
Exemplo n.º 4
0
        public void OnCreate(MonoBehaviour parentScene)
        {
            App.ChatUI.Show(false);
            repoListPopup = new GameObject("Repo List").AddComponent <UIListPopup> ();
            repoListPopup.transform.parent = parentScene.transform;
            repoListPopup.Init(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + 40.0f, (float)Screen.width / 4.5f, (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f), false, true, repoManager.repositories, this, null, null, false, true, true, true, null, true, false);
            repoListPopup.enabled = true;
            repoListPopup.SetOpacity(1f);
            if (repoManager.repositories.Count > 0)
            {
                repoListPopup.setSelectedItem(repoManager.repositories [0]);
            }

            downloadableListPopup = new GameObject("Downloadable List").AddComponent <UIListPopup> ();
            downloadableListPopup.transform.parent = parentScene.transform;
            if (repoManager.repositories.Count > 0)
            {
                downloadableListPopup.Init(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f * 1.5f + (float)Screen.width / 4.5f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + 40.0f, (float)Screen.width / 4.1f, (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f), false, true, repoManager.getModListForRepo((Repo)repoListPopup.selectedItem()), this, null, null, true, true, true, true, null, true, false);
            }
            else
            {
                downloadableListPopup.Init(new Rect((float)Screen.width / 15.0f + (float)Screen.width / 35.0f * 1.5f + (float)Screen.width / 4.5f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + 40.0f, (float)Screen.width / 4.1f, (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f), false, true, new List <Item>(), this, null, null, true, true, true, true, null, true, false);
            }

            downloadableListPopup.enabled = true;
            downloadableListPopup.SetOpacity(1f);

            modListPopup = new GameObject("Mod List").AddComponent <UIListPopup> ();
            modListPopup.transform.parent = parentScene.transform;
            modListPopup.Init(new Rect((float)Screen.width / 15.0f * 9.5f + (float)Screen.width / 35.0f, (float)Screen.height / 5.0f + (float)Screen.height / 30.0f + 40.0f, (float)Screen.width / 15.0f * 4.5f - (float)Screen.width / 35.0f * 2.0f, (float)Screen.height / 6.0f * 4.0f - (float)Screen.height / 15.0f - 80.0f), false, true, modManager.installedMods, this, null, null, true, true, true, true, null, true, true);
            modListPopup.enabled = true;
            modListPopup.SetOpacity(1f);
            modListPopup.setSelectedItems(modManager.installedMods.FindAll(delegate(Item mod) {
                return((mod as LocalMod).enabled);
            }));
        }