Skip to content

Commit d178a89

Browse files
committed
docs: update README and CONTRIBUTING
1 parent cba6dc0 commit d178a89

3 files changed

Lines changed: 49 additions & 24 deletions

File tree

CONTRIBUTING.md

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ You are free to use any style you want, except in these cases:
183183
DoSomething()
184184
```
185185

186+
## Macros
187+
188+
The project defines these global macros for convenience:
189+
190+
- `_F` -> `string.format`
191+
- `_J` -> `joaat`.
192+
- `_T` -> `Translator:Translate`
193+
186194
## Translations
187195

188196
- The primary language for all labels is English (US) (`includes/lib/translations/en-US.lua`).
@@ -206,7 +214,7 @@ Suppose you want to draw some text that gets automatically translated:
206214
}
207215
```
208216

209-
3. Use the `key` with the `_T` wrapper for the [`Translator:Translate(...)`](docs/services/Translator.md) method:
217+
3. Use the `key` with the `_T` macro:
210218

211219
```lua
212220
ImGui.Text(_T("MY_LABEL"))
@@ -230,35 +238,42 @@ The project is organized by responsibility rather than feature size. Folders def
230238

231239
```bash
232240
├─ includes/
233-
│ ├─ classes/
234-
│ │ └─ gta/ # Contains reverse-engineered game classes mostly sourced from Yimura's archived repository and others I reversed myself using a mix of debuggers, public research, and personal suffering.
241+
│ ├─ classes/ # A place where all classes are stored.
242+
│ │ └─ gta/ # Contains reverse-engineered game classes mostly sourced from Yimura's archived repository and others I reversed myself using a mix of debuggers, public research, and personal suffering.
235243
│ │
236-
│ ├─ data/ # A place where all raw data is stored.
237-
│ │ ├─ actions/ # Contains YimActions V3 data (animations, scenarios, synchronized scenes, and movement clipsets).
238-
│ │ └─ enums/ # Groups all game and custom enums in one place under one `Enums` global namespace.
244+
│ ├─ data/ # A place where all raw data is stored.
245+
│ │ ├─ actions/ # Contains YimActions V3 data (animations, scenarios, synchronized scenes, and movement clipsets).
246+
│ │ └─ enums/ # Groups all game and custom enums in one place under one `Enums` global namespace.
239247
│ │
240-
│ ├─ features/ # Stores all script features.
241-
│ │ ├─ self/ # Player-specific features.
242-
│ │ ├─ vehicle/ # Vehicle-specific features.
243-
│ │ └─ world/ # World-specific features.
248+
│ ├─ features/ # Stores all script features.
249+
│ │ ├─ extra/ # Self-contained experience-enhancing features.
250+
│ │ ├─ online/ # Online-only features.
251+
│ │ ├─ self/ # Player-specific features.
252+
│ │ ├─ vehicle/ # Vehicle-specific features.
253+
│ │ └─ world/ # World-specific features.
244254
│ │
245-
│ ├─ frontend/ # This is where UI tabs live.
255+
│ ├─ frontend/ # This is where UI tabs live. As a contributor, you are free to organize UI source files however you want but this general rule is highly recommended:
256+
│ │ # - If your UI requires more than one file, group them in a subfolder.
257+
│ │ # - If you have one large file doing a multitude of things, split it into multiple files and group them in a subfolder.
246258
│ │
247-
│ ├─ lib/ # Contains project libraries and commands: API extensions, translations, Lua standard library extensions, global utilities, etc.
259+
│ ├─ lib/ # Contains project libraries and commands: API extensions, ImGui extensions, Lua standard library extensions, global utilities, etc.
260+
│ │ └─ translations/ # This is where translation files, supported locales, and the translations hash map are stored.
248261
│ │
249-
│ ├─ modules/ # Contains custom modules such as native wrappers, game entity abstractions, and higher-level gameplay utilities.
262+
│ ├─ modules/ # Contains custom modules such as native wrappers, game entity abstractions, YimMenu API wrappers, and higher-level gameplay utilities.
250263
│ │
251-
│ ├─ services/ # Contains runtime services (GUI, KeyManager, Serializer, CommandExecutor, etc.)
264+
│ ├─ services/ # Contains runtime services (GUI, KeyManager, Serializer, CommandExecutor, etc.)
265+
│ │ └─ asset_browsers/ # Stores an assortment of focused asset browsers and their base class.
252266
│ │
253-
│ ├─ structs/ # Stores helper structs.
267+
│ ├─ structs/ # Stores helper structs.
254268
│ │
255-
│ ├─ thirdparty/ # Thirdparty components and their license texts.
269+
│ ├─ thirdparty/ # Thirdparty components and their license texts.
256270
│ │
257-
│ ├─ backend.lua # Central backend module providing lifecycle coordination, entity management, and API/script version checks.
258-
│ ├─ version.lua # This is purely for CI and should never be edited. It stores the latest script version.
259-
│ └─ init.lua # Initializes the whole project.
271+
│ ├─ backend.lua # Central backend module providing lifecycle coordination, entity management, and API/script version checks.
272+
│ ├─ tests.lua # Purely for local tests in a mock environment.
273+
│ ├─ version.lua # This is purely for CI and should never be edited. It stores the latest script version.
274+
│ └─ init.lua # Initializes the whole project.
260275
261-
└─ samurais_scripts.lua # Main entry point that calls `init.lua`, handles late initialization for a few modules/services, and lazily populates a few data sets in a fiber.
276+
└─ samurais_scripts.lua # Main entry point that calls `init.lua`, handles late initialization for a few modules/services, registers commands, and lazily populates a few data sets in a fiber.
262277
```
263278

264279
## Where Does My Code Go?
@@ -267,11 +282,11 @@ The project is organized by responsibility rather than feature size. Folders def
267282
| :---: | :---: | :---: |
268283
| A gameplay feature | `includes/features/` | Features are behavior, not UI. |
269284
| A UI tab or layout code | `includes/frontend/` | UI only. No game logic. |
270-
| A reusable system with lifecycle | `includes/services/` | Must be explicitly initialized. |
285+
| A reusable system with lifecycle | `includes/services/` | - |
271286
| A reverse-engineered game structure or a custom Lua class | `includes/classes/` | - |
272287
| A lightweight data container or object | `includes/structs/` | No lifecycle, no side effects. |
273288
| Raw static data (tables, lists, maps) | `includes/data/` | Never execute logic here. |
274-
| A native wrapper or abstraction | `includes/modules/` | Bridges Lua `<->` game engine. |
289+
| A native wrapper or abstraction | `includes/modules/` | Bridges `Lua <-> game engine`. |
275290
| Utility or extension code | `includes/lib/` | Generic helpers and API/stdlib extensions. |
276291
| Initialization or bootstrapping | `init.lua` / `backend.lua` | Do not add features here. |
277292
| A third party module from somewhere/someone else | `includes/thirdparty` | Place in a subfolder accompanied with the module's license *(when applicable)*. |

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Refer to the [Contribution Guidelines](./CONTRIBUTING.md) for more details on th
9292

9393
## Documentation
9494

95-
This project was rewritten from scratch using [SmallBase](https://github.com/xesdoog/SmallBase). For API documentation, please refer to the [docs](https://github.com/xesdoog/SmallBase/tree/main/docs).
95+
This project was rewritten from scratch using the [SmallBase](https://github.com/xesdoog/SmallBase) template.
96+
97+
A full documentation will be uploaded to this repository soon. In the meantime, feel free to explore [SmallBase's docs](https://github.com/xesdoog/SmallBase/tree/main/docs).
9698

9799
>[!Note]
98100
> Some parts of the API were refactored or extended but nothing has drastically changed.
@@ -143,3 +145,9 @@ A full list of available features and their usage [can be found here](docs/Featu
143145
| <a href="https://github.com/durtyfree"><img height="40" width="40" alt="DurtyFree" src="https://avatars.githubusercontent.com/durtyfree"><br/>Alexander Schmid</a> | [GTA V data dumps](https://github.com/DurtyFree/gta-v-data-dumps) |
144146
| <a href="https://github.com/yimura"><img height="40" width="40" alt="Yimura" src="https://avatars.githubusercontent.com/yimura"><br/>Andreas Maerten</a> | GTA V classes (archived/removed) |
145147
| <a href="https://unknowncheats.me"><img height="40" width="40" alt="UC" src="https://avatars.githubusercontent.com/u/29552835"><br/>UnknownCheats</a> | A treasure trove of information |
148+
149+
## TODO
150+
151+
- [ ] Generate our own docs since we're no longer in sync with [SmallBase](https://github.com/xesdoog/SmallBase).
152+
- [ ] Fully Refactor EntityForge.
153+
- [ ] Add support in YimActions for defining custom animations. This will require extracting EntityForge's attachment handler into a reusable module for animation prop configuration.

docs/Readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Documentation
22

3-
In version 1.7.3, the script was updated using [this template repository](https://github.com/xesdoog/SmallBase). For more information, please refer to the [SmallBase docs](https://github.com/xesdoog/SmallBase/tree/main/docs)
3+
This project was rewritten from scratch using the [SmallBase](https://github.com/xesdoog/SmallBase) template.
4+
5+
A full documentation will soon be generated and uploaded here. In the meantime, feel free to explore [SmallBase's docs](https://github.com/xesdoog/SmallBase/tree/main/docs).

0 commit comments

Comments
 (0)