//this is just easier than debugging unit tests


        static void Main(string[] args)
        {
#if DEBUG
            StudioCommunicationServer.Run();
            StudioCommunicationClient.Run();
#endif
        }
Exemple #2
0
        public void EnableStudio(bool hooked)
        {
            if (hooked)
            {
                try
                {
                    string fileName;
                    if (Environment.OSVersion.Platform == PlatformID.Unix)
                    {
                        if (null == (fileName = Environment.GetEnvironmentVariable("CELESTE_TAS_FILE")))
                        {
                            fileName = Environment.GetEnvironmentVariable("HOME") + "/.steam/steam/steamapps/common/Celeste/Celeste.tas";
                        }
                    }
                    else
                    {
                        fileName = Path.Combine(Wrapper.gamePath, "Celeste.tas");
                    }
                    if (!File.Exists(fileName))
                    {
                        File.WriteAllText(fileName, string.Empty);
                    }

                    if (string.IsNullOrEmpty(tasText.LastFileName))
                    {
                        if (string.IsNullOrEmpty(tasText.SaveToFileName))
                        {
                            tasText.OpenBindingFile(fileName, Encoding.ASCII);
                        }
                        tasText.LastFileName = fileName;
                    }
                    tasText.SaveToFileName = fileName;
                    if (tasText.LastFileName != tasText.SaveToFileName)
                    {
                        tasText.SaveFile(true);
                    }
                    tasText.Focus();
                } catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
            else
            {
                lblStatus.Text   = "Searching...";
                tasText.Height  += statusBar.Height - 22;
                statusBar.Height = 22;
                StudioCommunicationServer.Run();
            }
        }