Skip to content

Commit e6215da

Browse files
Reorganize elements and add missing
1 parent 6501efc commit e6215da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+112
-63
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

elements/Drawing/dx-font.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: dx-font
2+
description: |
3+
The **DX font** class represents a custom typeface which can be used in the **Drawing functions**. A DX font is created with [dxCreateFont](/dxCreateFont) and can be used as a parameter in [dxDrawText](/dxDrawText).

elements/Drawing/shader.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: shader
2+
# In the old wiki, this element is a type of "material" element
3+
description: |
4+
The shader class represents a Microsoft HLSL Effect File(.fx) loaded by the client, which can be used instead of a texture when calling [dxDrawImage](/dxDrawImage).
5+
6+

elements/Drawing/texture.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: texture
2+
# In the old wiki, this element is a type of "material" element
3+
description: |
4+
The texture class represents a source of renderable pixels which can be used as an image with [dxDrawImage](/dxDrawImage), [dxDrawImageSection](/dxDrawImageSection) or as a value in [dxSetShaderValue](/dxSetShaderValue).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

elements/GUI/gui-font.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: gui-font
2+
description: |
3+
The **GUI font** class represents a custom typeface which can be applied to [GUI widgets](/GUI_widgets). A GUI font is created with [guiCreateFont](/guiCreateFont) and can then used as a parameter in [guiSetFont](/guiSetFont).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

elements/info.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

web/src/pages/Client_Scripting_Events.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const theseEvents = eventsByTypeByCategory.client;
1616

