Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions LemonUI.FiveMEnhanced/LemonUI.FiveMEnhanced.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AssemblyName>LemonUI.FiveMEnhanced</AssemblyName>
<RootNamespace>LemonUI</RootNamespace>
<DefineConstants>FIVEM_G9,CLIENT</DefineConstants>
<Version>1.10.0</Version>
<OutputPath>$(SolutionDir)bin\$(Configuration)\FiveM_Enhanced\</OutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<CheckEolTargetFramework>false</CheckEolTargetFramework>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>$(ProjectName)</PackageId>
<Authors>Hannele "Lemon" Ruiz</Authors>
<Company>Hannele "Lemon" Ruiz</Company>
<Product>LemonUI</Product>
<Description>UI system for Grand Theft Auto V. This package is for FiveM Enhanced Client.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/justalemon/LemonUI</PackageProjectUrl>
<RepositoryUrl>https://github.com/justalemon/LemonUI.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageOutputPath>$(SolutionDir)bin\$(Configuration)\FOR DEVELOPERS</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(ProjectDir)../LemonUI/**/*.cs" />
<None Include="$(ProjectDir)../README.md" Pack="true" Visible="false" PackagePath="\" />
<None Include="$(ProjectDir)../logo.png" Pack="true" Visible="false" PackagePath="\" />
<PackageReference Include="CitizenFX.FiveM.Client" Version="0.0.4-alpha">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
10 changes: 8 additions & 2 deletions LemonUI.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32106.194
# Visual Studio Version 18
VisualStudioVersion = 18.10.12217.157 stable
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LemonUI.SHVDN3", "LemonUI.SHVDN3\LemonUI.SHVDN3.csproj", "{1FBC569D-7CD5-4F5C-8EB1-4FE1B6FF2B01}"
EndProject
Expand All @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LemonUI.AltV", "LemonUI.Alt
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LemonUI.AltV.Async", "LemonUI.AltV.Async\LemonUI.AltV.Async.csproj", "{F2761304-2B83-451F-B7BD-F7F752233A01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LemonUI.FiveMEnhanced", "LemonUI.FiveMEnhanced\LemonUI.FiveMEnhanced.csproj", "{4C1221DE-D455-7C03-A596-43E0024C981F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,6 +53,10 @@ Global
{F2761304-2B83-451F-B7BD-F7F752233A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2761304-2B83-451F-B7BD-F7F752233A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2761304-2B83-451F-B7BD-F7F752233A01}.Release|Any CPU.Build.0 = Release|Any CPU
{4C1221DE-D455-7C03-A596-43E0024C981F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C1221DE-D455-7C03-A596-43E0024C981F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C1221DE-D455-7C03-A596-43E0024C981F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C1221DE-D455-7C03-A596-43E0024C981F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions LemonUI/Control.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// NO MERGE
// NO MERGE

#if ALTV
#if ALTV || FIVEM_G9

namespace LemonUI
{
Expand Down
15 changes: 14 additions & 1 deletion LemonUI/Controls.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#if FIVEM
using CitizenFX.Core;
using CitizenFX.Core.Native;
#elif FIVEM_G9
using CitizenFX.FiveM.Client;
#elif ALTV
using AltV.Net.Client;
#elif RAGEMP
Expand All @@ -13,7 +15,6 @@
using GTA.Native;
#endif
using System.Collections.Generic;
using LemonUI.Elements;

namespace LemonUI
{
Expand All @@ -33,6 +34,8 @@ public static bool IsUsingController
{
#if FIVEM
return !API.IsInputDisabled(2);
#elif FIVEM_G9
return !Native.IsUsingKeyboardAndMouse(2);
#elif ALTV
return !Alt.Natives.IsUsingKeyboardAndMouse(2);
#elif RAGEMP
Expand All @@ -58,6 +61,8 @@ public static bool IsJustPressed(Control control)
{
#if FIVEM
return API.IsDisabledControlJustPressed(0, (int)control);
#elif FIVEM_G9
return Native.IsDisabledControlJustPressed(0, (int)control);
#elif ALTV
return Alt.Natives.IsDisabledControlJustPressed(0, (int)control);
#elif RAGEMP
Expand All @@ -79,6 +84,8 @@ public static bool IsPressed(Control control)
{
#if FIVEM
return API.IsDisabledControlPressed(0, (int)control);
#elif FIVEM_G9
return Native.IsDisabledControlPressed(0, (int)control);
#elif ALTV
return Alt.Natives.IsDisabledControlPressed(0, (int)control);
#elif RAGEMP
Expand All @@ -96,6 +103,8 @@ public static void DisableAll(int inputGroup = 0)
{
#if FIVEM
API.DisableAllControlActions(inputGroup);
#elif FIVEM_G9
Native.DisableAllControlActions(inputGroup);
#elif ALTV
Alt.Natives.DisableAllControlActions(inputGroup);
#elif RAGEMP
Expand All @@ -114,6 +123,8 @@ public static void EnableThisFrame(Control control)
{
#if FIVEM
API.EnableControlAction(0, (int)control, true);
#elif FIVEM_G9
Native.EnableControlAction(0, (int)control, true);
#elif ALTV
Alt.Natives.EnableControlAction(0, (int)control, true);
#elif RAGEMP
Expand Down Expand Up @@ -143,6 +154,8 @@ public static void DisableThisFrame(Control control)
{
#if FIVEM
API.DisableControlAction(0, (int)control, true);
#elif FIVEM_G9
Native.DisableControlAction(0, (int)control, true);
#elif ALTV
Alt.Natives.DisableControlAction(0, (int)control, true);
#elif RAGEMP
Expand Down
2 changes: 1 addition & 1 deletion LemonUI/Elements/Alignment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if RPH || ALTV
#if RPH || ALTV || FIVEM_G9
namespace LemonUI
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion LemonUI/Elements/Font.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// NO MERGE

#if RPH || ALTV
#if RPH || ALTV || FIVEM_G9
namespace LemonUI.Elements
{
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions LemonUI/Elements/ScaledAnim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using AltV.Net.Client;
#elif FIVEM
using CitizenFX.Core;
#elif FIVEM_G9
using CitizenFX.FiveM.Client;
#elif RAGEMP
using RAGE.Game;
#elif RPH
Expand Down Expand Up @@ -107,6 +109,8 @@ private void UpdateTexture()
long time = Alt.Natives.GetGameTimer();
#elif RAGEMP
long time = Misc.GetGameTimer();
#elif FIVEM_G9
long time = Native.GetGameTimer();
#elif FIVEM || RPH || SHVDN3 || SHVDNC
long time = Game.GameTime;
#endif
Expand Down
11 changes: 11 additions & 0 deletions LemonUI/Elements/ScaledBink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using AltV.Net.Client;
#elif FIVEM
using CitizenFX.Core.Native;
#elif FIVEM_G9
using CitizenFX.FiveM.Client;
#elif RAGEMP
using RAGE.Game;
#elif RPH
Expand Down Expand Up @@ -45,6 +47,8 @@
Id = Alt.Natives.SetBinkMovie(name);
#elif FIVEM
Id = API.SetBinkMovie(name);
#elif FIVEM_G9

Check warning on line 50 in LemonUI/Elements/ScaledBink.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

Check warning on line 50 in LemonUI/Elements/ScaledBink.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

Id = Native.SetBinkMovie(name);
#elif RAGEMP
Id = Invoker.Invoke<int>(0xfc36643f7a64338f, name);
#elif RPH
Expand Down Expand Up @@ -114,6 +118,9 @@
#elif FIVEM
API.PlayBinkMovie(Id);
API.DrawBinkMovie(Id, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, 0.0f, 255, 255, 255, 255);
#elif FIVEM_G9
Native.PlayBinkMovie(Id);
Native.DrawBinkMovie(Id, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, 0.0f, 255, 255, 255, 255);
#elif RAGEMP
Invoker.Invoke<int>(0xE178310643033958, Id);
Invoker.Invoke<int>(0x7118E83EEB9F7238, Id, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, 0.0f, 255, 255, 255, 255);
Expand Down Expand Up @@ -142,6 +149,8 @@
Alt.Natives.StopBinkMovie(Id);
#elif FIVEM
API.StopBinkMovie(Id);
#elif FIVEM_G9
Native.StopBinkMovie(Id);
#elif RAGEMP
Invoker.Invoke<int>(0x63606A61DE68898A, Id);
#elif RPH
Expand All @@ -164,6 +173,8 @@
Alt.Natives.ReleaseBinkMovie(Id);
#elif FIVEM
API.ReleaseBinkMovie(Id);
#elif FIVEM_G9
Native.ReleaseBinkMovie(Id);
#elif RAGEMP
Invoker.Invoke<int>(0x04D950EEFA4EED8C, Id);
#elif RPH
Expand Down
4 changes: 4 additions & 0 deletions LemonUI/Elements/ScaledRectangle.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#if FIVEM
using CitizenFX.Core.Native;
#elif FIVEM_G9
using CitizenFX.FiveM.Client;
#elif RAGEMP
using RAGE.Game;
#elif RPH
Expand Down Expand Up @@ -44,6 +46,8 @@ public override void Draw()
}
#if FIVEM
API.DrawRect(relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Color.R, Color.G, Color.B, Color.A);
#elif FIVEM_G9
Native.DrawRect(relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Color.R, Color.G, Color.B, Color.A, false);
#elif RAGEMP
Invoker.Invoke(Natives.DrawRect, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Color.R, Color.G, Color.B, Color.A);
#elif ALTV
Expand Down
54 changes: 53 additions & 1 deletion LemonUI/Elements/ScaledText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using CitizenFX.Core.Native;
using CitizenFX.Core.UI;
using Font = CitizenFX.Core.UI.Font;
#elif FIVEM_G9
using CitizenFX.FiveM.Client;
#elif ALTV
using AltV.Net.Client;
#elif RAGEMP
Expand All @@ -13,11 +15,11 @@
using GTA.UI;
using Font = GTA.UI.Font;
#endif
using LemonUI.Tools;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using LemonUI.Tools;

namespace LemonUI.Elements
{
Expand Down Expand Up @@ -152,6 +154,10 @@ public float Width
API.BeginTextCommandWidth("CELL_EMAIL_BCON");
Add();
return API.EndTextCommandGetWidth(true) * 1f.ToXScaled();
#elif FIVEM_G9
Native.BeginTextCommandWidth("CELL_EMAIL_BCON");
Add();
return Native.EndTextCommandGetWidth(true) * 1f.ToXScaled();
#elif ALTV
Alt.Natives.BeginTextCommandGetScreenWidthOfDisplayText("CELL_EMAIL_BCON");
Add();
Expand Down Expand Up @@ -180,6 +186,8 @@ public int LineCount
{
#if FIVEM
API.BeginTextCommandLineCount("CELL_EMAIL_BCON");
#elif FIVEM_G9
Native.BeginTextCommandLineCount("CELL_EMAIL_BCON");
#elif ALTV
Alt.Natives.BeginTextCommandGetNumberOfLinesForString("CELL_EMAIL_BCON");
#elif RAGEMP
Expand All @@ -192,6 +200,8 @@ public int LineCount
Add();
#if FIVEM
return API.EndTextCommandGetLineCount(relativePosition.X, relativePosition.Y);
#elif FIVEM_G9
return Native.EndTextCommandGetLineCount(relativePosition.X, relativePosition.Y);
#elif ALTV
return Alt.Natives.EndTextCommandGetNumberOfLinesForString(relativePosition.X, relativePosition.Y);
#elif RAGEMP
Expand All @@ -213,6 +223,8 @@ public float LineHeight
// Height will always be 1080
#if FIVEM
return 1080 * API.GetTextScaleHeight(Scale, (int)Font);
#elif FIVEM_G9
return 1080 * Native.GetTextScaleHeight(Scale, (int)Font);
#elif ALTV
return 1080 * Alt.Natives.GetRenderedCharacterHeight(Scale, (int)Font);
#elif RAGEMP
Expand Down Expand Up @@ -310,6 +322,42 @@ private void Add()
{
API.SetTextWrap(0f, relativePosition.X);
}
#elif FIVEM_G9
foreach (string chunk in chunks)
{
Native.AddTextComponentString(chunk);
}
Native.SetTextFont((int)Font);
Native.SetTextScale(1f, Scale);
Native.SetTextColour(Color.R, Color.G, Color.B, Color.A);
Native.SetTextJustification((int)Alignment);
if (Shadow)
{
Native.SetTextDropShadow();
}
if (Outline)
{
Native.SetTextOutline();
}
if (WordWrap > 0)
{
switch (Alignment)
{
case Alignment.Center:
Native.SetTextWrap(relativePosition.X - (realWrap * 0.5f), relativePosition.X + (realWrap * 0.5f));
break;
case Alignment.Left:
Native.SetTextWrap(relativePosition.X, relativePosition.X + realWrap);
break;
case Alignment.Right:
Native.SetTextWrap(relativePosition.X - realWrap, relativePosition.X);
break;
}
}
else if (Alignment == Alignment.Right)
{
Native.SetTextWrap(0f, relativePosition.X);
}
#elif ALTV
foreach (var chunk in chunks)
{
Expand Down Expand Up @@ -527,6 +575,8 @@ public void Draw()
{
#if FIVEM
API.SetTextEntry("CELL_EMAIL_BCON");
#elif FIVEM_G9
Native.BeginTextCommandDisplayText("CELL_EMAIL_BCON");
#elif ALTV
Alt.Natives.BeginTextCommandDisplayText("CELL_EMAIL_BCON");
#elif RAGEMP
Expand All @@ -541,6 +591,8 @@ public void Draw()

#if FIVEM
API.DrawText(relativePosition.X, relativePosition.Y);
#elif FIVEM_G9
Native.EndTextCommandDisplayText(relativePosition.X, relativePosition.Y, 0);
#elif ALTV
Alt.Natives.EndTextCommandDisplayText(relativePosition.X, relativePosition.Y, 0);
#elif RAGEMP
Expand Down
Loading
Loading