Added Credits
This commit is contained in:
1 parent
6db88bee29
commit
477f3d51f0
7 files changed
+8
-20
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { Component, useState } from "react"
|
||||
import { useNui, callNui } from "./utils/FiveM"
|
||||
var locale = {}
|
||||
import '../../styles/app.css'
|
||||
import './app.css'
|
||||
import ScaleMenu from "./components/ScaleMenu.jsx"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/* Reset and base styles */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
overflow: hidden;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@keyframes modalFadeIn {
|
||||
to {
|
||||
transform: translateY(-50%) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,10 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useNui, callNui } from '../utils/FiveM';
|
||||
|
||||
const ScaleMenu = ( { locale } ) => {
|
||||
// State for current scale value
|
||||
const [currentScale, setCurrentScale] = useState(1.0);
|
||||
const [minScale, setMinScale] = useState(0.1);
|
||||
const [maxScale, setMaxScale] = useState(2.0);
|
||||
|
||||
// Load config values when component mounts
|
||||
useEffect(() => {
|
||||
// Listen for config data from the client
|
||||
useNui('config_data', (eventData) => {
|
||||
if (eventData.data && eventData.data.scaling) {
|
||||
setMinScale(eventData.data.scaling.min || 0.1);
|
||||
@@ -18,29 +14,24 @@ const ScaleMenu = ( { locale } ) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Request config data from client
|
||||
callNui('get_config');
|
||||
}, []);
|
||||
|
||||
// Handle slider changes
|
||||
const handleScaleChange = (event) => {
|
||||
const newValue = parseFloat(event.target.value);
|
||||
setCurrentScale(newValue);
|
||||
|
||||
// Send NUI callback for slider update
|
||||
callNui('slider_updated', {
|
||||
value: newValue
|
||||
});
|
||||
};
|
||||
|
||||
// Handle save button
|
||||
const handleSave = () => {
|
||||
callNui('save_scale', {
|
||||
scale: currentScale
|
||||
});
|
||||
};
|
||||
|
||||
// Handle close button
|
||||
const handleClose = () => {
|
||||
callNui('close_menu');
|
||||
};
|
||||
@@ -73,7 +64,6 @@ const ScaleMenu = ( { locale } ) => {
|
||||
</span>
|
||||
</label>
|
||||
|
||||
{/* Modern slider container */}
|
||||
<div className="relative">
|
||||
<input
|
||||
type="range"
|
||||
|
||||
@@ -7,8 +7,8 @@ function addDebugLog(message, data = null) {
|
||||
message,
|
||||
data: data ? JSON.stringify(data) : null
|
||||
}
|
||||
debugLogs = [...debugLogs, log].slice(-50) // Keep last 50 logs
|
||||
window.debugLogs = debugLogs // Make it globally accessible
|
||||
debugLogs = [...debugLogs, log].slice(-50)
|
||||
window.debugLogs = debugLogs
|
||||
}
|
||||
|
||||
function useNui(action, handler) {
|
||||
@@ -43,8 +43,6 @@ function callNui(action, data, handler) {
|
||||
});
|
||||
}
|
||||
|
||||
// Add initial debug log
|
||||
addDebugLog(`FiveM.js loaded, resource name: ${GetParentResourceName()}`)
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user