Skip to content

Commit

Permalink
Updated source code to v1.4
Browse files Browse the repository at this point in the history
Important: Can only be used with IV-SDK .NET v1.0 and above
  • Loading branch information
ClonkAndre committed Dec 8, 2023
1 parent 1d512a6 commit adf4489
Show file tree
Hide file tree
Showing 23 changed files with 970 additions and 412 deletions.
7 changes: 3 additions & 4 deletions ClonksCodingLib.GTAIV/ClonksCodingLib.GTAIV.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Release|Any CPU.Build.0 = Release|Any CPU
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Debug|Any CPU.ActiveCfg = Debug|x86
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Release|Any CPU.ActiveCfg = Release|x86
{31CE9C9F-778D-40B4-BB7C-0E2CA2D6C530}.Release|Any CPU.Build.0 = Release|x86
{A0CF8D06-61AB-4E0E-AD1E-2434951C2674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0CF8D06-61AB-4E0E-AD1E-2434951C2674}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0CF8D06-61AB-4E0E-AD1E-2434951C2674}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace CCL.GTAIV.AnimationController
public class PedAnimationController
{
#region Variables
private CPed ped;
private IVPed ped;
#endregion

#region Constructor
internal PedAnimationController(CPed targetPed)
internal PedAnimationController(IVPed targetPed)
{
ped = targetPed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,30 @@
<FileAlignment>512</FileAlignment>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Debug\ClonksCodingLib.GTAIV.xml</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Release\ClonksCodingLib.GTAIV.xml</DocumentationFile>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="IVSDKDotNetWrapper, Version=0.8.0.9971, Culture=neutral, processorArchitecture=x86">
<Reference Include="IVSDKDotNetWrapper, Version=0.8.0.11511, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\IVSDKDotNet\Release\IVSDKDotNetWrapper.dll</HintPath>
</Reference>
Expand All @@ -49,6 +52,7 @@
<Compile Include="Extensions\CObjectExtensions.cs" />
<Compile Include="Extensions\ColorExtensions.cs" />
<Compile Include="Extensions\CPedExtensions.cs" />
<Compile Include="Extensions\CPlayerInfoExtensions.cs" />
<Compile Include="Extensions\CVehicleExtensions.cs" />
<Compile Include="Extensions\VectorExtensions.cs" />
<Compile Include="HandleObject.cs" />
Expand All @@ -62,6 +66,7 @@
<Compile Include="NativePickup.cs" />
<Compile Include="NativeRoom.cs" />
<Compile Include="NativeFire.cs" />
<Compile Include="NativeTaskSequence.cs" />
<Compile Include="NativeWorld.cs" />
<Compile Include="NewsScrollbar.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
47 changes: 45 additions & 2 deletions ClonksCodingLib.GTAIV/ClonksCodingLib.GTAIV/Enums.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using IVSDKDotNet;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

namespace CCL.GTAIV
{
Expand All @@ -9,7 +9,7 @@ namespace CCL.GTAIV
public enum ShootMode
{
AimOnly = 0,
SingleShot = 1,
SingleShot = 1,
SingleShotKeepAim = 2,
Burst = 3,
Continuous = 4
Expand Down Expand Up @@ -295,4 +295,47 @@ public enum BlipIcon
Misc_Base
};

/// <summary>
/// The indicators of a <see cref="IVSDKDotNet.IVVehicle"/>.
/// </summary>
public enum VehicleIndicator
{
Left = 0,
Right = 1
}

/// <summary>
/// Camera shake types.
/// </summary>
public enum CameraShakeType
{
PITCH_UP_DOWN = 0,
ROLL_LEFT_RIGHT = 1,
YAW_LEFT_RIGHT = 2,
TRACK_FORWARD_BACK = 3,
TRACK_LEFT_RIGHT = 4,
TRACK_UP_DOWN = 5,
TRACK_LEFT_RIGHT_2 = 6,
TRACK_FORWARD_BACK_2 = 7,
TRACK_UP_DOWN_2 = 8,
PULSE_IN_OUT = 9
}

/// <summary>
/// Camera shake behaviours.
/// </summary>
public enum CameraShakeBehaviour
{
CONSTANT_PLUS_FADE_IN_OUT = 1,
CONSTANT_PLUS_FADE_IN = 2,
EXPONENTIAL_PLUS_FADE_IN_OUT = 3,
VERY_SLOW_EXPONENTIAL_PLUS_FADE_IN = 4,
FAST_EXPONENTIAL_PLUS_FADE_IN_OUT = 5,
MEDIUM_FAST_EXPONENTIAL_PLUS_FADE_IN_OUT = 6,
SLOW_EXPONENTIAL_PLUS_FADE_IN = 7,
MEDIUM_SLOW_EXPONENTIAL_PLUS_FADE_IN = 8
}

}

#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

Expand All @@ -9,7 +10,10 @@

namespace CCL.GTAIV
{
public static class CObjectExtensions
/// <summary>
/// Contains extensions for the <see cref="IVObject"/> class.
/// </summary>
public static class IVObjectExtensions
{
#region Functions
/// <summary>
Expand All @@ -18,12 +22,68 @@ public static class CObjectExtensions
/// </summary>
/// <param name="obj"></param>
/// <returns>If successful, the handle of this <see cref="CObject"/> is returned. Otherwise, 0.</returns>
public static int GetHandle(this CObject obj)
public static int GetHandle(this IVObject obj)
{
if (obj == null)
return 0;

return (int)CPools.GetObjectPool().GetIndex(obj.GetUIntPtr());
return (int)IVPools.GetObjectPool().GetIndex(obj.GetUIntPtr());
}

public static bool IsPlayerTargettingObject(this IVObject obj, int playerIndex)
{
if (obj == null)
return false;

return IS_PLAYER_TARGETTING_OBJECT(playerIndex, GetHandle(obj));
}
#endregion

#region Methods
public static void ApplyForce(this IVObject obj, Vector3 direction, Vector3 rotation)
{
if (obj == null)
return;

APPLY_FORCE_TO_OBJECT(GetHandle(obj), 3, direction.X, direction.Y, direction.Z, rotation.X, rotation.Y, rotation.Z, 0, 0, 1, 1);
}
public static void ApplyForce(this IVObject obj, Vector3 direction)
{
if (obj == null)
return;

ApplyForce(obj, direction, Vector3.Zero);
}

public static void ApplyForceRelative(this IVObject obj, Vector3 direction, Vector3 rotation)
{
if (obj == null)
return;

APPLY_FORCE_TO_OBJECT(GetHandle(obj), 3, direction.X, direction.Y, direction.Z, rotation.X, rotation.Y, rotation.Z, 0, 1, 1, 1);
}
public static void ApplyForceRelative(this IVObject obj, Vector3 direction)
{
if (obj == null)
return;

ApplyForceRelative(obj, direction, Vector3.Zero);
}

public static void MakeObjectTargetable(this IVObject obj, bool targetable)
{
if (obj == null)
return;

MAKE_OBJECT_TARGETTABLE(GetHandle(obj), targetable);
}

public static void ClearObjectLastDamageEntity(this IVObject obj)
{
if (obj == null)
return;

CLEAR_OBJECT_LAST_DAMAGE_ENTITY(GetHandle(obj));
}
#endregion
}
Expand Down
Loading

0 comments on commit adf4489

Please sign in to comment.