Commit Graph

50 Commits

Author SHA1 Message Date
f62c8c875e fix(FontMgr): also keep in mind game language when generating font texture (#2892) 2024-07-23 08:47:38 +02:00
8f980ff1ac feat(lua): Expose Script Patches & Functions (#3393) 2024-07-22 10:16:48 +02:00
796f6209f5 more player stats lua bindings (#3325)
Some checks failed
Nightly Build / Check Recent Commit (push) Failing after 7s
Nightly Build / Build Nightly (push) Has been skipped
Nightly Build / Recreate Release (push) Has been skipped
get_player_money
get_player_wallet
get_player_bank
get_player_language_id
get_player_language_name
2024-07-13 13:41:58 +02:00
8b7cbda946 fix self doc (#3319)
Some checks failed
Nightly Build / Check Recent Commit (push) Failing after 5s
Nightly Build / Build Nightly (push) Has been skipped
Nightly Build / Recreate Release (push) Has been skipped
2024-07-09 18:42:32 +02:00
64faa400b1 lua doc: add self table doc and update doc for previous changes that forgot to run the doc gen script (#3318) 2024-07-09 18:14:15 +02:00
6bbaaa398e feat: dynamicly calling x64 functions from lua at runtime with arbitrary signatures. (#3311) 2024-07-09 17:48:24 +02:00
014281d3e9 feat: dynamicly hooking x64 functions from lua at runtime with arbitrary signatures. (#3301)
* feat: dynamicly hooking x64 functions from lua at runtime with arbitrary signatures.

* fix missing include

* c/c++ include system is a good system
2024-07-08 14:15:18 +02:00
a40f4a4956 add show_success lua binding (#3249) 2024-06-19 11:37:38 +02:00
155ffebe11 Make Player Stats Retrievable Within Lua (#3199)
Some checks are pending
Nightly Build / Check Recent Commit (push) Successful in 34s
Nightly Build / Build Nightly (push) Waiting to run
Nightly Build / Recreate Release (push) Blocked by required conditions
2024-06-01 12:57:21 +02:00
78b4302721 Chat spam to reaction (#3192) 2024-05-30 20:24:33 +02:00
10bec398bb fix(lua): fix pointer.allocate allocating the wrong number of bytes (#2941) 2024-04-13 17:41:04 +02:00
0dc5ad6137 fix(lua): better error reporting when calling player commands (#2932) 2024-04-10 11:43:55 +02:00
7e7bcb155a Refactor and fix send chat (#2864)
* feat(chat): refactor and fix send chat
* fix(chat): fixes
* fix(chat): fix team chat

Co-authored-by: DayibBaba <79384354+DayibBaba@users.noreply.github.com>
2024-03-23 17:37:51 +01:00
cba19d0c33 refactor!: Rewrite of the old notification service (#2866)
The main goal was improving the readability of the original code however some ugliness remains.

- Swapped from pointer singleton to instance singleton
- Actually make use of the alpha logic that used to be present
- Added a counter to notifications to indicate if something is being spammed
- Notification timeouts reset if they're sent to the queue again
2024-03-23 00:04:49 +01:00
95259faf59 add lua api: script.execute_as_script (#2824)
Co-authored-by: xiaoxiao921 <xiaoxiao921@hotmail.fr>
2024-03-21 11:20:22 +01:00
e07601347d refactor: switch RAGE_JOAAT with string literal functions (#2806)
Why? Shorter to write and removes the macro usage

I used the following regex to find all occurrences:
```r
RAGE_JOAAT\("(.*?)"\)
```
then the following to replace it all:
```r
"$1"_J
```
2024-03-12 09:42:11 +01:00
ec7735cb3a fixed bool_masked (#2708) 2024-02-12 18:26:07 +01:00
96048fa0f6 feat(lua): expose the self class and add new menu events (#2656) 2024-01-28 15:18:44 +01:00
1127e51a52 Optimizations (#2649)
* fix(Respawn): fix respawn in SP
* fix: re-enable bigobj
* fix: update creator's stack size
* fix: use BOOLs instead of bools
* fix(gitignore): hide .pyc files
2023-12-29 17:07:00 +01:00
5324d0a244 feat(cmake): update ImGui to latest release (#2621) 2023-12-21 16:01:47 +01:00
b7b901d77f Fixed TRIGGER_SCRIPT_EVENT for 3095. (#2527) 2023-12-13 19:32:26 +01:00
a2eff686cb Enabled strict sol for type safety and function enforcement. (#2502) 2023-12-10 12:51:29 +01:00
11d48f49f9 feat(lua): added weapon and vehicle cache bindings (#2477)
* Replaced bad example in entities documentation.
* Updated Lua documentation for vehicles/weapons to allow for auto generation.
* Added Vector3 support to the Lua globals/locals class.
* Fixed a bug with get_float in globals/locals returning an int instead of a float.
* Fixed globals get_uint/set_uint using signed types for the return/parameter.
* Added unsigned int helpers to the locals Lua class.
2023-12-05 09:58:35 +01:00
f0302ab135 Added packed stats handler to the stats Lua class. (#2460) 2023-11-29 23:15:10 +01:00
5d538cf53c Rewrite AC bypass (#2430)
* fix(anticheat): rewrite AC bypass again (the old one isn't detected but this is cleaner)
* fix(chat): some chat tweaks
* fix(anticheat): fix memory leak
* feat(lua): add is_player_friend
* fix(protections): fix possible false positives with the vehicle task mismatch protection
* feat(protections): add debug logs to trace false positive
* fix(spam): add some more stuff
2023-11-19 23:20:15 +01:00
3914ebee72 feat(lua): add tunable overloads for getting / setting values through the already joaated tunable value. (#2417) 2023-11-14 20:21:03 +01:00
d2acc65af0 fix(lua): small lua / lau doc fixes (#2415)
* fix(lua): small lua / lau doc fixes: expose stats.get_character_index like intended. also add a bit of doc to button and sameline pages so that the user is correctly refered to the tab class doc
2023-11-14 20:20:45 +01:00
c38e42a488 Feat(lua-doc): Make sure that the MPX -> MP0/MP1 behavior for stats function is documented. (#2251) 2023-10-13 00:14:02 +02:00
0bb5b3bda6 feat(lua): expose take_control_of (#2249) 2023-10-13 00:13:39 +02:00
94838af288 feat(lua): Allow lua scripts to flag modders with a custom reason if needed. (#2248) 2023-10-13 00:11:37 +02:00
afd3a5e943 Add Garage drop-down to Spawn PV menu (#2171)
* Fixed edge case where a garage that contained only banned vehicles would show if the user was using Spawn Clone.
Refactored a large portion of the garage code to be production ready.
Formatting changes.

* Added singular garage items to the m_garage setter like the Terrorbyte.

* Fixed is_blacklisted_vehicle returning an inverted condition.
Fixed Garage drop-down not updating properly.

* Separated out m_garage's setter into a ctor function.
Replaced the 4 singular garages that use an overloaded index with a define to be able to shift them easier when new properties are added.

* Removed obsolete and incorrect player.character_slot config entry.
Removed deprecated local_player.hpp.
Added self::char_slot that is guaranteed to be correct.

* Removed extraneous semi-colon.

* Added more stuff to fillsnacks.
Removed more extraneous usages of MPPLY_LAST_MP_CHAR.

* Added the vehicle's name to player info.

* Fixed get_property_garage_size returning the incorrect size for the facility.
Fixed get_static_property_name returning the Nightclub's name instead of Nightclub Service Entrance to maintain consistency with the Mechanic.
Fixed garage_slot_iterator not starting and ending at the correct indexes.

* Shifted the singular properties down one to compensate for the new math.

* Fixed backwards math on Terrorbyte and Nightclub B1.

* Fixed garage not being updated when the player moved the vehicle.

* Fixed backwards comments.
2023-09-22 23:16:33 +02:00
5eead0436f Huge protection improvements and other stuff (#1963)
* feat(protections): add a fuzzer
* feat(protections): improve protections
* feat(spoofing): add warning
* feat(world): force object cleanup
* fix(weapons): fix custom weapon code
* fix(weapons): fix for #1983
2023-08-19 13:01:08 +02:00
fb0fb191e7 fix(lua): input_float:get_value() was returning the wrong type (#1879) 2023-07-28 13:59:22 +02:00
93966dc3b1 Feat lua stats (#1875) 2023-07-28 10:07:17 +02:00
96493b5a22 refactor!: Modify command argument handling and move on_ method to bool_command (#1826) 2023-07-26 22:22:40 +02:00
fa8043be2a lua: sub folders support, check for .lua file extension, refactor and simplify internals. (#1775) 2023-07-22 13:05:43 +02:00
093abc72da feat(lua): Add entities.get_all_vehicles_as_handles() Add entities.get_all_peds_as_handles() Add entities.get_all_objects_as_handles() (#1795) 2023-07-21 21:21:51 +02:00
74ba7b6860 Custom Sky Color and unify some stuff (#1779) 2023-07-20 22:46:32 +02:00
69959df3ed feat(lua): Add tab:is_selected function to check if the tab is the currently selected one in the GUI. (#1763) 2023-07-19 09:28:22 +02:00
e1f70e84b4 fix(lua): move bindings to cpp files (#1757) 2023-07-18 13:07:33 +02:00
14f4241bd8 feat(lua): much more complete imgui bindings, allow lua imgui callbacks from outside yimmenu classic tabs through gui.add_imgui(func) but also inside yimmenu classic tabs through tab:add_imgui(func) (#1736) 2023-07-17 14:55:42 +02:00
5a76164d43 fix(lua): better exception handling (#1734) 2023-07-16 23:32:34 +02:00
f26514f8e4 fix(lua) (#1697)
- sandbox stuff.
- Fix lua scripts that could run when their lua state was destroyed, causing chaos.
2023-07-13 09:36:13 +02:00
15745eebe1 Fix(lua / script manager): Potential fix for stack overflow when yielding from lua scripts. Fix io / os lua libs being accessible. (#1681)
* fix(script-mgr / lua): first kill all scripts, then unload lua modules: because the lua scripts depend on lua state (which is stored inside lua module instance), killing the lua module first would not allow proper cleaning because of the lua state getting destroyed while the lua script might still be running.

* fix(unloading): Why even reset the fiber pool here?

* fix(lua): don't allow for io / os lua lib to be accessed for security reasons.

* fix(lua): Potential fix for C stack overflow error by using lua coroutine yielding instead of calling fiber yield directly from lua functions.

* feat(unloading): allow to unload in the main title screen. Also revert 309c374602 due to fiber pool being potentially exhausted, we want commands to have their cleanup code ran in priority.
2023-07-11 09:24:44 +02:00
167e1f8d54 Lua documentation: commands (#1595)
* lua api: fix command call null context

* lua doc: generate commands doc
2023-07-05 00:31:06 +02:00
89f57a9a4c Lua: can make new tabs from lua scripts, doc generation for available tabs to use (#1593)
* lua api: add globals.get_uint and globals.set_uint

* lua doc: remove duplicate function check as we can overload so it doesn't make sense

* lua doc gen: add support for parsing the tabs enum

* gui: custom lua tabs don't have a `func` rendering function but can still have elements to draw

* lua doc: update generated doc

* chore: code style

* chore: minor spelling mistake

* chore: code style

* gui_service: add runtime removal of tabs

* refactor: make it so that it's less likely defining tabs and their translation key in a wrong way.

* lua api: ability to add custom tabs to the gui from lua
2023-07-05 00:30:57 +02:00
6d6848c2fb Lua: refactor script api, more doc, add button for Open Lua Scripts Folder (#1588)
* lua manager: pass down the scripts folder to the instance instead of hard coding calls to the file manager everywhere
* lua: add open lua scripts folder button
* lua api: change script binding so that user cannot by mistake try to sleep or yield in a non script context
2023-07-03 13:01:12 +02:00
3bdd0796f4 Lua doc (#1552) 2023-07-02 00:59:02 +02:00
c3121de8e7 lua: change the way native functions are binded (#1543) 2023-06-27 20:13:05 +02:00
70efa40afe Lua Scripting (#1334)
Closes #83
Fixes #1309
Fixes #1287
Fixes #1129 (actually fixed now)
2023-06-06 09:40:40 +02:00