Compare commits

..

No commits in common. "master" and "1.0.2.1" have entirely different histories.

10 changed files with 25 additions and 102 deletions

View file

@ -23,7 +23,7 @@
<value>http://ensl.gk-servers.de/ns</value>
</setting>
<setting name="GatherURL" serializeAs="String">
<value>http://www.ensl.org/gathers/latest/ns1</value>
<value>https://www.ensl.org/gathers/latest/ns1</value>
</setting>
<setting name="NsXpURL" serializeAs="String">
<value>http://ensl.gk-servers.de/ns_xp</value>

View file

@ -45,7 +45,6 @@ namespace NaturalLauncher
public static bool keepLauncherAlive = true;
public static bool restartSteam = false; // used at the end of the verify process
public static bool keepCustomFiles = false; // keep files customized by the player when existing (sound, sprites ...)
public static DateTime LAUNCHTIME = System.DateTime.UtcNow;
public static string discordCustomStatus = "Currently In The Launcher";
@ -171,7 +170,7 @@ namespace NaturalLauncher
{
string IndicatedFolder = "";
bool isXP = false;
XmlBuilder.ReadConfigXml(out IndicatedFolder, out isXP, out string discordStatus, out bool keepAlive, out bool keepcustoms);
XmlBuilder.ReadConfigXml(out IndicatedFolder, out isXP, out string discordStatus, out bool keepAlive);
if (IndicatedFolder.Length >0)
{
@ -179,7 +178,6 @@ namespace NaturalLauncher
isExperimental = isXP;
discordCustomStatus = discordStatus;
keepLauncherAlive = keepAlive;
keepCustomFiles = keepcustoms;
}
else
NeedDirectory = true;
@ -217,9 +215,6 @@ namespace NaturalLauncher
{
Environment.Exit(0); //stop the process
}
// Because it's first launch, ask if we want to keep custom files
Util.AskForCustomFiles();
}
NSFolder = HLFolder + Path.DirectorySeparatorChar + "ns";
@ -232,7 +227,7 @@ namespace NaturalLauncher
if (File.Exists(curDir + Path.DirectorySeparatorChar + configName))
{
string IndicatedFolder = "";
XmlBuilder.ReadConfigXml(out IndicatedFolder, out Result, out string plop, out bool noob,out bool lolilol);
XmlBuilder.ReadConfigXml(out IndicatedFolder, out Result, out string plop, out bool noob);
}
else
{

View file

@ -548,11 +548,6 @@ namespace NaturalLauncher
UpdateLog.WriteLine(Util.GetShortTimeString() + gameFilePath + " not existing, needs downloading");
ShouldDownload = true;
}
if (File.Exists(gameFilePath) && Launcher.keepCustomFiles && ( kv.Key.EndsWith(".wav") || kv.Key.EndsWith(".mp3") || kv.Key.EndsWith(".spr") || kv.Key.EndsWith(".tga") ) )
{
UpdateLog.WriteLine(Util.GetShortTimeString() + gameFilePath + " Keeping custom files");
ShouldDownload = false;
}
if (File.Exists(gameFilePath) && IgnoreManifest.Files.ContainsKey(kv.Key) && IgnoreValue == "1") // ignore everything
{
UpdateLog.WriteLine(Util.GetShortTimeString() + gameFilePath + " Is Ignored for update, not checking");

View file

@ -69,10 +69,7 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="CrashReporter.NET, Version=1.5.5.0, Culture=neutral, PublicKeyToken=7828e0fd88cab698, processorArchitecture=MSIL">

View file

@ -12,7 +12,7 @@ namespace NaturalLauncher.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -73,7 +73,7 @@ namespace NaturalLauncher.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://www.ensl.org/gathers/latest/ns1")]
[global::System.Configuration.DefaultSettingValueAttribute("https://www.ensl.org/gathers/latest/ns1")]
public string GatherURL {
get {
return ((string)(this["GatherURL"]));

View file

@ -15,7 +15,7 @@
<Value Profile="(Default)">http://ensl.gk-servers.de/ns</Value>
</Setting>
<Setting Name="GatherURL" Type="System.String" Scope="User">
<Value Profile="(Default)">http://www.ensl.org/gathers/latest/ns1</Value>
<Value Profile="(Default)">https://www.ensl.org/gathers/latest/ns1</Value>
</Setting>
<Setting Name="NsXpURL" Type="System.String" Scope="User">
<Value Profile="(Default)">http://ensl.gk-servers.de/ns_xp</Value>

View file

@ -38,8 +38,7 @@
<Label Content="Custom discord status :" Canvas.Left="38" Canvas.Top="128" Height="27" Width="145" Foreground="#FF5ACAFF" FontWeight="Bold" HorizontalContentAlignment="Center"/>
<TextBox x:Name="DiscordTxtbox" Height="27" Canvas.Left="212" TextWrapping="Wrap" Text="status" Canvas.Top="127" Width="261" Foreground="#FF2B2F30" FontWeight="Bold" Background="#BFFFFFFF" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Button x:Name="ChangeDiscordButton" Content="Change" Canvas.Left="479" Canvas.Top="127" Width="49" Height="27" Background="#19000000" BorderBrush="#FF5ACAFF" Foreground="#FF5ACAFF" Click="ChangeDiscord_Click"/>
<CheckBox x:Name="isExperimental" Content="Use Experimental Build" Canvas.Left="306" Canvas.Top="265" FontWeight="Bold" Foreground="#FFFF685A" Width="175" HorizontalContentAlignment="Center" Click="isExperimental_Click"/>
<CheckBox x:Name="isKeepingCustoms" Content="Keep Custom Files" Canvas.Left="102" Canvas.Top="265" FontWeight="Bold" Foreground="#FFFF965A" Width="175" HorizontalContentAlignment="Center" Click="KeepCustom_Click"/>
<CheckBox x:Name="isExperimental" Content="Use Experimental Build" Canvas.Left="196" Canvas.Top="265" FontWeight="Bold" Foreground="#FFFF685A" Width="175" HorizontalContentAlignment="Center" Click="isExperimental_Click"/>
</Canvas>
</Grid>
</Window>

View file

@ -74,12 +74,11 @@ namespace NaturalLauncher
try
{
XmlBuilder.ReadConfigXml(out string uno, out bool isXP, out string discordStatus, out bool keepAlive, out bool keepCustoms);
XmlBuilder.ReadConfigXml(out string uno, out bool isXP, out string discordStatus, out bool keepAlive);
Launcher.keepLauncherAlive = keepAlive;
DiscordTxtbox.Text = discordStatus;
KeepAliveChecker.IsChecked = keepAlive;
isExperimental.IsChecked = isXP;
isKeepingCustoms.IsChecked = keepCustoms;
windowfullyopen = true;
}
catch(Exception exception)
@ -292,12 +291,5 @@ namespace NaturalLauncher
Launcher.UpdateDiscord(false);
XmlBuilder.CreateConfigXml();
}
private void KeepCustom_Click(object sender, RoutedEventArgs e)
{
Launcher.keepCustomFiles = isKeepingCustoms.IsChecked.Value;
XmlBuilder.CreateConfigXml();
}
}
}

View file

@ -275,35 +275,28 @@ namespace NaturalLauncher
public static int ReadGathererCount()
{
var url = Properties.Settings.Default.GatherURL;
var web = new HtmlWeb();
var doc = web.Load(url);
string htmlstring = doc.Text;
int Count = 0;
// need to retrieve this : <ul id="gatherers">
var nodal = doc.DocumentNode.Descendants("ul");
try
for(int i = 0; i < nodal.Count(); i++)
{
var url = Properties.Settings.Default.GatherURL;
var web = new HtmlWeb();
var doc = web.Load(url);
string htmlstring = doc.Text;
// need to retrieve this : <ul id="gatherers">
var nodal = doc.DocumentNode.Descendants("ul");
for (int i = 0; i < nodal.Count(); i++)
try
{
try
if (nodal.ElementAt(i).Id == "gatherers")
{
if (nodal.ElementAt(i).Id == "gatherers")
{
Count = nodal.ElementAt(i).SelectNodes("li").Count(); //and count the <li> inside
}
}
catch
{
Count = 0;
Count = nodal.ElementAt(i).SelectNodes("li").Count(); //and count the <li> inside
}
}
}
catch
{
Count = 0;
catch
{
Count = 0;
}
}
return Count;
@ -672,44 +665,5 @@ namespace NaturalLauncher
}
public static void AskForCustomFiles()
{
string sMessageBoxText = "Do you want to preserve your custom files?" + Environment.NewLine + "(can be changed in the settings)";
string sCaption = "Keep Custom Files";
MessageBoxButton btnMessageBox = MessageBoxButton.YesNo;
MessageBoxImage icnMessageBox = MessageBoxImage.Warning;
MessageBoxResult rsltMessageBox = System.Windows.MessageBox.Show(sMessageBoxText, sCaption, btnMessageBox, icnMessageBox);
switch (rsltMessageBox)
{
case MessageBoxResult.Yes:
Launcher.keepCustomFiles = true;
break;
case MessageBoxResult.No:
Launcher.keepCustomFiles = false;
break;
}
XmlBuilder.CreateConfigXml();
// if we keept the custom files, it's better to use them (thus the hud_style 0)
if (Launcher.keepCustomFiles)
{
try
{
Util.ChangeAValueInCfg("hud_style ", "0"); // change
}
catch
{
MessageBoxResult AlertBox = System.Windows.MessageBox.Show("Could not write config file to change hud_style 0" + Environment.NewLine +
"please note that you might need to change it manually to use your custom files");
}
}
}
}
}

View file

@ -81,7 +81,7 @@ namespace NaturalLauncher
return xmlInfo;
}
public static bool ReadConfigXml(out string HLFolder, out bool isXP, out string customDiscordStatus, out bool keepLauncherAlive, out bool keepCustomFiles)
public static bool ReadConfigXml(out string HLFolder, out bool isXP, out string customDiscordStatus, out bool keepLauncherAlive)
{
XmlDocument doc = new XmlDocument();
try
@ -125,14 +125,6 @@ namespace NaturalLauncher
{
keepLauncherAlive = true;
}
try
{
keepCustomFiles = doc.SelectSingleNode("//keepCustomFiles").InnerText == "True";
}
catch
{
keepCustomFiles = false;
}
return true;
@ -145,7 +137,6 @@ namespace NaturalLauncher
xmlInfo.Add(new XElement("isXP", Launcher.isExperimental.ToString()));
xmlInfo.Add(new XElement("DiscordStatus", Launcher.discordCustomStatus));
xmlInfo.Add(new XElement("keeplauncherAlive", Launcher.keepLauncherAlive.ToString()));
xmlInfo.Add(new XElement("keepCustomFiles", Launcher.keepCustomFiles.ToString()));
var doc = new XDocument(new XDeclaration("1.0", "UTF-8", "yes"), xmlInfo);