Skip to content

Commit

Permalink
unlock all horns, quickchats stuff like that
Browse files Browse the repository at this point in the history
  • Loading branch information
szaaamerik committed Jan 13, 2024
1 parent 6dc88b5 commit dc4859f
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 87 deletions.
1 change: 1 addition & 0 deletions Forza-Mods-AIO/App.xaml
Expand Up @@ -7,6 +7,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources/Theme/MenuButtonTheme.xaml"/>
<ResourceDictionary Source="/Resources/Theme/DropdownBorderBase.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Cobalt.xaml" />
Expand Down
13 changes: 13 additions & 0 deletions Forza-Mods-AIO/Resources/Theme/DropdownBorderBase.xaml
@@ -0,0 +1,13 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Style x:Key="CommonBorderStyle" TargetType="Border">
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Width" Value="556"/>
<Setter Property="Height" Value="46"/>
<Setter Property="BorderBrush" Value="#FF2E3440"/>
<Setter Property="Margin" Value="0,10,0,0"/>
</Style>
</ResourceDictionary>
6 changes: 0 additions & 6 deletions Forza-Mods-AIO/Resources/Theme/MenuButtonTheme.xaml
Expand Up @@ -21,11 +21,5 @@
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style.Setters>

<!-- <Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="#141414"/>
</Trigger>
</Style.Triggers> -->
</Style>
</ResourceDictionary>
10 changes: 7 additions & 3 deletions Forza-Mods-AIO/Tabs/AutoShowTab/AutoshowVars.cs
Expand Up @@ -19,6 +19,7 @@ internal class AutoshowVars
#region Variables

private static nuint _ptr = nuint.Zero;
private static nuint _callFunction = nuint.Zero;
private const int VirtualFunctionIndex = 9;

#endregion
Expand Down Expand Up @@ -166,10 +167,13 @@ private static bool Query(string command)

BlockCopy(GetBytes(rdx.ToUInt64()), 0, shellCode, 0x02, 8);
BlockCopy(GetBytes(r8.ToUInt64()), 0, shellCode, 0x0C, 8);

var callFunction = GetVirtualFunctionPtr(_ptr, VirtualFunctionIndex);

BlockCopy(GetBytes(callFunction.ToUInt64()), 0, shellCode, shellCode.Length - 8, 8);
if (_callFunction == nuint.Zero)
{
_callFunction = GetVirtualFunctionPtr(_ptr, VirtualFunctionIndex);
}

BlockCopy(GetBytes(_callFunction.ToUInt64()), 0, shellCode, shellCode.Length - 8, 8);

Mw.M.WriteStringMemory(r8, command + "\0");

Expand Down
Expand Up @@ -16,13 +16,7 @@
CornerRadius="0,0,10,10" />

<StackPanel>
<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">
<Border Style="{StaticResource CommonBorderStyle}">

<StackPanel Orientation="Horizontal">

Expand Down Expand Up @@ -61,13 +55,7 @@

</Border>

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">
<Border Style="{StaticResource CommonBorderStyle}">

<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<mah:NumericUpDown x:Name="HeadlightRed"
Expand Down Expand Up @@ -141,13 +129,7 @@

</Border>

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">
<Border Style="{StaticResource CommonBorderStyle}">

<Grid>

Expand Down Expand Up @@ -198,14 +180,10 @@
Margin="10 0"
Toggled="CleanlinessSwitch_OnToggled"/>
</Grid>

</Border><Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">

</Border>

<Border Style="{StaticResource CommonBorderStyle}">

<StackPanel Orientation="Horizontal">

Expand Down
Expand Up @@ -14,13 +14,7 @@
BorderThickness="2,0,2,2"
CornerRadius="0,0,10,10" />

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440" />
<Border Style="{StaticResource CommonBorderStyle}"/>

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
Expand All @@ -38,9 +32,6 @@
Margin="0,120,0,0"
BorderBrush="#FF2E3440" />




<Grid Height="46"
Width="556"
HorizontalAlignment="Center"
Expand Down
12 changes: 6 additions & 6 deletions Forza-Mods-AIO/Tabs/Self-Vehicle/DropDownTabs/HandlingPage.xaml
Expand Up @@ -13,7 +13,7 @@
<Border BorderBrush="#FF2E3440" BorderThickness="2,0,2,2" CornerRadius="0,0,10,10"/>

<StackPanel>
<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" Margin="0,10,0,0" BorderBrush="#FF2E3440" >
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<StackPanel Orientation="Horizontal">
<Label Content="Mode"
Expand Down Expand Up @@ -98,7 +98,7 @@

</Border>

<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" BorderBrush="#FF2E3440" Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<mah:ToggleSwitch x:Name="WheelSpeedSwitch"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -190,7 +190,7 @@
</Grid>
</Border>

<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" BorderBrush="#FF2E3440" Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<mah:NumericUpDown x:Name="GravityValueNum"
Margin="6.5 0 0 0"
Expand Down Expand Up @@ -350,7 +350,7 @@
</Grid>
</Border>

<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" BorderBrush="#FF2E3440" Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<mah:NumericUpDown x:Name="JumpHackVelocityNum"
HorizontalAlignment="Left"
Expand Down Expand Up @@ -529,7 +529,7 @@
</StackPanel>
</Grid>
</Border>
<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" BorderBrush="#FF2E3440" Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<mah:NumericUpDown x:Name="SuperBrakeVelocity"
HorizontalAlignment="Left"
Expand Down Expand Up @@ -573,7 +573,7 @@
ValueChanged="SuperBrakeSlider_OnValueChanged"/>
</Grid>
</Border>
<Border BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top" Width="556" Height="46" BorderBrush="#FF2E3440" Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">

