Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
misc: disable debug mode by default and set ui page to compiled code
Browse files Browse the repository at this point in the history
  • Loading branch information
vipexv committed Sep 10, 2024
1 parent b10bb11 commit 1906b4f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion config/shared.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
return {
debug = true,
debug = false,
useBuiltInSeatbeltLogic = true, -- Whether to enable the custom seatbelt logic in this script, or use your own one, keep in mind that if you decide to use your own seatbelt logic, you will need to edit the source code to tailor your needs.
framework =
"none" -- none, esx, qb. If you wanna enable the hunger/thirst stats you need to use a framework, or you can edit the source code to tailor your own custom framework
Expand Down
4 changes: 2 additions & 2 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ server_scripts {
"server/main.lua",
}

-- ui_page 'dist/index.html'
ui_page 'http://localhost:5173/'
ui_page 'dist/index.html'
-- ui_page 'http://localhost:5173/'

files {
'dist/index.html',
Expand Down
6 changes: 3 additions & 3 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { useNuiEvent } from "@/hooks/useNuiEvent.ts";
import { useEffect, useState } from "react";
import CarHud from "./components/car-hud";
import Compass from "./components/compass";
import PlayerStatus from "./components/player-status";
import {
useSetMinimapState,
type MinimapStateInterface,
Expand All @@ -8,9 +11,6 @@ import type { ConfigInterface } from "./types/config";
import { debug, setDebugMode } from "./utils/debug";
import { fetchNui } from "./utils/fetchNui";
import { isEnvBrowser } from "./utils/misc";
import CarHud from "./components/car-hud";
import PlayerStatus from "./components/player-status";
import Compass from "./components/compass";

if (isEnvBrowser()) {
const body = document.body;
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/car-hud.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useCallback, useMemo } from "react";
import { useNuiEvent } from "@/hooks/useNuiEvent";
import { usePlayerState } from "@/states/player";
import {
useVehicleStateStore,
type VehicleStateInterface,
} from "@/states/vehicle";
import { debug } from "@/utils/debug";
import React, { useCallback, useMemo } from "react";
import Speedometer from "./ui/speedometer";
import { TextProgressBar } from "./ui/text-progress-bar";
import { useNuiEvent } from "@/hooks/useNuiEvent";
import { usePlayerState } from "@/states/player";
import { debug } from "@/utils/debug";

const CarHud = React.memo(function CarHud() {
const [vehicleState, setVehicleState] = useVehicleStateStore();
Expand Down
5 changes: 2 additions & 3 deletions web/src/components/compass.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FaCompass, FaLocationDot, FaMap } from "react-icons/fa6";
import IconLabelBox from "./ui/icon-label-box";
import { usePlayerState } from "@/states/player";
import { debug } from "@/utils/debug";
import React from "preact/compat";
import { FaCompass, FaLocationDot, FaMap } from "react-icons/fa6";
import IconLabelBox from "./ui/icon-label-box";

const Compass = () => {
const playerState = usePlayerState();
Expand Down
11 changes: 5 additions & 6 deletions web/src/components/player-status.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { BiSolidShieldAlt2 } from "react-icons/bi";
import { TiHeartFullOutline } from "react-icons/ti";
import { StatBar, StatBarSegmented } from "./ui/status-bars";
import { PlayerStateInterface, usePlayerStateStore } from "@/states/player";
import { useNuiEvent } from "@/hooks/useNuiEvent";
import { useMinimapState } from "@/states/minimap";
import { debug } from "@/utils/debug";
import { PlayerStateInterface, usePlayerStateStore } from "@/states/player";
import React, { useCallback } from "preact/compat";
import { IoFastFood } from "react-icons/io5";
import { BiSolidShieldAlt2 } from "react-icons/bi";
import { FaBottleWater } from "react-icons/fa6";
import { IoFastFood } from "react-icons/io5";
import { TiHeartFullOutline } from "react-icons/ti";
import { StatBar, StatBarSegmented } from "./ui/status-bars";

const PlayerStatus = () => {
const [playerState, setPlayerState] = usePlayerStateStore();
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ui/speedometer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useMemo } from "react";
import React, { useEffect, useMemo, useRef } from "react";

interface SpeedometerProps {
speed: number;
Expand Down

0 comments on commit 1906b4f

Please sign in to comment.