Commit Graph

38 Commits

Author SHA1 Message Date
Arthur
0dd43e95b8 Redesign Script Patches for Lua (#3612)
* Refactor Script Patches for Lua

* Use update_all_patches_for_script instead of update and store script's joaat instead of its string
2024-08-22 19:52:02 +02:00
tupoy-ya
eecd20beaf feat(Lua)!: New Lua bindings (#3563)
* feat(Lua): Make independent imgui independent.
feat(Lua): Add a `pointer:set_address` binding.
feat(Lua): Added `menu_event.Wndproc` event.
fix(Lua): Fix `ImGui.SliderFloat3` binding.
fix(Lua Docs): Partially fixed auto generated documentation.
* fix(gui.cpp): include `lua_manager.hpp`.
* fix(lua_manager.hpp): Added `draw_less_dependent_gui` function.
* chore(Lua): Rename `add_independent_imgui` to `add_always_draw_imgui`.
* docs(menu_event): Added docs for Wndporc event.
* docs: Fixed a few more errors.
* add reasoning and use native underlying format

Co-authored-by: tupoy-ya <tupoy-ya@users.noreply.github.com>
Co-authored-by: xiaoxiao921 <837334+xiaoxiao921@users.noreply.github.com>
2024-08-14 08:40:09 +02:00
kikkin_yo_azzez
e4e1b6b63b feat(Lua): expose imgui separatortext to lua (#3554) 2024-08-12 09:34:22 +02:00
Arthur
12906d0365 Add Return Value Support for Script Functions (#3479)
* Add Return Value Support for Script Functions
* Removed address-of operator on instruction_pointer parameter, as sol is pass-by-value.
* Fixed reset_session_data & start_creator_script
* Added support for Vector3 and updated casting for bool type for proper conversion to Lua boolean
* Updated documentation for scr_function
* Added get_int method and updated param names for script functions
* Fix #3497 graceful landing not saved.
* Added a check in view_lsc to see if the vehicle can accept clan logos first.
* Fixed vehicle clan logo SP bypass not working properly.
* Fixed COPY VEHICLE not giving persist_car_service::spawn_vehicle_json the target's ped so it can copy their clan logo and not ours.
Fixed spawn_vehicle_json calling add_clan_logo_to_vehicle with our logo and not the ped parameter's logo.
* Added Clone Player Car.
* Fixed has_clan_logo check in view_lsc being given the wrong parameter.

---------

Co-authored-by: gir489 <100792176+gir489returns@users.noreply.github.com>
2024-08-06 14:46:48 +02:00
Arthur
f6a6f5dd86 Refactor Debug Threads & Expose More Functions (#3408)
- Added a search box for the script names in Debug -> Threads.
- Added `is_session_started` and `force_script_on_player` functions to the Lua network class.
- Added `is_active` and `start_launcher_script` functions to the Lua script class.
- Moved `view_stat_editor.cpp` to `src/views/network` from `src/views/settings`.
- Added a help text for directly editing the sliders in outfit editor.
2024-07-23 15:34:30 +02:00
Arthur
a44912dbd8 feat(lua): Expose Script Patches & Functions (#3393) 2024-07-22 10:16:48 +02:00
kikkin_yo_azzez
360c449c63 more player stats lua bindings (#3325)
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
Quentin
270ff255c2 fix self doc (#3319) 2024-07-09 18:42:32 +02:00
Quentin
3e48c2e6d5 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
Quentin
0b67accd30 feat: dynamicly calling x64 functions from lua at runtime with arbitrary signatures. (#3311) 2024-07-09 17:48:24 +02:00
Quentin
95969031df 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
kikkin_yo_azzez
1b25bdc866 add show_success lua binding (#3249) 2024-06-19 11:37:38 +02:00
kikkin_yo_azzez
0e7b5c1d37 Make Player Stats Retrievable Within Lua (#3199) 2024-06-01 12:57:21 +02:00
HCR-750F
0fa7c580c1 feat: Chat translator (#2931) 2024-05-10 21:41:59 +02:00
tiCkuhAr
861e53ec7a Remove useless kicks (#3061) 2024-05-06 22:11:35 +02:00
Quentin
6f8490f450 fix(lua): better error reporting when calling player commands (#2932) 2024-04-10 11:43:55 +02:00
Alice
540ff21b05 add lua api: script.execute_as_script (#2824)
Co-authored-by: xiaoxiao921 <xiaoxiao921@hotmail.fr>
2024-03-21 11:20:22 +01:00
Quentin
a548ecc074 lua io.exists (#2771) 2024-02-24 11:10:58 +01:00
Arthur
2e63940b77 feat(lua): expose the self class and add new menu events (#2656) 2024-01-28 15:18:44 +01:00
Andreas Maerten
9a1a75b675 refactor!: repo cleanup (#2650)
- Move cmake files to dedicated cmake folder
- Move scattered python files to `scripts/` folder
- Update CMakeLists.txt to reflect changes
* feat(scripts): add README to folder
2023-12-30 16:05:18 +01:00
gir489
d2a7ff8ba4 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
gir489
847a729918 Added packed stats handler to the stats Lua class. (#2460) 2023-11-29 23:15:10 +01:00
maybegreat48
a97af16888 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
Quentin
e56a6fd38f feat(lua): add tunable overloads for getting / setting values through the already joaated tunable value. (#2417) 2023-11-14 20:21:03 +01:00
Quentin
9d7e5893c6 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
Quentin
7869c254f2 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
Quentin
3293b374a8 feat(lua): expose take_control_of (#2249) 2023-10-13 00:13:39 +02:00
Quentin
5515c841a1 feat(lua): Allow lua scripts to flag modders with a custom reason if needed. (#2248) 2023-10-13 00:11:37 +02:00
kbabrmover1995
182a80a951 Sending all kick methods (#1921) 2023-08-12 20:45:28 +02:00
Quentin
d1baedc5a4 Feat lua stats (#1875) 2023-07-28 10:07:17 +02:00
Quentin
8253b58055 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
Quentin
497781b048 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
Quentin
664b5c6c40 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
gir489
feeaa2ddbd Added Always Full Ammo. (#1616) 2023-07-05 23:29:07 +02:00
Quentin
abb7e17d83 Lua documentation: commands (#1595)
* lua api: fix command call null context

* lua doc: generate commands doc
2023-07-05 00:31:06 +02:00
Quentin
76afd97185 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
Quentin
ed18f7e70d 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
Quentin
4c71be4142 Lua doc (#1552) 2023-07-02 00:59:02 +02:00