示例#1
0
        public SoundTestPlayerUI(Menu.Menu menu, MenuObject owner, SoundTestOwner testOwner) : base(menu, owner, new Vector2(-1000f, -1000f), Vector2.zero)
        {
            this.lastPos   = new Vector2(-1000f, -1000f);
            this.testOwner = testOwner;
            testOwner.ui   = this;

            this.infoLabel = new MenuLabel(menu, this, "PlayerUI", new Vector2(this.size.x / 2f - 100f, 0f), new Vector2(200f, 20f), true);
            this.subObjects.Add(this.infoLabel);

            this.slugButton = new SlugButton(menu, this);
            this.subObjects.Add(this.slugButton);
        }
示例#2
0
        public SoundTest(ProcessManager manager, RainWorldGame game, SoundTestOwner overlayOwner) : base(manager, ProcessManager.ProcessID.PauseMenu)
        {
            this.game         = game;
            this.overlayOwner = overlayOwner;
            this.darkFade     = 1f;
            this.lastDarkFade = 1f;
            this.pages.Add(new Page(this, null, "main", 0));
            this.fadeSprite        = new FSprite("Futile_White", true);
            this.fadeSprite.color  = new Color(0f, 0f, 0f);
            this.fadeSprite.x      = game.rainWorld.screenSize.x / 2f;
            this.fadeSprite.y      = game.rainWorld.screenSize.y / 2f;
            this.fadeSprite.shader = game.rainWorld.Shaders["EdgeFade"];
            Futile.stage.AddChild(this.fadeSprite);


            if (ConfigManager.songNameDict != null)
            {
                return;
            }

            Dictionary <string, string> dict = new Dictionary <string, string>();
            List <string> keys = new List <string>();

            //Get Songs
            string path = string.Concat(new object[]
            {
                Custom.RootFolderDirectory(),
                Path.DirectorySeparatorChar,
                "Assets",
                Path.DirectorySeparatorChar,
                "Futile",
                Path.DirectorySeparatorChar,
                "Resources",
                Path.DirectorySeparatorChar,
                "Music",
                Path.DirectorySeparatorChar,
                "Songs",
                Path.DirectorySeparatorChar
            });
            DirectoryInfo dirSong = new DirectoryInfo(path);

            foreach (FileInfo file in dirSong.GetFiles())
            {
                string key = file.Name;
                if (key.Substring(0, 2) != "NA" && key.Substring(0, 2) != "RW")
                {
                    continue;
                }
                if (key.Substring(key.Length - 4) == "meta")
                {
                    continue;
                }
                key = key.Substring(0, key.Length - 4);

                if (key.Substring(0, 2) == "RW" && key.Substring(4, 1) == " ")
                {
                    key = key.Insert(3, "0");
                }

                keys.Add(key);
            }
            keys.Sort();
            for (int k = 0; k < keys.Count; k++)
            {
                string name = keys[k];
                if (name.Substring(0, 2) == "NA")
                {
                    name = name.Substring(8);
                }
                else
                {
                    name = name.Substring(3);
                    if (int.TryParse(name.Substring(0, 1), out int p))
                    {
                        name = name.Substring(5);
                        if (keys[k].Substring(3, 1) == "0")
                        {
                            keys[k] = keys[k].Remove(3, 1);
                        }
                    }
                    else
                    {
                        name = name.Replace('_', ' ');
                    }
                }
                dict.Add(name, keys[k]);
                //Debug.Log(keys[k] + "/" + name);
            }
            ConfigManager.songNameDict = dict;
        }