Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cumulative updates for the release of version 1.0.0 #617

Merged
merged 14 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
73. [esx_context]: chore: esx_context update to version 1.0.0 @bitpredator
74. [esx_menu_default]: chore: esx_menu_default update to version 1.0.0 @bitpredator
75. [esx_multicharacter]: refactor: esx_multicharacter @bitpredator
76. [esx_multicharacter]: fix: fixed problem which prevented the menu from opening @bitpredator
76. [esx_multicharacter]: fix: fixed problem which prevented the menu from opening @bitpredator
77. [esx_notify]: refactor: formatting(all): Format with prettier and lua formatter @bitpredator
78. [esx_progressbar]: refactor: formatting(all): Format with prettier and lua formatter @bitpredator
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ game 'gta5'

description 'bpt_cars'
lua54 'yes'
version '0.0.4'
version '1.0.0'

files {
-- p911r
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/esx_notify/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_menu_default
Copyright (C) 2015-2023
Copyright (C) 2015-2024

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_menu_default Copyright (C) 2015-2023
esx_menu_default Copyright (C) 2015-2024
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
13 changes: 6 additions & 7 deletions server-data/resources/[esx]/esx_notify/Notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local Debug = ESX.GetConfig().EnableDebug
---@param length number the length of the notification
---@param message any the message :D
local function Notify(notificatonType, length, message)

if Debug then
print("1 ".. tostring(notificatonType))
print("2 "..tostring(length))
print("3 "..message)
print(('1 %s'):format(tostring(notificatonType)))
print(('2 %s'):format(tostring(length)))
print(('3 %s'):format(message))
end

if type(notificatonType) ~= "string" then
Expand All @@ -20,9 +19,9 @@ local function Notify(notificatonType, length, message)
end

if Debug then
print("4 ".. tostring(notificatonType))
print("5 "..tostring(length))
print("6 "..message)
print(('4 %s'):format(tostring(notificatonType)))
print(('5 %s'):format(tostring(length)))
print(('6 %s'):format(message))
end

SendNuiMessage(json.encode({
Expand Down
2 changes: 1 addition & 1 deletion server-data/resources/[esx]/esx_notify/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fx_version 'adamant'
lua54 'yes'
game 'gta5'
version '0.0.4'
version '1.0.0'
author 'ESX-Framework'
description 'Official NUI Notification system for ESX'

Expand Down
28 changes: 12 additions & 16 deletions server-data/resources/[esx]/esx_notify/nui/css/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100&family=Poppins:wght@300;400;500;600;800&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100&family=Poppins:wght@300;400;500;600;800&display=swap");

:root {
--color: #919191;
Expand All @@ -16,7 +16,7 @@ body {
height: 100vh;
color: var(--color);
font-weight: 100;
font-family: 'Poppins', sans-serif;
font-family: "Poppins", sans-serif;
overflow: hidden;
}

Expand All @@ -32,16 +32,16 @@ body {
min-width: 20rem;
width: fit-content;
height: 3.5rem;
background: rgba(5,5, 5, 0.9);
border-radius: .5rem;
margin-top: .5rem;
background: rgba(5, 5, 5, 0.9);
border-radius: 0.5rem;
margin-top: 0.5rem;
animation: anim 300ms ease-in-out;
align-items: center;
}

#root .innerText {
padding-left: .4rem;
padding-right: .4rem;
padding-left: 0.4rem;
padding-right: 0.4rem;
width: 100%;
}

Expand All @@ -52,7 +52,7 @@ body {

#root .text {
display: inline-block;
margin-left: .5rem;
margin-left: 0.5rem;
}

#root .error {
Expand All @@ -68,21 +68,17 @@ body {
}

.material-symbols-outlined {
font-variation-settings:
'FILL' 0,
'wght' 400,
'GRAD' 0,
'opsz' 48
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 48;
}

@keyframes anim {
0% {
transform: scaleY(0);
}
80% {
transform: scaleY(1.1)
transform: scaleY(1.1);
}
100% {
transform: scaleY(1)
transform: scaleY(1);
}
}
}
26 changes: 13 additions & 13 deletions server-data/resources/[esx]/esx_notify/nui/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>
<title>ESX Notify</title>
</head>
<body>
<div id="root">
<!-- this is just a template! No touchy touchy -->
</div>
</body>
</html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
<title>ESX Notify</title>
</head>
<body>
<div id="root">
<!-- this is just a template! No touchy touchy -->
</div>
</body>
</html>
18 changes: 9 additions & 9 deletions server-data/resources/[esx]/esx_notify/nui/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const w = window
const w = window;

// Gets the current icon it needs to use.
const types = {
Expand All @@ -10,8 +10,8 @@ const types = {
},
["info"]: {
["icon"]: "info",
}
}
},
};

// the color codes example `i ~r~love~s~ donuts`
const codes = {
Expand All @@ -23,8 +23,8 @@ const codes = {
"~c~": "grey",
"~m~": "#212121",
"~u~": "black",
"~o~": "orange"
}
"~o~": "orange",
};

w.addEventListener("message", (event) => {
notification({
Expand All @@ -41,8 +41,8 @@ const replaceColors = (str, obj) => {
strToReplace = strToReplace.replace(new RegExp(id, "g"), obj[id]);
}

return strToReplace
}
return strToReplace;
};

notification = (data) => {
for (color in codes) {
Expand All @@ -53,7 +53,7 @@ notification = (data) => {

let newStr = replaceColors(data["message"], objArr);

data["message"] = newStr
data["message"] = newStr;
}
}

Expand All @@ -71,4 +71,4 @@ notification = (data) => {
}, data.length);

return notification;
}
};
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/esx_notify/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ ESX.ShowNotification("I i ~r~love~s~ donuts", "success", 3000)

esx_notify- Notify!

Copyright (C) 2023
Copyright (C) 2023-2024

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

You should have received a copy Of the GNU General Public License along with this program. If Not, see <http://www.gnu.org/licenses/>.
You should have received a copy Of the GNU General Public License along with this program. If Not, see <http://www.gnu.org/licenses/>.
20 changes: 12 additions & 8 deletions server-data/resources/[esx]/esx_progressbar/Progress.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
local CurrentProgress = nil
local function Progressbar(message,length,Options)

local function Progressbar(message, length, Options)
if CurrentProgress then
return false
end
CurrentProgress = Options or {}
if CurrentProgress.animation then
if CurrentProgress.animation.type == "anim" then
ESX.Streaming.RequestAnimDict(CurrentProgress.animation.dict, function()
TaskPlayAnim(ESX.PlayerData.ped, CurrentProgress.animation.dict, CurrentProgress.animation.lib, 1.0, 1.0, length, 1, 1.0, false,false,false)
TaskPlayAnim(ESX.PlayerData.ped, CurrentProgress.animation.dict, CurrentProgress.animation.lib, 1.0, 1.0, length, 1, 1.0, false, false, false)
RemoveAnimDict(CurrentProgress.animation.dict)
end)
elseif CurrentProgress.animation.type == "Scenario" then
Expand All @@ -23,7 +24,7 @@ local function Progressbar(message,length,Options)
CurrentProgress.length = length or 3000
while CurrentProgress ~= nil do
if CurrentProgress.length > 0 then
CurrentProgress.length -= 1000
CurrentProgress.length = CurrentProgress.length - 1000
else
ClearPedTasks(ESX.PlayerData.ped)
if CurrentProgress.FreezePlayer then FreezeEntityPosition(PlayerPedId(), false) end
Expand All @@ -34,17 +35,20 @@ local function Progressbar(message,length,Options)
end
end

ESX.RegisterInput("cancelprog", "[ProgressBar] Cancel Progressbar", "keyboard", "BACK", function()
local function CancelProgressbar()
if not CurrentProgress then return end
if not CurrentProgress.onCancel then return end
SendNUIMessage({
type = "Close"
})
ClearPedTasks(ESX.PlayerData.ped)
if CurrentProgress.FreezePlayer then FreezeEntityPosition(PlayerPedId(), false) end
if CurrentProgress.onCancel then CurrentProgress.onCancel() end
CurrentProgress.canceled = true
CurrentProgress.length = 0
CurrentProgress.onCancel()
CurrentProgress = nil
end)
exports('Progressbar', Progressbar)
end

ESX.RegisterInput("cancelprog", "[ProgressBar] Cancel Progressbar", "keyboard", "BACK", CancelProgressbar)

exports('Progressbar', Progressbar)
exports('CancelProgressbar', CancelProgressbar)
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/esx_progressbar/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ game 'gta5'
author 'BPT-Framework'
lua54 'yes'
description 'BPT Progressbar'
version '0.0.4'
version '1.0.0'

client_scripts { 'Progress.lua' }
shared_script '@es_extended/imports.lua'
Expand All @@ -13,4 +13,4 @@ files {
'nui/index.html',
'nui/js/*.js',
'nui/css/*.css',
}
}
Loading
Loading