Skip to content

Commit

Permalink
chore: bump to 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vipexv committed Sep 15, 2024
1 parent bb557de commit 3bb9107
Show file tree
Hide file tree
Showing 13 changed files with 634 additions and 645 deletions.
22 changes: 8 additions & 14 deletions client/nuicb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ local config = require("config.shared")
local utility = require("modules.utils.shared")
local debug = utility.debug

RegisterNuiCallback("hideFrame", function(_, cb)
cb(true)
interface.toggle(false)
debug("(nuicb:hideFrame) Called and set to false.")
end)

RegisterNuiCallback('uiLoaded', function(_, cb)
local data = {
config = config,
minimap = utility.calculateMinimapSizeAndPosition(),
}
RegisterNuiCallback("uiLoaded", function(_, cb)
local data = {
config = config,
minimap = utility.calculateMinimapSizeAndPosition(),
}

cb(data)
cb(data)

CreateThread(utility.setupMinimap)
CreateThread(utility.setupMinimap)

debug("(nuicb:uiLoaded) Updating config and setting up minimap.")
debug("(nuicb:uiLoaded) Updating config and setting up minimap.")
end)
68 changes: 34 additions & 34 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
---@diagnostic disable: undefined-global
fx_version "cerulean"
game "gta5"
fx_version("cerulean")
game("gta5")

name 'minimal-hud'
author "vipex <discord:vipex.v>"
version "1.0.3"
repository 'https://github.com/vipexv/minimal-hud'
name("minimal-hud")
author("vipex <discord:vipex.v>")
version("1.0.4")
repository("https://github.com/vipexv/minimal-hud")

shared_scripts {
"require.lua",
}
shared_scripts({
"require.lua",
})

client_scripts {
"client/main.lua",
"client/nuicb.lua",
"client/commands.lua",
}
client_scripts({
"client/main.lua",
"client/nuicb.lua",
"client/commands.lua",
})

server_scripts {
"server/main.lua",
}
server_scripts({
"server/main.lua",
})

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

files {
'dist/index.html',
'dist/assets/*.js',
'dist/assets/*.css',
'dist/**/*.woff2',
"config/shared.lua",
"config/functions.lua",
"modules/interface/client.lua",
"modules/utils/shared.lua",
"modules/seatbelt/client.lua",
"modules/frameworks/**/*.lua",
"modules/threads/client/**/*.lua",
"data/mapData.lua",
}
files({
"dist/index.html",
"dist/assets/*.js",
"dist/assets/*.css",
"dist/**/*.woff2",
"config/shared.lua",
"config/functions.lua",
"modules/interface/client.lua",
"modules/utils/shared.lua",
"modules/seatbelt/client.lua",
"modules/frameworks/**/*.lua",
"modules/threads/client/**/*.lua",
"data/mapData.lua",
})

lua54 "yes"
use_experimental_fxv2_oal "yes"
lua54("yes")
use_experimental_fxv2_oal("yes")
2 changes: 1 addition & 1 deletion modules/utils/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local serverUtils = {}
serverUtils.versionCheck = function(repository)
local resource = GetInvokingResource() or GetCurrentResourceName()

local currentVersion = 'v1.0.3'
local currentVersion = 'v1.0.4'

if currentVersion then
currentVersion = currentVersion:match('%d+%.%d+%.%d+')
Expand Down
Binary file modified web/bun.lockb
Binary file not shown.
56 changes: 28 additions & 28 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "minimal-hud",
"author": "vipex",
"private": true,
"version": "1.0.3",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"jotai": "~2.9.3",
"preact": "^10.23.2",
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
"react-icons": "^5.3.0",
"tailwind-merge": "^2.5.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.9.0",
"@types/node": "^20.16.5",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.45",
"rollup-plugin-visualizer": "^5.12.0",
"tailwindcss": "^3.4.11",
"typescript": "^5.6.2",
"vite": "^5.4.4"
}
"name": "minimal-hud",
"author": "vipex",
"private": true,
"version": "1.0.4",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"jotai": "~2.9.3",
"preact": "^10.23.2",
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
"react-icons": "^5.3.0",
"tailwind-merge": "^2.5.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.9.0",
"@types/node": "^20.16.5",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.45",
"rollup-plugin-visualizer": "^5.12.0",
"tailwindcss": "^3.4.11",
"typescript": "^5.6.2",
"vite": "^5.4.4"
}
}
88 changes: 44 additions & 44 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,64 @@ import CarHud from "./components/car-hud";
import Compass from "./components/compass";
import PlayerStatus from "./components/player-status";
import {
useSetMinimapState,
type MinimapStateInterface,
useSetMinimapState,
type MinimapStateInterface,
} from "./states/minimap";
import type { ConfigInterface } from "./types/config";
import { debug, setDebugMode } from "./utils/debug";
import { fetchNui } from "./utils/fetchNui";
import { isEnvBrowser } from "./utils/misc";

if (isEnvBrowser()) {
const body = document.body;
const body = document.body;

body.style.backgroundColor = "#242424";
debug("App loaded in browser");
body.style.backgroundColor = "#242424";
debug("App loaded in browser");
}

export function App() {
const [visible, setVisible] = useState(true);
const setMinimapState = useSetMinimapState();
const [visible, setVisible] = useState(true);
const setMinimapState = useSetMinimapState();

useNuiEvent("setVisible", (state) => {
const newState = state === "toggle" ? !visible : state;
setVisible(newState);
useNuiEvent("setVisible", (state) => {
const newState = state === "toggle" ? !visible : state;
setVisible(newState);

debug(
`(App) NUI message received: setVisible ${state}`,
`newState: ${newState}`
);
});
debug(
`(App) NUI message received: setVisible ${state}`,
`newState: ${newState}`
);
});

useEffect(() => {
fetchNui("uiLoaded")
.then(
(res: {
config: ConfigInterface;
minimap: MinimapStateInterface;
}) => {
setDebugMode(res.config.debug ?? false);
setMinimapState(res.minimap);
}
)
.catch((err) => {
console.error(err);
})
.finally(() => {
debug("(App) fetched uiLoaded callback");
});
}, []);
useEffect(() => {
fetchNui("uiLoaded")
.then(
(res: {
config: ConfigInterface;
minimap: MinimapStateInterface;
}) => {
setDebugMode(res.config.debug ?? false);
setMinimapState(res.minimap);
}
)
.catch((err) => {
console.error(err);
})
.finally(() => {
debug("(App) fetched uiLoaded callback");
});
}, []);

if (!visible) {
debug("(App) Returning with no children since the app is not visible.");
return <></>;
}
if (!visible) {
debug("(App) Returning with no children since the app is not visible.");
return <></>;
}

return (
<>
<PlayerStatus />
<CarHud />
<Compass />
</>
);
return (
<>
<PlayerStatus />
<CarHud />
<Compass />
</>
);
}
Loading

0 comments on commit 3bb9107

Please sign in to comment.