citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.47k stars 2.05k forks source link

feat(mono/redm): initial works for rdr #2488

Closed AvarianKnight closed 2 weeks ago

AvarianKnight commented 4 months ago

Goal of this PR

Add same helper methods that FiveM has

How is this PR achieving the goal

Start implementing base classes for RedM.

This PR applies to the following area(s)

RedM, SCRT:C#

Successfully tested on

Game builds: 1491

Checklist

Fixes issues

AvarianKnight commented 4 months ago

This PR should be good to review.

The Goal of this PR is to implement some base classes for RedM to allow players who want to use it to get started.

Some of these methods were taken from the original FiveM classes, notably the Model class. Though this shouldn't have any have any int -> uint (or vice-versa) calls.

This was also why the Game.GenerateHash native is unique for RedM & FiveM.

This change set also introduces a UiFeed class so the user can generate feed messages, if wanted these changes can be pulled out to leave just the base classes being implemented.

AvarianKnight commented 2 months ago

Some changes that were made:

Model implements IDisposable so it will properly SetModelAsNoLongerNeeded when the object goes out of scope

Vehicle has more stuff implemented

Given recent events I likely wont work on this anymore so anyone can feel free to continue this PR if it needs changes.