Skip to content

Commit

Permalink
Added missing SHVDNC directives
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Oct 25, 2023
1 parent 58eeac9 commit 2f3660a
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 85 deletions.
14 changes: 7 additions & 7 deletions LemonUI/Controls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#elif RPH
using Rage.Native;
using Control = Rage.GameControl;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA;
using GTA.Native;
#endif
Expand Down Expand Up @@ -39,7 +39,7 @@ public static bool IsUsingController
return !Invoker.Invoke<bool>(Natives.IsInputDisabled, 2);
#elif RPH
return !NativeFunction.CallByHash<bool>(0xA571D46727E2B718, 2);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
return !Function.Call<bool>(Hash.IS_USING_KEYBOARD_AND_MOUSE, 2);
#endif
}
Expand All @@ -64,7 +64,7 @@ public static bool IsJustPressed(Control control)
return Invoker.Invoke<bool>(Natives.IsDisabledControlJustPressed, 0, (int)control);
#elif RPH
return NativeFunction.CallByHash<bool>(0x91AEF906BCA88877, 0, (int)control);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
return Function.Call<bool>(Hash.IS_DISABLED_CONTROL_JUST_PRESSED, 0, (int)control);
#elif ALTV
return Alt.Natives.IsControlJustPressed((uint)control);
Expand All @@ -85,7 +85,7 @@ public static bool IsPressed(Control control)
return Invoker.Invoke<bool>(Natives.IsDisabledControlJustPressed, 0, (int)control);
#elif RPH
return NativeFunction.CallByHash<bool>(0xE2587F8CBBD87B1D, 0, (int)control);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
return Function.Call<bool>(Hash.IS_DISABLED_CONTROL_PRESSED, 0, (int)control);
#endif
}
Expand All @@ -102,7 +102,7 @@ public static void DisableAll(int inputGroup = 0)
Invoker.Invoke(Natives.DisableAllControlActions, inputGroup);
#elif RPH
NativeFunction.CallByHash<int>(0x5F4B6931816E599B, inputGroup);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.DISABLE_ALL_CONTROL_ACTIONS, inputGroup);
#endif
}
Expand All @@ -120,7 +120,7 @@ public static void EnableThisFrame(Control control)
Invoker.Invoke(Natives.EnableControlAction, 0, (int)control, true);
#elif RPH
NativeFunction.CallByHash<int>(0x351220255D64C155, 0, (int)control);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.ENABLE_CONTROL_ACTION, 0, (int)control);
#endif
}
Expand Down Expand Up @@ -149,7 +149,7 @@ public static void DisableThisFrame(Control control)
Invoker.Invoke(Natives.DisableControlAction, 0, (int)control, true);
#elif RPH
NativeFunction.CallByHash<int>(0xFE99B66D079CF6BC, 0, (int)control, true);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)control, true);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion LemonUI/Elements/IText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Font = CitizenFX.Core.UI.Font;
#elif RAGEMP
using RAGE.Game;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using Alignment = GTA.UI.Alignment;
using Font = GTA.UI.Font;
#endif
Expand Down
4 changes: 2 additions & 2 deletions LemonUI/Elements/ScaledRectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using RAGE.Game;
#elif RPH
using Rage.Native;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA.Native;
#elif ALTV
using AltV.Net.Client;
Expand Down Expand Up @@ -51,7 +51,7 @@ public override void Draw()
false);
#elif RPH
NativeFunction.CallByHash<int>(0x3A618A217E5154F0, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Color.R, Color.G, Color.B, Color.A);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.DRAW_RECT, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Color.R, Color.G, Color.B, Color.A);
#endif
}
Expand Down
18 changes: 9 additions & 9 deletions LemonUI/Elements/ScaledText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using RAGE.Game;
#elif RPH
using Rage.Native;
#elif SHVDN3
using GTA.UI;
#elif SHVDN3 || SHVDNC
using GTA.Native;
using GTA.UI;
using Font = GTA.UI.Font;
#endif
using System.Collections.Generic;
Expand Down Expand Up @@ -163,7 +163,7 @@ public float Width
NativeFunction.CallByHash<int>(0x54CE8AC98E120CAB, "CELL_EMAIL_BCON");
Add();
return NativeFunction.CallByHash<float>(0x85F061DA64ED2F67, true) * 1f.ToXAbsolute();
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.BEGIN_TEXT_COMMAND_GET_SCREEN_WIDTH_OF_DISPLAY_TEXT, "CELL_EMAIL_BCON");
Add();
return Function.Call<float>(Hash.END_TEXT_COMMAND_GET_SCREEN_WIDTH_OF_DISPLAY_TEXT, true) * 1f.ToXAbsolute();
Expand All @@ -185,7 +185,7 @@ public int LineCount
Invoker.Invoke(Natives.BeginTextCommandLineCount, "CELL_EMAIL_BCON");
#elif RPH
NativeFunction.CallByHash<int>(0x521FB041D93DD0E4, "CELL_EMAIL_BCON");
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.BEGIN_TEXT_COMMAND_GET_NUMBER_OF_LINES_FOR_STRING, "CELL_EMAIL_BCON");
#endif
Add();
Expand All @@ -197,7 +197,7 @@ public int LineCount
return Invoker.Invoke<int>(Natives.EndTextCommandGetLineCount, relativePosition.X, relativePosition.Y);
#elif RPH
return NativeFunction.CallByHash<int>(0x9040DFB09BE75706, relativePosition.X, relativePosition.Y);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
return Function.Call<int>(Hash.END_TEXT_COMMAND_GET_NUMBER_OF_LINES_FOR_STRING, relativePosition.X, relativePosition.Y);
#endif
}
Expand All @@ -218,7 +218,7 @@ public float LineHeight
return 1080 * Invoker.Invoke<float>(Natives.GetTextScaleHeight, Scale, (int)Font);
#elif RPH
return 1080 * NativeFunction.CallByHash<float>(0xDB88A37483346780, Scale, (int)Font);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
return 1080 * Function.Call<float>(Hash.GET_RENDERED_CHARACTER_HEIGHT, Scale, (int)Font);
#endif
}
Expand Down Expand Up @@ -419,7 +419,7 @@ private void Add()
{
NativeFunction.CallByHash<int>(0x63145D9C883A1A70, 0f, relativePosition.X);
}
#elif SHVDN3
#elif SHVDN3 || SHVDNC
foreach (string chunk in chunks)
{
Function.Call((Hash)0x6C188BE134E074AA, chunk); // _ADD_TEXT_COMPONENT_STRING on v2, ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME on v3
Expand Down Expand Up @@ -534,7 +534,7 @@ public void Draw()
Invoker.Invoke(Natives.BeginTextCommandDisplayText, "CELL_EMAIL_BCON");
#elif RPH
NativeFunction.CallByHash<int>(0x25FBB336DF1804CB, "CELL_EMAIL_BCON");
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call((Hash)0x25FBB336DF1804CB, "CELL_EMAIL_BCON"); // _SET_TEXT_ENTRY on v2, BEGIN_TEXT_COMMAND_DISPLAY_TEXT on v3
#endif

Expand All @@ -548,7 +548,7 @@ public void Draw()
Invoker.Invoke(Natives.EndTextCommandDisplayText, relativePosition.X, relativePosition.Y);
#elif RPH
NativeFunction.CallByHash<int>(0xCD015E5BB0D96A57, relativePosition.X, relativePosition.Y);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call((Hash)0xCD015E5BB0D96A57, relativePosition.X, relativePosition.Y); // _DRAW_TEXT on v2, END_TEXT_COMMAND_DISPLAY_TEXT on v3
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions LemonUI/Elements/ScaledTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using RAGE.Game;
#elif RPH
using Rage.Native;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA.Native;
#elif ALTV
using AltV.Net.Client;
Expand Down Expand Up @@ -84,7 +84,7 @@ private void Request()
{
NativeFunction.CallByHash<int>(0xDFA2EF8E04127DD5, Dictionary, true);
}
#elif SHVDN3
#elif SHVDN3 || SHVDNC
if (!Function.Call<bool>(Hash.HAS_STREAMED_TEXTURE_DICT_LOADED, Dictionary))
{
Function.Call(Hash.REQUEST_STREAMED_TEXTURE_DICT, Dictionary, true);
Expand Down Expand Up @@ -114,7 +114,7 @@ public override void Draw()
NativeFunction.CallByHash<int>(0xE7FFAE5EBF23D890, Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Heading, Color.R, Color.G, Color.B, Color.A);
#elif ALTV
Alt.Natives.DrawSprite(Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Heading, Color.R, Color.G, Color.B, Color.A, false, 0);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.DRAW_SPRITE, Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, Heading, Color.R, Color.G, Color.B, Color.A);
#endif
}
Expand All @@ -136,7 +136,7 @@ public void DrawSpecific(PointF topLeft, PointF bottomRight)
NativeFunction.CallByHash<int>(0x95812F9B26074726, Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y, Heading, Color.R, Color.G, Color.B, Color.A);
#elif ALTV
Alt.Natives.DrawSpriteArxWithUv(Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y, Heading, Color.R, Color.G, Color.B, Color.A, 0);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call((Hash)0x95812F9B26074726, Dictionary, Texture, relativePosition.X, relativePosition.Y, relativeSize.Width, relativeSize.Height, topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y, Heading, Color.R, Color.G, Color.B, Color.A);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions LemonUI/Menus/NativeColorPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using RAGE.Game;
#elif RPH
using Control = Rage.GameControl;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA;
using GTA.UI;
#endif
Expand Down Expand Up @@ -690,7 +690,7 @@ public override void Process()
#if ALTV
if (Controls.IsJustPressed(Control.FrontendLT))
#else
if (Controls.IsJustPressed(Control.FrontendLt))
if (Controls.IsJustPressed(Control.FrontendLt))
#endif
{
Previous();
Expand Down
4 changes: 2 additions & 2 deletions LemonUI/Menus/NativeGridPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Rage;
using Rage.Native;
using Control = Rage.GameControl;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA;
using GTA.Native;
using GTA.UI;
Expand Down Expand Up @@ -334,7 +334,7 @@ public override void Process()
float rX = NativeFunction.CallByHash<float>(0xEC3C9B8D5327B563, 0, (int)Control.ScriptRightAxisX);
float rY = NativeFunction.CallByHash<float>(0xEC3C9B8D5327B563, 0, (int)Control.ScriptRightAxisY);
float frameTime = Game.FrameTime;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
float rX = Game.GetControlValueNormalized(Control.ScriptRightAxisX);
float rY = Game.GetControlValueNormalized(Control.ScriptRightAxisY);
float frameTime = Game.LastFrameTime;
Expand Down
2 changes: 1 addition & 1 deletion LemonUI/Menus/NativeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Font = RAGE.Game.Font;
#elif RPH
using Font = LemonUI.Elements.Font;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using Font = GTA.UI.Font;
#endif

Expand Down
14 changes: 7 additions & 7 deletions LemonUI/Menus/NativeMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using System.ComponentModel;
using Control = Rage.GameControl;
using Font = LemonUI.Elements.Font;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA;
using GTA.Native;
using GTA.UI;
Expand Down Expand Up @@ -991,7 +991,7 @@ public void ResetCursor()
NativeFunction.CallByHash<int>(0xFC695459D4D0E219, pos.X, pos.Y);
#elif ALTV
Alt.Natives.SetCursorPosition(pos.X, pos.Y);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.SET_CURSOR_POSITION, pos.X, pos.Y);
#endif
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ private void ProcessControls()
bool isKeyboardActive = Invoker.Invoke<int>(Natives.UpdateOnscreenKeyboard) == 0;
#elif RPH
bool isKeyboardActive = NativeFunction.CallByHash<int>(0x0CF2B696BBF945AE) == 0;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
bool isKeyboardActive = Function.Call<int>(Hash.UPDATE_ONSCREEN_KEYBOARD) == 0;
#endif
if (!AcceptsInput || isKeyboardActive)
Expand Down Expand Up @@ -1208,7 +1208,7 @@ private void ProcessControls()
if (UseMouse && !Controls.IsUsingController)
{
// Enable the mouse cursor
#if FIVEM || SHVDN3 || ALTV
#if FIVEM || SHVDN3 || SHVDNC || ALTV
Screen.ShowCursorThisFrame();
#elif RAGEMP
Invoker.Invoke(Natives.ShowCursorThisFrame);
Expand All @@ -1221,7 +1221,7 @@ private void ProcessControls()
{
if (Screen.IsCursorInArea(PointF.Empty, searchAreaSize))
{
#if FIVEM || SHVDN3
#if FIVEM || SHVDN3 || SHVDNC
GameplayCamera.RelativeHeading += 5;
#elif ALTV
float current = Alt.Natives.GetGameplayCamRelativeHeading();
Expand All @@ -1235,7 +1235,7 @@ private void ProcessControls()
}
else if (Screen.IsCursorInArea(searchAreaRight, searchAreaSize))
{
#if FIVEM || SHVDN3
#if FIVEM || SHVDN3 || SHVDNC
GameplayCamera.RelativeHeading -= 5;
#elif ALTV
float current = Alt.Natives.GetGameplayCamRelativeHeading();
Expand Down Expand Up @@ -1646,7 +1646,7 @@ public virtual void Process()
#elif RPH
NativeFunction.CallByHash<int>(0x351220255D64C155, 0, (int)Control.CellphoneCancel);
NativeFunction.CallByHash<int>(0x351220255D64C155, 0, (int)Control.FrontendPause);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
Function.Call(Hash.SET_INPUT_EXCLUSIVE, 0, (int)Control.PhoneCancel);
Function.Call(Hash.SET_INPUT_EXCLUSIVE, 0, (int)Control.FrontendPause);
#endif
Expand Down
10 changes: 5 additions & 5 deletions LemonUI/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#elif RPH
using Rage;
using Rage.Native;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
using GTA.Native;
#elif ALTV
using AltV.Net.Client;
Expand Down Expand Up @@ -36,7 +36,7 @@ public class ObjectPool : IEnumerable<IProcessable>
private SizeF lastKnownResolution = new SizeF(Game.ScreenResolution.Width, Game.ScreenResolution.Height);
#elif RPH
private SizeF lastKnownResolution = Game.Resolution;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
private SizeF lastKnownResolution = GTA.UI.Screen.Resolution;
#endif
/// <summary>
Expand All @@ -50,7 +50,7 @@ public class ObjectPool : IEnumerable<IProcessable>
private float lastKnownSafezone = Invoker.Invoke<float>(Natives.GetSafeZoneSize);
#elif RPH
private float lastKnownSafezone = NativeFunction.CallByHash<float>(0xBAF107B6BB2C97F0);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
private float lastKnownSafezone = Function.Call<float>(Hash.GET_SAFE_ZONE_SIZE);
#endif

Check warning on line 56 in LemonUI/ObjectPool.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Debug)

Check warning on line 56 in LemonUI/ObjectPool.cs

View workflow job for this annotation

GitHub Actions / lint-and-compile (Release)

Expand Down Expand Up @@ -113,7 +113,7 @@ private void DetectResolutionChanges()
SizeF resolution = new SizeF(raw.Width, raw.Height);
#elif RPH
SizeF resolution = Game.Resolution;
#elif SHVDN3
#elif SHVDN3 || SHVDNC
SizeF resolution = GTA.UI.Screen.Resolution;
#endif
// If the old res does not matches the current one
Expand Down Expand Up @@ -141,7 +141,7 @@ private void DetectSafezoneChanges()
float safezone = Invoker.Invoke<float>(Natives.GetSafeZoneSize);
#elif RPH
float safezone = NativeFunction.CallByHash<float>(0xBAF107B6BB2C97F0);
#elif SHVDN3
#elif SHVDN3 || SHVDNC
float safezone = Function.Call<float>(Hash.GET_SAFE_ZONE_SIZE);
#endif

Expand Down
Loading

0 comments on commit 2f3660a

Please sign in to comment.