diff --git a/GUI/Program.cs b/GUI/Program.cs index f212e5bf8..1b6506024 100644 --- a/GUI/Program.cs +++ b/GUI/Program.cs @@ -1,19 +1,19 @@ /* - Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy) - - Dual-licensed under the Educational Community License, Version 2.0 and - the GNU General Public License, Version 3 (the "Licenses"); you may - not use this file except in compliance with the Licenses. You may - obtain a copy of the Licenses at - - http://www.opensource.org/licenses/ecl2.php - http://www.gnu.org/licenses/gpl-3.0.html - - Unless required by applicable law or agreed to in writing, - software distributed under the Licenses are distributed on an "AS IS" - BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the Licenses for the specific language governing - permissions and limitations under the Licenses. + Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy) + + Dual-licensed under the Educational Community License, Version 2.0 and + the GNU General Public License, Version 3 (the "Licenses"); you may + not use this file except in compliance with the Licenses. You may + obtain a copy of the Licenses at + + http://www.opensource.org/licenses/ecl2.php + http://www.gnu.org/licenses/gpl-3.0.html + + Unless required by applicable law or agreed to in writing, + software distributed under the Licenses are distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the Licenses for the specific language governing + permissions and limitations under the Licenses. */ using System; using System.Diagnostics; @@ -68,7 +68,7 @@ namespace MCGalaxy.Gui { useConsole = false; useHighQualityGui = false; try { - ReadViewmode(); + ReadViewmode(); if (useConsole) { Server s = new Server(); s.OnLog += WriteToConsole; @@ -100,13 +100,16 @@ namespace MCGalaxy.Gui { } static void ReadViewmode() { + PlatformID platform = Environment.OSVersion.Platform; + useConsole = !(platform == PlatformID.Win32NT || platform == PlatformID.Win32Windows); + if (!File.Exists("Viewmode.cfg")) { using (StreamWriter w = new StreamWriter("Viewmode.cfg")) { w.WriteLine("#This file controls how the console window is shown to the server host"); w.WriteLine("#cli: True or False (Determines whether a CLI interface is used) (Set True if on Mono)"); w.WriteLine("#high-quality: True or false (Determines whether the GUI interface uses higher quality objects)"); w.WriteLine(); - w.WriteLine("cli = false"); + w.WriteLine("cli = " + useConsole); w.WriteLine("high-quality = true"); } }