feat: Update COX and QBCore tools with new event and function references, enhance documentation views, and improve boilerplate generation
This commit is contained in:
31 files changed
+87
-122
No files matched your search
@@ -29,15 +29,15 @@ class AddFrameworkIntegration extends Prompt
|
||||
|
||||
$parts[] = sprintf(
|
||||
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n%s",
|
||||
"Please:",
|
||||
"1. Update the fxmanifest.lua with framework dependencies",
|
||||
"2. Replace custom player systems with framework functions",
|
||||
"3. Convert money/inventory operations to framework equivalents",
|
||||
"4. Update event handlers to use framework events",
|
||||
"5. Add framework-specific features if beneficial",
|
||||
"6. Maintain backward compatibility where possible",
|
||||
"7. Add comments explaining the integration changes",
|
||||
"Use the GetEventReference tool to find relevant framework events."
|
||||
'Please:',
|
||||
'1. Update the fxmanifest.lua with framework dependencies',
|
||||
'2. Replace custom player systems with framework functions',
|
||||
'3. Convert money/inventory operations to framework equivalents',
|
||||
'4. Update event handlers to use framework events',
|
||||
'5. Add framework-specific features if beneficial',
|
||||
'6. Maintain backward compatibility where possible',
|
||||
'7. Add comments explaining the integration changes',
|
||||
'Use the GetEventReference tool to find relevant framework events.'
|
||||
);
|
||||
|
||||
return Response::prompt(implode('', $parts));
|
||||
|
||||
@@ -25,19 +25,19 @@ class ConvertLanguage extends Prompt
|
||||
|
||||
$parts[] = sprintf(
|
||||
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
"Please:",
|
||||
"1. Convert the code while maintaining functionality",
|
||||
"2. Use idiomatic patterns for the target language",
|
||||
"3. Update native function calls to match language syntax",
|
||||
"4. Adjust event handlers and callbacks",
|
||||
"5. Explain major differences in the conversion",
|
||||
"6. Ensure FiveM compatibility in the target language",
|
||||
"Key differences to consider:",
|
||||
"- Array/table indexing (0 vs 1-based)",
|
||||
"- String formatting",
|
||||
"- Event registration syntax",
|
||||
"- Async patterns",
|
||||
"- Native return values"
|
||||
'Please:',
|
||||
'1. Convert the code while maintaining functionality',
|
||||
'2. Use idiomatic patterns for the target language',
|
||||
'3. Update native function calls to match language syntax',
|
||||
'4. Adjust event handlers and callbacks',
|
||||
'5. Explain major differences in the conversion',
|
||||
'6. Ensure FiveM compatibility in the target language',
|
||||
'Key differences to consider:',
|
||||
'- Array/table indexing (0 vs 1-based)',
|
||||
'- String formatting',
|
||||
'- Event registration syntax',
|
||||
'- Async patterns',
|
||||
'- Native return values'
|
||||
);
|
||||
|
||||
return Response::prompt(implode('', $parts));
|
||||
|
||||
@@ -18,17 +18,17 @@ class CreateNewResource extends Prompt
|
||||
$language = $request->get('language', 'lua');
|
||||
|
||||
return Response::prompt(sprintf(
|
||||
"Create a new FiveM resource called '%s' with the following requirements:\n\n" .
|
||||
"Framework: %s\n" .
|
||||
"Language: %s\n\n" .
|
||||
"Please:\n" .
|
||||
"1. Generate a complete fxmanifest.lua\n" .
|
||||
"2. Create a config file with common settings\n" .
|
||||
"3. Generate boilerplate client and server files\n" .
|
||||
"4. Include proper error handling and validation\n" .
|
||||
"5. Follow FiveM best practices\n" .
|
||||
"6. Add helpful comments explaining the code structure\n\n" .
|
||||
"Use the available tools to generate the manifest and boilerplate code.",
|
||||
"Create a new FiveM resource called '%s' with the following requirements:\n\n".
|
||||
"Framework: %s\n".
|
||||
"Language: %s\n\n".
|
||||
"Please:\n".
|
||||
"1. Generate a complete fxmanifest.lua\n".
|
||||
"2. Create a config file with common settings\n".
|
||||
"3. Generate boilerplate client and server files\n".
|
||||
"4. Include proper error handling and validation\n".
|
||||
"5. Follow FiveM best practices\n".
|
||||
"6. Add helpful comments explaining the code structure\n\n".
|
||||
'Use the available tools to generate the manifest and boilerplate code.',
|
||||
$resourceName,
|
||||
$framework,
|
||||
$language
|
||||
|
||||
@@ -28,13 +28,13 @@ class DebugIssues extends Prompt
|
||||
|
||||
$parts[] = sprintf(
|
||||
"%s\n%s\n%s\n%s\n%s\n%s\n\n%s",
|
||||
"Please analyze this issue and:",
|
||||
"1. Identify the likely cause",
|
||||
"2. Suggest fixes with code examples",
|
||||
"3. Explain common mistakes that lead to this issue",
|
||||
"4. Provide preventive measures",
|
||||
"5. Reference FiveM best practices if applicable",
|
||||
"Use the SearchFiveMDocs and GetNativeFunction tools to find relevant information."
|
||||
'Please analyze this issue and:',
|
||||
'1. Identify the likely cause',
|
||||
'2. Suggest fixes with code examples',
|
||||
'3. Explain common mistakes that lead to this issue',
|
||||
'4. Provide preventive measures',
|
||||
'5. Reference FiveM best practices if applicable',
|
||||
'Use the SearchFiveMDocs and GetNativeFunction tools to find relevant information.'
|
||||
);
|
||||
|
||||
return Response::prompt(implode('', $parts));
|
||||
|
||||
@@ -25,18 +25,18 @@ class OptimizePerformance extends Prompt
|
||||
$parts[] = sprintf(
|
||||
"Script Type: %s\n\n%s\n%s\n%s\n%s\n%s\n%s\n\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
$scriptType,
|
||||
"Please analyze the code and:",
|
||||
"1. Identify performance issues (unnecessary loops, missing waits, etc.)",
|
||||
"2. Suggest optimizations with code examples",
|
||||
"3. Explain why each optimization improves performance",
|
||||
"4. Provide the optimized version of the code",
|
||||
"5. Reference FiveM best practices for performance",
|
||||
"Focus on:",
|
||||
"- Proper Citizen.Wait() usage",
|
||||
"- Distance checks before expensive operations",
|
||||
"- Caching frequently accessed values",
|
||||
"- Reducing server-client communication",
|
||||
"- Efficient event handling"
|
||||
'Please analyze the code and:',
|
||||
'1. Identify performance issues (unnecessary loops, missing waits, etc.)',
|
||||
'2. Suggest optimizations with code examples',
|
||||
'3. Explain why each optimization improves performance',
|
||||
'4. Provide the optimized version of the code',
|
||||
'5. Reference FiveM best practices for performance',
|
||||
'Focus on:',
|
||||
'- Proper Citizen.Wait() usage',
|
||||
'- Distance checks before expensive operations',
|
||||
'- Caching frequently accessed values',
|
||||
'- Reducing server-client communication',
|
||||
'- Efficient event handling'
|
||||
);
|
||||
|
||||
return Response::prompt(implode('', $parts));
|
||||
|
||||
Reference in new issue
Block a user