Some naming consistency + cleaning

pull/35/head
Miepee 4 years ago
parent 8f66290032
commit 33f8e974cd

@ -44,7 +44,7 @@ internal static class MainClass
#endif #endif
//Log Wine //Log Wine
if (OS.IsThisRunningFromWine) log.Info("Currently running from WINE!"); if (OS.IsThisRunningFromWINE) log.Info("Currently running from WINE!");
// Try catch in case it ever crashes before actually getting to the Eto application // Try catch in case it ever crashes before actually getting to the Eto application
try try

@ -498,7 +498,7 @@ public partial class MainForm : Form
bool useHQMusic = hqMusicAndroidCheck.Checked.Value; bool useHQMusic = hqMusicAndroidCheck.Checked.Value;
Progress<int> progressIndicator = new Progress<int>(UpdateProgressBar); Progress<int> progressIndicator = new Progress<int>(UpdateProgressBar);
await Task.Run(() => Profile.CreateAPK(profileList[profileIndex.Value], useHQMusic, progressIndicator)); await Task.Run(() => Profile.CreateApk(profileList[profileIndex.Value], useHQMusic, progressIndicator));
SetApkButtonState(ApkButtonState.Create); SetApkButtonState(ApkButtonState.Create);
DisableProgressBar(); DisableProgressBar();

@ -5,7 +5,6 @@ using AM2RLauncher.Properties;
using Eto.Drawing; using Eto.Drawing;
using Eto.Forms; using Eto.Forms;
using log4net; using log4net;
using Pablo.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -284,7 +283,7 @@ public partial class MainForm : Form
// Version number label // Version number label
Label versionLabel = new Label Label versionLabel = new Label
{ {
Text = $"v{VERSION}{(OS.IsThisRunningFromWine ? "-WINE" : "")}", Text = $"v{VERSION}{(OS.IsThisRunningFromWINE ? "-WINE" : "")}",
Width = 48, TextAlignment = TextAlignment.Right, TextColor = LauncherColors.Green, Width = 48, TextAlignment = TextAlignment.Right, TextColor = LauncherColors.Green,
Font = new Font(SystemFont.Default, 12) Font = new Font(SystemFont.Default, 12)
}; };
@ -300,7 +299,7 @@ public partial class MainForm : Form
mainLayout.AddSpace(); mainLayout.AddSpace();
// Yes, I'm hard-coding this string. Linux users can english. // Yes, I'm hard-coding this string. Linux users can english.
Label wineLabel = OS.IsThisRunningFromWine ? new Label { Text = "Unsupported", TextColor = LauncherColors.Red, TextAlignment = TextAlignment.Right } : null; Label wineLabel = OS.IsThisRunningFromWINE ? new Label { Text = "Unsupported", TextColor = LauncherColors.Red, TextAlignment = TextAlignment.Right } : null;
mainLayout.AddColumn(versionLabel, wineLabel); mainLayout.AddColumn(versionLabel, wineLabel);
drawable.Content = mainLayout; drawable.Content = mainLayout;

@ -2,7 +2,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Net.NetworkInformation;
using System.Security.Cryptography; using System.Security.Cryptography;
namespace AM2RLauncherLib; namespace AM2RLauncherLib;

@ -51,7 +51,7 @@ public static class OS
/// <summary> /// <summary>
/// Checks if this is run via WINE. /// Checks if this is run via WINE.
/// </summary> /// </summary>
public static readonly bool IsThisRunningFromWine = CheckIfRunFromWINE(); public static readonly bool IsThisRunningFromWINE = CheckIfRunFromWINE();
/// <summary> /// <summary>
/// Checks if this is run via Flatpak. /// Checks if this is run via Flatpak.

@ -461,7 +461,7 @@ public static class Profile
if (OS.IsLinux) if (OS.IsLinux)
{ {
string assetsPath = profilePath; string assetsPath = profilePath;
profilePath = profilePath.Substring(0, profilePath.LastIndexOf("/")); profilePath = $"{Core.ProfilesPath}/{profile.Name}";
// Rename all songs to lowercase // Rename all songs to lowercase
foreach (FileInfo file in new DirectoryInfo(assetsPath).GetFiles()) foreach (FileInfo file in new DirectoryInfo(assetsPath).GetFiles())
@ -571,7 +571,7 @@ public static class Profile
/// <param name="profile"><see cref="ProfileXML"/> to be compiled into an APK.</param> /// <param name="profile"><see cref="ProfileXML"/> to be compiled into an APK.</param>
/// <param name="useHqMusic">Whether to create the APK with high quality music or not.</param> /// <param name="useHqMusic">Whether to create the APK with high quality music or not.</param>
/// <param name="progress">Provides the current progress of this method.</param> /// <param name="progress">Provides the current progress of this method.</param>
public static void CreateAPK(ProfileXML profile, bool useHqMusic, IProgress<int> progress) public static void CreateApk(ProfileXML profile, bool useHqMusic, IProgress<int> progress)
{ {
// Overall safety check just in case of bad situations // Overall safety check just in case of bad situations
if (!profile.SupportsAndroid) if (!profile.SupportsAndroid)
@ -695,7 +695,7 @@ public static class Profile
// Write log header to file // Write log header to file
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append($"AM2RLauncher {Core.Version} log generated at {date}"); stringBuilder.Append($"AM2RLauncher {Core.Version} log generated at {date}");
if (OS.IsThisRunningFromWine) if (OS.IsThisRunningFromWINE)
stringBuilder.Append("Using WINE!"); stringBuilder.Append("Using WINE!");
File.WriteAllText(logFile, stringBuilder.ToString()); File.WriteAllText(logFile, stringBuilder.ToString());
@ -725,15 +725,16 @@ public static class Profile
if (!File.Exists(am2rConfigPath)) if (!File.Exists(am2rConfigPath))
File.WriteAllText(am2rConfigPath, "[Screen]\nFullscreen=\"0\"\nScale=\"3\""); File.WriteAllText(am2rConfigPath, "[Screen]\nFullscreen=\"0\"\nScale=\"3\"");
ProcessStartInfo startInfo = new ProcessStartInfo(); ProcessStartInfo startInfo = new ProcessStartInfo
{
startInfo.UseShellExecute = false; UseShellExecute = false,
startInfo.WorkingDirectory = gameDirectory; WorkingDirectory = gameDirectory,
#if NOAPPIMAGE #if NOAPPIMAGE
startInfo.FileName = $"{gameDirectory}/runner"; FileName = $"{gameDirectory}/runner"
#else #else
startInfo.FileName = $"{gameDirectory}/AM2R.AppImage"; FileName = $"{gameDirectory}/AM2R.AppImage"
#endif #endif
};
log.Info($"CWD of Profile is {startInfo.WorkingDirectory}"); log.Info($"CWD of Profile is {startInfo.WorkingDirectory}");

Loading…
Cancel
Save