renaming + variable cleanup

- rename UpdateState to PlayButtonState for better clarity
- move variables that are only used in constructor to local scope
- make colors and formBG readonly
pull/32/head
Miepee 4 years ago
parent 386bcf623d
commit 0067a6b9a5

@ -38,7 +38,7 @@ namespace AM2RLauncher
if (!Profile.IsPatchDataCloned() || !(bool)autoUpdateAM2RCheck.Checked)
return;
SetPlayButtonState(UpdateState.Downloading);
SetPlayButtonState(PlayButtonState.Downloading);
progressBar.Visible = true;
progressLabel.Visible = true;
@ -113,7 +113,7 @@ namespace AM2RLauncher
}
}
SetPlayButtonState(UpdateState.Install);
SetPlayButtonState(PlayButtonState.Install);
UpdateStateMachine();
}
@ -160,7 +160,7 @@ namespace AM2RLauncher
/// <summary>
/// Gets called when user tries to close <see cref="MainForm"/>. This does a few things:<br/>
/// 1) Writes the Width, Height, the check if <see cref="MainForm"/> is currently maximized and the ProfileIndex to the Config<br/>
/// 2) Checks if current <see cref="updateState"/> is <see cref="UpdateState.Downloading"/>. If yes, it creates a Warning to the end user.
/// 2) Checks if current <see cref="updateState"/> is <see cref="PlayButtonState.Downloading"/>. If yes, it creates a Warning to the end user.
/// </summary>
private void MainformClosing(object sender, CancelEventArgs e)
{
@ -174,7 +174,7 @@ namespace AM2RLauncher
switch (updateState)
{
// If we're currently still downloading, ask first if user really wants to close and cancel the event if necessary
case UpdateState.Downloading:
case PlayButtonState.Downloading:
{
var result = MessageBox.Show(this, Text.CloseOnCloningText, Text.WarningWindowTitle, MessageBoxButtons.YesNo,
MessageBoxType.Warning, MessageBoxDefaultButton.No);
@ -187,7 +187,7 @@ namespace AM2RLauncher
break;
}
// We can't close during installing, so we cancel the event.
case UpdateState.Installing:
case PlayButtonState.Installing:
{
MessageBox.Show(this, Text.CloseOnInstallingText, Text.WarningWindowTitle, MessageBoxButtons.OK, MessageBoxType.Warning);
e.Cancel = true;
@ -232,13 +232,13 @@ namespace AM2RLauncher
switch (updateState)
{
#region Download
case UpdateState.Download:
case PlayButtonState.Download:
log.Info("Attempting to clone repository " + currentMirror + "...");
bool successful = true;
// Update playButton states
SetPlayButtonState(UpdateState.Downloading);
SetPlayButtonState(PlayButtonState.Downloading);
// Enable progressBar
progressBar.Visible = true;
@ -306,7 +306,7 @@ namespace AM2RLauncher
progressBar.Value = 0;
// Just need to switch this to anything that isn't an "active" state so SetUpdateState() actually does something
SetPlayButtonState(UpdateState.Install);
SetPlayButtonState(PlayButtonState.Install);
// This needs to be run BEFORE the state check so that the Mod Settings tab doesn't weird out
LoadProfilesAndAdjustLists();
@ -319,7 +319,7 @@ namespace AM2RLauncher
#region Downloading
case UpdateState.Downloading:
case PlayButtonState.Downloading:
var result = MessageBox.Show(this, Text.CloseOnCloningText, Text.WarningWindowTitle, MessageBoxButtons.YesNo, MessageBoxType.Warning, MessageBoxDefaultButton.No);
if (result != DialogResult.Yes)
return;
@ -336,7 +336,7 @@ namespace AM2RLauncher
#endregion
#region Select11
case UpdateState.Select11:
case PlayButtonState.Select11:
log.Info("Requesting user input for AM2R_11.zip...");
@ -381,10 +381,10 @@ namespace AM2RLauncher
#endregion
#region Install
case UpdateState.Install:
case PlayButtonState.Install:
progressBar.Visible = true;
progressBar.Value = 0;
SetPlayButtonState(UpdateState.Installing);
SetPlayButtonState(PlayButtonState.Installing);
// Make sure the main interface state machines properly
UpdateApkState();
@ -398,7 +398,7 @@ namespace AM2RLauncher
{
MessageBox.Show(this, Text.XdeltaNotFound, Text.WarningWindowTitle, MessageBoxButtons.OK);
SetPlayButtonState(UpdateState.Install);
SetPlayButtonState(PlayButtonState.Install);
UpdateStateMachine();
log.Error("Xdelta not found. Aborting installing a profile...");
return;
@ -419,20 +419,20 @@ namespace AM2RLauncher
progressBar.Value = 0;
// Just need to switch this to anything that isn't an "active" state so SetUpdateState() actually does something
SetPlayButtonState(UpdateState.Play);
SetPlayButtonState(PlayButtonState.Play);
UpdateStateMachine();
break;
#endregion
#region Play
case UpdateState.Play:
case PlayButtonState.Play:
if (!IsProfileIndexValid())
return;
ProfileXML profile = profileList[profileIndex.Value];
Visible = false;
SetPlayButtonState(UpdateState.Playing);
SetPlayButtonState(PlayButtonState.Playing);
// Make sure the main interface state machines properly
UpdateApkState();
@ -455,7 +455,7 @@ namespace AM2RLauncher
Visible = true;
WindowState = windowStateBeforeLaunching;
SetPlayButtonState(UpdateState.Play);
SetPlayButtonState(PlayButtonState.Play);
UpdateStateMachine();
break;
@ -602,7 +602,7 @@ namespace AM2RLauncher
}
/// <summary>Gets called when user selects a different item from <see cref="mirrorDropDown"/>.
/// It then writes that to the config, and if <see cref="updateState"/> is not <see cref="UpdateState.Downloading"/>
/// It then writes that to the config, and if <see cref="updateState"/> is not <see cref="PlayButtonState.Downloading"/>
/// it also overwrites the upstream URL in .git/config.</summary>
private void MirrorDropDownSelectedIndexChanged(object sender, EventArgs e)
{
@ -613,7 +613,7 @@ namespace AM2RLauncher
CrossPlatformOperations.WriteToConfig("MirrorIndex", mirrorDropDown.SelectedIndex);
// Don't overwrite the git config while we download!!!
if (updateState == UpdateState.Downloading) return;
if (updateState == PlayButtonState.Downloading) return;
log.Info("Overwriting mirror in gitconfig.");

@ -23,12 +23,12 @@ namespace AM2RLauncher
}
/// <summary>
/// Determines current conditions and calls <see cref="SetPlayButtonState(UpdateState)"/> accordingly.
/// Determines current conditions and calls <see cref="SetPlayButtonState(PlayButtonState)"/> accordingly.
/// </summary>
private void UpdatePlayState()
{
// If we're downloading or installing, dont't change anything
if ((updateState == UpdateState.Downloading) || (updateState == UpdateState.Installing))
if ((updateState == PlayButtonState.Downloading) || (updateState == PlayButtonState.Installing))
return;
// If we're currently creating an APK, we disable the play button
@ -42,14 +42,14 @@ namespace AM2RLauncher
// If PatchData isn't cloned, we still need to download
if (!Profile.IsPatchDataCloned())
{
SetPlayButtonState(UpdateState.Download);
SetPlayButtonState(PlayButtonState.Download);
return;
}
// If 1.1 isn't installed, we still need to select it
if (!Profile.Is11Installed())
{
SetPlayButtonState(UpdateState.Select11);
SetPlayButtonState(PlayButtonState.Select11);
return;
}
@ -57,7 +57,7 @@ namespace AM2RLauncher
// If current profile is installed, we're ready to play!
if (isProfileValid && Profile.IsProfileInstalled(profileList[profileIndex.Value]))
{
SetPlayButtonState(UpdateState.Play);
SetPlayButtonState(PlayButtonState.Play);
return;
}
// Otherwise, if profile is NOT installable, we delete the profile because we can't install it and therefore holds no value!
@ -68,7 +68,7 @@ namespace AM2RLauncher
}
// Otherwise, we still need to install.
SetPlayButtonState(UpdateState.Install);
SetPlayButtonState(PlayButtonState.Install);
}
/// <summary>
@ -95,14 +95,14 @@ namespace AM2RLauncher
// Switch status based on main button's state
switch (updateState)
{
case UpdateState.Download:
case UpdateState.Downloading:
case UpdateState.Select11:
case UpdateState.Installing:
case UpdateState.Playing: return;
case UpdateState.Install:
case UpdateState.Play: apkButton.Enabled = true; apkButton.ToolTip = HelperMethods.GetText(Text.ApkButtonEnabledToolTip, profileDropDown?.Items[profileDropDown.SelectedIndex]?.Text ?? ""); break;
case PlayButtonState.Download:
case PlayButtonState.Downloading:
case PlayButtonState.Select11:
case PlayButtonState.Installing:
case PlayButtonState.Playing: return;
case PlayButtonState.Install:
case PlayButtonState.Play: apkButton.Enabled = true; apkButton.ToolTip = HelperMethods.GetText(Text.ApkButtonEnabledToolTip, profileDropDown?.Items[profileDropDown.SelectedIndex]?.Text ?? ""); break;
}
}
@ -116,14 +116,14 @@ namespace AM2RLauncher
return;
switch (updateState)
{
case UpdateState.Download:
case UpdateState.Downloading:
case UpdateState.Select11:
case UpdateState.Installing:
case UpdateState.Playing: profileDropDown.Enabled = false; break;
case UpdateState.Install:
case UpdateState.Play: profileDropDown.Enabled = true; break;
case PlayButtonState.Download:
case PlayButtonState.Downloading:
case PlayButtonState.Select11:
case PlayButtonState.Installing:
case PlayButtonState.Playing: profileDropDown.Enabled = false; break;
case PlayButtonState.Install:
case PlayButtonState.Play: profileDropDown.Enabled = true; break;
}
if (apkButtonState == ApkButtonState.Creating) profileDropDown.Enabled = false;
@ -148,14 +148,14 @@ namespace AM2RLauncher
bool enabled = false;
switch (updateState)
{
case UpdateState.Download:
case UpdateState.Downloading:
case UpdateState.Select11:
case UpdateState.Installing:
case UpdateState.Playing: enabled = false; break;
case PlayButtonState.Download:
case PlayButtonState.Downloading:
case PlayButtonState.Select11:
case PlayButtonState.Installing:
case PlayButtonState.Playing: enabled = false; break;
case UpdateState.Install:
case UpdateState.Play: enabled = true; break;
case PlayButtonState.Install:
case PlayButtonState.Play: enabled = true; break;
}
if (apkButtonState == ApkButtonState.Creating) enabled = false;
@ -195,19 +195,19 @@ namespace AM2RLauncher
/// Sets the global <see cref="updateState"/> and then changes the state of <see cref="playButton"/> accordingly.
/// </summary>
/// <param name="state">The state that should be set to.</param>
private void SetPlayButtonState(UpdateState state)
private void SetPlayButtonState(PlayButtonState state)
{
updateState = state;
switch (updateState)
{
case UpdateState.Download:
case UpdateState.Downloading:
case UpdateState.Select11:
case UpdateState.Install:
case UpdateState.Play: playButton.Enabled = true; break;
case UpdateState.Installing:
case UpdateState.Playing: playButton.Enabled = false; break;
case PlayButtonState.Download:
case PlayButtonState.Downloading:
case PlayButtonState.Select11:
case PlayButtonState.Install:
case PlayButtonState.Play: playButton.Enabled = true; break;
case PlayButtonState.Installing:
case PlayButtonState.Playing: playButton.Enabled = false; break;
}
playButton.Text = GetPlayButtonText();
playButton.ToolTip = GetPlayButtonTooltip();
@ -240,13 +240,13 @@ namespace AM2RLauncher
{
switch (updateState)
{
case UpdateState.Download: return Text.Download;
case UpdateState.Downloading: return Text.Abort;
case UpdateState.Select11: return Text.Select11;
case UpdateState.Install: return Text.Install;
case UpdateState.Installing: return Text.Installing;
case UpdateState.Play: return Text.Play;
case UpdateState.Playing: return Text.Playing;
case PlayButtonState.Download: return Text.Download;
case PlayButtonState.Downloading: return Text.Abort;
case PlayButtonState.Select11: return Text.Select11;
case PlayButtonState.Install: return Text.Install;
case PlayButtonState.Installing: return Text.Installing;
case PlayButtonState.Play: return Text.Play;
case PlayButtonState.Playing: return Text.Playing;
default: return null;
}
}
@ -260,13 +260,13 @@ namespace AM2RLauncher
string profileName = ((profileDropDown != null) && (profileDropDown.Items.Count > 0)) ? profileDropDown.Items[profileDropDown.SelectedIndex].Text : "";
switch (updateState)
{
case UpdateState.Download: return Text.PlayButtonDownloadToolTip;
case UpdateState.Downloading: return Text.PlayButtonDownloadToolTip;
case UpdateState.Select11: return Text.PlayButtonSelect11ToolTip;
case UpdateState.Install: return playButton.ToolTip = HelperMethods.GetText(Text.PlayButtonInstallToolTip, profileName);
case UpdateState.Installing: return Text.PlayButtonInstallingToolTip;
case UpdateState.Play: return HelperMethods.GetText(Text.PlayButtonPlayToolTip, profileName);
case UpdateState.Playing: return Text.PlayButtonPlayingToolTip;
case PlayButtonState.Download: return Text.PlayButtonDownloadToolTip;
case PlayButtonState.Downloading: return Text.PlayButtonDownloadToolTip;
case PlayButtonState.Select11: return Text.PlayButtonSelect11ToolTip;
case PlayButtonState.Install: return playButton.ToolTip = HelperMethods.GetText(Text.PlayButtonInstallToolTip, profileName);
case PlayButtonState.Installing: return Text.PlayButtonInstallingToolTip;
case PlayButtonState.Play: return HelperMethods.GetText(Text.PlayButtonPlayToolTip, profileName);
case PlayButtonState.Playing: return Text.PlayButtonPlayingToolTip;
default: return null;
}
}
@ -374,7 +374,7 @@ namespace AM2RLauncher
customMirrorTextBox.Enabled = enabled;
mirrorDropDown.Enabled = !enabled;
// Not sure why the dropdown menu needs this hack, but the textBox does not.
//TODO: eto issue?
//TODO: eto feature request
if (OS.IsWindows)
mirrorDropDown.TextColor = mirrorDropDown.Enabled ? colGreen : colInactive;
mirrorLabel.TextColor = !enabled ? colGreen : colInactive;

@ -1,6 +1,7 @@
using AM2RLauncher.Core;
using AM2RLauncher.Core.XML;
using AM2RLauncher.Language;
using AM2RLauncher.Properties;
using Eto.Drawing;
using Eto.Forms;
using log4net;
@ -31,15 +32,11 @@ namespace AM2RLauncher
/// </summary>
private const string VERSION = LauncherUpdater.VERSION;
/// <summary>
/// A <see cref="Bitmap"/> of the AM2R icon.
/// </summary>
private static readonly Bitmap am2rIcon = new Bitmap(AM2RLauncher.Properties.Resources.AM2RIcon);
/// <summary>
/// An enum, that has possible states for our Launcher.
/// An enum, that has possible states for the play button.
/// </summary>
public enum UpdateState
public enum PlayButtonState
{
Download,
Downloading,
@ -62,7 +59,7 @@ namespace AM2RLauncher
/// <summary>
/// This variable has the current global state of the Launcher.
/// </summary>
private static UpdateState updateState = UpdateState.Download;
private static PlayButtonState updateState = PlayButtonState.Download;
/// <summary>
/// This variable has the current global statue of the <see cref="apkButton"/>.
/// </summary>
@ -101,13 +98,9 @@ namespace AM2RLauncher
if (OS.IsWindows)
{
Process current = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(current.ProcessName))
{
if (process.Id == current.Id)
continue;
Process process = Process.GetProcessesByName(current.ProcessName).First(p => p.Id == current.Id);
if (process != null)
Core.Core.SetForegroundWindow(process.MainWindowHandle);
break;
}
}
Environment.Exit(0);
}
@ -134,8 +127,10 @@ namespace AM2RLauncher
#region VARIABLE INITIALIZATION
log.Info("Beginning UI initialization...");
Bitmap am2rIcon = new Bitmap(AM2RLauncher.Properties.Resources.AM2RIcon);
// System tray indicator
showButton = new ButtonMenuItem { Text = Text.TrayButtonShow };
ButtonMenuItem showButton = new ButtonMenuItem { Text = Text.TrayButtonShow };
trayIndicator = new TrayIndicator
{
Menu = new ContextMenu(showButton),
@ -151,6 +146,7 @@ namespace AM2RLauncher
// Create array from validCount
profileList = new List<ProfileXML>();
//TODO: whenever profileDropDown gets rewritten to use a datastore, scrap this
profileNames = new List<ListItem>();
foreach (var profile in profileList)
{
@ -161,23 +157,6 @@ namespace AM2RLauncher
string splash = Splash.GetSplash();
log.Info("Randomly chosen splash: " + splash);
// Load bitmaps
redditIcon = new Bitmap(AM2RLauncher.Properties.Resources.redditIcon48);
githubIcon = new Bitmap(AM2RLauncher.Properties.Resources.githubIcon48);
youtubeIcon = new Bitmap(AM2RLauncher.Properties.Resources.youtubeIcon48);
discordIcon = new Bitmap(AM2RLauncher.Properties.Resources.discordIcon48);
formBG = new Bitmap(AM2RLauncher.Properties.Resources.bgCentered);
// Load colors
colGreen = Color.FromArgb(142, 188, 35);
colRed = Color.FromArgb(188, 10, 35);
colInactive = Color.FromArgb(109, 109, 109);
colBGNoAlpha = Color.FromArgb(10, 10, 10);
colBG = Color.FromArgb(10, 10, 10, 80);
if (OS.IsLinux) colBG = colBGNoAlpha; // XORG can't display alpha anyway, and Wayland breaks with it.
// TODO: that sounds like an Eto bug. investigate, try to open eto issue.
colBGHover = Color.FromArgb(17, 28, 13);
Font smallButtonFont = new Font(SystemFont.Default, 10);
// Create mirror list - eventually this should be platform specific!
@ -347,15 +326,19 @@ namespace AM2RLauncher
// Social buttons
Bitmap redditIcon = new Bitmap(Resources.redditIcon48);
var redditButton = new ImageButton { ToolTip = Text.RedditToolTip, Image = redditIcon };
redditButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.reddit.com/r/AM2R");
Bitmap githubIcon = new Bitmap(Resources.githubIcon48);
var githubButton = new ImageButton { ToolTip = Text.GithubToolTip, Image = githubIcon };
githubButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.github.com/AM2R-Community-Developers");
Bitmap youtubeIcon = new Bitmap(Resources.youtubeIcon48);
var youtubeButton = new ImageButton { ToolTip = Text.YoutubeToolTip, Image = youtubeIcon };
youtubeButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://www.youtube.com/c/AM2RCommunityUpdates");
Bitmap discordIcon = new Bitmap(Resources.discordIcon48);
var discordButton = new ImageButton { ToolTip = Text.DiscordToolTip, Image = discordIcon };
discordButton.Click += (sender, e) => CrossPlatformOperations.OpenURL("https://discord.gg/nk7UYPbd5u");
@ -371,7 +354,12 @@ namespace AM2RLauncher
// Version number label
versionLabel = new Label { Text = "v" + VERSION + (isThisRunningFromWine ? "-WINE" : ""), Width = 48, TextAlignment = TextAlignment.Right, TextColor = colGreen, Font = new Font(SystemFont.Default, 12) };
Label versionLabel = new Label
{
Text = "v" + VERSION + (isThisRunningFromWine ? "-WINE" : ""),
Width = 48, TextAlignment = TextAlignment.Right, TextColor = colGreen,
Font = new Font(SystemFont.Default, 12)
};
// Tie everything together
var mainLayout = new DynamicLayout();
@ -394,7 +382,7 @@ namespace AM2RLauncher
#region MAIN PAGE
// [MAIN PAGE]
mainPage = new TabPage
TabPage mainPage = new TabPage
{
BackgroundColor = colBGNoAlpha,
Text = Text.PlayTab,
@ -404,20 +392,19 @@ namespace AM2RLauncher
#region CHANGELOG PAGE
// [CHANGELOG]
changelogUri = new Uri("https://am2r-community-developers.github.io/DistributionCenter/changelog.html");
changelogWebView = new WebView { Url = changelogUri };
Uri changelogUri = new Uri("https://am2r-community-developers.github.io/DistributionCenter/changelog.html");
WebView changelogWebView = new WebView { Url = changelogUri };
if (OS.IsUnix && !isInternetThere)
changelogWebView = new WebView();
changelogNoConnectionLabel = new Label
Label changelogNoConnectionLabel = new Label
{
Text = Text.NoInternetConnection,
TextColor = colGreen
};
changelogPage = new TabPage
TabPage changelogPage = new TabPage
{
BackgroundColor = colBGNoAlpha,
Text = Text.ChangelogTab,
@ -436,19 +423,20 @@ namespace AM2RLauncher
#region NEWS PAGE
// [NEWS]
newsUri = new Uri("https://am2r-community-developers.github.io/DistributionCenter/news.html");
newsWebView = new WebView { Url = newsUri };
Uri newsUri = new Uri("https://am2r-community-developers.github.io/DistributionCenter/news.html");
WebView newsWebView = new WebView { Url = newsUri };
//TODO: why exactly is this check necessary?
if (OS.IsUnix && !isInternetThere)
newsWebView = new WebView();
newsNoConnectionLabel = new Label
Label newsNoConnectionLabel = new Label
{
Text = Text.NoInternetConnection,
TextColor = colGreen
};
newsPage = new TabPage
TabPage newsPage = new TabPage
{
Text = Text.NewsTab,
BackgroundColor = colBGNoAlpha,
@ -462,6 +450,7 @@ namespace AM2RLauncher
}
};
//TODO: this is hack because on linux / mac the other way doesn't work. eto issue?
if (OS.IsUnix && !isInternetThere)
{
changelogPage.Content = new TableLayout
@ -492,7 +481,7 @@ namespace AM2RLauncher
DynamicLayout settingsLayout = new DynamicLayout();
// LanguageLabel
languageLabel = new Label
Label languageLabel = new Label
{
Text = Text.LanguageNotice,
TextColor = colGreen
@ -575,7 +564,7 @@ namespace AM2RLauncher
};
// Custom environment variables label
customEnvVarLabel = new Label();
Label customEnvVarLabel = new Label();
if (OS.IsLinux)
{
customEnvVarLabel = new Label
@ -653,7 +642,7 @@ namespace AM2RLauncher
#region MODSETTINGS PAGE
// [MOD SETTINGS]
DynamicLayout profileLayout = new DynamicLayout();
DynamicLayout modSettingsLayout = new DynamicLayout();
addModButton = new ColorButton
@ -756,15 +745,15 @@ namespace AM2RLauncher
Text = Text.ProfileNotes
};
profileLayout.BeginHorizontal();
profileLayout.AddSpace();
profileLayout.AddColumn(null, addModButton, modSpacer, settingsProfileLabel, modSettingsProfileDropDown, profileButton, saveButton, updateModButton, deleteModButton, profileNotesTextArea, null);
profileLayout.AddSpace();
modSettingsLayout.BeginHorizontal();
modSettingsLayout.AddSpace();
modSettingsLayout.AddColumn(null, addModButton, modSpacer, settingsProfileLabel, modSettingsProfileDropDown, profileButton, saveButton, updateModButton, deleteModButton, profileNotesTextArea, null);
modSettingsLayout.AddSpace();
profilePage = new TabPage
TabPage modSettingsPage = new TabPage
{
BackgroundColor = colBGNoAlpha,
Content = profileLayout,
Content = modSettingsLayout,
Text = Text.ModSettingsTab
};
@ -784,7 +773,7 @@ namespace AM2RLauncher
settingsPage,
profilePage
modSettingsPage
}
};
@ -808,7 +797,7 @@ namespace AM2RLauncher
playButton.LoadComplete += PlayButtonLoadComplete;
customMirrorTextBox.LostFocus += CustomMirrorTextBoxLostFocus;
mirrorDropDown.SelectedIndexChanged += MirrorDropDownSelectedIndexChanged;
profileLayout.LoadComplete += ProfileLayoutLoadComplete;
modSettingsLayout.LoadComplete += ProfileLayoutLoadComplete;
addModButton.Click += AddModButtonClicked;
profileButton.Click += ProfileDataButtonClickEvent;
saveButton.Click += SaveButtonClickEvent;
@ -833,9 +822,7 @@ namespace AM2RLauncher
// Visual studio does it like this for normal winforms projects, so I just used the same format.
/// <summary>The tray indicator</summary>
TrayIndicator trayIndicator;
/// <summary>The "Show" Button on the tray indicator</summary>
ButtonMenuItem showButton;
private TrayIndicator trayIndicator;
/// <summary><see cref="List{T}"/> of <see cref="ProfileXML"/>s, used for actually working with profile data.</summary>
//TODO: this should be moved into AM2RLauncher.Core
@ -843,31 +830,24 @@ namespace AM2RLauncher
/// <summary><see cref="List{T}"/> of <see cref="ListItem"/>s so that Eto's annoying <see cref="IListItem"/> interface is appeased. Used for profile name display in DropDowns.</summary>
List<ListItem> profileNames;
// Bitmaps
/// <summary>The Reddit icon.</summary>
private Bitmap redditIcon;
/// <summary>The Github icon.</summary>
private Bitmap githubIcon;
/// <summary>The YouTube icon.</summary>
private Bitmap youtubeIcon;
/// <summary>The Discord icon.</summary>
private Bitmap discordIcon;
/// <summary>The planet Background.</summary>
private Bitmap formBG;
private readonly Bitmap formBG = new Bitmap(Resources.bgCentered);
// Colors
/// <summary>The main green color.</summary>
private Color colGreen;
private readonly Color colGreen = Color.FromArgb(142, 188, 35);
/// <summary>The warning red color.</summary>
private Color colRed;
private readonly Color colRed = Color.FromArgb(188, 10, 35);
/// <summary>The main inactive color.</summary>
private Color colInactive;
private readonly Color colInactive = Color.FromArgb(109, 109, 109);
/// <summary>The black background color without alpha value.</summary>
private Color colBGNoAlpha;
private readonly Color colBGNoAlpha = Color.FromArgb(10, 10, 10);
/// <summary>The black background color.</summary>
private Color colBG;
// XORG can't display alpha anyway, and Wayland breaks with it.
// TODO: that sounds like an Eto bug. investigate, try to open eto issue.
private readonly Color colBG = OS.IsLinux ? Color.FromArgb(10, 10, 10) : Color.FromArgb(10, 10, 10, 80);
/// <summary>The lighter green color on hover.</summary>
private Color colBGHover;
private readonly Color colBGHover = Color.FromArgb(17, 28, 13);
// Mirror lists
/// <summary><see cref="List{String}"/> of mirror <see cref="string"/>s, used for actually working with mirrors.</summary>
@ -876,7 +856,7 @@ namespace AM2RLauncher
private List<ListItem> mirrorDescriptionList;
// UI Elements
/// <summary>The main control of the <see cref="mainPage"/>, used to draw the <see cref="formBG"/> and hold the main interface.</summary>
/// <summary>The main control of the main page, used to draw the <see cref="formBG"/> and hold the main interface.</summary>
private Drawable drawable;
/// <summary>A <see cref="ColorButton"/> that acts as the main Button</summary>
@ -894,8 +874,6 @@ namespace AM2RLauncher
/// <summary>A <see cref="ColorButton"/> that is used to delete a mod</summary>
private ColorButton deleteModButton;
/// <summary>The <see cref="Label"/> that gives information for <see cref="languageDropDown"/>.</summary>
private Label languageLabel;
/// <summary>The <see cref="Label"/> that entitles <see cref="profileDropDown"/>.</summary>
private Label profileLabel;
/// <summary>The <see cref="Label"/> that gives author information for <see cref="profileDropDown"/>.</summary>
@ -904,22 +882,12 @@ namespace AM2RLauncher
private Label profileVersionLabel;
/// <summary>The <see cref="Label"/> that gives information for <see cref="mirrorDropDown"/>.</summary>
private Label mirrorLabel;
/// <summary>The <see cref="Label"/> that displays <see cref="VERSION"/>, aka the current launcher version.</summary>
private Label versionLabel;
/// <summary>The <see cref="Label"/> that gives information for <see cref="modSettingsProfileDropDown"/>.</summary>
private Label settingsProfileLabel;
/// <summary>The <see cref="Label"/> that compliments <see cref="progressBar"/>.</summary>
private Label progressLabel;
/// <summary>The <see cref="Label"/> that gives a warning on failure to load the <see cref="newsWebView"/>.</summary>
private Label newsNoConnectionLabel;
/// <summary>The <see cref="Label"/> that gives a warning on failure to load the <see cref="changelogWebView"/>.</summary>
private Label changelogNoConnectionLabel;
/// <summary>The <see cref="Label"/> that gives a warning if the current selected <see cref="ProfileXML"/> shares the same save location has default AM2R.</summary>
private Label saveWarningLabel;
/// <summary>The <see cref="Label"/> that describes <see cref="customEnvVarTextBox"/>.</summary>
private Label customEnvVarLabel;
/// <summary>A <see cref="CheckBox"/>, that indicates wether to automatically update AM2R or not.</summary>
private CheckBox autoUpdateAM2RCheck;
@ -955,25 +923,6 @@ namespace AM2RLauncher
/// <summary>A <see cref="ProgressBar"/> that can be used to show progress for a specific task.</summary>
private ProgressBar progressBar;
/// <summary>The Uri used by <see cref="newsWebView"/>.</summary>
private Uri newsUri;
/// <summary>The Uri used by <see cref="changelogWebView"/>.</summary>
private Uri changelogUri;
/// <summary>A <see cref="WebView"/> to display the DistributionCenter news page.</summary>
private WebView newsWebView;
/// <summary>A <see cref="WebView"/> to display the DistributionCenter changelog page.</summary>
private WebView changelogWebView;
/// <summary>A <see cref="TabPage"/> for the Launcher's main interface.</summary>
private TabPage mainPage;
/// <summary>A <see cref="TabPage"/> for the Launcher's news integration.</summary>
private TabPage newsPage;
/// <summary>A <see cref="TabPage"/> for the Launcher's changelog integration.</summary>
private TabPage changelogPage;
/// <summary>A <see cref="TabPage"/> for the Launcher's profile settings.</summary>
private TabPage profilePage;
#endregion
}
}
Loading…
Cancel
Save