Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6037e0c91 |
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<Grid Margin="0,35,0,0">
|
<Grid Margin="0,35,0,0">
|
||||||
<TabControl Background="#1E1E1E" Foreground="White">
|
<TabControl x:Name="MainTabControl" Background="#1E1E1E" Foreground="White" SelectionChanged="MainTabControl_SelectionChanged">
|
||||||
<!-- Console Tab -->
|
<!-- Console Tab -->
|
||||||
<TabItem Header="Console">
|
<TabItem Header="Console">
|
||||||
<Grid Background="#252525" Margin="10">
|
<Grid Background="#252525" Margin="10">
|
||||||
|
|||||||
@@ -451,7 +451,40 @@ namespace Lithium
|
|||||||
private void ToggleCustomSet_Click(object sender, RoutedEventArgs e)
|
private void ToggleCustomSet_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
customSetEnabled = !customSetEnabled;
|
customSetEnabled = !customSetEnabled;
|
||||||
UpdateCustomSetConsole(customSetEnabled ? "Set is ON" : "Set is OFF");
|
UpdateCustomSetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainTabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateCustomSetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateCustomSetState()
|
||||||
|
{
|
||||||
|
var selectedTab = MainTabControl.SelectedItem as TabItem;
|
||||||
|
bool onCustomTab = selectedTab != null &&
|
||||||
|
string.Equals(selectedTab.Header?.ToString(), "Custom Set Builder", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
if (customSetEnabled && onCustomTab)
|
||||||
|
{
|
||||||
|
if (double.TryParse(RecoilXTextBox.Text, System.Globalization.NumberStyles.Float,
|
||||||
|
System.Globalization.CultureInfo.InvariantCulture, out double x) &&
|
||||||
|
double.TryParse(RecoilYTextBox.Text, System.Globalization.NumberStyles.Float,
|
||||||
|
System.Globalization.CultureInfo.InvariantCulture, out double y))
|
||||||
|
{
|
||||||
|
RecoilEngine.CustomModeActive = true;
|
||||||
|
RecoilEngine.CustomRecoilX = x;
|
||||||
|
RecoilEngine.CustomRecoilY = y;
|
||||||
|
UpdateCustomSetConsole($"Custom Set ACTIVE | X:{x} Y:{y}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateCustomSetConsole("Error: Invalid recoil values");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RecoilEngine.CustomModeActive = false;
|
||||||
|
UpdateCustomSetConsole(customSetEnabled ? "Set is ON (switch to tab to activate)" : "Set is OFF");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// AA0145
|
// AA0145
|
||||||
|
|||||||
+13
-2
@@ -20,6 +20,10 @@ namespace Lua
|
|||||||
private static double _remainderX, _remainderY;
|
private static double _remainderX, _remainderY;
|
||||||
private static double _jitterMultiplierX, _jitterMultiplierY;
|
private static double _jitterMultiplierX, _jitterMultiplierY;
|
||||||
|
|
||||||
|
public static bool CustomModeActive = false;
|
||||||
|
public static double CustomRecoilX = 0;
|
||||||
|
public static double CustomRecoilY = 0;
|
||||||
|
|
||||||
private static bool IsDown(int key)
|
private static bool IsDown(int key)
|
||||||
{
|
{
|
||||||
return (GetAsyncKeyState(key) & 0x8000) != 0;
|
return (GetAsyncKeyState(key) & 0x8000) != 0;
|
||||||
@@ -61,12 +65,19 @@ namespace Lua
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int now = Environment.TickCount;
|
||||||
|
|
||||||
|
if (CustomModeActive)
|
||||||
|
{
|
||||||
|
HandleJitter(now);
|
||||||
|
ApplyRecoil((CustomRecoilX, CustomRecoilY));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string setName = OperatorSets.CurrentSet;
|
string setName = OperatorSets.CurrentSet;
|
||||||
|
|
||||||
if (!OperatorSets.mergedSets.TryGetValue(setName, out var recoil)) return;
|
if (!OperatorSets.mergedSets.TryGetValue(setName, out var recoil)) return;
|
||||||
|
|
||||||
int now = Environment.TickCount;
|
|
||||||
|
|
||||||
HandleJitter(now);
|
HandleJitter(now);
|
||||||
ApplyRecoil(recoil);
|
ApplyRecoil(recoil);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user