forked from aedenthorn/ValheimMods
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce42636
commit 4a0325a
Showing
17 changed files
with
654 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
using BepInEx.Configuration; | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace ControllerButtonSwitch | ||
{ | ||
internal class ButtonInfo | ||
public class ButtonInfo | ||
{ | ||
internal string button; | ||
internal string key; | ||
internal float repeatDelay = 0; | ||
internal float repeatInterval = 0; | ||
internal bool inverted = false; | ||
public string button; | ||
public string key; | ||
public float repeatDelay = 0; | ||
public float repeatInterval = 0; | ||
public bool inverted = false; | ||
|
||
public ButtonInfo(string name, ConfigEntry<string> entry) | ||
{ | ||
button = name; | ||
string[] parts = entry.Value.Split(','); | ||
key = parts[0]; | ||
if (parts.Length == 1) | ||
return; | ||
repeatDelay = float.Parse(parts[1]); | ||
if (parts.Length == 2) | ||
return; | ||
repeatInterval = float.Parse(parts[2]); | ||
if (parts.Length == 3) | ||
return; | ||
inverted = bool.Parse(parts[3]); | ||
try | ||
{ | ||
button = name; | ||
string[] parts = entry.Value.Split(','); | ||
key = parts[0]; | ||
if (parts.Length == 1) | ||
return; | ||
repeatDelay = float.Parse(parts[1], CultureInfo.InvariantCulture.NumberFormat); | ||
if (parts.Length == 2) | ||
return; | ||
repeatInterval = float.Parse(parts[2], CultureInfo.InvariantCulture.NumberFormat); | ||
if (parts.Length == 3) | ||
return; | ||
inverted = bool.Parse(parts[3]); | ||
} | ||
catch(Exception ex) | ||
{ | ||
BepInExPlugin.Dbgl($"Exception parsing config entry {name} string {entry.Value}\n{ex}"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.