mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge branch 'master' into cleanup/config
This commit is contained in:
103 files changed
+3418
-1928
No files matched your search
@@ -118,7 +118,7 @@ function openCallModal(show: boolean) {
|
||||
);
|
||||
}
|
||||
|
||||
onNet(CallEvents.SEND_HISTORY, (calls: CallHistoryItem[]) => {
|
||||
onNet(CallEvents.FETCH_CALLS, (calls: CallHistoryItem[]) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'DIALER',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContactEvents } from '../../typings/contact';
|
||||
import { ContactEvents, PreDBContact } from '../../typings/contact';
|
||||
import { sendContactsEvent } from '../utils/messages';
|
||||
|
||||
onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||
@@ -6,8 +6,8 @@ onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(ContactEvents.ADD_CONTACT);
|
||||
on(`__cfx_nui:${ContactEvents.ADD_CONTACT}`, (data: any, cb: Function) => {
|
||||
emitNet(ContactEvents.ADD_CONTACT, data.number, data.display, data.avatar);
|
||||
on(`__cfx_nui:${ContactEvents.ADD_CONTACT}`, (data: PreDBContact, cb: Function) => {
|
||||
emitNet(ContactEvents.ADD_CONTACT, data);
|
||||
cb();
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
local disableKeys
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
if disableKeys then
|
||||
Wait(0)
|
||||
DisableControlAction(0, 0, true) -- Next Camera
|
||||
DisableControlAction(0, 1, true) -- Look Left/Right
|
||||
DisableControlAction(0, 2, true) -- Look up/Down
|
||||
DisableControlAction(0, 16, true) -- Next Weapon
|
||||
DisableControlAction(0, 17, true) -- Select Previous Weapon
|
||||
DisableControlAction(0, 22, true) -- Jump
|
||||
DisableControlAction(0, 24, true) -- Attack
|
||||
DisableControlAction(0, 25, true) -- Aim
|
||||
DisableControlAction(0, 26, true) -- Look Behind
|
||||
DisableControlAction(0, 37, true) -- Weapon Wheel
|
||||
DisableControlAction(0, 44, true) -- Cover
|
||||
DisableControlAction(0, 47, true) -- Detonate
|
||||
DisableControlAction(0, 55, true) -- Dive
|
||||
DisableControlAction(0, 75, true) -- Exit Vehicle
|
||||
DisableControlAction(0, 76, true) -- Vehicle Handbrake
|
||||
DisableControlAction(0, 81, true) -- Next Radio (Vehicle)
|
||||
DisableControlAction(0, 82, true) -- Previous Radio (Vehicle)
|
||||
DisableControlAction(0, 91, true) -- Passenger Aim (Vehicle)
|
||||
DisableControlAction(0, 92, true) -- Passenger Attack (Vehicle)
|
||||
DisableControlAction(0, 99, true) -- Select Next Weapon (Vehicle)
|
||||
DisableControlAction(0, 106, true) -- Control Override (Vehicle)
|
||||
DisableControlAction(0, 114, true) -- Fly Attack (Flying)
|
||||
DisableControlAction(0, 115, true) -- Next Weapon (Flying)
|
||||
DisableControlAction(0, 121, true) -- Fly Camera (Flying)
|
||||
DisableControlAction(0, 122, true) -- Control OVerride (Flying)
|
||||
DisableControlAction(0, 135, true) -- Control OVerride (Sub)
|
||||
DisableControlAction(0, 200, true) -- Pause Menu
|
||||
DisableControlAction(0, 245, true) -- Chat
|
||||
else
|
||||
Wait(100)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('npwd:disableControlActions', function(bool)
|
||||
disableKeys = bool
|
||||
end)
|
||||
@@ -9,7 +9,6 @@ import { NotesEvents } from '../../typings/notes';
|
||||
import { BankEvents } from '../../typings/bank';
|
||||
import { PhotoEvents } from '../../typings/photo';
|
||||
import { CallEvents } from '../../typings/call';
|
||||
import { MatchEvents } from '../../typings/match';
|
||||
import { config } from './client';
|
||||
|
||||
let isPhoneOpen = false;
|
||||
@@ -58,6 +57,8 @@ const showPhone = async (): Promise<void> => {
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, true);
|
||||
sendMessage('PHONE', PhoneEvents.SET_TIME, time);
|
||||
SetNuiFocus(true, true);
|
||||
SetNuiFocusKeepInput(true);
|
||||
emit('npwd:disableControlActions', true);
|
||||
};
|
||||
|
||||
const hidePhone = async (): Promise<void> => {
|
||||
@@ -65,6 +66,8 @@ const hidePhone = async (): Promise<void> => {
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, false);
|
||||
await phoneCloseAnim();
|
||||
SetNuiFocus(false, false);
|
||||
SetNuiFocusKeepInput(false);
|
||||
emit('npwd:disableControlActions', false);
|
||||
};
|
||||
|
||||
/* * * * * * * * * * * * *
|
||||
@@ -86,6 +89,7 @@ RegisterCommand(
|
||||
async () => {
|
||||
await hidePhone();
|
||||
sendMessage('PHONE', 'phoneRestart', {});
|
||||
fetchOnInitialize();
|
||||
},
|
||||
false,
|
||||
);
|
||||
@@ -109,12 +113,9 @@ async function Phone(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
// triggerd when the player is ready
|
||||
onNet(PhoneEvents.PLAYER_IS_READY, () => {
|
||||
isPlayerReady = true;
|
||||
if (isUiReady) {
|
||||
fetchOnInitialize();
|
||||
}
|
||||
// Set the global depending on the response from event
|
||||
onNet(PhoneEvents.PLAYER_IS_READY, (ready: boolean) => {
|
||||
isPlayerReady = ready;
|
||||
});
|
||||
|
||||
AddEventHandler('onResourceStop', function (resource: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NotesEvents } from '../../typings/notes';
|
||||
import { Note, NotesEvents } from '../../typings/notes';
|
||||
import { sendNotesEvent } from '../utils/messages';
|
||||
|
||||
onNet(NotesEvents.SEND_NOTE, (notes: any) => {
|
||||
@@ -6,30 +6,24 @@ onNet(NotesEvents.SEND_NOTE, (notes: any) => {
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(NotesEvents.ADD_NOTE);
|
||||
on(`__cfx_nui:${NotesEvents.ADD_NOTE}`, (data: any) => {
|
||||
emitNet(NotesEvents.ADD_NOTE, data);
|
||||
on(`__cfx_nui:${NotesEvents.ADD_NOTE}`, (note: Note) => {
|
||||
emitNet(NotesEvents.ADD_NOTE, note);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(NotesEvents.DELETE_NOTE);
|
||||
on(`__cfx_nui:${NotesEvents.DELETE_NOTE}`, (noteId: number) => {
|
||||
emitNet(NotesEvents.DELETE_NOTE, noteId);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(NotesEvents.UPDATE_NOTE);
|
||||
on(`__cfx_nui:${NotesEvents.UPDATE_NOTE}`, (note: Note) => {
|
||||
emitNet(NotesEvents.UPDATE_NOTE, note);
|
||||
});
|
||||
|
||||
onNet(NotesEvents.SEND_NOTE_SUCCESS, () => {
|
||||
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
onNet(NotesEvents.DELETE_NOTE_SUCCESS, () => {
|
||||
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(NotesEvents.DELETE_NOTE);
|
||||
on(`__cfx_nui:${NotesEvents.DELETE_NOTE}`, (data: any) => {
|
||||
emitNet(NotesEvents.DELETE_NOTE, data);
|
||||
|
||||
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(NotesEvents.UPDATE_NOTE);
|
||||
on(`__cfx_nui:${NotesEvents.UPDATE_NOTE}`, (data: any) => {
|
||||
emitNet(NotesEvents.UPDATE_NOTE, data);
|
||||
});
|
||||
|
||||
onNet(NotesEvents.UPDATE_NOTE_SUCCESS, () => {
|
||||
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
||||
});
|
||||
@@ -37,3 +31,7 @@ onNet(NotesEvents.UPDATE_NOTE_SUCCESS, () => {
|
||||
onNet(NotesEvents.ACTION_RESULT, (alert: any) => {
|
||||
sendNotesEvent(NotesEvents.SEND_ALERT, alert);
|
||||
});
|
||||
|
||||
onNet(NotesEvents.DELETE_NOTE_SUCCESS, () => {
|
||||
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
||||
});
|
||||
@@ -11,7 +11,7 @@ on(`__cfx_nui:${TwitterEvents.GET_OR_CREATE_PROFILE}`, () => {
|
||||
});
|
||||
|
||||
onNet(TwitterEvents.GET_OR_CREATE_PROFILE_SUCCESS, (profile: any) => {
|
||||
sendTwitterMessage(TwitterEvents.GET_OR_CREATE_PROFILE_SUCCESS, profile);
|
||||
sendTwitterMessage(TwitterEvents.GET_OR_CREATE_PROFILE, profile);
|
||||
});
|
||||
|
||||
onNet(TwitterEvents.GET_OR_CREATE_PROFILE_FAILURE, () => {
|
||||
@@ -61,7 +61,7 @@ on(`__cfx_nui:${TwitterEvents.FETCH_TWEETS}`, () => {
|
||||
});
|
||||
|
||||
onNet(TwitterEvents.FETCH_TWEETS_SUCCESS, (tweets: any) => {
|
||||
sendTwitterMessage(TwitterEvents.FETCH_TWEETS_SUCCESS, tweets);
|
||||
sendTwitterMessage(TwitterEvents.FETCH_TWEETS, tweets);
|
||||
});
|
||||
|
||||
onNet(TwitterEvents.FETCH_TWEETS_FAILURE, () => {
|
||||
|
||||
Reference in new issue
Block a user