42 changes: 40 additions & 2 deletions client/nui.lua
Expand Up @@ -74,7 +74,7 @@ RegisterNUICallback('exitPanel', function(_, cb)
cfg.panelStatus = false
SetNuiFocus(false, false)
TriggerScreenblurFadeOut(3000)
SendNUIMessage({action = 'panelStatus',panelStatus = cfg.panelStatus})
SendNUIMessage({action = 'panelStatus', panelStatus = cfg.panelStatus})
end
cb({})
end)
Expand All @@ -95,6 +95,16 @@ RegisterNUICallback('fetchStorage', function(data, cb)
cfg.animMovement = true
end
end
local savedWalk = GetResourceKvpString('savedWalk')
if savedWalk then -- If someone has a better implementation which works with multichar please share it.
local p = promise.new()
Wait(cfg.waitBeforeWalk)
Play.Walk({style = savedWalk}, p)
local result = Citizen.Await(p)
if result.passed then
Play.Notification('info', 'Set old walk style back.')
end
end
end
cb({})
end)
Expand Down Expand Up @@ -157,4 +167,32 @@ AddEventHandler('onResourceStop', function(name)
if GetCurrentResourceName() == name then
Load.Cancel()
end
end)
end)

---Event for updating cfg from other resource
---@param _cfg table
---@param result any
---@return any
AddEventHandler('anims:updateCfg', function(_cfg, result)
if GetCurrentResourceName() == GetInvokingResource() then
CancelEvent()
return print('Cannot use this event from the same resource!')
end
if type(_cfg) ~= "table" then
print(GetInvokingResource() .. ' tried to update anims cfg but it was not a table')
CancelEvent()
return
end
local oldCfg = cfg
for k, v in pairs(_cfg) do
if cfg[k] and v then
cfg[k] = v
end
end
print(GetInvokingResource() .. ' updated anims cfg!')
if result then
print('Old:' .. json.encode(oldCfg) .. '\nNew: ' .. json.encode(cfg))
end
end)

exports('PlayEmote', findEmote)
11 changes: 10 additions & 1 deletion client/request.lua
Expand Up @@ -197,4 +197,13 @@ Load.Cancel = function()
Load.PtfxRemoval()
cfg.ptfxActive = false
end
end
end

exports('Load', Load)

CreateThread(function()
TriggerEvent('chat:addSuggestions', {
{name = '/' .. cfg.commandNameEmote, help = cfg.commandNameSuggestion, params = {{name = 'emote', help = 'Emote name'}}},
{name = '/' .. cfg.commandName, help = cfg.commandSuggestion, params = {}}
})
end)
92 changes: 91 additions & 1 deletion html/css/style.css
Expand Up @@ -146,6 +146,40 @@ body {
width: 100%;
}

.info-container {
position: absolute;
display: flex;
justify-content: space-evenly;
align-items: center;
align-self: flex-end;
flex-direction: column;
width: 18.2em;
height: 4em;

margin-right: 5%;
top: -4.5em;

background: #000000cc;
border-radius: 0.6vh;
text-align: center;
}

.info-container span {
font-size: 2.2vh;
color: #FFFFFF;
font-family: "Rubik Medium";
margin-left: 5%;
margin-right: 5%;
text-transform: capitalize;
}

.info-container span:last-of-type {
font-size: 1.8vh;
color: #C1C1C1;
font-family: "Rubik Light";
text-transform: none;
}

.navbar div {
position: relative;
display: flex;
Expand Down Expand Up @@ -321,6 +355,21 @@ body {
}

@media screen and (min-width: 45.375em) {
.info-container {
max-width: 11.50em;
max-height: 2.725em;
top: -3em;
margin-right: 0;
}
.info-container span {
font-size: 0.7em;
margin-right: 2.5%;
margin-left: 2.5%;
width: 90%;
}
.info-container span:last-of-type {
font-size: 0.55em;
}
.menu-container {
max-width: 3em;
max-height: 20em;
Expand All @@ -336,7 +385,6 @@ body {
.settings-container div span {
font-size: 0.65em;
}

.settings-container button {
font-size: 0.60em;
}
Expand Down Expand Up @@ -375,6 +423,20 @@ body {
}

@media screen and (min-width: 80em) {
.info-container {
max-width: 15em;
max-height: 3.5em;
top: -4em;
margin-right: 0.4em;
}
.info-container span {
font-size: 0.9em;
margin-right: 0.2em;
margin-left: 0.2em;
}
.info-container span:last-of-type {
font-size: 0.65em;
}
.menu-container {
max-width: 4em;
max-height: 25em;
Expand Down Expand Up @@ -429,6 +491,20 @@ body {
}

@media screen and (min-width: 100em) {
.info-container {
max-width: 100em;
max-height: 4em;
top: -4.5em;
margin-right: 1.4em;
}
.info-container span {
font-size: 1.1em;
margin-right: 0.5em;
margin-left: 0.5em;
}
.info-container span:last-of-type {
font-size: 0.75em;
}
.menu-container {
max-width: 100%;
max-height: 100%;
Expand Down Expand Up @@ -482,6 +558,20 @@ body {
}

@media screen and (min-width: 160em) {
.info-container {
min-width: 28.5em;
min-height: 6em;
top: -7em;
margin-right: 1.4em;
}
.info-container span {
font-size: 1.7em;
margin-right: 0.5em;
margin-left: 0.5em;
}
.info-container span:last-of-type {
font-size: 1.2em;
}
.menu-container {
min-width: 6.5em;
min-height: 55em;
Expand Down
13 changes: 11 additions & 2 deletions html/js/listeners.js
@@ -1,4 +1,4 @@
import { changeClass, getStatus } from "./modules/functions.js";
import { changeClass, getStatus, changeInfo } from "./modules/functions.js";
import { fetchNUI } from "./modules/fetch.js"

const doc = document;
Expand Down Expand Up @@ -50,6 +50,9 @@ doc.getElementById('search-bar').addEventListener('input', e => {
}
})


doc.getElementById('cancel').addEventListener('mouseover', _ => changeInfo(true, 'Cancel', 'Cancel current playing animation.'));
doc.getElementById('cancel').addEventListener('mouseleave', _ => changeInfo(false));
doc.getElementById('cancel').addEventListener('click', e => {
e.target.classList.add('pop');
e.target.style.backgroundColor = "#ff0d4ecc";
Expand All @@ -60,6 +63,8 @@ doc.getElementById('cancel').addEventListener('click', e => {
fetchNUI('cancelAnimation');
});

doc.getElementById('delete').addEventListener('mouseover', _ => changeInfo(true, 'Delete Props', 'Deletes all props if you have them stuck to you.'));
doc.getElementById('delete').addEventListener('mouseleave', _ => changeInfo(false));
doc.getElementById('delete').addEventListener('click', e => {
e.target.classList.add('pop');
e.target.style.backgroundColor = "#ff0d4ecc";
Expand All @@ -69,8 +74,12 @@ doc.getElementById('delete').addEventListener('click', e => {
}, 300);
fetchNUI('removeProps');
});

doc.getElementById('movement').addEventListener('mouseover', _ => changeInfo(true, 'Movement', 'Allows movement while playing an animation (not shared).'));
doc.getElementById('movement').addEventListener('mouseleave', _ => changeInfo(false));
doc.getElementById('movement').addEventListener('click', e => (getStatus(e.target)));

doc.getElementById('loop').addEventListener('mouseover', _ => changeInfo(true, 'Loop', 'Loops animations (overwrites duration in animations).'));
doc.getElementById('loop').addEventListener('mouseleave', _ => changeInfo(false));
doc.getElementById('loop').addEventListener('click', e => getStatus(e.target));

doc.getElementById('save-settings').addEventListener('click', () => {
Expand Down
12 changes: 12 additions & 0 deletions html/js/modules/functions.js
Expand Up @@ -92,4 +92,16 @@ export const setDisplay = animType => {
document.querySelector('.menu-container').classList.remove(animType);
document.querySelector('.anims-container').classList.remove(animType);
}, 300);
}

export const changeInfo = (type, titleM, descM) => {
const title = document.getElementById('info-title');
const desc = document.getElementById('info-desc');
if (type) {
title.textContent = titleM;
desc.textContent = descM;
} else {
title.textContent = 'Info';
desc.textContent = 'Display info about certain buttons and icons.'
}
}
4 changes: 4 additions & 0 deletions html/ui.html
Expand Up @@ -33,6 +33,10 @@
<span id="movement" class="material-icons md-18 controls" style="color: white;">control_camera</span>
<span id="loop" class="material-icons md-18 controls" style="color: white;">loop</span>
</nav>
<div class="info-container">
<span id="info-title">Info</span>
<span id="info-desc">Display info about certain buttons and icons.</span>
</div>
<main id="anims-holder" class="anims-block">
<!--Data inserted by Javascript-->
</main>
Expand Down
11 changes: 8 additions & 3 deletions server/update.lua
@@ -1,5 +1,7 @@
local firstTime = false
local versionData = json.decode(LoadResourceFile('anims', 'update.json'))

local function checkVersion(e, latest, _)
local versionData = json.decode(LoadResourceFile('anims', 'update.json'))
local latest = json.decode(latest)
if e ~= 200 then
return print('Error: Anims could not verify with Github')
Expand All @@ -14,15 +16,18 @@ local function checkVersion(e, latest, _)
elseif version > latest.version then
print('^3Your version is above latest. Sus stuff you got here.^7')
else
print('^2Anims are updated!^7')
if not firstTime then
firstTime = true
print('^2Anims are updated!^7')
end
end
else
print('You removed the JSON file smh. Goodbye to updates :sadge:')
end
end

local function updateStatus()
SetTimeout(10 * 60000, updateStatus)
SetTimeout(1000 * 60 * 30, updateStatus)

PerformHttpRequest('https://raw.githubusercontent.com/BombayV/anims/main/update.json', checkVersion, "GET")
end
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed stream/CasinoEmotes/anim@amb@casino@peds@.ycd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed stream/CasinoEmotes/anim@amb@waving@female.ycd
Binary file not shown.
Binary file removed stream/CasinoEmotes/anim@amb@waving@male.ycd
Binary file not shown.
Binary file removed stream/CasinoEmotes/anim@move_f@waitress.ycd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added stream/custom@cant_see.ycd
Binary file not shown.
Binary file added stream/custom@dab.ycd
Binary file not shown.
Binary file added stream/custom@police.ycd
Binary file not shown.
Binary file added stream/custom@sheeeeesh.ycd
Binary file not shown.
Binary file added stream/custom@suspect.ycd
Binary file not shown.
Binary file added stream/export@breakdance.ycd
Binary file not shown.
6 changes: 3 additions & 3 deletions update.json
@@ -1,5 +1,5 @@
{
"version": "1.0.0",
"new": "Initial Release",
"update": "Initial Release"
"version": "1.1.0",
"new": "Button Description, Anim Exports, Cfg Event, Removed Streamed Assets, and more.",
"update": "Highly Recommended"
}