added proper functionality for important launcher stuff

This commit is contained in:
Bitl 2021-09-20 18:01:52 -07:00
parent 310ff6a040
commit 5a85ccc150
10 changed files with 491 additions and 213 deletions

View File

@ -30,7 +30,8 @@ public class Settings
{
None = 0,
Extended = 1,
Compact = 2
Compact = 2,
Stylish = 3
}
public enum ClientLoadOptions

View File

@ -32,6 +32,5 @@
<Compile Include="$(MSBuildThisFileDirectory)WinForms\TabControlWithoutHeader.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)WinForms\TreeNodeHelper.cs" />
</ItemGroup>
</Project>

View File

@ -3,7 +3,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media;
#endregion
#region Tree Node Helper
@ -47,30 +50,6 @@ public static class TreeNodeHelper
return null;
}
public static string GetFolderNameFromPrefix(string source, string seperator = " -")
{
try
{
string result = source.Substring(0, source.IndexOf(seperator));
if (Directory.Exists(GlobalPaths.MapsDir + @"\\" + result))
{
return result + @"\\";
}
else
{
return "";
}
}
catch (Exception ex)
{
#if URI || LAUNCHER || CMD
GlobalFuncs.LogExceptions(ex);
#endif
return "";
}
}
public static void CopyNodes(TreeNodeCollection oldcollection, TreeNodeCollection newcollection)
{
foreach (TreeNode node in oldcollection)
@ -78,45 +57,5 @@ public static class TreeNodeHelper
newcollection.Add((TreeNode)node.Clone());
}
}
public static List<TreeNode> GetAllNodes(this TreeView _self)
{
List<TreeNode> result = new List<TreeNode>();
foreach (TreeNode child in _self.Nodes)
{
result.AddRange(child.GetAllNodes());
}
return result;
}
public static List<TreeNode> GetAllNodes(this TreeNode _self)
{
List<TreeNode> result = new List<TreeNode>();
result.Add(_self);
foreach (TreeNode child in _self.Nodes)
{
result.AddRange(child.GetAllNodes());
}
return result;
}
public static List<TreeNode> Ancestors(this TreeNode node)
{
return AncestorsInternal(node).Reverse().ToList();
}
public static List<TreeNode> AncestorsAndSelf(this TreeNode node)
{
return AncestorsInternal(node, true).Reverse().ToList();
}
private static IEnumerable<TreeNode> AncestorsInternal(TreeNode node, bool self = false)
{
if (self)
yield return node;
while (node.Parent != null)
{
node = node.Parent;
yield return node;
}
}
}
#endregion

View File

@ -67,7 +67,7 @@ namespace NovetusLauncher
try
{
NetFuncs.StartUPnP(device, protocol, port);
string IP = (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString());
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
GlobalFuncs.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3, ConsoleBox);
}
catch (Exception ex)
@ -85,7 +85,7 @@ namespace NovetusLauncher
try
{
NetFuncs.StopUPnP(device, protocol, port);
string IP = (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString());
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
GlobalFuncs.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3, ConsoleBox);
}
catch (Exception ex)
@ -101,7 +101,7 @@ namespace NovetusLauncher
try
{
INatDevice device = args.Device;
string IP = (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString());
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
GlobalFuncs.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3, ConsoleBox);
StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
@ -118,7 +118,7 @@ namespace NovetusLauncher
try
{
INatDevice device = args.Device;
string IP = (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString());
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
GlobalFuncs.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3, ConsoleBox);
StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
@ -184,22 +184,25 @@ namespace NovetusLauncher
GlobalFuncs.ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4, ConsoleBox);
GlobalFuncs.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 4, ConsoleBox);
if (File.Exists(GlobalPaths.RootPath + "\\changelog.txt"))
if (FormStyle != Settings.Style.Stylish)
{
ChangelogBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\changelog.txt");
}
else
{
GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\changelog.txt not found.", 2, ConsoleBox);
}
if (File.Exists(GlobalPaths.RootPath + "\\changelog.txt"))
{
ChangelogBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\changelog.txt");
}
else
{
GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\changelog.txt not found.", 2, ConsoleBox);
}
if (File.Exists(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT"))
{
ReadmeBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT");
}
else
{
GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT not found.", 2, ConsoleBox);
if (File.Exists(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT"))
{
ReadmeBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT");
}
else
{
GlobalFuncs.ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT not found.", 2, ConsoleBox);
}
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName))
@ -225,17 +228,26 @@ namespace NovetusLauncher
GlobalFuncs.CreateAssetCacheDirectories();
ProductVersionLabel.Text = Application.ProductVersion;
SetupImportantData();
NovetusVersionLabel.Text = GlobalVars.ProgramInformation.Version;
SplashLabel.Text = SplashReader.GetSplash();
LocalVars.prevsplash = SplashLabel.Text;
ReadConfigValues(true);
if (FormStyle != Settings.Style.Stylish)
{
ProductVersionLabel.Text = Application.ProductVersion;
NovetusVersionLabel.Text = GlobalVars.ProgramInformation.Version;
ReadConfigValues(true);
}
InitUPnP();
StartDiscord();
LocalVars.launcherInitState = false;
if (FormStyle != Settings.Style.Stylish)
{
LocalVars.launcherInitState = false;
}
}
public void CloseEvent()
@ -742,29 +754,20 @@ namespace NovetusLauncher
{
GlobalFuncs.ReadClientValues(ConsoleBox, initial);
switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{
case true:
PlayerNameTextBox.Enabled = true;
break;
case false:
PlayerNameTextBox.Enabled = false;
break;
}
PlayerNameTextBox.Enabled = GlobalVars.SelectedClientInfo.UsesPlayerName;
PlayerIDTextBox.Enabled = GlobalVars.SelectedClientInfo.UsesID;
RegeneratePlayerIDButton.Enabled = GlobalVars.SelectedClientInfo.UsesID;
switch (GlobalVars.SelectedClientInfo.UsesID)
{
case true:
PlayerIDTextBox.Enabled = true;
RegeneratePlayerIDButton.Enabled = true;
if (GlobalVars.IP.Equals("localhost"))
{
LocalPlayCheckBox.Enabled = true;
}
break;
case false:
PlayerIDTextBox.Enabled = false;
RegeneratePlayerIDButton.Enabled = false;
LocalPlayCheckBox.Enabled = false;
GlobalVars.LocalPlayMode = false;
break;
@ -860,13 +863,10 @@ namespace NovetusLauncher
TreeNodeHelper.CopyNodes(Tree.Nodes, _TreeCache.Nodes);
Tree.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.UserConfiguration.Map, Tree.Nodes);
Tree.Focus();
if (File.Exists(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt"))
if (FormStyle != Settings.Style.Stylish)
{
MapDescBox.Text = File.ReadAllText(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt");
}
else
{
MapDescBox.Text = Tree.SelectedNode.Text.ToString();
LoadMapDesc();
}
}
@ -893,19 +893,27 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.Map = Tree.SelectedNode.Text.ToString();
GlobalVars.UserConfiguration.MapPathSnip = Tree.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
GlobalVars.UserConfiguration.MapPath = GlobalPaths.BasePath + @"\\" + GlobalVars.UserConfiguration.MapPathSnip;
SelectedMapLabel.Text = GlobalVars.UserConfiguration.Map;
if (File.Exists(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt"))
if (FormStyle != Settings.Style.Stylish)
{
MapDescBox.Text = File.ReadAllText(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt");
}
else
{
MapDescBox.Text = Tree.SelectedNode.Text.ToString();
SelectedMapLabel.Text = GlobalVars.UserConfiguration.Map;
LoadMapDesc();
}
}
}
private void LoadMapDesc()
{
if (File.Exists(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt"))
{
MapDescBox.Text = File.ReadAllText(GlobalPaths.RootPath + @"\\" + Tree.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt");
}
else
{
MapDescBox.Text = Tree.SelectedNode.Text.ToString();
}
}
public void AddIPPortListing(ListBox box, string file, object val)
{
File.AppendAllText(file, val + Environment.NewLine);
@ -983,16 +991,43 @@ namespace NovetusLauncher
public void ChangeClient()
{
if (ClientBox.Items.Count == 0)
return;
string clientdir = GlobalPaths.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
List<string> clientNameList = new List<string>();
foreach (DirectoryInfo dir in Dirs)
{
clientNameList.Add(dir.Name);
}
if (ClientBox.Items.Count == (clientNameList.Count - 1))
return;
if (ClientBox.SelectedItem == null)
return;
string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient;
GlobalVars.UserConfiguration.SelectedClient = ClientBox.SelectedItem.ToString();
if (!ourselectedclient.Equals(GlobalVars.UserConfiguration.SelectedClient))
if (!string.IsNullOrWhiteSpace(ourselectedclient))
{
ReadClientValues(true);
if (!ourselectedclient.Equals(GlobalVars.UserConfiguration.SelectedClient))
{
ReadClientValues(true);
}
else
{
ReadClientValues();
}
}
else
{
ReadClientValues();
return;
}
GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "");
FormCollection fc = Application.OpenForms;

View File

@ -32,7 +32,7 @@ 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.launcherFormStylishInterface1 = new LauncherFormStylishInterface(this);
this.logoImageBox = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.logoImageBox)).BeginInit();
this.SuspendLayout();
@ -94,9 +94,9 @@ namespace NovetusLauncher
this.Name = "LauncherFormStylish";
this.Text = "Novetus";
this.Load += new System.EventHandler(this.LauncherFormStylish_Load);
this.Closing += new System.ComponentModel.CancelEventHandler(this.LauncherFormStylish_Close);
((System.ComponentModel.ISupportInitialize)(this.logoImageBox)).EndInit();
this.ResumeLayout(false);
}
#endregion

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
@ -19,22 +20,72 @@ namespace NovetusLauncher
private void LauncherFormStylish_Load(object sender, EventArgs e)
{
CryptoRandom rand = new CryptoRandom();
int randColor = rand.Next(0, 2);
switch (randColor)
try
{
case 0:
//orange message
//splash loader
CryptoRandom rand = new CryptoRandom();
int randColor = rand.Next(0, 3);
if (randColor == 0)
{
splashLabel.BackColor = Color.FromArgb(245, 135, 13);
break;
case 1:
//red message
}
else if (randColor == 1)
{
splashLabel.BackColor = Color.FromArgb(255, 3, 2);
break;
default:
break;
}
else if (randColor == 2)
{
splashLabel.BackColor = Color.FromArgb(238, 154, 181);
}
launcherFormStylishInterface1.mapsBox.BackColor = Color.FromArgb(237, 237, 237);
launcherFormStylishInterface1.launcherForm.SplashLabel = splashLabel;
launcherFormStylishInterface1.launcherForm.InitForm();
if (File.Exists(GlobalPaths.RootPath + "\\changelog.txt"))
{
launcherFormStylishInterface1.changelogBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\changelog.txt");
}
if (File.Exists(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT"))
{
launcherFormStylishInterface1.readmeBox.Text = File.ReadAllText(GlobalPaths.RootPath + "\\README-AND-CREDITS.TXT");
}
launcherFormStylishInterface1.versionLabel.Content = Application.ProductVersion;
launcherFormStylishInterface1.versionNovetusLabel.Content = GlobalVars.ProgramInformation.Version;
if (launcherFormStylishInterface1.playTab != null && launcherFormStylishInterface1.playTab.IsSelected)
{
if (launcherFormStylishInterface1.mapsBox.Nodes.Count == 0)
{
launcherFormStylishInterface1.launcherForm.RefreshMaps();
launcherFormStylishInterface1.LoadMapDesc();
}
}
ReadConfigValues(true);
LocalVars.launcherInitState = false;
CenterToScreen();
}
catch (Exception ex)
{
GlobalFuncs.LogExceptions(ex);
}
}
void LauncherFormStylish_Close(object sender, CancelEventArgs e)
{
WriteConfigValues();
if (GlobalVars.UserConfiguration.DiscordPresence)
{
DiscordRPC.Shutdown();
}
Application.Exit();
}
void splashLabel_Paint(object sender, PaintEventArgs e)
@ -51,5 +102,60 @@ namespace NovetusLauncher
color, width, style,
color, width, style);
}
public void ReadConfigValues(bool initial = false)
{
GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false);
//CloseOnLaunchCheckbox.Checked = GlobalVars.UserConfiguration.CloseOnLaunch;
launcherFormStylishInterface1.userIDBox.Text = GlobalVars.UserConfiguration.UserID.ToString();
launcherFormStylishInterface1.tripcodeLabel.Content = GlobalVars.UserConfiguration.PlayerTripcode.ToString();
launcherFormStylishInterface1.maxPlayersBox.Text = GlobalVars.UserConfiguration.PlayerLimit.ToString();
launcherFormStylishInterface1.userNameBox.Text = GlobalVars.UserConfiguration.PlayerName;
//SelectedClientLabel.Text = GlobalVars.UserConfiguration.SelectedClient;
//SelectedMapLabel.Text = GlobalVars.UserConfiguration.Map;
//Tree.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.UserConfiguration.Map, Tree.Nodes);
//Tree.Focus();
launcherFormStylishInterface1.joinPortBox.Text = GlobalVars.JoinPort.ToString();
launcherFormStylishInterface1.serverPortBox.Text = GlobalVars.UserConfiguration.RobloxPort.ToString();
//DiscordPresenceCheckbox.Checked = GlobalVars.UserConfiguration.DiscordPresence;
launcherFormStylishInterface1.uPnPBox.IsChecked = GlobalVars.UserConfiguration.UPnP;
launcherFormStylishInterface1.NotifBox.IsChecked = GlobalVars.UserConfiguration.ShowServerNotifications;
launcherFormStylishInterface1.browserNameBox.Text = GlobalVars.UserConfiguration.ServerBrowserServerName;
launcherFormStylishInterface1.browserAddressBox.Text = GlobalVars.UserConfiguration.ServerBrowserServerAddress;
ReadClientValues(initial);
}
public void WriteConfigValues(bool ShowBox = false)
{
GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true);
ReadClientValues();
if (ShowBox)
{
MessageBox.Show("Config Saved!", "Novetus - Config Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
public void ReadClientValues(bool initial = false)
{
GlobalFuncs.ReadClientValues(null, initial);
launcherFormStylishInterface1.userNameBox.IsEnabled = GlobalVars.SelectedClientInfo.UsesPlayerName;
launcherFormStylishInterface1.userIDBox.IsEnabled = GlobalVars.SelectedClientInfo.UsesID;
launcherFormStylishInterface1.regenerateIDButton.IsEnabled = GlobalVars.SelectedClientInfo.UsesID;
if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning))
{
launcherFormStylishInterface1.clientWarningBox.Text = GlobalVars.SelectedClientInfo.Warning;
}
else
{
launcherFormStylishInterface1.clientWarningBox.Text = "";
}
launcherFormStylishInterface1.clientDescBox.Text = GlobalVars.SelectedClientInfo.Description;
//SelectedClientLabel.Text = GlobalVars.UserConfiguration.SelectedClient;
}
}
}

View File

@ -4,10 +4,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:properties="clr-namespace:NovetusLauncher.Properties"
xmlns:local="clr-namespace:NovetusLauncher"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
mc:Ignorable="d"
Height="299.569" Width="695.158">
<UserControl.Resources>
<Style x:Key="TabItemStyleSeperators" TargetType="{x:Type TabItem}">
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
@ -34,10 +38,11 @@
</Style>
<Style x:Key="TabItemStyleNoSeperators" TargetType="{x:Type TabItem}">
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border x:Name="Border" BorderThickness="0,0,0,0" HorizontalAlignment="Center" BorderBrush="White" >
<Border x:Name="Border2" BorderThickness="45,1,45,1" HorizontalAlignment="Center">
<Grid Name="Panel">
@ -99,6 +104,7 @@
<Setter Property="Background" Value="#F4CC35" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="FontSize" Value="18" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
@ -132,6 +138,7 @@
<Setter Property="Background" Value="#F4CC35" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="FontSize" Value="13" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
@ -361,43 +368,6 @@
</Setter>
</Style>
<Style x:Key="RegenButton" TargetType="{x:Type Button}">
<Setter Property="Background" Value="#FF761A91" />
<Setter Property="BorderBrush" Value="#FF761A91" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontFamily" Value="Helvetica" />
<Setter Property="FontSize" Value="10" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="#FF761A91" BorderThickness="1">
<Grid>
<ContentPresenter x:Name="MyContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFB96AD1" />
<Setter Property="BorderBrush" Value="#FFB96AD1" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FF430E53" />
<Setter Property="BorderBrush" Value="#FF430E53" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Helvetica" />
@ -405,6 +375,7 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Background" Value="#FFEDEDED"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
@ -446,13 +417,47 @@
</VisualBrush.Visual>
</VisualBrush>
</Border.BorderBrush>
<ScrollViewer Margin="0" x:Name="PART_ContentHost" Background="#FFEDEDED"/>
<ScrollViewer Margin="0"
Focusable="false" Background="#FFEDEDED">
<StackPanel Margin="2"
IsItemsHost="True" />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="FontFamily" Value="Comic Sans MS" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="_Border"
Padding="2"
SnapsToDevicePixels="true">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="_Border" Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}"/>
</Setter.Value>
</Setter>
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.HighlightTextColorKey}}"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TreeView}">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Helvetica" />
@ -473,7 +478,11 @@
</VisualBrush.Visual>
</VisualBrush>
</Border.BorderBrush>
<ScrollViewer Margin="0" x:Name="PART_ContentHost" Background="#FFEDEDED"/>
<ScrollViewer Focusable="False"
CanContentScroll="False"
Padding="4" Background="#FFEDEDED">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
@ -482,12 +491,14 @@
<Style TargetType="{x:Type CheckBox}">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<Style TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
@ -518,51 +529,66 @@
</Style>
</UserControl.Resources>
<TabControl x:Name="tabControl" HorizontalAlignment="Center" Height="295" Margin="0,0
,0,0" Width="689" BorderBrush="{x:Null}" Background="#FF294E64">
<TabItem Header="PLAY" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True" FontSize="18" FontFamily="Comic Sans MS">
<TabControl x:Name="tabControl" HorizontalAlignment="Center" Height="295" Margin="0,0,0,0" Width="689" BorderBrush="{x:Null}" Background="#FF294E64" SelectionChanged="TabControl_SelectionChanged">
<TabItem x:Name="playTab" Header="PLAY" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True">
<Grid Background="#FFEDEDED">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="101*"/>
<ColumnDefinition Width="584*"/>
<ColumnDefinition Width="135*"/>
<ColumnDefinition Width="447*"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="userInfoGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="120" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="163" Grid.ColumnSpan="2"/>
<Button x:Name="regenerateIDButton" Style="{DynamicResource RegenButton}" Content="Regen" HorizontalAlignment="Left" Margin="21,81,0,0" VerticalAlignment="Top" Width="39" Height="21" RenderTransformOrigin="0.42,0.512" Grid.Column="1"/>
<Button x:Name="regenerateIDButton" Content="Regen" HorizontalAlignment="Left" Margin="21,82,0,0" VerticalAlignment="Top" Width="39" Height="19" RenderTransformOrigin="0.42,0.512" Grid.Column="1"/>
<TextBox x:Name="userNameBox" HorizontalAlignment="Left" Height="20" Margin="66,53,0,0" TextWrapping="Wrap" Text="Player" VerticalAlignment="Top" Width="95" Grid.ColumnSpan="2"/>
<Rectangle x:Name="joinServerGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="120" Margin="6,135,0,0" Stroke="Black" VerticalAlignment="Top" Width="163" Grid.ColumnSpan="2"/>
<Rectangle x:Name="joinServerLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="6,135,0,0" Stroke="Black" VerticalAlignment="Top" Width="163" Grid.ColumnSpan="2"/>
<Rectangle x:Name="userInfoLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="163" Grid.ColumnSpan="2"/>
<Label x:Name="userInfoLabel" Content="User Info" HorizontalAlignment="Left" Margin="44,9,0,0" VerticalAlignment="Top" FontSize="15" Grid.ColumnSpan="2" Width="87"/>
<Label x:Name="userInfoLabel" Content="User Info" HorizontalAlignment="Left" Margin="44,10,0,0" VerticalAlignment="Top" FontSize="15" Grid.ColumnSpan="2" Width="95"/>
<Label x:Name="userName" Content="Name:" HorizontalAlignment="Left" Margin="16,47,0,0" VerticalAlignment="Top" FontSize="12" Height="29" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBox x:Name="userIDBox" HorizontalAlignment="Left" Height="20" Margin="66,81,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="51" Grid.ColumnSpan="2"/>
<Label x:Name="userID" Content="ID:" HorizontalAlignment="Left" Margin="26,75,0,0" VerticalAlignment="Top" FontSize="12" Height="29" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label x:Name="joinServerLabel" Content="Join Server" HorizontalAlignment="Left" Margin="37,134,0,0" VerticalAlignment="Top" FontSize="15" Width="102" Grid.ColumnSpan="2"/>
<TextBox x:Name="ipAddressBox" HorizontalAlignment="Left" Height="20" Margin="26,186,0,0" TextWrapping="Wrap" Text="localhost" VerticalAlignment="Top" Width="120" Grid.ColumnSpan="2"/>
<Label x:Name="ipAddressLabel" Content="Server IP Address:" HorizontalAlignment="Left" Margin="29,165,0,0" VerticalAlignment="Top" FontSize="12" Height="29" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.ColumnSpan="2"/>
<Label x:Name="ipAddressLabel" Content="Server IP Address:" HorizontalAlignment="Left" Margin="27,165,0,0" VerticalAlignment="Top" FontSize="12" Height="29" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.ColumnSpan="2"/>
<TextBox x:Name="joinPortBox" HorizontalAlignment="Left" Height="20" Margin="26,221,0,0" TextWrapping="Wrap" Text="53640" VerticalAlignment="Top" Width="120" Grid.ColumnSpan="2"/>
<Label x:Name="joinPortLabel" Content="Server Port" HorizontalAlignment="Left" Margin="44,199,0,0" VerticalAlignment="Top" FontSize="12" Height="27" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="86" Grid.ColumnSpan="2"/>
<Button x:Name="joinButton" Style="{DynamicResource JoinButton}" Content="" HorizontalAlignment="Left" Margin="238,192,0,0" VerticalAlignment="Top" Width="91" Height="33" Grid.Column="1" RenderTransformOrigin="0.227,0.54"/>
<Button x:Name="serverBrowserButton" Style="{DynamicResource ImportantButton}" Content="Browse Servers" HorizontalAlignment="Left" Margin="262,229,0,0" VerticalAlignment="Top" Width="156" Height="26" Grid.Column="1" RenderTransformOrigin="0.645,-0.075"/>
<Rectangle x:Name="hostServerGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="245" Margin="72,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1"/>
<Rectangle x:Name="hostServerLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="72,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1"/>
<Label x:Name="hostServerLabel" Content="Host Server" HorizontalAlignment="Left" Margin="100,9,0,0" VerticalAlignment="Top" FontSize="15" Width="98" Grid.Column="1" RenderTransformOrigin="0.561,0.175"/>
<Button x:Name="playSoloButton" Style="{DynamicResource SoloButton}" Content="" HorizontalAlignment="Left" Margin="348,192,0,0" VerticalAlignment="Top" Width="92" Height="32" Grid.Column="1" RenderTransformOrigin="1.3,0.863"/>
<TextBox x:Name="ServerInfo" Grid.Column="1" HorizontalAlignment="Left" Height="94" Margin="79,45,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="139"/>
<Button x:Name="StudioButton" Style="{DynamicResource StudioButton}" Content="" HorizontalAlignment="Left" Margin="474,192,0,0" VerticalAlignment="Top" Width="90" Height="32" Grid.Column="1" RenderTransformOrigin="1.3,0.863"/>
<Button x:Name="ServerButton" Style="{DynamicResource HostButton}" Content="" HorizontalAlignment="Left" Margin="474,227,0,0" VerticalAlignment="Top" Width="90" Height="31" Grid.Column="1" RenderTransformOrigin="1.3,0.863"/>
<Rectangle x:Name="mapsGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="179" Margin="230,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="344" Grid.Column="1"/>
<Rectangle x:Name="mapsLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="230,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="344" Grid.Column="1"/>
<Label x:Name="mapsLabel" Content="Places" HorizontalAlignment="Left" Margin="388,9,0,0" VerticalAlignment="Top" FontSize="15" Width="52" Grid.Column="1"/>
<TextBox x:Name="mapsDescBox" Grid.Column="1" HorizontalAlignment="Left" Height="54" Margin="238,128,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="329" IsReadOnly="True" HorizontalContentAlignment="Left" VerticalContentAlignment="Top"/>
<TreeView x:Name="mapsBox" Grid.Column="1" HorizontalAlignment="Left" Height="61" Margin="238,64,0,0" VerticalAlignment="Top" Width="329"/>
<TextBox x:Name="searchBox" Grid.Column="1" HorizontalAlignment="Left" Height="20" Margin="238,42,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="207" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True"/>
<Button x:Name="searchButton" Style="{DynamicResource SearchButton}" Content="" Grid.Column="1" HorizontalAlignment="Left" Margin="450,43,0,0" VerticalAlignment="Top" Width="19" Height="19"/>
<Button x:Name="refreshButton" Style="{DynamicResource RefreshButton}" Content="" Grid.Column="1" HorizontalAlignment="Left" Margin="474,45,0,0" VerticalAlignment="Top" Width="16" Height="16"/>
<Button x:Name="addMapButton" Content="Add Place" Grid.Column="1" HorizontalAlignment="Left" Margin="495,45,0,0" VerticalAlignment="Top" Width="72"/>
<Label x:Name="joinPortLabel" Content="Join Port" HorizontalAlignment="Left" Margin="44,199,0,0" VerticalAlignment="Top" FontSize="12" Height="27" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="86" Grid.ColumnSpan="2"/>
<Button x:Name="joinButton" Style="{DynamicResource JoinButton}" Content="" HorizontalAlignment="Left" Margin="103.166,192,0,0" VerticalAlignment="Top" Width="91" Height="33" Grid.Column="2" RenderTransformOrigin="0.227,0.54"/>
<Button x:Name="serverBrowserButton" Style="{DynamicResource ImportantButton}" Content="Browse Servers" HorizontalAlignment="Left" Margin="131.166,229,0,0" VerticalAlignment="Top" Width="156" Height="26" Grid.Column="2" RenderTransformOrigin="0.645,-0.075"/>
<Rectangle x:Name="hostServerGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="130" Margin="72,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1" Grid.ColumnSpan="2"/>
<Rectangle x:Name="hostServerLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="72,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1" Grid.ColumnSpan="2"/>
<Label x:Name="hostServerLabel" Content="Host Server" HorizontalAlignment="Left" Margin="100,9,0,0" VerticalAlignment="Top" FontSize="15" Width="98" Grid.Column="1" RenderTransformOrigin="0.561,0.175" Grid.ColumnSpan="2"/>
<Button x:Name="playSoloButton" Style="{DynamicResource SoloButton}" Content="" HorizontalAlignment="Left" Margin="213.166,192,0,0" VerticalAlignment="Top" Width="92" Height="32" Grid.Column="2" RenderTransformOrigin="1.3,0.863"/>
<Button x:Name="StudioButton" Style="{DynamicResource StudioButton}" Content="" HorizontalAlignment="Left" Margin="339.166,192,0,0" VerticalAlignment="Top" Width="90" Height="32" Grid.Column="2" RenderTransformOrigin="1.3,0.863"/>
<Button x:Name="ServerButton" Style="{DynamicResource HostButton}" Content="" HorizontalAlignment="Left" Margin="339.166,227,0,0" VerticalAlignment="Top" Width="90" Height="31" Grid.Column="2" RenderTransformOrigin="1.3,0.863"/>
<Rectangle x:Name="mapsGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="179" Margin="95.166,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="344" Grid.Column="2"/>
<Rectangle x:Name="mapsLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="95.166,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="344" Grid.Column="2"/>
<Label x:Name="mapsLabel" Content="Places" HorizontalAlignment="Left" Margin="253.166,9,0,0" VerticalAlignment="Top" FontSize="15" Width="52" Grid.Column="2"/>
<TextBox x:Name="mapsDescBox" Grid.Column="2" HorizontalAlignment="Left" Height="120" Margin="298.166,64,0,0" TextWrapping="Wrap" FontFamily="Comic Sans MS" FontSize="12" VerticalAlignment="Top" Width="131" IsReadOnly="True" HorizontalContentAlignment="Left" VerticalContentAlignment="Top"/>
<WindowsFormsHost Height="120" Margin="103.166,64,154,76" Width="190" Grid.Column="2" FontFamily="Comic Sans MS" FontSize="9" Background="#FFEDEDED">
<wf:TreeView x:Name="mapsBox" AfterSelect="mapsBox_AfterSelect" BeforeSelect="mapsBox_BeforeSelect"/>
</WindowsFormsHost>
<TextBox x:Name="searchBox" Grid.Column="2" HorizontalAlignment="Left" Height="20" Margin="103.166,42,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="207" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True"/>
<Button x:Name="searchButton" Style="{DynamicResource SearchButton}" Content="" Grid.Column="2" HorizontalAlignment="Left" Margin="315.166,43,0,0" VerticalAlignment="Top" Width="19" Height="19"/>
<Button x:Name="refreshButton" Style="{DynamicResource RefreshButton}" Content="" Grid.Column="2" HorizontalAlignment="Left" Margin="339.166,45,0,0" VerticalAlignment="Top" Width="16" Height="16"/>
<Button x:Name="addMapButton" Content="Add Place" Grid.Column="2" HorizontalAlignment="Left" Margin="360.166,45,0,0" VerticalAlignment="Top" Width="72"/>
<Button x:Name="customizeButton" Style="{DynamicResource ImportantButtonSmall}" Content="Customize Character" HorizontalAlignment="Left" Margin="16,105,0,0" VerticalAlignment="Top" Width="145" Grid.ColumnSpan="2"/>
<Label x:Name="serverPortLabel" Content="Host Port:" Grid.Column="1" HorizontalAlignment="Left" Margin="78,43,0,0" VerticalAlignment="Top" Width="68" Grid.ColumnSpan="2"/>
<TextBox x:Name="serverPortBox" HorizontalAlignment="Left" Height="20" Margin="16.166,47,0,0" TextWrapping="Wrap" Text="53640" VerticalAlignment="Top" Width="65" Grid.Column="2"/>
<Label x:Name="maxPlayersLabel" Content="Max Players:" Grid.Column="1" HorizontalAlignment="Left" Margin="68,64,0,0" VerticalAlignment="Top" Width="86" Grid.ColumnSpan="2"/>
<TextBox x:Name="maxPlayersBox" HorizontalAlignment="Left" Height="20" Margin="16.166,71,0,0" TextWrapping="Wrap" Text="12" VerticalAlignment="Top" Width="66" Grid.Column="2" RenderTransformOrigin="0.525,-0.722"/>
<CheckBox x:Name="uPnPBox" Content="uPnP" Grid.Column="1" HorizontalAlignment="Left" Margin="78,93,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="NotifBox" Content="Join Alerts" Grid.Column="1" HorizontalAlignment="Left" Margin="134,93,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
<Button x:Name="serverInfoButton" Content="Server Information" Grid.Column="1" HorizontalAlignment="Left" Margin="78,113,0,0" VerticalAlignment="Top" Width="139" Grid.ColumnSpan="2"/>
<Rectangle x:Name="hostServerBrowserGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="110" Margin="74,145,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1" Grid.ColumnSpan="2"/>
<Rectangle x:Name="hostServerBrowserLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="74,145,0,0" Stroke="Black" VerticalAlignment="Top" Width="153" Grid.Column="1" Grid.ColumnSpan="2"/>
<Label x:Name="hostServerBrowserLabel" Content="Optional Hosting Settings" HorizontalAlignment="Left" Margin="77,148,0,0" VerticalAlignment="Top" Width="145" Grid.Column="1" RenderTransformOrigin="0.561,0.175" FontSize="11" Grid.ColumnSpan="2"/>
<Label x:Name="browserNameLabel" Content="Server Name:" Grid.Column="1" HorizontalAlignment="Left" Margin="101,171,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
<TextBox x:Name="browserNameBox" HorizontalAlignment="Left" Height="20" Margin="82,192,0,0" TextWrapping="Wrap" Text="Novetus" VerticalAlignment="Top" Width="135" Grid.Column="1" Grid.ColumnSpan="2"/>
<Label x:Name="browserAddressLabel" Content="Browser Master Server:" Grid.Column="1" HorizontalAlignment="Left" Margin="77,206,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
<TextBox x:Name="browserAddressBox" HorizontalAlignment="Left" Height="20" Margin="82,227,0,0" TextWrapping="Wrap" Text="localhost" VerticalAlignment="Top" Width="135" Grid.Column="1" Grid.ColumnSpan="2"/>
</Grid>
</TabItem>
<TabItem Header="VERSIONS" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True" FontSize="18" FontFamily="Comic Sans MS">
<TabItem x:Name="clientTab" Header="VERSIONS" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True">
<Grid Background="#FFEDEDED">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="37*"/>
@ -570,22 +596,30 @@
<ColumnDefinition Width="409*"/>
</Grid.ColumnDefinitions>
<Rectangle Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="245" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669" Grid.ColumnSpan="3"/>
<ListBox x:Name="clientListBox" HorizontalAlignment="Left" Height="76" Margin="18,45,0,0" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3"/>
<TextBox x:Name="clientWarningBox" HorizontalAlignment="Left" Height="47" Margin="18,126,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3" IsReadOnly="True" Foreground="Red" FontWeight="Bold" Text="THIS IS A TEST"/>
<TextBox x:Name="clientDescBox" HorizontalAlignment="Left" Height="65" Margin="18,178,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3" IsReadOnly="True"/>
<Rectangle x:Name="clientLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669" Grid.ColumnSpan="3"/>
<Label x:Name="clientLabel" Content="Versions" HorizontalAlignment="Left" Margin="37,10,0,0" VerticalAlignment="Top" FontSize="15" Width="68" RenderTransformOrigin="0.561,0.175" Grid.Column="2"/>
<ListBox x:Name="clientListBox" HorizontalAlignment="Left" Height="102" Margin="18,19,0,0" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" SelectionChanged="clientListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding ClientName}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBox x:Name="clientWarningBox" HorizontalAlignment="Left" Height="47" Margin="18,126,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3" IsReadOnly="True" Foreground="Red" FontWeight="Bold" Text="CLIENT WARNING" FontSize="10"/>
<TextBox x:Name="clientDescBox" HorizontalAlignment="Left" Height="65" Margin="18,178,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="646" Grid.ColumnSpan="3" IsReadOnly="True" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" FontFamily="Comic Sans MS"/>
</Grid>
</TabItem>
<TabItem Header="CHANGES" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True" FontSize="18" FontFamily="Comic Sans MS">
<TabItem x:Name="changesTab" Header="CHANGES" Style="{DynamicResource TabItemStyleSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True">
<Grid Background="#FFEDEDED">
<Rectangle x:Name="changelogGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="245" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669"/>
<Rectangle x:Name="changelogLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669"/>
<Label x:Name="changelogLabel" Content="Changelog" HorizontalAlignment="Left" Margin="303,10,0,0" VerticalAlignment="Top" FontSize="15" Width="98" RenderTransformOrigin="0.561,0.175"/>
<TextBox x:Name="changelogBox" HorizontalAlignment="Left" Height="200" Margin="18,45,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="646" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True"/>
<TextBox x:Name="changelogBox" HorizontalAlignment="Left" Height="225" Margin="18,20,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="646" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True" FontFamily="Comic Sans MS"/>
</Grid>
</TabItem>
<TabItem Header="OPTIONS" Style="{DynamicResource TabItemStyleNoSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True" FontSize="18" FontFamily="Comic Sans MS">
<TabItem x:Name="optionsTab" Header="OPTIONS" Style="{DynamicResource TabItemStyleNoSeperators}" BorderBrush="{x:Null}" Background="#FF294E64" Foreground="White" IsSelected="True">
<Grid Background="#FFEDEDED">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="439*"/>
@ -594,7 +628,7 @@
<Rectangle x:Name="optionsGroupBox" Fill="#FFDEDCDC" HorizontalAlignment="Left" Height="96" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669" Grid.ColumnSpan="2"/>
<Rectangle x:Name="optionsLabelBox" Fill="#FFAAA8A8" HorizontalAlignment="Left" Height="30" Margin="6,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="669" Grid.ColumnSpan="2"/>
<Label x:Name="optionsLabel" Content="Options" HorizontalAlignment="Left" Margin="317,10,0,0" VerticalAlignment="Top" FontSize="15" Width="65" RenderTransformOrigin="0.561,0.175"/>
<TextBox x:Name="readmeBox" HorizontalAlignment="Left" Height="115" Margin="6,111,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="667" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True" Grid.ColumnSpan="2"/>
<TextBox x:Name="readmeBox" HorizontalAlignment="Left" Height="115" Margin="6,111,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="667" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" IsReadOnly="True" Grid.ColumnSpan="2" FontFamily="Comic Sans MS"/>
<Label x:Name="versionLabel" Content="1.0" HorizontalAlignment="Left" Margin="6,235,0,-4" VerticalAlignment="Top" Width="194" BorderThickness="0" BorderBrush="#FF6E6E6E" VerticalContentAlignment="Top" HorizontalContentAlignment="Center" Height="29"/>
<Label x:Name="tripcodeLabel" Content="abcdefghijklmopqrstuvwxyz" HorizontalAlignment="Left" Margin="205,231,0,0" VerticalAlignment="Top" Width="270" Grid.ColumnSpan="2"/>
<Label x:Name="codenameLabel" Content="PROJECT STARLIGHT" HorizontalAlignment="Left" Margin="41.096,231,0,0" VerticalAlignment="Top" Width="193" Grid.Column="1"/>

View File

@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
@ -17,11 +19,172 @@ namespace NovetusLauncher
/// <summary>
/// Interaction logic for LauncherFormStylishInterface.xaml
/// </summary>
public partial class LauncherFormStylishInterface : UserControl
///
public partial class LauncherFormStylishInterface : System.Windows.Controls.UserControl
{
public LauncherFormStylishInterface()
public LauncherFormShared launcherForm;
private System.Windows.Forms.TreeView _fieldsTreeCache;
private LauncherFormStylish FormParent;
public LauncherFormStylishInterface(LauncherFormStylish parent)
{
_fieldsTreeCache = new System.Windows.Forms.TreeView();
InitializeComponent();
FormParent = parent;
InitStylishForm(FormParent);
}
private void InitStylishForm(Form parent)
{
launcherForm = new LauncherFormShared();
launcherForm.Parent = parent;
launcherForm.FormStyle = Settings.Style.Stylish;
launcherForm.Tree = mapsBox;
launcherForm._TreeCache = _fieldsTreeCache;
}
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
if (e.Source is System.Windows.Controls.TabControl)
{
if (playTab != null && playTab.IsSelected)
{
launcherForm.RefreshMaps();
LoadMapDesc();
clientListBox.Items.Clear();
clientWarningBox.Text = "";
clientDescBox.Text = "";
}
if (clientTab != null && clientTab.IsSelected)
{
string clientdir = GlobalPaths.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
foreach (DirectoryInfo dir in Dirs)
{
clientListBox.Items.Add(new ClientListItem() { ClientName = dir.Name });
}
foreach (object o in clientListBox.Items)
{
if ((o is ClientListItem) && (o as ClientListItem).ClientName.Contains(GlobalVars.UserConfiguration.SelectedClient))
{
clientListBox.SelectedItem = o;
break;
}
}
mapsBox.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
mapsDescBox.Text = "";
}
}
}
catch (Exception ex)
{
GlobalFuncs.LogExceptions(ex);
}
e.Handled = true;
}
public void LoadMapDesc()
{
if (File.Exists(GlobalPaths.RootPath + @"\\" + mapsBox.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt"))
{
mapsDescBox.Text = File.ReadAllText(GlobalPaths.RootPath + @"\\" + mapsBox.SelectedNode.FullPath.ToString().Replace(".rbxl", "").Replace(".rbxlx", "") + "_desc.txt");
}
else
{
mapsDescBox.Text = mapsBox.SelectedNode.Text.ToString();
}
}
private void mapsBox_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
if (mapsBox.SelectedNode != null)
{
mapsBox.SelectedNode.BackColor = System.Drawing.SystemColors.Control;
mapsBox.SelectedNode.ForeColor = System.Drawing.SystemColors.ControlText;
}
}
private void mapsBox_AfterSelect(object sender, TreeViewEventArgs e)
{
if (mapsBox.SelectedNode != null)
{
mapsBox.SelectedNode.BackColor = System.Drawing.SystemColors.Highlight;
mapsBox.SelectedNode.ForeColor = System.Drawing.SystemColors.HighlightText;
}
launcherForm.SelectMap();
LoadMapDesc();
}
private void clientListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (clientListBox.Items.Count == 0)
return;
string clientdir = GlobalPaths.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
List<string> clientNameList = new List<string>();
foreach (DirectoryInfo dir in Dirs)
{
clientNameList.Add(dir.Name);
}
if (clientListBox.Items.Count == (clientNameList.Count - 1))
return;
if (clientListBox.SelectedItem == null)
return;
string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient;
ClientListItem cli = (ClientListItem)clientListBox.SelectedItem ?? null;
GlobalVars.UserConfiguration.SelectedClient = (cli != null) ? cli.ToString() : "";
if (!string.IsNullOrWhiteSpace(ourselectedclient))
{
if (!ourselectedclient.Equals(GlobalVars.UserConfiguration.SelectedClient))
{
FormParent.ReadClientValues(true);
}
else
{
FormParent.ReadClientValues();
}
}
else
{
return;
}
GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "");
FormCollection fc = System.Windows.Forms.Application.OpenForms;
foreach (Form frm in fc)
{
//iterate through
if (frm.Name == "CustomGraphicsOptions")
{
frm.Close();
break;
}
}
}
}
public class ClientListItem
{
public string ClientName { get; set; }
public override string ToString() { return ClientName; }
}
}

View File

@ -160,6 +160,7 @@
<Compile Include="Classes\Launcher\AddonLoader.cs" />
<Compile Include="Classes\Launcher\EasterEggs.cs" />
<Compile Include="Classes\Launcher\SplashLoader.cs" />
<Compile Include="Classes\Launcher\TreeNodeHelper.cs" />
<Compile Include="Classes\LocalVars.cs" />
<Compile Include="Classes\SDK\Downloader.cs" />
<Compile Include="Classes\SDK\ROBLOXFileTypes.cs" />
@ -262,7 +263,7 @@
<Compile Include="Forms\LauncherForm\Extended\LauncherFormExtended.Designer.cs">
<DependentUpon>LauncherFormExtended.cs</DependentUpon>
</Compile>
<Compile Include="NovetusLauncher.cs" />
<Compile Include="NovetusLauncherEntryPoint.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -6,7 +6,7 @@ using System;
namespace NovetusLauncher
{
#region Novetus Launcher Main Class
internal sealed class NovetusLauncher
internal sealed class NovetusLauncherEntryPoint
{
/// <summary>
/// Program entry point.