Fix 3rdPartyControllers file not being able to be found when launching BetterJoyForCemu from Search/PowerToys Run (#703)
This commit is contained in:
parent
b8de5003a4
commit
19bc9e32c5
1 changed files with 9 additions and 8 deletions
|
@ -50,14 +50,15 @@ namespace BetterJoyForCemu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const string PATH = "3rdPartyControllers";
|
static readonly string path;
|
||||||
|
|
||||||
|
static _3rdPartyControllers() {
|
||||||
|
path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
|
||||||
|
+ "\\3rdPartyControllers";
|
||||||
|
}
|
||||||
|
|
||||||
public _3rdPartyControllers() {
|
public _3rdPartyControllers() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
/*list_allControllers.DisplayMember = "Text";
|
|
||||||
list_allControllers.ValueMember = "Value";
|
|
||||||
list_customControllers.DisplayMember = "Text";
|
|
||||||
list_customControllers.ValueMember = "Value";*/
|
|
||||||
list_allControllers.HorizontalScrollbar = true; list_customControllers.HorizontalScrollbar = true;
|
list_allControllers.HorizontalScrollbar = true; list_customControllers.HorizontalScrollbar = true;
|
||||||
|
|
||||||
chooseType.Items.AddRange(new String[] { "Pro Controller", "Left Joycon", "Right Joycon" });
|
chooseType.Items.AddRange(new String[] { "Pro Controller", "Left Joycon", "Right Joycon" });
|
||||||
|
@ -66,8 +67,8 @@ namespace BetterJoyForCemu {
|
||||||
group_props.Controls.Add(chooseType);
|
group_props.Controls.Add(chooseType);
|
||||||
group_props.Enabled = false;
|
group_props.Enabled = false;
|
||||||
|
|
||||||
if (File.Exists(PATH)) {
|
if (File.Exists(path)) {
|
||||||
using (StreamReader file = new StreamReader(PATH)) {
|
using (StreamReader file = new StreamReader(path)) {
|
||||||
string line = String.Empty;
|
string line = String.Empty;
|
||||||
while ((line = file.ReadLine()) != null && (line != String.Empty)) {
|
while ((line = file.ReadLine()) != null && (line != String.Empty)) {
|
||||||
String[] split = line.Split('|');
|
String[] split = line.Split('|');
|
||||||
|
@ -154,7 +155,7 @@ namespace BetterJoyForCemu {
|
||||||
foreach (SController v in list_customControllers.Items) {
|
foreach (SController v in list_customControllers.Items) {
|
||||||
sc += v.Serialise() + "\r\n";
|
sc += v.Serialise() + "\r\n";
|
||||||
}
|
}
|
||||||
File.WriteAllText(PATH, sc);
|
File.WriteAllText(path, sc);
|
||||||
CopyCustomControllers();
|
CopyCustomControllers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue