diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs
index 84f9741..543d3fa 100644
--- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs
+++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs
@@ -1062,7 +1062,7 @@ namespace NovetusLauncher
}
}
- private static int GetSpecialNameID(string text)
+ public int GetSpecialNameID(string text)
{
string[] names = File.ReadAllLines(GlobalPaths.ConfigDir + "\\names-special.txt");
int returnname = 0;
diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs
index ed9c214..42fed45 100644
--- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs
+++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs
@@ -32,7 +32,6 @@ namespace NovetusLauncher
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LauncherFormStylish));
this.splashLabel = new System.Windows.Forms.Label();
this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
- this.launcherFormStylishInterface1 = new LauncherFormStylishInterface(this);
this.logoImageBox = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.logoImageBox)).BeginInit();
this.SuspendLayout();
@@ -64,7 +63,6 @@ namespace NovetusLauncher
this.elementHost1.Size = new System.Drawing.Size(707, 303);
this.elementHost1.TabIndex = 0;
this.elementHost1.Text = "elementHost1";
- this.elementHost1.Child = this.launcherFormStylishInterface1;
//
// logoImageBox
//
@@ -102,7 +100,6 @@ namespace NovetusLauncher
#endregion
private System.Windows.Forms.Integration.ElementHost elementHost1;
- private LauncherFormStylishInterface launcherFormStylishInterface1;
private System.Windows.Forms.Label splashLabel;
private System.Windows.Forms.PictureBox logoImageBox;
}
diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs
index 3166fdf..2538d4f 100644
--- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs
+++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs
@@ -13,9 +13,13 @@ namespace NovetusLauncher
{
public partial class LauncherFormStylish : Form
{
+ LauncherFormStylishInterface launcherFormStylishInterface1;
+
public LauncherFormStylish()
{
InitializeComponent();
+ launcherFormStylishInterface1 = new LauncherFormStylishInterface(this);
+ elementHost1.Child = launcherFormStylishInterface1;
}
private void LauncherFormStylish_Load(object sender, EventArgs e)
diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml
index bbba1ca..f29d240 100644
--- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml
+++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml
@@ -530,14 +530,14 @@
-
-
+
+
-
+
@@ -563,7 +563,7 @@
-
+
diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs
index 81987e6..a1f4bed 100644
--- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs
+++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs
@@ -24,7 +24,7 @@ namespace NovetusLauncher
{
public LauncherFormShared launcherForm;
private System.Windows.Forms.TreeView _fieldsTreeCache;
- private LauncherFormStylish FormParent;
+ public LauncherFormStylish FormParent;
public LauncherFormStylishInterface(LauncherFormStylish parent)
{
@@ -45,11 +45,14 @@ namespace NovetusLauncher
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
try
{
- if (e.Source is System.Windows.Controls.TabControl)
+ if (e.Source is TabItem)
{
- if (playTab != null && playTab.IsSelected)
+ if (e.Source == playTab && playTab.IsSelected)
{
launcherForm.RefreshMaps();
LoadMapDesc();
@@ -57,8 +60,7 @@ namespace NovetusLauncher
clientWarningBox.Text = "";
clientDescBox.Text = "";
}
-
- if (clientTab != null && clientTab.IsSelected)
+ else if (e.Source == clientTab && clientTab.IsSelected)
{
string clientdir = GlobalPaths.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
@@ -81,14 +83,21 @@ namespace NovetusLauncher
_fieldsTreeCache.Nodes.Clear();
mapsDescBox.Text = "";
}
+ else
+ {
+ clientListBox.Items.Clear();
+ clientWarningBox.Text = "";
+ clientDescBox.Text = "";
+ mapsBox.Nodes.Clear();
+ _fieldsTreeCache.Nodes.Clear();
+ mapsDescBox.Text = "";
+ }
}
}
catch (Exception ex)
{
GlobalFuncs.LogExceptions(ex);
}
-
- e.Handled = true;
}
public void LoadMapDesc()
@@ -105,6 +114,9 @@ namespace NovetusLauncher
private void mapsBox_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
if (mapsBox.SelectedNode != null)
{
mapsBox.SelectedNode.BackColor = System.Drawing.SystemColors.Control;
@@ -114,6 +126,9 @@ namespace NovetusLauncher
private void mapsBox_AfterSelect(object sender, TreeViewEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
if (mapsBox.SelectedNode != null)
{
mapsBox.SelectedNode.BackColor = System.Drawing.SystemColors.Highlight;
@@ -126,6 +141,9 @@ namespace NovetusLauncher
private void clientListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
if (clientListBox.Items.Count == 0)
return;
@@ -182,6 +200,9 @@ namespace NovetusLauncher
private void customizeButton_Click(object sender, RoutedEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
CharacterCustomizationExtended ccustom = new CharacterCustomizationExtended();
ccustom.Show();
}
@@ -218,7 +239,8 @@ namespace NovetusLauncher
private void regenerateIDButton_Click(object sender, RoutedEventArgs e)
{
-
+ GlobalFuncs.GeneratePlayerID();
+ userIDBox.Text = Convert.ToString(GlobalVars.UserConfiguration.UserID);
}
private void addMapButton_Click(object sender, RoutedEventArgs e)
@@ -240,14 +262,56 @@ namespace NovetusLauncher
private void refreshButton_Click(object sender, RoutedEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
launcherForm.RefreshMaps();
LoadMapDesc();
}
private void versionLabel_MouseDown(object sender, MouseButtonEventArgs e)
{
+ if (!IsLoaded)
+ return;
+
launcherForm.EasterEggLogic();
}
+
+ private void userNameBox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!IsLoaded)
+ return;
+
+ GlobalVars.UserConfiguration.PlayerName = userNameBox.Text;
+ int autoNameID = launcherForm.GetSpecialNameID(GlobalVars.UserConfiguration.PlayerName);
+ if (LocalVars.launcherInitState == false && autoNameID > 0)
+ {
+ userIDBox.Text = autoNameID.ToString();
+ }
+ }
+
+ private void userIDBox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (!IsLoaded)
+ return;
+
+ int parsedValue;
+ if (int.TryParse(userIDBox.Text, out parsedValue))
+ {
+ if (userIDBox.Text.Equals(""))
+ {
+ GlobalVars.UserConfiguration.UserID = 0;
+ }
+ else
+ {
+ GlobalVars.UserConfiguration.UserID = Convert.ToInt32(userIDBox.Text);
+ }
+ }
+ else
+ {
+ GlobalVars.UserConfiguration.UserID = 0;
+ }
+ }
}
public class ClientListItem
diff --git a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs
index a7c6f34..e92ae75 100644
--- a/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs
+++ b/Novetus/NovetusLauncher/NovetusLauncherEntryPoint.cs
@@ -26,19 +26,26 @@ namespace NovetusLauncher
GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false);
if (args.Length == 0)
{
- switch (GlobalVars.UserConfiguration.LauncherStyle)
- {
- case Settings.Style.Compact:
- System.Windows.Forms.Application.Run(new LauncherFormCompact());
- break;
- case Settings.Style.Extended:
- System.Windows.Forms.Application.Run(new LauncherFormExtended());
- break;
- case Settings.Style.Stylish:
- default:
- System.Windows.Forms.Application.Run(new LauncherFormStylish());
- break;
+ try
+ {
+ switch (GlobalVars.UserConfiguration.LauncherStyle)
+ {
+ case Settings.Style.Compact:
+ System.Windows.Forms.Application.Run(new LauncherFormCompact());
+ break;
+ case Settings.Style.Extended:
+ System.Windows.Forms.Application.Run(new LauncherFormExtended());
+ break;
+ case Settings.Style.Stylish:
+ default:
+ System.Windows.Forms.Application.Run(new LauncherFormStylish());
+ break;
+ }
}
+ catch(Exception ex)
+ {
+ GlobalFuncs.LogExceptions(ex);
+ }
}
else
{