Skip to content

Commit 447623e

Browse files
Fix function category display and incorrect note defs
1 parent 1989e0f commit 447623e

File tree

9 files changed

+27
-18
lines changed

9 files changed

+27
-18
lines changed

functions/Cursor/isCursorShowing.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ shared: &shared
33
description: |
44
This function determines the state of a [player](/player)'s cursor.
55
notes:
6-
- This function only handles the cursor state set by the [showCursor](/showCursor) function, ignoring it if the console, chatbox, or menu is opened.
7-
- If you use this function on the server-side, keep in mind that it only detects the [showCursor](/showCursor) function executed on the server-side and not changes done by client-side.
6+
- type: 'warning'
7+
content: 'This function only handles the cursor state set by the [showCursor](/showCursor) function, ignoring it if the console, chatbox, or menu is opened.'
8+
- type: 'warning'
9+
content: 'If you use this function on the server-side, keep in mind that it only detects the [showCursor](/showCursor) function executed on the server-side and not changes done by client-side.'
810
returns:
911
description: |
1012
Returns *true* if the [player](/player)'s cursor is visible, and *false* if it is not.

functions/Cursor/showCursor.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ shared: &shared
33
description: |
44
This function is used to show or hide a [player](/player)'s cursor.
55
notes:
6-
- Regardless of the cursor state you set using this function, the cursor will always be visible while the menu, the chatbox input line or the console are active, or if another resource has called this function.
7-
- Be aware of that if showCursor is enabled by a resource, you can't disabled it from a different ressource! showCursor(false) will not work, in order to make it work, disable it from the original resource that enabled it or use an export.
6+
- type: 'warning'
7+
content: 'Regardless of the cursor state you set using this function, the cursor will always be visible while the menu, the chatbox input line or the console are active, or if another resource has called this function.'
8+
- type: 'warning'
9+
content: "Be aware of that if showCursor is enabled by a resource, you can't disabled it from a different ressource! `showCursor(false)` will not work, in order to make it work, disable it from the original resource that enabled it or use an export."
810
parameters:
911
- name: 'thePlayer'
1012
type: 'player'

functions/Element/setElementHealth.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ shared: &shared
88
description: |
99
This function sets the health of a [player](/player), [ped](/ped), [vehicle](/vehicle), or [object](/object) element.
1010
notes:
11-
- type: 'standard'
11+
- type: 'info'
1212
content: |
1313
In the case of the [vehicle](/vehicle) element, the health ranges from 0 to 1000.
1414

functions/Element/setElementPosition.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ shared: &shared
88
description: |
99
This function sets the position of an element to the specified coordinates.
1010
notes:
11-
- |
12-
Warning: Do not use this function to spawn a [player](/player). It will cause problems with other functions like [warpPedIntoVehicle](/warpPedIntoVehicle). Use [spawnPlayer](/spawnPlayer) instead.
13-
- |
14-
If you want to put a vehicle or player out of the water or simulate the position-resetting behaviour if CJ goes below the ground too far, then you need to retrieve a recommended coordinate on ground to place the element at. Take a look at this MTA forums [post](https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&comment=1003198) for steps in the right direction.
11+
- type: 'warning'
12+
content: 'Do not use this function to spawn a [player](/player). It will cause problems with other functions like [warpPedIntoVehicle](/warpPedIntoVehicle). Use [spawnPlayer](/spawnPlayer) instead.'
13+
- type: 'info'
14+
content: If you want to put a vehicle or player out of the water or simulate the position-resetting behaviour if CJ goes below the ground too far, then you need to retrieve a recommended coordinate on ground to place the element at. Take a look at this MTA forums [post](https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&comment=1003198) for steps in the right direction.
1515
parameters:
1616
- name: 'theElement'
1717
type: 'element'

schemas/common-defs.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $defs:
77
type: array
88
description: |
99
List of noteworthy pieces of information for the item.
10-
Each note can be of a specific type, e.g., 'standard' or 'important'.
10+
Each note can be of a specific type, e.g., 'info' or 'important'.
1111
items:
1212
type: object
1313
description: An individual note item.
@@ -18,9 +18,10 @@ $defs:
1818
type: string
1919
description: The type of the note, influencing its presentation.
2020
enum:
21-
- standard
21+
- info
22+
- warning
2223
- important
23-
default: standard
24+
default: info
2425
content:
2526
type: string
2627
description: The textual content of the note. Can use markdown and YAML multi-line strings.

schemas/element.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ properties:
1212
description:
1313
type: string
1414
description: Description of the element.
15+
notes:
16+
type: array
17+
description: A list of noteworthy pieces of information for the item.
18+
items:
19+
type: string
1520
see_also:
1621
$ref: 'common-defs.yaml#/$defs/see_also'

web/src/components/NoteBox.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import type { HTMLAttributes } from 'astro/types';
33
44
interface Props extends HTMLAttributes<'div'> {
5-
type?: 'standard' | 'important';
5+
type?: 'info' | 'warning' | 'important';
66
}
77
8-
const { type = 'standard', class: className, ...rest } = Astro.props;
8+
const { type = 'info', class: className, ...rest } = Astro.props;
99
---
1010
<div
1111
class:list={["custom-note-box", { 'note-important': type === 'important' }, className]}

web/src/utils/functions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,14 @@ let functionsByTypeByCategory: FunctionsByTypeByCategory = {
8989
};
9090

9191
for (let func of functionsCollection) {
92-
const normalizedPath = path.normalize(func.id);
93-
const folder = path.basename(path.dirname(normalizedPath));
92+
const folder = path.basename(path.dirname(func.filePath || ''));
9493
if (!functionsByCategory[folder]) {
9594
functionsByCategory[folder] = [];
9695
}
9796
functionsByCategory[folder].push(func);
9897

9998
const funcType = getFunctionType(func.data);
100-
if (!functionsByTypeByCategory[funcType]?.[folder]) {
99+
if (!functionsByTypeByCategory[funcType][folder]) {
101100
functionsByTypeByCategory[funcType][folder] = [];
102101
}
103102
functionsByTypeByCategory[funcType][folder].push(func);

web/src/utils/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type FunctionType = 'shared' | 'client' | 'server';
22
export type NotesType = {
3-
type: 'standard' | 'important';
3+
type: 'info' | 'warning' | 'important';
44
content: string;
55
}[];

0 commit comments

Comments
 (0)