1717
{Object.entries(theseEvents).map(([category, events]) => (
1818
<section>
19-
<details>
19+
<details open>
2020
<summary>{category} events</summary>
2121
<ul>
2222
{events.map(event => (

web/src/pages/Client_Scripting_Functions.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const theseFunctions = functionsByTypeByCategory.client;
1616

1717
{Object.entries(theseFunctions).map(([category, funcs]) => (
1818
<section>
19-
<details>
19+
<details open>
2020
<summary>{category} functions</summary>
2121
<ul>
2222
{funcs.map(func => (

web/src/pages/Element.astro

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@ const elementsByCategory = getElementsByCategory();
1212
tableOfContents: false,
1313
}}>
1414
<p>In order to perform operations on MTA objects via scripting, pointers to internal classes are exported to scripts as Lua userdata. Each of these classes has a number of exported scripting functions associated with them. Elements that have a physical representation in the game are also known as <a href="/Entity">Entities</a>.</p>
15-
<p>An <strong>element</strong> is a generic class that can represent almost all in-game entities. The built-in element types are:</p>
16-
<ul>
17-
{Object.entries(elementsByCategory).map(([category, elements], index) => (
18-
<section>
19-
{/* <details {...(index === 0 ? { open: true } : {})}> */}
20-
<details>
21-
<summary>{category} elements</summary>
22-
<ul>
23-
{elements.map(element => (
24-
<li>
25-
<a href={`/${element.id}`}>{element.id}</a>
26-
{hasOopMethods(element) ? <span class="small-text">[OOP]</span> : ''}
27-
</li>
28-
))}
29-
</ul>
30-
</details>
31-
</section>
15+
<p>An <strong>element</strong> is a generic class that can represent almost all in-game entities.
16+
The built-in element types are:</p>
17+
18+
<div class="mtaflex">
19+
{Object.entries(elementsByCategory).map(([category, elements]) => (
20+
<div class="mtabox">
21+
<span class="mtabox_title">{category} elements</span>
22+
<ul>
23+
{elements.map(element => (
24+
<li>
25+
<a href={`/${element.id}`}>{element.id}</a>
26+
{hasOopMethods(element) ? <span class="small-text">[OOP]</span> : ''}
27+
</li>
28+
))}
29+
</ul>
30+
</div>
3231
))}
33-
</ul>
32+
</div>
3433

3534
<hr>
3635

@@ -44,3 +43,26 @@ const elementsByCategory = getElementsByCategory();
4443
'article:Entity',
4544
])} currentId='' />
4645
</StarlightPage>
46+
47+
<style>
48+
.mtaflex {
49+
display: flex;
50+
flex-wrap: wrap;
51+
gap: 2rem;
52+
align-items: flex-start;
53+
justify-content: flex-start;
54+
}
55+
56+
.mtabox {
57+
margin: 0;
58+
display: flex;
59+
flex-direction: column;
60+
justify-content: space-between;
61+
height: 100%;
62+
}
63+
.mtabox_title {
64+
font-weight: bold;
65+
margin-bottom: 0.5rem;
66+
}
67+
68+
</style>

web/src/pages/Entity.astro

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
import { getSeeAlsoLinksFromList } from '@src/utils/general';
4+
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
5+
6+
import { getElementsByCategory } from '@src/utils/elements';
7+
const elementsByCategory = getElementsByCategory();
8+
const entities = elementsByCategory['Entity'] || [];
9+
10+
---
11+
<StarlightPage frontmatter={{
12+
template: 'doc',
13+
title: 'Entity',
14+
tableOfContents: false,
15+
}}>
16+
<p>An <strong>entity</strong> is an element that has a position and a physical representation in the world. The following elements are entities:</p>
17+
18+
<div class="mtagrid">
19+
{Array.from({ length: Math.ceil(entities.length / 10) }, (_, i) => (
20+
<ul class="mtabox">
21+
{entities.slice(i * 10, i * 10 + 10).map(entity => (
22+
<li>
23+
<a href={`/${entity.id}`}>{entity.id}</a>
24+
</li>
25+
))}
26+
</ul>
27+
))}
28+
</div>
29+
30+
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
31+
'article:Element',
32+
'article:Element_tree',
33+
])} currentId='' />
34+
</StarlightPage>
35+
36+
<style>
37+
.mtagrid {
38+
display: grid;
39+
grid-template-columns: repeat(2, 1fr); /* 2 boxes per row */
40+
}
41+
42+
.mtabox {
43+
padding: 4px 8px 8px 8px;
44+
padding: 1rem;
45+
}
46+
</style>

web/src/pages/Entity.mdx

Lines changed: 0 additions & 35 deletions
This file was deleted.

web/src/pages/OOP_Classes.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ const elementsByCategory = getOOPElementsByCategory();
1010
title: 'OOP Classes',
1111
tableOfContents: false,
1212
}}>
13-
<p>This page lists all <strong>Classes</strong> available in the <a href="/Lua_API">Lua API</a> using <a href="/OOP_Introduction">OOP</a> organized by category.</p>
13+
<p>This page lists all <strong>special classes</strong> only available in the <a href="/Lua_API">Lua API</a> using <a href="/OOP_Introduction">OOP</a>.</p>
1414

15-
<p><strong>Vectors</strong> and <strong>Matrices</strong> make it easier to drop the complex maths and go straight ahead with fun part of maths. OOP does not have to be enabled in the server config for this to be enabled.</p>
15+
<p><strong>Vectors</strong> and <strong>Matrices</strong> make it easier to drop the complex maths and go straight ahead with fun part of maths.</p>
16+
<p>OOP does not have to be enabled in the server config for this to be enabled.</p>
1617

1718
{Object.entries(elementsByCategory).map(([category, elements]) => (
1819
<section>

web/src/pages/Scripting_Events.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const eventsByCategory = getEventsByCategory();
1515

1616
{Object.entries(eventsByCategory).map(([category, events]) => (
1717
<section>
18-
<details>
18+
<details open>
1919
<summary>{category} events</summary>
2020
<ul>
2121
{events.map(event => (

web/src/pages/Scripting_Functions.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const functionsByCategory = getFunctionsByCategory();
1515

1616
{Object.entries(functionsByCategory).map(([category, funcs]) => (
1717
<section>
18-
<details>
18+
<details open>
1919
<summary>{category} functions</summary>
2020
<ul>
2121
{funcs.map(func => (

web/src/pages/Server_Scripting_Events.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const theseEvents = eventsByTypeByCategory.server;
1616

1717
{Object.entries(theseEvents).map(([category, events]) => (
1818
<section>
19-
<details>
19+
<details open>
2020
<summary>{category} events</summary>
2121
<ul>
2222
{events.map(event => (

web/src/pages/Server_Scripting_Functions.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const theseFunctions = functionsByTypeByCategory.server;
1616

1717
{Object.entries(theseFunctions).map(([category, funcs]) => (
1818
<section>
19-
<details>
19+
<details open>
2020
<summary>{category} functions</summary>
2121
<ul>
2222
{funcs.map(func => (

web/src/pages/Shared_Scripting_Functions.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const theseFunctions = functionsByTypeByCategory.shared;
1616

1717
{Object.entries(theseFunctions).map(([category, funcs]) => (
1818
<section>
19-
<details>
19+
<details open>
2020
<summary>{category} functions</summary>
2121
<ul>
2222
{funcs.map(func => (

0 commit comments

Comments
 (0)