Exemplo n.º 1
0
        private void LoadSongFile(AssignString ds)
        {
            OpenFileDialog openTex = new OpenFileDialog();

            openTex.Title = "Open texture file";

            openTex.Filter           = "Sound File|*.mp3;*.wav;*.xnb; *.wma";
            openTex.InitialDirectory = TBAGW.Game1.rootContent;


            bool bDone = false;

            while (!bDone)
            {
                DialogResult dia = openTex.ShowDialog();
                if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                {
                    ds(openTex.FileName.Replace(TBAGW.Game1.rootContent, "").Substring(0, openTex.FileName.Replace(TBAGW.Game1.rootContent, "").LastIndexOf(".")));
                    bDone = true;
                }
                else if (dia == DialogResult.Cancel)
                {
                    ds("");
                    bDone = true;
                }
                else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                {
                    MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                }
            }

            GetRegionBGInfo();
        }
Exemplo n.º 2
0
        public static ParamLessInstruction GetAssignInstructionForDatSymbolType(DatSymbolType type)
        {
            ParamLessInstruction instruction = new ParamLessInstruction();

            switch (type)
            {
            case (DatSymbolType.Int):
            {
                instruction = new Assign();
                break;
            }

            case (DatSymbolType.String):
            {
                instruction = new AssignString();     //TODO when to use AssignStringRef?
                break;
            }

            case (DatSymbolType.Func):
            {
                instruction = new AssignFunc();
                break;
            }

            case (DatSymbolType.Float):
            {
                instruction = new AssignFloat();
                break;
            }

            case (DatSymbolType.Instance):     // TODO check if it happens
            case (DatSymbolType.Class):
            {
                instruction = new AssignInstance();
                break;
            }
            }

            return(instruction);
        }