added OpenGL experimental/stable as a graphics option. add autocomplete feature for names and ids
This commit is contained in:
parent
fdc005ab2a
commit
d750c2f08f
|
|
@ -13,8 +13,9 @@ public class Settings
|
|||
public enum Mode
|
||||
{
|
||||
Automatic = 0,
|
||||
OpenGL = 1,
|
||||
DirectX = 2
|
||||
OpenGLStable = 1,
|
||||
OpenGLExperimental = 2,
|
||||
DirectX = 3
|
||||
}
|
||||
|
||||
public enum Level
|
||||
|
|
@ -46,8 +47,10 @@ public class Settings
|
|||
switch (level)
|
||||
{
|
||||
case 1:
|
||||
return Mode.OpenGL;
|
||||
return Mode.OpenGLStable;
|
||||
case 2:
|
||||
return Mode.OpenGLExperimental;
|
||||
case 3:
|
||||
return Mode.DirectX;
|
||||
default:
|
||||
return Mode.Automatic;
|
||||
|
|
@ -58,10 +61,12 @@ public class Settings
|
|||
{
|
||||
switch (level)
|
||||
{
|
||||
case Mode.OpenGL:
|
||||
case Mode.OpenGLStable:
|
||||
return 1;
|
||||
case Mode.DirectX:
|
||||
case Mode.OpenGLExperimental:
|
||||
return 2;
|
||||
case Mode.DirectX:
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -911,7 +911,7 @@ public class GlobalFuncs
|
|||
|
||||
switch (GlobalVars.UserConfiguration.GraphicsMode)
|
||||
{
|
||||
case Settings.GraphicsOptions.Mode.OpenGL:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLStable:
|
||||
switch (info.ClientLoadOptions)
|
||||
{
|
||||
case Settings.GraphicsOptions.ClientLoadOptions.Client_2007:
|
||||
|
|
@ -927,6 +927,9 @@ public class GlobalFuncs
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.OpenGLExperimental:
|
||||
GraphicsMode = 4;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
GraphicsMode = 3;
|
||||
break;
|
||||
|
|
@ -1033,7 +1036,7 @@ public class GlobalFuncs
|
|||
|
||||
switch (GlobalVars.UserConfiguration.GraphicsMode)
|
||||
{
|
||||
case Settings.GraphicsOptions.Mode.OpenGL:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLStable:
|
||||
switch (info.ClientLoadOptions)
|
||||
{
|
||||
case Settings.GraphicsOptions.ClientLoadOptions.Client_2007:
|
||||
|
|
@ -1049,6 +1052,9 @@ public class GlobalFuncs
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.OpenGLExperimental:
|
||||
GraphicsMode = 4;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
GraphicsMode = 3;
|
||||
break;
|
||||
|
|
@ -1103,7 +1109,7 @@ public class GlobalFuncs
|
|||
{
|
||||
switch (GlobalVars.UserConfiguration.GraphicsMode)
|
||||
{
|
||||
case Settings.GraphicsOptions.Mode.OpenGL:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLStable:
|
||||
switch (info.ClientLoadOptions)
|
||||
{
|
||||
case Settings.GraphicsOptions.ClientLoadOptions.Client_2007:
|
||||
|
|
@ -1119,6 +1125,9 @@ public class GlobalFuncs
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.OpenGLExperimental:
|
||||
GraphicsMode = 4;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
GraphicsMode = 3;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
#region Special Splash Definition
|
||||
public class SpecialSplash
|
||||
{
|
||||
public SpecialSplash(string text)
|
||||
{
|
||||
if (text.Contains('|'))
|
||||
{
|
||||
string[] subs = text.Split('|');
|
||||
SplashText = subs[0];
|
||||
string date = subs[1];
|
||||
if (date.Contains('/'))
|
||||
{
|
||||
if (date.Contains('-'))
|
||||
{
|
||||
string[] datesubs = date.Split('-');
|
||||
SplashFirstAppearanceDate = ConvertStringToDate(datesubs[0]);
|
||||
SplashEndAppearanceDate = ConvertStringToDate(datesubs[1]);
|
||||
|
||||
if (datesubs.ElementAtOrDefault(2) != null && datesubs.ElementAtOrDefault(3) != null)
|
||||
{
|
||||
SplashDateStopAppearingAllTheTime = ConvertStringToDate(datesubs[2]);
|
||||
SplashDateStartToAppearLess = ConvertStringToDate(datesubs[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashFirstAppearanceDate = ConvertStringToDate(date);
|
||||
SplashEndAppearanceDate = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
}
|
||||
|
||||
SplashWeekday = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashWeekday = ConvertStringToDayOfWeek(date);
|
||||
SplashFirstAppearanceDate = null;
|
||||
SplashEndAppearanceDate = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime ConvertStringToDate(string date)
|
||||
{
|
||||
if (date.Contains('/'))
|
||||
{
|
||||
string[] subs = date.Split('/');
|
||||
return new DateTime(DateTime.Now.Year, Convert.ToInt32(subs[0]), Convert.ToInt32(subs[1]), CultureInfo.InvariantCulture.Calendar);
|
||||
}
|
||||
|
||||
return DateTime.Now;
|
||||
}
|
||||
|
||||
public DayOfWeek ConvertStringToDayOfWeek(string dayofweek)
|
||||
{
|
||||
DayOfWeek weekday = DayOfWeek.Sunday;
|
||||
|
||||
switch (dayofweek)
|
||||
{
|
||||
case string monday when string.Compare(monday, "monday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Monday;
|
||||
break;
|
||||
case string tuesday when string.Compare(tuesday, "tuesday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Tuesday;
|
||||
break;
|
||||
case string wednesday when string.Compare(wednesday, "wednesday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Wednesday;
|
||||
break;
|
||||
case string thursday when string.Compare(thursday, "thursday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Thursday;
|
||||
break;
|
||||
case string friday when string.Compare(friday, "friday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Friday;
|
||||
break;
|
||||
case string saturday when string.Compare(saturday, "saturday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Saturday;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return weekday;
|
||||
}
|
||||
|
||||
//text
|
||||
public string SplashText { get; set; }
|
||||
//date we should start appearing
|
||||
public DateTime? SplashFirstAppearanceDate { get; set; }
|
||||
//date we should stop appearing
|
||||
public DateTime? SplashEndAppearanceDate { get; set; }
|
||||
public DateTime? SplashDateStopAppearingAllTheTime { get; set; }
|
||||
public DateTime? SplashDateStartToAppearLess { get; set; }
|
||||
//weekdays.
|
||||
public DayOfWeek? SplashWeekday { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Special Names Definition
|
||||
public class SpecialName
|
||||
{
|
||||
public SpecialName(string text)
|
||||
{
|
||||
if (text.Contains('|'))
|
||||
{
|
||||
string[] subs = text.Split('|');
|
||||
NameText = subs[0];
|
||||
NameID = Convert.ToInt32(subs[1]);
|
||||
}
|
||||
}
|
||||
|
||||
//text
|
||||
public string NameText { get; set; }
|
||||
//id
|
||||
public int NameID { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
|
@ -5,112 +5,6 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
#region Special Splash Definition
|
||||
public class SpecialSplash
|
||||
{
|
||||
public SpecialSplash(string text)
|
||||
{
|
||||
if (text.Contains('|'))
|
||||
{
|
||||
string[] subs = text.Split('|');
|
||||
SplashText = subs[0];
|
||||
string date = subs[1];
|
||||
if (date.Contains('/'))
|
||||
{
|
||||
if (date.Contains('-'))
|
||||
{
|
||||
string[] datesubs = date.Split('-');
|
||||
SplashFirstAppearanceDate = ConvertStringToDate(datesubs[0]);
|
||||
SplashEndAppearanceDate = ConvertStringToDate(datesubs[1]);
|
||||
|
||||
if (datesubs.ElementAtOrDefault(2) != null && datesubs.ElementAtOrDefault(3) != null)
|
||||
{
|
||||
SplashDateStopAppearingAllTheTime = ConvertStringToDate(datesubs[2]);
|
||||
SplashDateStartToAppearLess = ConvertStringToDate(datesubs[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashFirstAppearanceDate = ConvertStringToDate(date);
|
||||
SplashEndAppearanceDate = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
}
|
||||
|
||||
SplashWeekday = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashWeekday = ConvertStringToDayOfWeek(date);
|
||||
SplashFirstAppearanceDate = null;
|
||||
SplashEndAppearanceDate = null;
|
||||
SplashDateStartToAppearLess = null;
|
||||
SplashDateStopAppearingAllTheTime = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime ConvertStringToDate(string date)
|
||||
{
|
||||
if (date.Contains('/'))
|
||||
{
|
||||
string[] subs = date.Split('/');
|
||||
return new DateTime(DateTime.Now.Year, Convert.ToInt32(subs[0]), Convert.ToInt32(subs[1]), CultureInfo.InvariantCulture.Calendar);
|
||||
}
|
||||
|
||||
return DateTime.Now;
|
||||
}
|
||||
|
||||
public DayOfWeek ConvertStringToDayOfWeek(string dayofweek)
|
||||
{
|
||||
DayOfWeek weekday = DayOfWeek.Sunday;
|
||||
|
||||
switch (dayofweek)
|
||||
{
|
||||
case string monday when string.Compare(monday, "monday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Monday;
|
||||
break;
|
||||
case string tuesday when string.Compare(tuesday, "tuesday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Tuesday;
|
||||
break;
|
||||
case string wednesday when string.Compare(wednesday, "wednesday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Wednesday;
|
||||
break;
|
||||
case string thursday when string.Compare(thursday, "thursday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Thursday;
|
||||
break;
|
||||
case string friday when string.Compare(friday, "friday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Friday;
|
||||
break;
|
||||
case string saturday when string.Compare(saturday, "saturday", true, CultureInfo.InvariantCulture) == 0:
|
||||
weekday = DayOfWeek.Saturday;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return weekday;
|
||||
}
|
||||
|
||||
//text
|
||||
public string SplashText { get; set; }
|
||||
//date we should start appearing
|
||||
public DateTime? SplashFirstAppearanceDate { get; set; }
|
||||
//date we should stop appearing
|
||||
public DateTime? SplashEndAppearanceDate { get; set; }
|
||||
public DateTime? SplashDateStopAppearingAllTheTime { get; set; }
|
||||
public DateTime? SplashDateStartToAppearLess { get; set; }
|
||||
//weekdays.
|
||||
public DayOfWeek? SplashWeekday { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Splash Reader
|
||||
|
||||
public static class SplashReader
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ namespace NovetusLauncher
|
|||
#region LocalVars
|
||||
class LocalVars
|
||||
{
|
||||
#region Easter Egg Variables
|
||||
#region Variables
|
||||
public static int Clicks = 0;
|
||||
public static string prevsplash = "";
|
||||
public static bool launcherInitState = true;
|
||||
#endregion
|
||||
#region Commands
|
||||
public static string important = "";
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace NovetusLauncher
|
|||
|
||||
void TextBox2TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.UserConfiguration.PlayerName = textBox2.Text;
|
||||
launcherForm.ChangeName();
|
||||
}
|
||||
|
||||
void ListBox2SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@
|
|||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"Automatic",
|
||||
"OpenGL",
|
||||
"GL Stable",
|
||||
"GL Experimental",
|
||||
"DirectX"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(123, 11);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
|
|
|
|||
|
|
@ -36,9 +36,12 @@ namespace NovetusLauncher
|
|||
switch (comboBox1.SelectedIndex)
|
||||
{
|
||||
case 1:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGL;
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGLStable;
|
||||
break;
|
||||
case 2:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGLExperimental;
|
||||
break;
|
||||
case 3:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.DirectX;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -146,12 +149,15 @@ namespace NovetusLauncher
|
|||
|
||||
switch (GlobalVars.UserConfiguration.GraphicsMode)
|
||||
{
|
||||
case Settings.GraphicsOptions.Mode.OpenGL:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLStable:
|
||||
comboBox1.SelectedIndex = 1;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLExperimental:
|
||||
comboBox1.SelectedIndex = 2;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
comboBox1.SelectedIndex = 3;
|
||||
break;
|
||||
default:
|
||||
comboBox1.SelectedIndex = 0;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1345,7 +1345,8 @@ namespace NovetusLauncher
|
|||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"Automatic",
|
||||
"OpenGL",
|
||||
"GL Stable",
|
||||
"GL Experimental",
|
||||
"DirectX"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(90, 108);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace NovetusLauncher
|
|||
|
||||
void TextBox2TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
GlobalVars.UserConfiguration.PlayerName = textBox2.Text;
|
||||
launcherForm.ChangeName();
|
||||
}
|
||||
|
||||
void ListBox2SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
@ -320,9 +320,12 @@ namespace NovetusLauncher
|
|||
switch (comboBox1.SelectedIndex)
|
||||
{
|
||||
case 1:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGL;
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGLStable;
|
||||
break;
|
||||
case 2:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.OpenGLExperimental;
|
||||
break;
|
||||
case 3:
|
||||
GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.DirectX;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ namespace NovetusLauncher
|
|||
ReadConfigValues(true);
|
||||
InitUPnP();
|
||||
StartDiscord();
|
||||
LocalVars.launcherInitState = false;
|
||||
}
|
||||
|
||||
public void CloseEvent()
|
||||
|
|
@ -700,12 +701,15 @@ namespace NovetusLauncher
|
|||
{
|
||||
switch (GlobalVars.UserConfiguration.GraphicsMode)
|
||||
{
|
||||
case Settings.GraphicsOptions.Mode.OpenGL:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLStable:
|
||||
GraphicsModeBox.SelectedIndex = 1;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
case Settings.GraphicsOptions.Mode.OpenGLExperimental:
|
||||
GraphicsModeBox.SelectedIndex = 2;
|
||||
break;
|
||||
case Settings.GraphicsOptions.Mode.DirectX:
|
||||
GraphicsModeBox.SelectedIndex = 3;
|
||||
break;
|
||||
default:
|
||||
GraphicsModeBox.SelectedIndex = 0;
|
||||
break;
|
||||
|
|
@ -1090,6 +1094,39 @@ namespace NovetusLauncher
|
|||
}
|
||||
}
|
||||
|
||||
private static int GetSpecialNameID(string text)
|
||||
{
|
||||
string[] names = File.ReadAllLines(GlobalPaths.ConfigDir + "\\names-special.txt");
|
||||
int returnname = 0;
|
||||
List<SpecialName> specialnames = new List<SpecialName>();
|
||||
|
||||
foreach (var name in names)
|
||||
{
|
||||
specialnames.Add(new SpecialName(name));
|
||||
}
|
||||
|
||||
foreach (var specialname in specialnames)
|
||||
{
|
||||
if (specialname.NameText.Equals(text, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
returnname = specialname.NameID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return returnname;
|
||||
}
|
||||
|
||||
public void ChangeName()
|
||||
{
|
||||
GlobalVars.UserConfiguration.PlayerName = PlayerNameTextBox.Text;
|
||||
int autoNameID = GetSpecialNameID(GlobalVars.UserConfiguration.PlayerName);
|
||||
if (LocalVars.launcherInitState == false && autoNameID > 0)
|
||||
{
|
||||
PlayerIDTextBox.Text = autoNameID.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeUserID()
|
||||
{
|
||||
int parsedValue;
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@
|
|||
<DependentUpon>CharacterCustomizationExtended.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Classes\Launcher\AddonLoader.cs" />
|
||||
<Compile Include="Classes\Launcher\EasterEggs.cs" />
|
||||
<Compile Include="Classes\Launcher\SplashLoader.cs" />
|
||||
<Compile Include="Classes\LocalVars.cs" />
|
||||
<Compile Include="Forms\CharCustom\CharacterCustomizationShared.cs" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue