Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

New items and Patchs for accent letters and panels #17

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
In the next few days, I will release one of the latest versions of RageUI. This one will probably have no support from me, and you will have a commercial right on it without any counterpart, only a thank you.

This version will be less customizable, and much more powerful, in order to meet MY requirements, and not those of the community.
A fixed version of Rage UI with new features to suit my projects...
You can use it for your projects but please make pull requests if you find bugs, that's the point of open source 😉
[FiveM Topic](https://forum.cfx.re/t/maintened-and-improved-rageui-repository/5222341)
4 changes: 3 additions & 1 deletion src/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ function RageUIMenus:IsVisible(Item, Panel)
RageUI.Background();
RageUI.Navigation();
RageUI.Description();
Panel(Panels);
if Panel and type(Panel) == "function" then
Panel(Panels);
end
RageUI.PoolMenus.Timer = 1
RageUI.Render()
end
Expand Down
86 changes: 44 additions & 42 deletions src/RageUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ end

function RageUI.Background()
local CurrentMenu = RageUI.CurrentMenu;
if (CurrentMenu.Display.Background) then
if CurrentMenu and (CurrentMenu.Display.Background) then
RageUI.ItemsSafeZone(CurrentMenu)
SetScriptGfxDrawOrder(0)
Graphics.Sprite(RageUI.Settings.Items.Background.Dictionary, RageUI.Settings.Items.Background.Texture, CurrentMenu.X, CurrentMenu.Y + RageUI.Settings.Items.Background.Y + CurrentMenu.SubtitleHeight, RageUI.Settings.Items.Background.Width + CurrentMenu.WidthOffset, RageUI.ItemOffset, 0, 0, 0, 0, 255)
Expand All @@ -368,7 +368,7 @@ end
function RageUI.Description()
local CurrentMenu = RageUI.CurrentMenu;
local Description = RageUI.Settings.Items.Description;
if CurrentMenu.Description ~= nil then
if CurrentMenu and CurrentMenu.Description ~= nil then
RageUI.ItemsSafeZone(CurrentMenu)
Graphics.Rectangle(CurrentMenu.X, CurrentMenu.Y + Description.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Description.Bar.Width + CurrentMenu.WidthOffset, Description.Bar.Height, 0, 0, 0, 255)
Graphics.Sprite(Description.Background.Dictionary, Description.Background.Texture, CurrentMenu.X, CurrentMenu.Y + Description.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Description.Background.Width + CurrentMenu.WidthOffset, CurrentMenu.DescriptionHeight, 0, 0, 0, 255)
Expand All @@ -379,56 +379,58 @@ end

function RageUI.Render()
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu.Safezone then
ResetScriptGfxAlign()
end

if (CurrentMenu.Display.InstructionalButton) then
if not CurrentMenu.InitScaleform then
CurrentMenu:UpdateInstructionalButtons(true)
CurrentMenu.InitScaleform = true
if CurrentMenu then
if CurrentMenu.Safezone then
ResetScriptGfxAlign()
end
DrawScaleformMovieFullscreen(CurrentMenu.InstructionalScaleform, 255, 255, 255, 255, 0)
end
CurrentMenu.Options = RageUI.Options
CurrentMenu.SafeZoneSize = nil
RageUI.Controls()
RageUI.Options = 0
RageUI.StatisticPanelCount = 0
RageUI.ItemOffset = 0
if CurrentMenu.Controls.Back.Enabled then
if CurrentMenu.Controls.Back.Pressed and CurrentMenu.Closable then
CurrentMenu.Controls.Back.Pressed = false

Audio.PlaySound(RageUI.Settings.Audio.Back.audioName, RageUI.Settings.Audio.Back.audioRef)

if CurrentMenu.Closed ~= nil then
collectgarbage()
CurrentMenu.Closed()
if (CurrentMenu.Display.InstructionalButton) then
if not CurrentMenu.InitScaleform then
CurrentMenu:UpdateInstructionalButtons(true)
CurrentMenu.InitScaleform = true
end
DrawScaleformMovieFullscreen(CurrentMenu.InstructionalScaleform, 255, 255, 255, 255, 0)
end
CurrentMenu.Options = RageUI.Options
CurrentMenu.SafeZoneSize = nil
RageUI.Controls()
RageUI.Options = 0
RageUI.StatisticPanelCount = 0
RageUI.ItemOffset = 0
if CurrentMenu.Controls.Back.Enabled then
if CurrentMenu.Controls.Back.Pressed and CurrentMenu.Closable then
CurrentMenu.Controls.Back.Pressed = false

Audio.PlaySound(RageUI.Settings.Audio.Back.audioName, RageUI.Settings.Audio.Back.audioRef)

if CurrentMenu.Closed ~= nil then
collectgarbage()
CurrentMenu.Closed()
end

if CurrentMenu.Parent ~= nil then
if CurrentMenu.Parent() then
RageUI.NextMenu = CurrentMenu.Parent
if CurrentMenu.Parent ~= nil then
if CurrentMenu.Parent() then
RageUI.NextMenu = CurrentMenu.Parent
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
elseif CurrentMenu.Controls.Back.Pressed and not CurrentMenu.Closable then
CurrentMenu.Controls.Back.Pressed = false
end
elseif CurrentMenu.Controls.Back.Pressed and not CurrentMenu.Closable then
CurrentMenu.Controls.Back.Pressed = false
end
end
if RageUI.NextMenu ~= nil then
if RageUI.NextMenu() then
RageUI.Visible(CurrentMenu, false)
RageUI.Visible(RageUI.NextMenu, true)
CurrentMenu.Controls.Select.Active = false
RageUI.NextMenu = nil
RageUI.LastControl = false
if RageUI.NextMenu ~= nil then
if RageUI.NextMenu() then
RageUI.Visible(CurrentMenu, false)
RageUI.Visible(RageUI.NextMenu, true)
CurrentMenu.Controls.Select.Active = false
RageUI.NextMenu = nil
RageUI.LastControl = false
end
end
end
end
Expand Down
44 changes: 41 additions & 3 deletions src/components/Util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,48 @@
--- File created at [24/05/2021 09:57]
---

function math.round(num, numDecimalPlaces)
return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num))
function math.round(value, numDecimalPlaces)
if numDecimalPlaces then
local power = 10^numDecimalPlaces
return math.floor((value * power) + 0.5) / (power)
else
return math.floor(value + 0.5)
end
end

