aidancheddar
Active Member
Having fiddled with processors on my own repository, I decided to try out on @francot514's TSOCategorizer. I know he barely touches it but since it makes use of PD's APIs, it makes for excellent way to get your hands dirty in the TSO.Files APIs. So, I wondered, would it be possible to have TSOCategorizer work on Linux? Right now, it can but not without Wine. This is because of the Microsoft.Win32 package. Thankfully, it only makes use of it once. So, after much trial and error, it worked! Unfortunately, I don't have a Linux VM on me at the moment but if you swap !UNIX with UNIX and vice verse, yeah. I also used the if (Environment.Is64BitOperatingSystem && Environment.Is64BitProcess) logic from PD itself for detecting systems on 32bit installations. Apparently, Mono doesn't have those Unix processors. Created a simpler implantation below.
Code:
#if !UNIX
using Microsoft.Win32;
#endif
Code:
#if !UNIX
string autoRegSoft;
if (Environment.Is64BitOperatingSystem && Environment.Is64BitProcess){
autoRegSoft = "SOFTWARE";
} else {
autoRegSoft = "SOFTWARE\\Wow6432Node";
}
if (Registry.GetValue("HKEY_LOCAL_MACHINE\\" + autoRegSoft + "\\Maxis\\The Sims Online", "InstallDir", null) == null)
{
// Displays a message box with the yes and no options.
DialogResult Response = MessageBox.Show("Please select TSO Game Folder", "TSO Game Installation", MessageBoxButtons.OKCancel);
// If statement to check if the yes button was selected.
if (Response == DialogResult.OK)
{
folderBrowserDialog1.ShowDialog();
Properties.Settings.Default.Gamepath = folderBrowserDialog1.SelectedPath;
Properties.Settings.Default.Save();
gamedir = folderBrowserDialog1.SelectedPath;
}
else
{
// The no button was selected.
MessageBox.Show("Now you cannot preview files");
Application.Exit();
}
}
else
{
regvalue = Registry.GetValue("HKEY_LOCAL_MACHINE\\" + autoRegSoft + "\\Maxis\\The Sims Online", "InstallDir", null).ToString();
Properties.Settings.Default.Gamepath = regvalue;
Properties.Settings.Default.Save();
gamedir = regvalue;
}
#elif UNIX
// Displays a message box with the yes and no options.
DialogResult Response = MessageBox.Show("Please select TSO Game Folder", "TSO Game Installation", MessageBoxButtons.OKCancel);
if(Response == DialogResult.OK)
{
folderBrowserDialog1.ShowDialog();
Properties.Settings.Default.Gamepath = folderBrowserDialog1.SelectedPath;
gamedir = folderBrowserDialog1.SelectedPath;
}
else
{
MessageBox.Show("Now you cannot preview files");
Application.Exit();
}
#endif
Last edited:
