Skip to content

Commit

Permalink
client: use altv enums instead of literals
Browse files Browse the repository at this point in the history
  • Loading branch information
xxshady committed Aug 10, 2022
1 parent a7c77bb commit d357faa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions freeroam-extended/client/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ esbuild.build({
altvEsbuild({
mode: 'client',
dev,
altvEnums: true,
})
]
})
2 changes: 1 addition & 1 deletion freeroam-extended/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@altv/types-shared": "^1.2.6",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"altv-esbuild": "^0.0.8",
"altv-esbuild": "^0.1.3",
"concurrently": "^7.3.0",
"esbuild": "^0.14.53",
"eslint": "^7.30.0",
Expand Down
11 changes: 5 additions & 6 deletions freeroam-extended/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { LOCAL_PLAYER } from "./helpers"

import * as native from "natives"
import * as alt from "alt-client"

import "./events"
import "./chat"
import "./noclip"
import { playerData } from "./playerdata"
import { view } from "./view"
import { playerNametags } from "./nametags"
import { ConfigFlag, StatName, WatermarkPosition } from "altv-enums"

alt.setConfigFlag("DISABLE_AUTO_WEAPON_SWAP", true)
alt.setConfigFlag("DISABLE_IDLE_CAMERA", true)
alt.setStat("stamina", 100)
alt.setWatermarkPosition(3) // top center
alt.setConfigFlag(ConfigFlag.DisableAutoWeaponSwap, true)
alt.setConfigFlag(ConfigFlag.DisableIdleCamera, true)
alt.setStat(StatName.Stamina, 100)
alt.setWatermarkPosition(WatermarkPosition.TopCenter) // top center

setInterval(() => {
if (!playerData.areNametagsVisible) return
Expand Down
5 changes: 2 additions & 3 deletions freeroam-extended/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
"resolveJsonModule": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"isolatedModules": false,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"typeRoots": [
"./node_modules/@altv",
"./node_modules/@types",
"./@types",
"node_modules/altv-esbuild/altv-enums/types"
],
"paths": {
"@/*": ["./src/*"]
Expand Down
8 changes: 4 additions & 4 deletions freeroam-extended/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ ajv@^8.0.1:
require-from-string "^2.0.2"
uri-js "^4.2.2"

altv-esbuild@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/altv-esbuild/-/altv-esbuild-0.0.8.tgz#aa412ecc179585e23c23370e5a04fc8c0fcf9f44"
integrity sha512-nrIf6GYyUysD/8JsQ5Tc63rDPIiKPNvG59UAgP0Q15bF6esNUQrxP0SCal/7ZQR6dx+Z56IxAl45p29gJl8VRg==
altv-esbuild@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/altv-esbuild/-/altv-esbuild-0.1.3.tgz#3d05d4cad7b4ec005ac4f4053ba9cc228f08dd5d"
integrity sha512-tJajq+1isEdYkusRaQPES/jZucAoQ8QHbufE4O9WqCkH90NKhfMjHfS5K/eKyQL2J9EulBnHULVvi7uLIm203A==

ansi-colors@^4.1.1:
version "4.1.3"
Expand Down

0 comments on commit d357faa

Please sign in to comment.