Skip to content

Commit

Permalink
feat(menu/tp): made Z optional in tp to coords
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Apr 25, 2023
1 parent 47da3ac commit bdd93ee
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 64 deletions.
114 changes: 64 additions & 50 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,65 +28,77 @@
- [x] Resource: reorder `sv_main.lua` and add `local` prefix to most if not all functions
- [x] Resource: rename menu events to `txsv:xxx` and `txcl:xxx`
- [ ] Resource: full redm compatibility
- [x] Player Mode
- [x] noclip
- [x] controls
- [x] bug: after exiting, the mouse doesn't move
- [x] fix behavior while seated on vehicle or horse
- [x] scaleform/prompt
- [x] god mode
- [x] super jump
- [x] fix stamina bug
- [x] normal
- [x] particles
- [x] Teleport
- [x] waypoint
- [x] coords
- [x] back
- [x] copy coords
- [x] Vehicle
- [x] spawn
- [x] fix
- [x] delete
- [ ] boost (FIXME: doesn't work, disable button)
- [x] Heal
- [x] self
- [x] everyone
- [x] Announcements
- [ ] reset world area (FIXME: doesn't work, disable button)
- [x] player ids
- [ ] logger (death reasons, explosions, etc)

- [x] Actions
- [x] heal
- [x] go to
- [x] bring
- [x] spectate
- [x] copy prompt helper from freecam
- [x] freeze
- [x] troll: set drunk
- [x] troll: set fire
- [x] troll: wild attack

- [x] Make Z optional in tp to coords feature
- [ ] Find out why the players page doesn't reflect the player health, maybe it is client side only?
- [ ] Vehicle spawn should accept `[horse, cart, boat]` options, maybe add the buttons
- [x] Generalize the sound function in `cl_misc.lua` and replace the other `PlaySoundFrontend`
- [ ] Deprecate `cl_misc.lua`: move `playLibrarySound` to `cl_functions`, the rest to `cl_base`

- [ ] make `recipes/indexv4.json` dropping version and adding tags
- drop author field as well?
- remove zap esx pack? last update was 6 months ago
- [ ] add redm recipes
- use `sv_enforceGameBuild 1491`
- need to add a tracking for % of redm/fivem/libertym servers
- [ ] add `sv_enforceGameBuild 2699` for fivem recipe
- [ ] add redm cfx default recipe (use `sv_enforceGameBuild 1491`)
- [ ] add vorp recipe

> required
- [ ] add bot enabled / whitelist back into stats
- [ ] inject consts isZapHosting and isPterodactyl in ctxUtil
- [ ] add isPterodactyl to stats
- [ ] Check again for any added `print()`

- [ ] Add a tracking for % of redm/fivem/libertym servers to txTracker
- [ ] add hwid token bans
- add an option to wipe all hwids from the database
- must start tracking the search duration
- [ ] update discord.js - should be drop in
- [ ] add bot enabled / whitelist back into stats
- [ ] inject consts isZapHosting and isPterodactyl in ctxUtil
- [ ] maybe add some debug logging to `AdminVault.checkAdminsFile()`, to find out why so many people are having issues with their logins
- [ ] Update packages





# RedM Migrations
- [x] Player Mode
- [x] noclip
- [x] controls
- [x] bug: after exiting, the mouse doesn't move
- [x] fix behavior while seated on vehicle or horse
- [x] scaleform/prompt
- [x] god mode
- [x] super jump
- [x] fix stamina bug
- [x] normal
- [x] particles
- [x] Teleport
- [x] waypoint
- [x] coords
- [x] back
- [x] copy coords
- [x] Vehicle
- [x] spawn
- [x] fix
- [x] delete
- [ ] boost (FIXME: doesn't work, disable button)
- [x] Heal
- [x] self
- [x] everyone
- [x] Announcements
- [ ] reset world area (FIXME: doesn't work, disable button)
- [x] player ids
- [ ] logger (death reasons, explosions, etc)

- [x] Actions
- [x] heal
- [x] go to
- [x] bring
- [x] spectate
- [x] copy prompt helper from freecam
- [x] freeze
- [x] troll: set drunk
- [x] troll: set fire
- [x] troll: wild attack

- [x] Generalize the sound function in `cl_misc.lua` and replace the other `PlaySoundFrontend`
- [ ] Deprecate `cl_misc.lua`: move `playLibrarySound` to `cl_functions`, the rest to `cl_base`
- [ ] Find out why the players page doesn't reflect the player health, maybe it is client side only?
- [ ] check again for any added `print()`

--DEBUG
RegisterCommand('go', function()
Expand Down Expand Up @@ -650,6 +662,8 @@ https://kinark.github.io/Materialize-stepper/

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

https://github.com/femga/rdr3_discoveries


=======================================

Expand Down
27 changes: 13 additions & 14 deletions nui/src/components/MainPage/MainPageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,30 +134,29 @@ export const MainPageList: React.FC = () => {
description: t("nui_menu.page_main.teleport.coords.dialog_desc"),
placeholder: "340, 480, 12",
onSubmit: (coords: string) => {
// TODO: accept X, Y and calculate Z
// TODO: accept heading
// Testing examples:
// {x: -1; y: 2; z:3}
// {x = -1.01; y= 2.02; z=3.03}
// -1, 2, 3
const [x, y, z] = Array.from(
let [x, y, z] = Array.from(
coords.matchAll(/-?\d{1,4}(?:\.\d{1,9})?/g),
(m) => parseFloat(m[0])
);

if ([x, y, z].every((n) => typeof n === "number")) {
enqueueSnackbar(t("nui_menu.page_main.teleport.generic_success"), {
variant: "success",
});
fetchNui("tpToCoords", { x, y, z });
} else {
enqueueSnackbar(
if (typeof x !== 'number' || typeof y !== 'number') {
return enqueueSnackbar(
t("nui_menu.page_main.teleport.coords.dialog_error"),
{
variant: "error",
}
{ variant: "error" }
);
}
if (typeof z !== 'number') {
z = 0;
}

enqueueSnackbar(
t("nui_menu.page_main.teleport.generic_success"),
{ variant: "success" }
);
fetchNui("tpToCoords", { x, y, z });
},
});
};
Expand Down

0 comments on commit bdd93ee

Please sign in to comment.