<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
Expand Down
11 changes: 2 additions & 9 deletions Forza-Mods-AIO/Tabs/Self-Vehicle/DropDownTabs/StatsPage.xaml
Expand Up @@ -15,15 +15,8 @@
BorderThickness="2,0,2,2"
CornerRadius="0,0,10,10" />

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440" />


<Border Style="{StaticResource CommonBorderStyle}"/>

<ComboBox x:Name="StatsBox"
BorderThickness="0"
Background="#FF2E3440"
Expand Down
73 changes: 50 additions & 23 deletions Forza-Mods-AIO/Tabs/Self-Vehicle/DropDownTabs/UnlocksPage.xaml
Expand Up @@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="235"
d:DesignHeight="290"
d:DesignWidth="580"
Title="UnlocksPage"
Background="{DynamicResource ApplicationBackgroundBrush}">
Expand All @@ -17,14 +17,7 @@

<StackPanel>

<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">

<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
Expand Down Expand Up @@ -99,13 +92,7 @@
</Grid>

</Border>
<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
Margin="0,10,0,0"
BorderBrush="#FF2E3440">
<Border Style="{StaticResource CommonBorderStyle}">

<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -257,13 +244,7 @@
</StackPanel>


<Border BorderThickness="2,2,2,2"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="556"
Height="46"
BorderBrush="#FF2E3440"
Margin="0,10,0,0">
<Border Style="{StaticResource CommonBorderStyle}">
<Grid>
<mah:NumericUpDown x:Name="SeriesNum"
HideUpDownButtons="True"
Expand Down Expand Up @@ -309,6 +290,52 @@
Toggled="SeasonalToggle_OnToggled"/>
</Grid>
</Border>

<Border Style="{StaticResource CommonBorderStyle}">
<StackPanel Orientation="Horizontal">

<Label VerticalAlignment="Center"
Content="Unlock all:"
Margin="6.5 0 0 0"/>

<Button VerticalAlignment="Center"
Background="#FF2E3440"
BorderThickness="0"
Content="Horns"
Margin="6.5 0 0 0"
Width="111.5"
Tag="5"
Click="Unlock_OnClick"/>

<Button VerticalAlignment="Center"
Background="#FF2E3440"
BorderThickness="0"
Content="Quick Chats"
Margin="6.5 0 0 0"
Width="111.5"
Tag="7"
Click="Unlock_OnClick"/>

<Button VerticalAlignment="Center"
Background="#FF2E3440"
BorderThickness="0"
Content="Clothing"
Margin="6.5 0 0 0"
Width="111.5"
Tag="4"
Click="Unlock_OnClick"/>

<Button VerticalAlignment="Center"
Background="#FF2E3440"
BorderThickness="0"
Content="Emotes"
Tag="6"
Margin="6.5 0 0 0"
Width="111.5"
Click="Unlock_OnClick"/>

</StackPanel>
</Border>
</StackPanel>


Expand Down
31 changes: 31 additions & 0 deletions Forza-Mods-AIO/Tabs/Self-Vehicle/DropDownTabs/UnlocksPage.xaml.cs
@@ -1,5 +1,7 @@
using System.Windows;
using System.Windows.Controls;
using Forza_Mods_AIO.Resources;
using Forza_Mods_AIO.Tabs.AutoShowTab;
using MahApps.Metro.Controls;
using static System.Convert;
using static Forza_Mods_AIO.Tabs.Self_Vehicle.SelfVehicleAddresses;
Expand Down Expand Up @@ -317,4 +319,33 @@ private void SkillPointsToggle_OnToggled(object sender, RoutedEventArgs e)

SkillPointsDetour.Toggle();
}

private bool _wasIdListCreated;

private void Unlock_OnClick(object sender, RoutedEventArgs e)
{
if (sender is not Button button)
{
return;
}

if (MessageBox.Show(
"This feature wasnt tested at all, it should work in theory though. Do you want to continue?",
"Warning", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
{
return;
}

if (!_wasIdListCreated)
{
const string makeIdList = "CREATE TABLE IF NOT EXISTS id_list (id INTEGER PRIMARY KEY); WITH RECURSIVE Counter(id) AS (SELECT 1 UNION SELECT id + 1 FROM Counter WHERE id < 5000) INSERT INTO id_list (id) SELECT id FROM Counter;";
AutoshowVars.ExecSql(button, Unlock_OnClick, makeIdList);
_wasIdListCreated = true;
}
AutoshowVars.ExecSql(button, Unlock_OnClick,"UPDATE ContentOffers SET IsFree = 1;");

var insert = $"INSERT INTO ContentOffersMapping (OfferId,ContentId,ContentType,IsPromo,IsAutoRedeem,Quantity) SELECT 3, id, {button.Tag}, 0, 1, 1 FROM id_list;";
AutoshowVars.ExecSql(button, Unlock_OnClick,insert);
}

}
2 changes: 1 addition & 1 deletion Forza-Mods-AIO/Tabs/Self-Vehicle/Self-Vehicle.xaml.cs
Expand Up @@ -50,7 +50,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
private static readonly Dictionary<string, double> Sizes = new()
{
{ "HandlingButton", 570 }, // Button name for page, height of page
{ "UnlocksButton", 235 },
{ "UnlocksButton", 290 },
{ "PhotomodeButton", 285 },
{ "StatsButton", 70 },
{ "TeleportsButton", 70 },
Expand Down

0 comments on commit dc4859f

Please sign in to comment.