Skip to content

Commit

Permalink
Various improvements
Browse files Browse the repository at this point in the history
- Bumped SHVDN to 3.3.1
- Bumped LemonUI to 1.5.1
- Use new FusionLibrary stuff
- Removed obsolete code
- Fixed some bugs
  • Loading branch information
bttf92 committed Sep 27, 2021
1 parent 1a17328 commit 26ae6f4
Show file tree
Hide file tree
Showing 62 changed files with 417 additions and 605 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "KlangRageAudioLibrary"]
path = KlangRageAudioLibrary
url = https://github.com/bttfv/KlangRageAudioLibrary
[submodule "FusionLibrary"]
path = FusionLibrary
url = https://github.com/bttfv/FusionLibrary
20 changes: 0 additions & 20 deletions BackToTheFutureV.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackToTheFutureV", "BackToTheFutureV\BackToTheFutureV.csproj", "{7BE2F39B-E0F1-4F7D-B674-BC595E4AF50D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KlangRageAudioLibrary", "KlangRageAudioLibrary\KlangRageAudioLibrary.csproj", "{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FusionLibrary", "FusionLibrary\FusionLibrary.csproj", "{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,22 +21,6 @@ Global
{7BE2F39B-E0F1-4F7D-B674-BC595E4AF50D}.Release|Any CPU.Build.0 = Release|Any CPU
{7BE2F39B-E0F1-4F7D-B674-BC595E4AF50D}.Release|x64.ActiveCfg = Release|Any CPU
{7BE2F39B-E0F1-4F7D-B674-BC595E4AF50D}.Release|x64.Build.0 = Release|Any CPU
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Debug|x64.ActiveCfg = Debug|x64
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Debug|x64.Build.0 = Debug|x64
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Release|Any CPU.Build.0 = Release|Any CPU
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Release|x64.ActiveCfg = Release|x64
{E52DB215-0AA9-453A-B5F3-91F3FF35C1D9}.Release|x64.Build.0 = Release|x64
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Debug|x64.ActiveCfg = Debug|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Debug|x64.Build.0 = Debug|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Release|Any CPU.Build.0 = Release|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Release|x64.ActiveCfg = Release|Any CPU
{F5AAD1BD-63CA-4A12-97A8-F0D876AB4462}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
70 changes: 11 additions & 59 deletions BackToTheFutureV/BackToTheFutureV.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -58,59 +57,22 @@
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release %28Test%29|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Release %28Test%29\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release %28Test%29|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Release %28Test%29\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug %28Test%29|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug %28Test%29\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug %28Test%29|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug %28Test%29\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="BackToTheFutureV.HUD.Core">
<HintPath>$(GTAPath)\scripts\BackToTheFutureV.HUD.Core.dll</HintPath>
</Reference>
<Reference Include="FusionLibrary, Version=1.0.7917.28287, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(GTAPath)\scripts\FusionLibrary.dll</HintPath>
</Reference>
<Reference Include="irrKlang.NET4, Version=1.0.6617.18847, Culture=neutral, PublicKeyToken=a854741bd80517c7, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\KlangRageAudioLibrary\irrKlang\irrKlang.NET4.dll</HintPath>
<HintPath>$(GTAPath)\scripts\irrKlang.NET4.dll</HintPath>
</Reference>
<Reference Include="KlangRageAudioLibrary, Version=1.0.7917.28287, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(GTAPath)\scripts\KlangRageAudioLibrary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -234,25 +196,15 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FusionLibrary\FusionLibrary.csproj">
<Project>{f5aad1bd-63ca-4a12-97a8-f0d876ab4462}</Project>
<Name>FusionLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\KlangRageAudioLibrary\KlangRageAudioLibrary.csproj">
<Project>{e52db215-0aa9-453a-b5f3-91f3ff35c1d9}</Project>
<Name>KlangRageAudioLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="LemonUI.SHVDN3">
<Version>1.4.0</Version>
<Version>1.5.1</Version>
</PackageReference>
<PackageReference Include="MonoGame.Framework.DesktopGL">
<Version>3.8.0.1641</Version>
</PackageReference>
<PackageReference Include="ScriptHookVDotNet3">
<Version>3.1.0</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion BackToTheFutureV/GUI/SIDScaleform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class SIDScaleform : ScaleformGui
private PropertiesHandler Properties => TimeMachineHandler.ClosestTimeMachine.Properties;

private static PointF SID3DLocation = new PointF() { X = 0.626f, Y = 0.626f };
private static float SID3DScale = 1.284f;
private static readonly float SID3DScale = 1.284f;

public SIDScaleform(bool is2D) : base(is2D ? "bttf_2d_sid" : "bttf_3d_sid")
{
Expand Down
2 changes: 1 addition & 1 deletion BackToTheFutureV/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private unsafe void Main_Tick(object sender, EventArgs e)
ModelHandler.RequestModels();

//Disable fake shake of the cars.
Function.Call((Hash)0x84FD40F56075E816, 0);
Function.Call(Hash._​SET_​CAR_​HIGH_​SPEED_​BUMP_​SEVERITY_​MULTIPLIER, 0);

if (ModSettings.PersistenceSystem)
{
Expand Down
28 changes: 14 additions & 14 deletions BackToTheFutureV/Menu/ControlsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ namespace BackToTheFutureV
{
internal class ControlsMenu : BTTFVMenu
{
private NativeCheckboxItem UseControlForMainMenu;
private NativeListItem<Keys> MainMenu;
private readonly NativeCheckboxItem UseControlForMainMenu;
private readonly NativeListItem<Keys> MainMenu;

private NativeCheckboxItem CombinationsForInteractionMenu;
private NativeListItem<ControlInfo> InteractionMenu1;
private NativeListItem<ControlInfo> InteractionMenu2;
private readonly NativeCheckboxItem CombinationsForInteractionMenu;
private readonly NativeListItem<ControlInfo> InteractionMenu1;
private readonly NativeListItem<ControlInfo> InteractionMenu2;

private NativeCheckboxItem LongPressForHover;
private NativeListItem<ControlInfo> Hover;
private NativeListItem<ControlInfo> HoverBoost;
private NativeListItem<ControlInfo> HoverVTOL;
private NativeListItem<Keys> HoverAltitudeHold;
private readonly NativeCheckboxItem LongPressForHover;
private readonly NativeListItem<ControlInfo> Hover;
private readonly NativeListItem<ControlInfo> HoverBoost;
private readonly NativeListItem<ControlInfo> HoverVTOL;
private readonly NativeListItem<Keys> HoverAltitudeHold;

private NativeListItem<Keys> TCToggle;
private NativeListItem<Keys> CutsceneToggle;
private NativeListItem<Keys> InputToggle;
private readonly NativeListItem<Keys> TCToggle;
private readonly NativeListItem<Keys> CutsceneToggle;
private readonly NativeListItem<Keys> InputToggle;

private NativeItem Reset;
private readonly NativeItem Reset;

private bool _doNotUpdate;

Expand Down
36 changes: 18 additions & 18 deletions BackToTheFutureV/Menu/CustomMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ internal class CustomMenu : BTTFVMenu
{
public bool ForceNew = false;

private NativeListItem<string> _wormholeType;
private NativeListItem<string> _reactorType;
private NativeListItem<string> _wheelsType;
private NativeCheckboxItem _hoverUnderbody;
private NativeCheckboxItem _hoodBox;
private NativeCheckboxItem _hook;
private NativeCheckboxItem _threeDigits;
private NativeListItem<string> _plate;
private NativeListItem<string> _exhaust;
private NativeListItem<string> _suspensions;
private NativeListItem<string> _hood;
private NativeItem _saveConf;
private NativeItem _confirm;
private readonly NativeListItem<string> _wormholeType;
private readonly NativeListItem<string> _reactorType;
private readonly NativeListItem<string> _wheelsType;
private readonly NativeCheckboxItem _hoverUnderbody;
private readonly NativeCheckboxItem _hoodBox;
private readonly NativeCheckboxItem _hook;
private readonly NativeCheckboxItem _threeDigits;
private readonly NativeListItem<string> _plate;
private readonly NativeListItem<string> _exhaust;
private readonly NativeListItem<string> _suspensions;
private readonly NativeListItem<string> _hood;
private readonly NativeItem _saveConf;
private readonly NativeItem _confirm;

private TimeMachine _tempTimeMachine;

Expand Down Expand Up @@ -193,10 +193,10 @@ private bool ConvertFromModState(ModState value)
public override void Menu_Shown(object sender, EventArgs e)
{
if (MenuHandler.MainMenu.Visible)
MenuHandler.MainMenu.Close();
MenuHandler.MainMenu.Visible = false;

if (MenuHandler.TimeMachineMenu.Visible)
MenuHandler.TimeMachineMenu.Close();
MenuHandler.TimeMachineMenu.Visible = false;

if (ForceNew || (FusionUtils.PlayerVehicle == null || !FusionUtils.PlayerVehicle.IsTimeMachine()))
{
Expand All @@ -211,7 +211,7 @@ public override void Menu_Shown(object sender, EventArgs e)

if (_tempTimeMachine.Constants.FullDamaged)
{
Close();
Visible = false;
return;
}

Expand All @@ -234,7 +234,7 @@ public override void Menu_OnItemActivated(NativeItem sender, EventArgs e)
if (sender == _wormholeType | sender == _confirm)
{
GarageHandler.WaitForCustomMenu = false;
Close();
Visible = false;
}
else if (sender == _saveConf)
{
Expand Down Expand Up @@ -275,7 +275,7 @@ public override void Tick()
{
if (FusionUtils.PlayerVehicle != _tempTimeMachine)
{
Close();
Visible = false;
return;
}

Expand Down
22 changes: 11 additions & 11 deletions BackToTheFutureV/Menu/CustomMenu2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace BackToTheFutureV
{
internal class CustomMenu2 : BTTFVMenu
{
private NativeListItem<string> _wormholeType;
private NativeListItem<string> _wheelsType;
private NativeCheckboxItem _hook;
private NativeCheckboxItem _threeDigits;
private NativeListItem<string> _plate;
private NativeListItem<string> _exhaust;
private NativeListItem<string> _suspensions;
private NativeListItem<string> _hood;
private readonly NativeListItem<string> _wormholeType;
private readonly NativeListItem<string> _wheelsType;
private readonly NativeCheckboxItem _hook;
private readonly NativeCheckboxItem _threeDigits;
private readonly NativeListItem<string> _plate;
private readonly NativeListItem<string> _exhaust;
private readonly NativeListItem<string> _suspensions;
private readonly NativeListItem<string> _hood;

private TimeMachine TimeMachine => TimeMachineHandler.CurrentTimeMachine;

Expand Down Expand Up @@ -166,10 +166,10 @@ private void LoadVehicleMods()
public override void Menu_Shown(object sender, EventArgs e)
{
if (MenuHandler.MainMenu.Visible)
MenuHandler.MainMenu.Close();
MenuHandler.MainMenu.Visible = false;

if (MenuHandler.TimeMachineMenu.Visible)
MenuHandler.TimeMachineMenu.Close();
MenuHandler.TimeMachineMenu.Visible = false;

_hook.Enabled = TimeMachine.Mods.IsDMC12;
_plate.Enabled = TimeMachine.Mods.IsDMC12;
Expand Down Expand Up @@ -209,7 +209,7 @@ public override void Tick()
{
if (FusionUtils.PlayerVehicle != TimeMachine)
{
Close();
Visible = false;
return;
}

Expand Down
6 changes: 3 additions & 3 deletions BackToTheFutureV/Menu/EventsSettingsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace BackToTheFutureV
{
internal class EventsSettingsMenu : BTTFVMenu
{
private NativeCheckboxItem LightningStrikeEvent;
private NativeCheckboxItem EngineStallEvent;
private NativeCheckboxItem TurbulenceEvent;
private readonly NativeCheckboxItem LightningStrikeEvent;
private readonly NativeCheckboxItem EngineStallEvent;
private readonly NativeCheckboxItem TurbulenceEvent;

public EventsSettingsMenu() : base("Events")
{
Expand Down
20 changes: 10 additions & 10 deletions BackToTheFutureV/Menu/GarageMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ namespace BackToTheFutureV
{
internal class GarageMenu : BTTFVMenu
{
private NativeItem transformInto;
private NativeItem hoverConvert;
private NativeItem installMrFusion;
private NativeItem buyPlutonium;
private NativeItem repairTC;
private NativeItem repairFC;
private NativeItem repairEngine;
private readonly NativeItem transformInto;
private readonly NativeItem hoverConvert;
private readonly NativeItem installMrFusion;
private readonly NativeItem buyPlutonium;
private readonly NativeItem repairTC;
private readonly NativeItem repairFC;
private readonly NativeItem repairEngine;

public static AudioPlayer[] GarageSounds { get; } = { Main.CommonAudioEngine.Create("general/garage/tireChange.wav", Presets.No3D), Main.CommonAudioEngine.Create("general/garage/drill1.wav", Presets.No3D), Main.CommonAudioEngine.Create("general/garage/drill2.wav", Presets.No3D), Main.CommonAudioEngine.Create("general/garage/drill3.wav", Presets.No3D) };

private NativeSubmenuItem customMenu;
private readonly NativeSubmenuItem customMenu;

public GarageMenu() : base("Garage")
{
Expand Down Expand Up @@ -61,7 +61,7 @@ public override void Menu_OnItemActivated(NativeItem sender, EventArgs e)
//TimeMachineHandler.Create(FusionUtils.PlayerVehicle).Properties.ReactorCharge = 0;
Game.Player.Money -= 500000;
GarageHandler.Transform = true;
Close();
Visible = false;
}

if (sender == hoverConvert)
Expand Down Expand Up @@ -175,7 +175,7 @@ public override void Tick()
{
if (!FusionUtils.PlayerVehicle.NotNullAndExists())
{
Close();
Visible = false;
return;
}

Expand Down
Loading

0 comments on commit 26ae6f4

Please sign in to comment.