function string.starts(String, Start)
return string.sub(String, 1, string.len(Start)) == Start
end
end

local up_trans = {
["é"] = "É",
["è"] = "È",
["â"] = "Â",
["ê"] = "Ê",
["î"] = "Î",
["ô"] = "Ô",
["û"] = "Û",
["ä"] = "Ä",
["ë"] = "Ë",
["ï"] = "Ï",
["ö"] = "Ö",
["ü"] = "Ü",
["à"] = "À",
["æ"] = "Æ",
["ç"] = "Ç",
["œ"] = "Œ",
["ù"] = "Ù",
}

local old_upper = string.upper
function string.upper(str)
local res = old_upper(str)
for k, v in pairs(up_trans) do
res = string.gsub(res, k, v)
end
return res
end

function string.FirstUp(str)
return string.upper(string.sub(str, 1, 1)) .. string.sub(str, 2)
end
2 changes: 2 additions & 0 deletions src/elements/ItemsColour.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,7 @@ RageUI.ItemsColour = {
DegenMagenta = { 255, 0, 255, 255 },
Stunt1 = { 38, 136, 234, 255 },
Stunt2 = { 224, 50, 50, 255 },
BleuClairMenu = { 46, 105, 187, 255 },
BleuFonceMenu = { 11, 60, 123, 255 },
}

66 changes: 66 additions & 0 deletions src/elements/PanelColour.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,71 @@ RageUI.PanelColour = {
{ 212, 185, 158 }, -- 62
{ 213, 170, 115 }, -- 63
},
MakeUp = {
{ 153, 37, 50 }, -- 0
{ 200, 57, 93 }, -- 1
{ 189, 81, 108 }, -- 2
{ 184, 99, 122 }, -- 3
{ 166, 82, 107 }, -- 4
{ 177, 67, 76 }, -- 5
{ 127, 49, 51 }, -- 6
{ 164, 100, 93 }, -- 7
{ 193, 135, 121 }, -- 8
{ 203, 160, 150 }, -- 9
{ 198, 145, 143 }, -- 10
{ 171, 111, 99}, -- 11
{ 176, 96, 80 }, -- 12
{ 168, 76, 51 }, -- 13
{ 180, 113, 120 }, -- 14
{ 202, 127, 146 }, -- 15
{ 237, 156, 190 }, -- 16
{ 231, 117, 164 }, -- 17
{ 222, 62, 129 }, -- 18
{ 179, 76, 110 }, -- 19
{ 113, 39, 57 }, -- 20
{ 79, 31, 42 }, -- 21
{ 170, 34, 47 }, -- 22
{ 222, 32, 52 }, -- 23
{ 207, 8, 19 }, -- 24
{ 229, 84, 112 }, -- 25
{ 220, 63, 181 }, -- 26
{ 192, 39, 178 }, -- 27
{ 160, 28, 169 }, -- 28
{ 110, 24, 117 }, -- 29
{ 115, 20, 101 }, -- 30
{ 86, 22, 92 }, -- 31
{ 109, 26, 157 }, -- 32
{ 27, 55, 113 }, -- 33
{ 29, 78, 167 }, -- 34
{ 30, 116, 187 }, -- 35
{ 33, 163, 206 }, -- 36
{ 37, 194, 210 }, -- 37
{ 35, 204, 165 }, -- 38
{ 39, 192, 125 }, -- 39
{ 27, 156, 50 }, -- 40
{ 20, 134, 4 }, -- 41
{ 112, 208, 65 }, -- 42
{ 197, 234, 52 }, -- 43
{ 225, 227, 47 }, -- 44
{ 255, 221, 38 }, -- 45
{ 250, 192, 38 }, -- 46
{ 247, 138, 39 }, -- 47
{ 254, 89, 16 }, -- 48
{ 190, 110, 25 }, -- 49
{ 247, 201, 127 }, -- 50
{ 251, 229, 192 }, -- 51
{ 245, 245, 245 }, -- 52
{ 179, 180, 179 }, -- 53
{ 145, 145, 145 }, -- 54
{ 86, 78, 78 }, -- 55
{ 24, 14, 14 }, -- 56
{ 88, 150, 158 }, -- 57
{ 77, 111, 140 }, -- 58
{ 26, 43, 85 }, -- 59
{ 160, 126, 107 }, -- 60
{ 130, 99, 85 }, -- 61
{ 109, 83, 70 }, -- 62
{ 62, 45, 39 } -- 63
}
}

Loading