From 725c4d3d73a99ba77753006ad4c5442874563ba5 Mon Sep 17 00:00:00 2001 From: w7rus Date: Wed, 28 Oct 2020 21:20:14 +0700 Subject: [PATCH 01/23] Update mkdocs.yml (Update site name, nav and theme) Update docs/index.md Add .gitignore Add docs/for_developers/api.json (Json file containing data for generating markdown documentation) Add docs/for_developers/getting_started.md Add docs/for_developers/tips_and_tricks.md Add docs/for_users/common_issues_and_troubleshooting.md --- .gitignore | 4 + docs/for_developers/api.json | 1423 +++++++++++++++++ docs/for_developers/getting_started.md | 0 docs/for_developers/tips_and_tricks.md | 0 .../common_issues_and_troubleshooting.md | 0 docs/index.md | 18 +- mkdocs.yml | 22 +- 7 files changed, 1451 insertions(+), 16 deletions(-) create mode 100644 .gitignore create mode 100644 docs/for_developers/api.json create mode 100644 docs/for_developers/getting_started.md create mode 100644 docs/for_developers/tips_and_tricks.md create mode 100644 docs/for_users/common_issues_and_troubleshooting.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..18f39a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.md +!/docs/for_developers/getting_started.md +!/docs/for_developers/tips_and_tricks.md +!/docs/for_users/common_issues_and_troubleshooting.md \ No newline at end of file diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json new file mode 100644 index 0000000..83bda0c --- /dev/null +++ b/docs/for_developers/api.json @@ -0,0 +1,1423 @@ +{ + "MyArray": [ + { + "alias": "_G", + "functions": [ + { + "alias": "defer", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "vector", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "readfile", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "vtable_bind", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "vtable_thunk", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "writefile", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "bit", + "functions": [ + { + "alias": "arshift", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "arithmetic right-shift of x by n bits", + "returns": [] + }, + { + "alias": "band", + "arguments": [ + { + "alias": "x1", + "type": "number", + "optional": false + }, + { + "alias": "x2", + "type": "number", + "optional": true + }, + { + "alias": "...", + "type": "variadic number", + "optional": true + } + ], + "description": "bitwise and of x1, x2, ...", + "returns": [] + }, + { + "alias": "bnot", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + } + ], + "description": "bitwise not of x", + "returns": [] + }, + { + "alias": "bor", + "arguments": [ + { + "alias": "x1", + "type": "number", + "optional": false + }, + { + "alias": "x2", + "type": "number", + "optional": true + }, + { + "alias": "...", + "type": "variadic number", + "optional": true + } + ], + "description": "bitwise or of x1, x2, ...", + "returns": [] + }, + { + "alias": "bswap", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + } + ], + "description": "byte-swap of x (little-endian <-> big-endian)", + "returns": [] + }, + { + "alias": "bxor", + "arguments": [ + { + "alias": "x1", + "type": "number", + "optional": false + }, + { + "alias": "x2", + "type": "number", + "optional": true + }, + { + "alias": "...", + "type": "variadic number", + "optional": true + } + ], + "description": "bitwise xor of x1, x2, ...", + "returns": [] + }, + { + "alias": "lshift", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "left-shift of x by n bits", + "returns": [] + }, + { + "alias": "rol", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "left-rotate of x by n bits", + "returns": [] + }, + { + "alias": "ror", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "right-rotate of x by n bits", + "returns": [] + }, + { + "alias": "rshift", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "logical right-shift of x by n bits", + "returns": [] + }, + { + "alias": "tobit", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + } + ], + "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)", + "returns": [] + }, + { + "alias": "tohex", + "arguments": [ + { + "alias": "x", + "type": "number", + "optional": false + }, + { + "alias": "n", + "type": "number", + "optional": false + } + ], + "description": "convert x to hex with n digits (default 8)" + } + ] + }, + { + "alias": "client", + "functions": [ + { + "alias": "camera_angles", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "camera_position", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "color_log", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "create_interface", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "delay_call", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_circle", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_circle_outline", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_debug_text", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_gradient", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_hitboxes", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_indicator", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_line", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_rectangle", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "draw_text", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "error_log", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "exec", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "eye_position", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "find_signature", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_cvar", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_model_name", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "key_state", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "latency", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "log", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "random_float", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "random_int", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "register_esp_flag", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "reload_active_scripts", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "scale_damage", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "screen_size", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_clan_tag", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_cvar", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_event_callback", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "system_time", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "timestamp", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "trace_bullet", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "trace_line", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "unix_time", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "unset_event_callback", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "update_player_list", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "userid_to_entindex", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "visible", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "world_to_screen", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "config", + "functions": [ + { + "alias": "export", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "import", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "load", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "cvar{}", + "functions": [ + { + "alias": "get_float", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_int", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_string", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "invoke_callback", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_float", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_int", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_raw_float", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_raw_int", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_string", + "arguments": [], + "description": "", + "returns": [] + } + ] + }, + { + "alias": "database", + "functions": [ + { + "alias": "flush", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "read", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "write", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "entity", + "functions": [ + { + "alias": "get_all", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_bounding_box", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_classname", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_esp_data", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_game_rules", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_local_player", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_origin", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_player_name", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_player_resource", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_player_weapon", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_players", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_prop", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_steam64", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "hitbox_position", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "is_alive", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "is_dormant", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "is_enemy", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_prop", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "globals", + "functions": [ + { + "alias": "absoluteframetime", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "chokedcommands", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "commandack", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "curtime", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "framecount", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "frametime", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "lastoutgoingcommand", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "mapname", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "maxplayers", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "oldcommandack", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "realtime", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "tickcount", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "tickinterval", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "json", + "functions": [ + { + "alias": "decode_invalid_numbers", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "decode_max_depth", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "encode_invalid_numbers", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "encode_max_depth", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "encode_number_precision", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "encode_sparse_array", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "parse", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "stringify", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "materialsystem", + "functions": [ + { + "alias": "arms_material", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "chams_material", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "find_material", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "find_materials", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "find_texture", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_model_materials", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "override_material", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "materialsystem{}", + "functions": [ + { + "alias": "alpha_modulate", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "color_modulate", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_material_var_flag", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "get_shader_param", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "reload", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_material_var_flag", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_shader_param", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "ffi", + "functions": [ + { + "alias": "abi", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "alignof", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "cast", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "cdef", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "copy", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "errno", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "fill", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "gc", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "istype", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "metatype", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "offsetof", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "sizeof", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "string", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "typeinfo", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "typeof", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "vector{}", + "functions": [ + { + "alias": "init", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "init_from_angles", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "scale", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "scaled", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "normalize", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "normalized", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "length2d", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "length2dsqr", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "length", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "lengthsqr", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "lerp", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "dot", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "dist", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "dist2d", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "cross", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "angles", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "vectors", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "to", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "panorama", + "functions": [ + { + "alias": "loadstring", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "open", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "plist", + "functions": [ + { + "alias": "get", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "renderer", + "functions": [ + { + "alias": "circle", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "circle_outline", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "gradient", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "indicator", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "line", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "load_jpg", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "load_png", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "load_rgba", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "load_svg", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "measure_text", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "rectangle", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "text", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "texture", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "triangle", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "world_to_screen", + "arguments": [], + "description": "" + } + ] + }, + { + "alias": "ui", + "functions": [ + { + "alias": "get", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "is_menu_open", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "menu_position", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "menu_size", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "mouse_position", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "name", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_button", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_checkbox", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_color_picker", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_combobox", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_hotkey", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_label", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_listbox", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_multiselect", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_slider", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_string", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "new_textbox", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "reference", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_callback", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "set_visible", + "arguments": [], + "description": "", + "returns": [] + }, + { + "alias": "update", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/getting_started.md b/docs/for_developers/getting_started.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/for_developers/tips_and_tricks.md b/docs/for_developers/tips_and_tricks.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/for_users/common_issues_and_troubleshooting.md b/docs/for_users/common_issues_and_troubleshooting.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.md b/docs/index.md index 000ea34..eb36c2b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,5 @@ -# Welcome to MkDocs +# Welcome to gamesense_docs -For full documentation visit [mkdocs.org](https://www.mkdocs.org). +This website documents the usage of gamesense.pub features for users and developers. -## Commands - -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs -h` - Print help message and exit. - -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. +All content is split by categories. Use navigation bar and/or search to find what you interested in. diff --git a/mkdocs.yml b/mkdocs.yml index c97182f..733350b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1 +1,21 @@ -site_name: My Docs +site_name: gamesense_docs +nav: + - Home: index.md + - For users: + - Features: + - Legitbot: ./for_users/features/legitbot.md # Must be autogenerated + - Ragebot: ./for_users/features/ragebot.md # Must be autogenerated + - Antiaim: ./for_users/features/antiaim.md # Must be autogenerated + - Visuals: ./for_users/features/visuals.md # Must be autogenerated + - Misc: ./for_users/features/misc.md # Must be autogenerated + - Settings: ./for_users/features/settings.md # Must be autogenerated + - Skinchanger: ./for_users/features/skinchanger.md # Must be autogenerated + - Playerlist: ./for_users/features/playerlist.md # Must be autogenerated + - Common issues & Troubleshooting: ./for_users/common_issues_and_troubleshooting.md + - For developers: + - Getting Started: ./for_developers/getting_started.md + - API: ./for_developers/api.md # Must be autogenerated + - Events: ./for_developers/events.md # Must be autogenerated + - Netprops: ./for_developers/netprops.md # Must be autogenerated + - Tips & Tricks: ./for_developers/tips_and_tricks.md +theme: readthedocs \ No newline at end of file From 216f1348cfa2f6a7d0cd07364e666b1fa70a7977 Mon Sep 17 00:00:00 2001 From: w7rus Date: Wed, 28 Oct 2020 21:21:09 +0700 Subject: [PATCH 02/23] Add .Net Core app for generating markdown documentation out of JSON files. --- GenDoc/GenDoc.sln | 25 +++ GenDoc/GenDoc/GenDocAPIs.csproj | 12 ++ GenDoc/GenDoc/Program.cs | 156 ++++++++++++++++++ .../Debug/netcoreapp3.1/GenDocAPIs.deps.json | 41 +++++ .../GenDocAPIs.runtimeconfig.dev.json | 8 + .../GenDocAPIs.runtimeconfig.json | 9 + ...CoreApp,Version=v3.1.AssemblyAttributes.cs | 4 + .../netcoreapp3.1/GenDoc.AssemblyInfo.cs | 23 +++ .../netcoreapp3.1/GenDoc.csproj.CopyComplete | 0 .../GenDoc.csproj.FileListAbsolute.txt | 15 ++ .../netcoreapp3.1/GenDocAPIs.AssemblyInfo.cs | 23 +++ .../GenDocAPIs.csproj.CopyComplete | 0 .../GenDocAPIs.csproj.FileListAbsolute.txt | 14 ++ .../obj/GenDoc.csproj.nuget.dgspec.json | 66 ++++++++ GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.props | 18 ++ .../GenDoc/obj/GenDoc.csproj.nuget.g.targets | 6 + .../obj/GenDocAPIs.csproj.nuget.dgspec.json | 66 ++++++++ .../obj/GenDocAPIs.csproj.nuget.g.props | 18 ++ .../obj/GenDocAPIs.csproj.nuget.g.targets | 6 + GenDoc/GenDoc/obj/project.assets.json | 115 +++++++++++++ 20 files changed, 625 insertions(+) create mode 100644 GenDoc/GenDoc.sln create mode 100644 GenDoc/GenDoc/GenDocAPIs.csproj create mode 100644 GenDoc/GenDoc/Program.cs create mode 100644 GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.deps.json create mode 100644 GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.dev.json create mode 100644 GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.json create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.AssemblyInfo.cs create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.CopyComplete create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.AssemblyInfo.cs create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.CopyComplete create mode 100644 GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt create mode 100644 GenDoc/GenDoc/obj/GenDoc.csproj.nuget.dgspec.json create mode 100644 GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.props create mode 100644 GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.targets create mode 100644 GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.dgspec.json create mode 100644 GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.props create mode 100644 GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.targets create mode 100644 GenDoc/GenDoc/obj/project.assets.json diff --git a/GenDoc/GenDoc.sln b/GenDoc/GenDoc.sln new file mode 100644 index 0000000..d180c75 --- /dev/null +++ b/GenDoc/GenDoc.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenDocAPIs", "GenDoc\GenDocAPIs.csproj", "{3C6FC27E-5380-4CE1-B5E0-32A32469BC50}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C6FC27E-5380-4CE1-B5E0-32A32469BC50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C6FC27E-5380-4CE1-B5E0-32A32469BC50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C6FC27E-5380-4CE1-B5E0-32A32469BC50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C6FC27E-5380-4CE1-B5E0-32A32469BC50}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AF400EF9-4480-4E12-8F84-8311143D4A9A} + EndGlobalSection +EndGlobal diff --git a/GenDoc/GenDoc/GenDocAPIs.csproj b/GenDoc/GenDoc/GenDocAPIs.csproj new file mode 100644 index 0000000..0eaee1b --- /dev/null +++ b/GenDoc/GenDoc/GenDocAPIs.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp3.1 + + + + + + + diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs new file mode 100644 index 0000000..171799b --- /dev/null +++ b/GenDoc/GenDoc/Program.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Newtonsoft.Json; + +namespace GenDocAPIs +{ + public class LuaFunctionArgument + { + [JsonProperty("alias")] public string Alias { get; set; } + + [JsonProperty("type")] public string Type { get; set; } + + [JsonProperty("optional")] public bool Optional { get; set; } + + [JsonProperty("description")] public string Description { get; set; } + } + + public class LuaFunctionReturn + { + [JsonProperty("type")] public string Type { get; set; } + + [JsonProperty("description")] public string Description { get; set; } + } + + public class LuaFunction + { + [JsonProperty("alias")] public string Alias { get; set; } + + [JsonProperty("arguments")] public List Arguments { get; set; } + + [JsonProperty("description")] public string Description { get; set; } + + [JsonProperty("returns")] public List Returns { get; set; } + } + + public class LuaFunctionsTable + { + [JsonProperty("alias")] public string Alias { get; set; } + + [JsonProperty("functions")] public List Functions { get; set; } + } + + public class Root + { + [JsonProperty("MyArray")] public List MyArray { get; set; } + } + + public static class Helper + { + public static string GetFullPathWithoutExtension(string path) + { + return Path.Combine(Path.GetDirectoryName(path) ?? string.Empty, Path.GetFileNameWithoutExtension(path)); + } + } + + internal class Program + { + private static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + + foreach (var s in args) + { + var filePath = s; + + var pathIn = Path.GetRelativePath(Directory.GetCurrentDirectory(), Path.Combine(Directory.GetCurrentDirectory(), filePath)); + var pathOut = Helper.GetFullPathWithoutExtension(pathIn) + ".md"; + + if (!File.Exists(pathIn)) return; + + using var streamReader = new StreamReader(pathIn); + using var streamWriter = new StreamWriter(pathOut, false, Encoding.UTF8); + var stringBuilder = new StringBuilder(); + + stringBuilder.AppendLine("# " + Path.GetFileNameWithoutExtension(filePath) + "\n"); + + var json = streamReader.ReadToEndAsync().Result; + + var jsonDeserialized = JsonConvert.DeserializeObject(json); + + foreach (var luaFunctionsTable in jsonDeserialized.MyArray) + { + stringBuilder.AppendLine($"## {luaFunctionsTable.Alias}\n\n---\n"); + + if (luaFunctionsTable.Functions == null) continue; + + foreach (var luaFunction in luaFunctionsTable.Functions) + { + stringBuilder.AppendLine($"### {luaFunction.Alias}\n"); + + stringBuilder.Append($"`{luaFunctionsTable.Alias}.{luaFunction.Alias}("); + + if (luaFunction.Arguments != null) + { + var isReadingOptionalArguments = false; + var optionalArgumentsToClose = 0; + + foreach (var luaFunctionArgument in luaFunction.Arguments) + { + if (luaFunction.Arguments.IndexOf(luaFunctionArgument) == 0) + { + stringBuilder.Append($"{luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + } + else + { + if (luaFunctionArgument.Optional) + { + isReadingOptionalArguments = true; + optionalArgumentsToClose++; + } + + stringBuilder.Append(isReadingOptionalArguments + ? $" [, {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}" + : $", {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + } + } + + for (var i = 0; i < optionalArgumentsToClose; i++) + { + stringBuilder.Append(']'); + } + + stringBuilder.Append(')'); + } + + if (luaFunction.Returns != null) + { + if (luaFunction.Returns?.Count > 0) + stringBuilder.Append(" : "); + + + foreach (var luaFunctionReturn in luaFunction.Returns) + { + stringBuilder.Append(luaFunction.Returns.IndexOf(luaFunctionReturn) == 0 + ? $"{luaFunctionReturn.Type}" + : $", {luaFunctionReturn.Type}"); + } + } + + + stringBuilder.AppendLine("`\n"); + + //TODO: Add arguments and returns tables here... + + stringBuilder.AppendLine($"{luaFunction.Description}\n"); + } + + } + + streamWriter.Write(stringBuilder); + } + } + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.deps.json b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.deps.json new file mode 100644 index 0000000..b5f3516 --- /dev/null +++ b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.deps.json @@ -0,0 +1,41 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "GenDocAPIs/1.0.0": { + "dependencies": { + "Newtonsoft.Json": "12.0.3" + }, + "runtime": { + "GenDocAPIs.dll": {} + } + }, + "Newtonsoft.Json/12.0.3": { + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "assemblyVersion": "12.0.0.0", + "fileVersion": "12.0.3.23909" + } + } + } + } + }, + "libraries": { + "GenDocAPIs/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Newtonsoft.Json/12.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "path": "newtonsoft.json/12.0.3", + "hashPath": "newtonsoft.json.12.0.3.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.dev.json b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.dev.json new file mode 100644 index 0000000..12ebaf3 --- /dev/null +++ b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.dev.json @@ -0,0 +1,8 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\w7rus\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\w7rus\\.nuget\\packages" + ] + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.json b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.json new file mode 100644 index 0000000..bc456d7 --- /dev/null +++ b/GenDoc/GenDoc/bin/Debug/netcoreapp3.1/GenDocAPIs.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "3.1.0" + } + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..ad8dfe1 --- /dev/null +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.AssemblyInfo.cs b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.AssemblyInfo.cs new file mode 100644 index 0000000..a3f8f76 --- /dev/null +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("GenDoc")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("GenDoc")] +[assembly: System.Reflection.AssemblyTitleAttribute("GenDoc")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.CopyComplete b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..a2f503e --- /dev/null +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.exe +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csprojAssemblyReference.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfoInputs.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfo.cs +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.deps.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.runtimeconfig.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.runtimeconfig.dev.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.pdb +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csproj.CoreCompileInputs.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csproj.CopyComplete +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.pdb +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.genruntimeconfig.cache diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.AssemblyInfo.cs b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.AssemblyInfo.cs new file mode 100644 index 0000000..438165e --- /dev/null +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("GenDocAPIs")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("GenDocAPIs")] +[assembly: System.Reflection.AssemblyTitleAttribute("GenDocAPIs")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.CopyComplete b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e401c37 --- /dev/null +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.exe +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.deps.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.runtimeconfig.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.runtimeconfig.dev.json +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDocAPIs.pdb +D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.AssemblyInfoInputs.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.AssemblyInfo.cs +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.csproj.CoreCompileInputs.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.csproj.CopyComplete +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.pdb +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.genruntimeconfig.cache diff --git a/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.dgspec.json b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.dgspec.json new file mode 100644 index 0000000..8573dd6 --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.dgspec.json @@ -0,0 +1,66 @@ +{ + "format": 1, + "restore": { + "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj": {} + }, + "projects": { + "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj", + "projectName": "GenDoc", + "projectPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj", + "packagesPath": "C:\\Users\\w7rus\\.nuget\\packages\\", + "outputPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\w7rus\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.props b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.props new file mode 100644 index 0000000..8a93ea8 --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.props @@ -0,0 +1,18 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\w7rus\.nuget\packages\ + PackageReference + 5.7.0 + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.targets b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDoc.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.dgspec.json b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.dgspec.json new file mode 100644 index 0000000..2e9097e --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.dgspec.json @@ -0,0 +1,66 @@ +{ + "format": 1, + "restore": { + "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj": {} + }, + "projects": { + "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", + "projectName": "GenDocAPIs", + "projectPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", + "packagesPath": "C:\\Users\\w7rus\\.nuget\\packages\\", + "outputPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\w7rus\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.props b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.props new file mode 100644 index 0000000..8a93ea8 --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.props @@ -0,0 +1,18 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\w7rus\.nuget\packages\ + PackageReference + 5.7.0 + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.targets b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/GenDoc/GenDoc/obj/GenDocAPIs.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/GenDoc/GenDoc/obj/project.assets.json b/GenDoc/GenDoc/obj/project.assets.json new file mode 100644 index 0000000..532b8c2 --- /dev/null +++ b/GenDoc/GenDoc/obj/project.assets.json @@ -0,0 +1,115 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Newtonsoft.Json/12.0.3": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + } + } + } + }, + "libraries": { + "Newtonsoft.Json/12.0.3": { + "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "type": "package", + "path": "newtonsoft.json/12.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", + "newtonsoft.json.12.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + } + }, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [ + "Newtonsoft.Json >= 12.0.3" + ] + }, + "packageFolders": { + "C:\\Users\\w7rus\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", + "projectName": "GenDocAPIs", + "projectPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", + "packagesPath": "C:\\Users\\w7rus\\.nuget\\packages\\", + "outputPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\w7rus\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file From e52d935fbb00006cf8a03dfeac7be62bd2290304 Mon Sep 17 00:00:00 2001 From: w7rus Date: Thu, 29 Oct 2020 22:58:26 +0700 Subject: [PATCH 03/23] Update .gitignore --- .gitignore | 365 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 364 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 18f39a9..55a24db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,367 @@ *.md !/docs/for_developers/getting_started.md !/docs/for_developers/tips_and_tricks.md -!/docs/for_users/common_issues_and_troubleshooting.md \ No newline at end of file +!/docs/for_users/common_issues_and_troubleshooting.md + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file From 038a312bc7de940b8d420e3a4dfade44c6be6695 Mon Sep 17 00:00:00 2001 From: w7rus Date: Thu, 29 Oct 2020 22:59:38 +0700 Subject: [PATCH 04/23] Update docs/for_developers/api.json --- docs/for_developers/api.json | 992 +++++++++++++++++++++-------------- 1 file changed, 588 insertions(+), 404 deletions(-) diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json index 83bda0c..0e945b6 100644 --- a/docs/for_developers/api.json +++ b/docs/for_developers/api.json @@ -1,4 +1,5 @@ { + "type": "LuaFunctionsTableArray", "MyArray": [ { "alias": "_G", @@ -6,37 +7,135 @@ { "alias": "defer", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "vector", - "arguments": [], - "description": "", - "returns": [] + "arguments": [ + { + "alias": "nX", + "type": "number", + "optional": false, + "description": "x asix coordinate" + }, + { + "alias": "nY", + "type": "number", + "optional": false, + "description": "y asix coordinate" + }, + { + "alias": "nZ", + "type": "number", + "optional": false, + "description": "z asix coordinate" + } + ], + "returns": [ + { + "type": "vector{}", + "description": "instance of vector object" + } + ], + "description": "creates a new vector object with given coordinates" }, { "alias": "readfile", - "arguments": [], - "description": "", - "returns": [] + "arguments": [ + { + "alias": "sPath", + "type": "string", + "optional": false, + "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + } + ], + "returns": [ + { + "type": "string", + "description": "contents of file" + } + ], + "description": "reads a file contents" }, { "alias": "vtable_bind", - "arguments": [], - "description": "", - "returns": [] + "arguments": [ + { + "alias": "sModuleFileName", + "type": "string", + "optional": false, + "description": "a module filename, e.g. `engine.dll`" + }, + { + "alias": "sInterfaceAlias", + "type": "string", + "optional": false, + "description": "a module's interface alias, e.g. `VEngineClient014`" + }, + { + "alias": "nVTFI", + "type": "number", + "optional": false, + "description": "a virtual table function index inside the interface, e.g. for GetNetChannelInfo it's `78`" + }, + { + "alias": "sTypeOf", + "type": "string", + "optional": false, + "description": "a function typeof to which the result pointer is casted, e.g. for GetNetChannelInfo it's `void*(__thiscall*)(void*)`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a function pointer)" + } + ], + "description": "binds virtual function table method from module's interface to a callable cdata object (call it like the lua function). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" }, { "alias": "vtable_thunk", - "arguments": [], - "description": "", - "returns": [] + "arguments": [ + { + "alias": "nVTFI", + "type": "number", + "optional": false, + "description": "a virtual table function index inside the interface, e.g. for GetLatency it's `9`" + }, + { + "alias": "sTypeOf", + "type": "string", + "optional": false, + "description": "a function typeof to which the result pointer is casted, e.g. for GetLatency it's `float(__thiscall*)(void*, int)`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a function pointer)" + } + ], + "description": "thunks virtual function table method from interface to a callable cdata object (call it like the lua function, but the first argument must be a pointer to the interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" }, { "alias": "writefile", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "sPath", + "type": "string", + "optional": false, + "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + }, + { + "alias": "sData", + "type": "string", + "optional": false, + "description": "contents to write" + } + ], + "returns": [], + "description": "writes contents to file" } ] }, @@ -49,16 +148,23 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "value to shift" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "number of positions to shift" + } + ], + "returns": [ + { + "type": "number", + "description": "result" } ], - "description": "arithmetic right-shift of x by n bits", - "returns": [] + "description": "arithmetic right-shift of x by n bits" }, { "alias": "band", @@ -66,21 +172,29 @@ { "alias": "x1", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "x2", "type": "number", - "optional": true + "optional": true, + "description": "" }, { "alias": "...", "type": "variadic number", - "optional": true + "optional": true, + "description": "" } ], - "description": "bitwise and of x1, x2, ...", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "bitwise and of x1, x2, ..." }, { "alias": "bnot", @@ -88,11 +202,17 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" + } + ], + "returns": [ + { + "type": "number", + "description": "result" } ], - "description": "bitwise not of x", - "returns": [] + "description": "bitwise not of x" }, { "alias": "bor", @@ -100,21 +220,29 @@ { "alias": "x1", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "x2", "type": "number", - "optional": true + "optional": true, + "description": "" }, { "alias": "...", "type": "variadic number", - "optional": true + "optional": true, + "description": "" } ], - "description": "bitwise or of x1, x2, ...", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "bitwise or of x1, x2, ..." }, { "alias": "bswap", @@ -122,11 +250,17 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" } ], - "description": "byte-swap of x (little-endian <-> big-endian)", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "byte-swap of x (little-endian <-> big-endian)" }, { "alias": "bxor", @@ -134,21 +268,29 @@ { "alias": "x1", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "x2", "type": "number", - "optional": true + "optional": true, + "description": "" }, { "alias": "...", "type": "variadic number", - "optional": true + "optional": true, + "description": "" + } + ], + "returns": [ + { + "type": "number", + "description": "result" } ], - "description": "bitwise xor of x1, x2, ...", - "returns": [] + "description": "bitwise xor of x1, x2, ..." }, { "alias": "lshift", @@ -156,16 +298,23 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "" } ], - "description": "left-shift of x by n bits", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "left-shift of x by n bits" }, { "alias": "rol", @@ -173,16 +322,23 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "" } ], - "description": "left-rotate of x by n bits", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "left-rotate of x by n bits" }, { "alias": "ror", @@ -190,16 +346,23 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "" } ], - "description": "right-rotate of x by n bits", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "right-rotate of x by n bits" }, { "alias": "rshift", @@ -207,16 +370,23 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "" } ], - "description": "logical right-shift of x by n bits", - "returns": [] + "returns": [ + { + "type": "number", + "description": "result" + } + ], + "description": "logical right-shift of x by n bits" }, { "alias": "tobit", @@ -224,11 +394,17 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" + } + ], + "returns": [ + { + "type": "number", + "description": "result" } ], - "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)", - "returns": [] + "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)" }, { "alias": "tohex", @@ -236,12 +412,20 @@ { "alias": "x", "type": "number", - "optional": false + "optional": false, + "description": "" }, { "alias": "n", "type": "number", - "optional": false + "optional": false, + "description": "" + } + ], + "returns": [ + { + "type": "number", + "description": "result" } ], "description": "convert x to hex with n digits (default 8)" @@ -254,248 +438,248 @@ { "alias": "camera_angles", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "camera_position", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "color_log", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "create_interface", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "delay_call", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_circle", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_circle_outline", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_debug_text", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_gradient", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_hitboxes", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_indicator", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_line", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_rectangle", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "draw_text", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "error_log", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "exec", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "eye_position", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "find_signature", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_cvar", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_model_name", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "key_state", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "latency", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "log", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "random_float", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "random_int", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "register_esp_flag", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "reload_active_scripts", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "scale_damage", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "screen_size", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_clan_tag", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_cvar", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_event_callback", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "system_time", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "timestamp", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "trace_bullet", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "trace_line", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "unix_time", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "unset_event_callback", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "update_player_list", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "userid_to_entindex", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "visible", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "world_to_screen", @@ -510,14 +694,14 @@ { "alias": "export", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "import", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "load", @@ -532,56 +716,56 @@ { "alias": "get_float", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_int", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_string", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "invoke_callback", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_float", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_int", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_raw_float", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_raw_int", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_string", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" } ] }, @@ -591,14 +775,14 @@ { "alias": "flush", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "read", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "write", @@ -613,104 +797,104 @@ { "alias": "get_all", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_bounding_box", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_classname", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_esp_data", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_game_rules", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_local_player", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_origin", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_player_name", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_player_resource", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_player_weapon", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_players", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_prop", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_steam64", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "hitbox_position", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "is_alive", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "is_dormant", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "is_enemy", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_prop", @@ -725,74 +909,74 @@ { "alias": "absoluteframetime", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "chokedcommands", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "commandack", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "curtime", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "framecount", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "frametime", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "lastoutgoingcommand", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "mapname", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "maxplayers", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "oldcommandack", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "realtime", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "tickcount", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "tickinterval", @@ -807,44 +991,44 @@ { "alias": "decode_invalid_numbers", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "decode_max_depth", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "encode_invalid_numbers", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "encode_max_depth", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "encode_number_precision", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "encode_sparse_array", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "parse", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "stringify", @@ -859,38 +1043,38 @@ { "alias": "arms_material", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "chams_material", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "find_material", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "find_materials", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "find_texture", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_model_materials", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "override_material", @@ -905,38 +1089,38 @@ { "alias": "alpha_modulate", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "color_modulate", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_material_var_flag", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "get_shader_param", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "reload", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_material_var_flag", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_shader_param", @@ -951,92 +1135,92 @@ { "alias": "abi", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "alignof", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "cast", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "cdef", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "copy", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "errno", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "fill", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "gc", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "istype", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "metatype", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "offsetof", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "sizeof", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "string", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "typeinfo", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "typeof", @@ -1051,104 +1235,104 @@ { "alias": "init", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "init_from_angles", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "scale", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "scaled", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "normalize", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "normalized", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "length2d", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "length2dsqr", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "length", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "lengthsqr", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "lerp", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "dot", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "dist", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "dist2d", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "cross", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "angles", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "vectors", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "to", @@ -1163,8 +1347,8 @@ { "alias": "loadstring", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "open", @@ -1179,8 +1363,8 @@ { "alias": "get", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set", @@ -1195,86 +1379,86 @@ { "alias": "circle", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "circle_outline", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "gradient", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "indicator", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "line", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "load_jpg", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "load_png", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "load_rgba", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "load_svg", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "measure_text", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "rectangle", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "text", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "texture", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "triangle", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "world_to_screen", @@ -1289,128 +1473,128 @@ { "alias": "get", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "is_menu_open", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "menu_position", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "menu_size", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "mouse_position", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "name", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_button", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_checkbox", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_color_picker", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_combobox", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_hotkey", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_label", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_listbox", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_multiselect", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_slider", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_string", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "new_textbox", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "reference", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_callback", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "set_visible", "arguments": [], - "description": "", - "returns": [] + "returns": [], + "description": "" }, { "alias": "update", From 7e37ed456d6a88cb3f2c74b91acaf9f52bf96a2d Mon Sep 17 00:00:00 2001 From: w7rus Date: Thu, 29 Oct 2020 23:03:07 +0700 Subject: [PATCH 05/23] Update GenDoc (Support for different MyArray model casts) --- GenDoc/GenDoc.sln | 2 +- .../{GenDocAPIs.csproj => GenDoc.csproj} | 0 GenDoc/GenDoc/Program.cs | 246 ++++++++++++------ .../GenDocAPIs.csproj.FileListAbsolute.txt | 1 + GenDoc/GenDoc/obj/project.assets.json | 6 +- 5 files changed, 175 insertions(+), 80 deletions(-) rename GenDoc/GenDoc/{GenDocAPIs.csproj => GenDoc.csproj} (100%) diff --git a/GenDoc/GenDoc.sln b/GenDoc/GenDoc.sln index d180c75..4bca1ae 100644 --- a/GenDoc/GenDoc.sln +++ b/GenDoc/GenDoc.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30611.23 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenDocAPIs", "GenDoc\GenDocAPIs.csproj", "{3C6FC27E-5380-4CE1-B5E0-32A32469BC50}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenDoc", "GenDoc\GenDoc.csproj", "{3C6FC27E-5380-4CE1-B5E0-32A32469BC50}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/GenDoc/GenDoc/GenDocAPIs.csproj b/GenDoc/GenDoc/GenDoc.csproj similarity index 100% rename from GenDoc/GenDoc/GenDocAPIs.csproj rename to GenDoc/GenDoc/GenDoc.csproj diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index 171799b..dbdae4e 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -1,50 +1,75 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; -namespace GenDocAPIs +namespace GenDoc { + internal enum GenDocType + { + LuaFunctionsTableArray, + LuaEventsArray, + LuaNetPropsTableArray, + } + public class LuaFunctionArgument { - [JsonProperty("alias")] public string Alias { get; set; } + [JsonProperty("alias")] + public string Alias { get; set; } - [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("type")] + public string Type { get; set; } - [JsonProperty("optional")] public bool Optional { get; set; } + [JsonProperty("optional")] + public bool Optional { get; set; } - [JsonProperty("description")] public string Description { get; set; } + [JsonProperty("description")] + public string Description { get; set; } } public class LuaFunctionReturn { - [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("type")] + public string Type { get; set; } - [JsonProperty("description")] public string Description { get; set; } + [JsonProperty("description")] + public string Description { get; set; } } public class LuaFunction { - [JsonProperty("alias")] public string Alias { get; set; } + [JsonProperty("alias")] + public string Alias { get; set; } - [JsonProperty("arguments")] public List Arguments { get; set; } + [JsonProperty("arguments")] + public List Arguments { get; set; } - [JsonProperty("description")] public string Description { get; set; } + [JsonProperty("description")] + public string Description { get; set; } - [JsonProperty("returns")] public List Returns { get; set; } + [JsonProperty("returns")] + public List Returns { get; set; } } public class LuaFunctionsTable { - [JsonProperty("alias")] public string Alias { get; set; } + [JsonProperty("alias")] + public string Alias { get; set; } - [JsonProperty("functions")] public List Functions { get; set; } + [JsonProperty("functions")] + public List Functions { get; set; } } public class Root { - [JsonProperty("MyArray")] public List MyArray { get; set; } + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("MyArray")] + public JArray MyArray { get; set; } } public static class Helper @@ -55,101 +80,170 @@ public static string GetFullPathWithoutExtension(string path) } } - internal class Program + internal static class GenDoc { - private static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - - foreach (var s in args) + private static readonly Dictionary> TypeToAction = + new Dictionary> { - var filePath = s; + { + GenDocType.LuaFunctionsTableArray, + (stringBuilder, jsonMapRoot) => + { + var jsonMapRootCastMyArray = jsonMapRoot.MyArray.ToObject>(); - var pathIn = Path.GetRelativePath(Directory.GetCurrentDirectory(), Path.Combine(Directory.GetCurrentDirectory(), filePath)); - var pathOut = Helper.GetFullPathWithoutExtension(pathIn) + ".md"; + if (jsonMapRootCastMyArray == null) + return; - if (!File.Exists(pathIn)) return; + foreach (var luaFunctionsTable in jsonMapRootCastMyArray) + { + stringBuilder.AppendLine($"## {luaFunctionsTable.Alias}\n\n---\n"); - using var streamReader = new StreamReader(pathIn); - using var streamWriter = new StreamWriter(pathOut, false, Encoding.UTF8); - var stringBuilder = new StringBuilder(); + if (luaFunctionsTable.Functions == null) continue; - stringBuilder.AppendLine("# " + Path.GetFileNameWithoutExtension(filePath) + "\n"); + foreach (var luaFunction in luaFunctionsTable.Functions) + { + stringBuilder.AppendLine($"### {luaFunction.Alias}\n"); - var json = streamReader.ReadToEndAsync().Result; + stringBuilder.Append( + $"`{luaFunctionsTable.Alias}{(luaFunctionsTable.Alias.Contains("{}") ? ":" : ".")}{luaFunction.Alias}("); - var jsonDeserialized = JsonConvert.DeserializeObject(json); + var argumentsExists = luaFunction.Arguments != null; + var returnsExists = luaFunction.Returns != null; - foreach (var luaFunctionsTable in jsonDeserialized.MyArray) - { - stringBuilder.AppendLine($"## {luaFunctionsTable.Alias}\n\n---\n"); + /* + * Write arguments + */ + if (argumentsExists) + { + var isReadingOptionalArguments = false; + var optionalArgumentsToClose = 0; - if (luaFunctionsTable.Functions == null) continue; + foreach (var luaFunctionArgument in luaFunction.Arguments) + { + if (luaFunction.Arguments.IndexOf(luaFunctionArgument) == 0) + { + stringBuilder.Append( + $"{luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + } + else + { + if (luaFunctionArgument.Optional) + { + isReadingOptionalArguments = true; + optionalArgumentsToClose++; + } + + stringBuilder.Append(isReadingOptionalArguments + ? $" [, {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}" + : $", {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + } + } - foreach (var luaFunction in luaFunctionsTable.Functions) - { - stringBuilder.AppendLine($"### {luaFunction.Alias}\n"); + for (var i = 0; i < optionalArgumentsToClose; i++) + { + stringBuilder.Append(']'); + } - stringBuilder.Append($"`{luaFunctionsTable.Alias}.{luaFunction.Alias}("); + stringBuilder.Append(')'); + } - if (luaFunction.Arguments != null) - { - var isReadingOptionalArguments = false; - var optionalArgumentsToClose = 0; + /* + * Write returns + */ + if (returnsExists) + { + if (luaFunction.Returns?.Count > 0) + stringBuilder.Append(" : "); - foreach (var luaFunctionArgument in luaFunction.Arguments) - { - if (luaFunction.Arguments.IndexOf(luaFunctionArgument) == 0) + + foreach (var luaFunctionReturn in luaFunction.Returns) + { + stringBuilder.Append(luaFunction.Returns.IndexOf(luaFunctionReturn) == 0 + ? $"{luaFunctionReturn.Type}" + : $", {luaFunctionReturn.Type}"); + } + } + + stringBuilder.AppendLine("`\n"); + + /* + * Write table of arguments + */ + if (argumentsExists && luaFunction.Arguments.Count > 0) { - stringBuilder.Append($"{luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + stringBuilder.AppendLine("|Argument|Type|Optional|Description|"); + stringBuilder.AppendLine("|-|-|-|-|"); + + foreach (var luaFunctionArgument in luaFunction.Arguments) + { + stringBuilder.AppendLine( + $"|{luaFunctionArgument.Alias}|{luaFunctionArgument.Type}|{(luaFunctionArgument.Optional ? "Yes" : "No")}|{luaFunctionArgument.Description}|"); + } + + stringBuilder.Append("\n"); } - else + + /* + * Write table of returns + */ + if (returnsExists && luaFunction.Returns.Count > 0) { - if (luaFunctionArgument.Optional) + stringBuilder.AppendLine("|Return|Type|Description|"); + stringBuilder.AppendLine("|-|-|-|"); + + foreach (var (value, i) in luaFunction.Returns.Select((value, i) => (value, i))) { - isReadingOptionalArguments = true; - optionalArgumentsToClose++; + stringBuilder.AppendLine( + $"|{i + 1}|{value.Type}|{value.Description}|"); } - stringBuilder.Append(isReadingOptionalArguments - ? $" [, {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}" - : $", {luaFunctionArgument.Alias}: {luaFunctionArgument.Type}"); + stringBuilder.Append("\n"); } - } - for (var i = 0; i < optionalArgumentsToClose; i++) - { - stringBuilder.Append(']'); + if (!string.IsNullOrEmpty(luaFunction.Description)) + stringBuilder.AppendLine($"{luaFunction.Description}\n"); } - - stringBuilder.Append(')'); } + } + }, + }; - if (luaFunction.Returns != null) - { - if (luaFunction.Returns?.Count > 0) - stringBuilder.Append(" : "); + private static void ForType(GenDocType type, StringBuilder stringBuilder, Root jsonMapRoot) + { + TypeToAction[type](stringBuilder, jsonMapRoot); + } + public static void ForFile(string path) + { + var pathIn = Path.GetRelativePath(Directory.GetCurrentDirectory(), + Path.Combine(Directory.GetCurrentDirectory(), path)); + var pathOut = Helper.GetFullPathWithoutExtension(pathIn) + ".md"; - foreach (var luaFunctionReturn in luaFunction.Returns) - { - stringBuilder.Append(luaFunction.Returns.IndexOf(luaFunctionReturn) == 0 - ? $"{luaFunctionReturn.Type}" - : $", {luaFunctionReturn.Type}"); - } - } + if (!File.Exists(pathIn)) return; + using var streamReader = new StreamReader(pathIn); + using var streamWriter = new StreamWriter(pathOut, false, Encoding.UTF8); + var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine("`\n"); + stringBuilder.AppendLine("# " + Path.GetFileNameWithoutExtension(path) + "\n"); - //TODO: Add arguments and returns tables here... + var jsonMapRoot = JsonConvert.DeserializeObject(streamReader.ReadToEndAsync().Result); - stringBuilder.AppendLine($"{luaFunction.Description}\n"); - } + var docType = (GenDocType)Enum.Parse(typeof(GenDocType), jsonMapRoot.Type); + + ForType(docType, stringBuilder, jsonMapRoot); - } + streamWriter.Write(stringBuilder); + } + } - streamWriter.Write(stringBuilder); + internal class Program + { + private static void Main(string[] args) + { + foreach (var s in args) + { + GenDoc.ForFile(s); } } } diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt index e401c37..8303d6e 100644 --- a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDocAPIs.csproj.FileListAbsolute.txt @@ -12,3 +12,4 @@ D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.csproj.Co D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.dll D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.pdb D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.genruntimeconfig.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDocAPIs.csprojAssemblyReference.cache diff --git a/GenDoc/GenDoc/obj/project.assets.json b/GenDoc/GenDoc/obj/project.assets.json index 532b8c2..968404d 100644 --- a/GenDoc/GenDoc/obj/project.assets.json +++ b/GenDoc/GenDoc/obj/project.assets.json @@ -57,9 +57,9 @@ "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", - "projectName": "GenDocAPIs", - "projectPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDocAPIs.csproj", + "projectUniqueName": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj", + "projectName": "GenDoc", + "projectPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\GenDoc.csproj", "packagesPath": "C:\\Users\\w7rus\\.nuget\\packages\\", "outputPath": "D:\\Git\\gamesense_docs\\GenDoc\\GenDoc\\obj\\", "projectStyle": "PackageReference", From ca2caed4f84880c36e8f1647de44e4db294e3fc3 Mon Sep 17 00:00:00 2001 From: w7rus Date: Fri, 30 Oct 2020 00:03:55 +0700 Subject: [PATCH 06/23] Update docs/for_developers/api.json --- docs/for_developers/api.json | 132 +++++++++++++++++------------------ 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json index 0e945b6..db90f57 100644 --- a/docs/for_developers/api.json +++ b/docs/for_developers/api.json @@ -146,13 +146,13 @@ "alias": "arshift", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, "description": "value to shift" }, { - "alias": "n", + "alias": "nPositions", "type": "number", "optional": false, "description": "number of positions to shift" @@ -161,247 +161,247 @@ "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "arithmetic right-shift of x by n bits" + "description": "arithmetic right-shift by bits of value" }, { "alias": "band", "arguments": [ { - "alias": "x1", + "alias": "nValue1", "type": "number", "optional": false, - "description": "" + "description": "value for bitwise and" }, { - "alias": "x2", + "alias": "nValue2", "type": "number", "optional": true, - "description": "" + "description": "value for bitwise and" }, { "alias": "...", "type": "variadic number", "optional": true, - "description": "" + "description": "values for bitwise and" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "bitwise and of x1, x2, ..." + "description": "bitwise and of values" }, { "alias": "bnot", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value for bitwise not" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "bitwise not of x" + "description": "bitwise not of value" }, { "alias": "bor", "arguments": [ { - "alias": "x1", + "alias": "nValue1", "type": "number", "optional": false, - "description": "" + "description": "value for bitwise or" }, { - "alias": "x2", + "alias": "nValue2", "type": "number", "optional": true, - "description": "" + "description": "value for bitwise or" }, { "alias": "...", "type": "variadic number", "optional": true, - "description": "" + "description": "values for bitwise or" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "bitwise or of x1, x2, ..." + "description": "bitwise or of values" }, { "alias": "bswap", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value for byte swap" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "byte-swap of x (little-endian <-> big-endian)" + "description": "byte-swap of value (little-endian <-> big-endian)" }, { "alias": "bxor", "arguments": [ { - "alias": "x1", + "alias": "nValue1", "type": "number", "optional": false, - "description": "" + "description": "value for bitwise xor" }, { - "alias": "x2", + "alias": "nValue2", "type": "number", "optional": true, - "description": "" + "description": "value for bitwise xor" }, { "alias": "...", "type": "variadic number", "optional": true, - "description": "" + "description": "value sfor bitwise xor" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "bitwise xor of x1, x2, ..." + "description": "bitwise xor of values" }, { "alias": "lshift", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to shift" }, { - "alias": "n", + "alias": "nPositions", "type": "number", "optional": false, - "description": "" + "description": "number of positions to shift" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "left-shift of x by n bits" + "description": "logical left-shift by bits of value" }, { "alias": "rol", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to rotate" }, { - "alias": "n", + "alias": "nPositions", "type": "number", "optional": false, - "description": "" + "description": "number of positions to rotate" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "left-rotate of x by n bits" + "description": "left-rotate by bits of value" }, { "alias": "ror", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to rotate" }, { - "alias": "n", + "alias": "nPositions", "type": "number", "optional": false, - "description": "" + "description": "number of positions to rotate" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "right-rotate of x by n bits" + "description": "right-rotate by bits of value" }, { "alias": "rshift", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to shift" }, { - "alias": "n", + "alias": "nPositions", "type": "number", "optional": false, - "description": "" + "description": "number of positions to shift" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], - "description": "logical right-shift of x by n bits" + "description": "logical left-shift by bits of value" }, { "alias": "tobit", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to normalize" } ], "returns": [ { "type": "number", - "description": "result" + "description": "-" } ], "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)" @@ -410,25 +410,25 @@ "alias": "tohex", "arguments": [ { - "alias": "x", + "alias": "nValue", "type": "number", "optional": false, - "description": "" + "description": "value to format" }, { "alias": "n", "type": "number", - "optional": false, - "description": "" + "optional": true, + "description": "amount of hex digits (default is 8)" } ], "returns": [ { - "type": "number", + "type": "string", "description": "result" } ], - "description": "convert x to hex with n digits (default 8)" + "description": "format value as hex with digit limit" } ] }, From 4671a04af575f84fae49929c81032f0c369cb30e Mon Sep 17 00:00:00 2001 From: w7rus Date: Fri, 30 Oct 2020 18:17:26 +0700 Subject: [PATCH 07/23] Update mkdocs.yml (Use material theme) Update docs/for_developers/api.json Update docs/stylesheets/extra.css (Alter material theme colors) --- docs/for_developers/api.json | 664 +++++++++++++++++++++++++++++++---- docs/stylesheets/extra.css | 77 ++++ mkdocs.yml | 11 +- 3 files changed, 680 insertions(+), 72 deletions(-) create mode 100644 docs/stylesheets/extra.css diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json index db90f57..d55c73a 100644 --- a/docs/for_developers/api.json +++ b/docs/for_developers/api.json @@ -8,7 +8,7 @@ "alias": "defer", "arguments": [], "returns": [], - "description": "" + "description": "`shutdown` event (obsolete)" }, { "alias": "vector", @@ -1362,14 +1362,51 @@ "functions": [ { "alias": "get", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index of the player" + }, + { + "alias": "sUiFieldName", + "type": "string", + "optional": false, + "description": "Name of the field inside player list, e.g. `Correction Active`" + } + ], + "returns": [ + { + "type": "any", + "description": "value of ui element (ui element specific type)" + } + ], + "description": "Gets the value of corresponding ui element for specific player in playerlist tab" }, { "alias": "set", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index of the player" + }, + { + "alias": "sUiFieldName", + "type": "string", + "optional": false, + "description": "Name of the field inside player list, e.g. `Correction Active`" + }, + { + "alias": "value", + "type": "any", + "optional": false, + "description": "value to set (ui element specific type)" + } + ], + "description": "Sets the value to corresponding ui element for specific player in playerlist tab" } ] }, @@ -1472,134 +1509,619 @@ "functions": [ { "alias": "get", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + } + ], + "returns": [ + { + "type": "any", + "description": "value of ui element (ui element specific type)" + } + ], + "description": "Gets the value of referenced ui element" }, { "alias": "is_menu_open", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "boolean", + "description": "-" + } + ], + "description": "returns whether cheat menu is open" }, { "alias": "menu_position", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "x axis coordinate of menu" + }, + { + "type": "number", + "description": "y axis coordinate of menu" + } + ], + "description": "returns position of the menu as 2 values" }, { "alias": "menu_size", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "width of menu" + }, + { + "type": "number", + "description": "height of menu" + } + ], + "description": "returns dimensions of the menu as 2 values" }, { "alias": "mouse_position", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "x axis coordinate of menu" + }, + { + "type": "number", + "description": "y axis coordinate of menu" + } + ], + "description": "returns position of the menu as 2 values" }, { "alias": "name", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + } + ], + "returns": [ + { + "type": "string", + "description": "alias of ui element" + } + ], + "description": "Gets the alias of referenced ui element" }, { "alias": "new_button", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_checkbox", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_color_picker", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "nR", + "type": "number", + "optional": true, + "description": "value of red channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": true, + "description": "value of green channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": true, + "description": "value of blue channel (0 - 255)" + }, + { + "alias": "nA", + "type": "number", + "optional": true, + "description": "value of alpha channel (0 - 255)" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_combobox", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "...", + "type": "variadic string / table{string, ...}", + "optional": false, + "description": "values that will be added to combobox" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_hotkey", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "bInline", + "type": "boolean", + "optional": true, + "description": "whether on not, the newly created ui element will be placed to the right of preceding ui element" + }, + { + "alias": "nInitVK", + "type": "number", + "optional": true, + "description": "initial virtual key value" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_label", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that reference of that ui element can be used only in `ui.set` and `ui.name`**" }, { "alias": "new_listbox", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "tItems", + "type": "table{string, ...}", + "optional": false, + "description": "values that will be added to listbox" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_multiselect", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "...", + "type": "variadic string / table{string, ...}", + "optional": false, + "description": "values that will be added to multiselect" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_slider", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "nMin", + "type": "number", + "optional": false, + "description": "minimum value of slider (must be an integer)" + }, + { + "alias": "nMax", + "type": "number", + "optional": false, + "description": "maximum value of slider (must be an integer)" + }, + { + "alias": "nInit", + "type": "number", + "optional": true, + "description": "initial value of slider (must be an integer)" + }, + { + "alias": "bShowTooltip", + "type": "boolean", + "optional": true, + "description": "whether or not to show current value of the slider" + }, + { + "alias": "sUnit", + "type": "string", + "optional": true, + "description": "string to append to tooltip (max 3 symbols)" + }, + { + "alias": "nScale", + "type": "number", + "optional": true, + "description": "multiplier for displayed value, e.g. slider with range of `0-10` and scale set to `0.1` would result in tooltip to display values within `0.0-1.0` range" + }, + { + "alias": "tTooltops", + "type": "table{[nValue] = string, ...}", + "optional": true, + "description": "override tooltip for specified value" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" }, { "alias": "new_string", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "sValue", + "type": "string", + "optional": false, + "description": "initial value of element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element. **This doesn't populate any ui elements visually**" }, { "alias": "new_textbox", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that this element doesn't store it's value in configuration**" }, { "alias": "reference", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element, e.g. `Force third person (alive)`" + } + ], + "returns": [ + { + "type": "number, ...", + "description": "a ui element reference (multiple references if corresponding ui element contains inlined following ui elements)" + } + ], + "description": "returns a reference of a built-in ui element at specified location in menu structure. **Keep in mind that it's better not to call this more than once per enviroment**" }, { "alias": "set", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "value", + "type": "any", + "optional": false, + "description": "value to set (ui element specific type)" + }, + { + "alias": "...", + "type": "variadic any", + "optional": true, + "description": "values to set (ui element specific type)" + } + ], + "description": "Sets the value of referenced ui element" }, { "alias": "set_callback", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function that will be called on ui element action. **Reference to that ui element is passed to callback function as first argument**" + } + ], + "description": "Binds function that will be called on ui element action" }, { "alias": "set_visible", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "bVisible", + "type": "boolean", + "optional": false, + "description": "whether on not the referenced ui element is visible in ui" + } + ], + "description": "Changes visibility of referenced ui element" }, { "alias": "update", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "...", + "type": "any", + "optional": false, + "description": "values that will be overriden (ui element specific type)" + } + ], + "description": "Updates values of referenced ui element" } ] } diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..6f99e75 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,77 @@ +[data-md-color-scheme="gamesense"] { + /* Default color shades */ + --md-default-fg-color: hsla(0, 0%, 100%, 0.87); + --md-default-fg-color--light: hsla(0, 0%, 100%, 0.54); + --md-default-fg-color--lighter: hsla(0, 0%, 100%, 0.32); + --md-default-fg-color--lightest: hsla(0, 0%, 100%, 0.07); + --md-default-bg-color: hsla(0, 0%, 6%, 1); + --md-default-bg-color--light: hsla(0, 0%, 0%, 0.7); + --md-default-bg-color--lighter: hsla(0, 0%, 0%, 0.3); + --md-default-bg-color--lightest: hsla(0, 0%, 0%, 0.12); + + /* Primary color shades */ + --md-primary-fg-color: hsla(86, 54%, 51%, 1); + --md-primary-fg-color--light: hsla(86, 44%, 64%, 1); + --md-primary-fg-color--dark: hsla(86, 54%, 41%, 1); + --md-primary-bg-color: hsla(0, 0%, 6%, 1); + --md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7); + + /* Accent color shades */ + --md-accent-fg-color: hsla(86, 54%, 51%, 1); + --md-accent-fg-color--transparent: hsla(86, 54%, 51%, 0.1); + --md-accent-bg-color: hsla(0, 0%, 6%, 1); + --md-accent-bg-color--light: hsla(0, 0%, 6%, 0.7); + + /* Light theme (default) */ + + /* Code color shades */ + --md-code-fg-color: hsla(0, 0%, 100%, 1); + --md-code-bg-color: hsla(0, 0%, 16%, 1); + + /* Code highlighting color shades */ + --md-code-hl-color: hsla(60, 100%, 50%, 0.5); + --md-code-hl-number-color: hsla(0, 67%, 50%, 1); + --md-code-hl-special-color: hsla(340, 83%, 47%, 1); + --md-code-hl-function-color: hsla(291, 45%, 50%, 1); + --md-code-hl-constant-color: hsla(250, 63%, 60%, 1); + --md-code-hl-keyword-color: hsla(219, 54%, 51%, 1); + --md-code-hl-string-color: hsla(150, 63%, 30%, 1); + --md-code-hl-name-color: var(--md-code-fg-color); + --md-code-hl-operator-color: var(--md-default-fg-color--light); + --md-code-hl-punctuation-color: var(--md-default-fg-color--light); + --md-code-hl-comment-color: var(--md-default-fg-color--light); + --md-code-hl-generic-color: var(--md-default-fg-color--light); + --md-code-hl-variable-color: var(--md-default-fg-color--light); + + /* Typeset color shades */ + --md-typeset-color: var(--md-default-fg-color); + --md-typeset-a-color: var(--md-primary-fg-color); + + /* Typeset `mark` color shades */ + --md-typeset-mark-color: hsla(60, 100%, 50%, 0.5); + + /* Typeset `del` and `ins` color shades */ + --md-typeset-del-color: hsla(6, 90%, 60%, 0.15); + --md-typeset-ins-color: hsla(150, 90%, 44%, 0.15); + + /* Typeset `kbd` color shades */ + --md-typeset-kbd-color: hsla(0, 0%, 98%, 1); + --md-typeset-kbd-accent-color: hsla(0, 100%, 100%, 1); + --md-typeset-kbd-border-color: hsla(0, 0%, 72%, 1); + + /* Admonition color shades */ + --md-admonition-fg-color: var(--md-default-fg-color); + --md-admonition-bg-color: var(--md-default-bg-color); + + /* Footer color shades */ + --md-footer-fg-color: hsla(0, 0%, 100%, 1); + --md-footer-fg-color--light: hsla(0, 0%, 100%, 0.7); + --md-footer-fg-color--lighter: hsla(0, 0%, 100%, 0.3); + --md-footer-bg-color: hsla(0, 0%, 0%, 0.87); + --md-footer-bg-color--dark: hsla(0, 0%, 0%, 0.32); +} + +[data-md-color-scheme="gamesense"] .md-typeset table:not([class]) th { + color: var(--md-default-fg-color) !important; + background-color: var(--md-default-bg-color--light) !important; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 733350b..0977ae7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,6 +2,7 @@ site_name: gamesense_docs nav: - Home: index.md - For users: + - Getting Started: ./for_users/getting_started.md - Features: - Legitbot: ./for_users/features/legitbot.md # Must be autogenerated - Ragebot: ./for_users/features/ragebot.md # Must be autogenerated @@ -18,4 +19,12 @@ nav: - Events: ./for_developers/events.md # Must be autogenerated - Netprops: ./for_developers/netprops.md # Must be autogenerated - Tips & Tricks: ./for_developers/tips_and_tricks.md -theme: readthedocs \ No newline at end of file +theme: + name: material + palette: + scheme: gamesense + features: + - navigation.instant + - navigation.tabs +extra_css: + - stylesheets/extra.css \ No newline at end of file From af033656b9eaa169acabf56ba3ba6f85eccc8b7b Mon Sep 17 00:00:00 2001 From: w7rus Date: Fri, 30 Oct 2020 18:57:38 +0700 Subject: [PATCH 08/23] Update mkdocs.yml (Split API into subsections) --- docs/for_developers/api/_G.json | 143 ++++ docs/for_developers/api/bit.json | 298 +++++++++ docs/for_developers/api/client.json | 261 ++++++++ docs/for_developers/api/config.json | 27 + docs/for_developers/api/cvar{}.json | 64 ++ docs/for_developers/api/database.json | 27 + docs/for_developers/api/entity.json | 117 ++++ docs/for_developers/api/ffi.json | 105 +++ docs/for_developers/api/globals.json | 87 +++ docs/for_developers/api/json.json | 57 ++ docs/for_developers/api/materialsystem.json | 51 ++ docs/for_developers/api/materialsystem{}.json | 51 ++ docs/for_developers/api/panorama.json | 21 + docs/for_developers/api/plist.json | 58 ++ docs/for_developers/api/renderer.json | 99 +++ docs/for_developers/api/ui.json | 626 ++++++++++++++++++ docs/for_developers/api/vector{}.json | 117 ++++ mkdocs.yml | 42 +- 18 files changed, 2239 insertions(+), 12 deletions(-) create mode 100644 docs/for_developers/api/_G.json create mode 100644 docs/for_developers/api/bit.json create mode 100644 docs/for_developers/api/client.json create mode 100644 docs/for_developers/api/config.json create mode 100644 docs/for_developers/api/cvar{}.json create mode 100644 docs/for_developers/api/database.json create mode 100644 docs/for_developers/api/entity.json create mode 100644 docs/for_developers/api/ffi.json create mode 100644 docs/for_developers/api/globals.json create mode 100644 docs/for_developers/api/json.json create mode 100644 docs/for_developers/api/materialsystem.json create mode 100644 docs/for_developers/api/materialsystem{}.json create mode 100644 docs/for_developers/api/panorama.json create mode 100644 docs/for_developers/api/plist.json create mode 100644 docs/for_developers/api/renderer.json create mode 100644 docs/for_developers/api/ui.json create mode 100644 docs/for_developers/api/vector{}.json diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/_G.json new file mode 100644 index 0000000..31c76e7 --- /dev/null +++ b/docs/for_developers/api/_G.json @@ -0,0 +1,143 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "_G", + "functions": [ + { + "alias": "defer", + "arguments": [], + "returns": [], + "description": "`shutdown` event (obsolete)" + }, + { + "alias": "vector", + "arguments": [ + { + "alias": "nX", + "type": "number", + "optional": false, + "description": "x asix coordinate" + }, + { + "alias": "nY", + "type": "number", + "optional": false, + "description": "y asix coordinate" + }, + { + "alias": "nZ", + "type": "number", + "optional": false, + "description": "z asix coordinate" + } + ], + "returns": [ + { + "type": "vector{}", + "description": "instance of vector object" + } + ], + "description": "creates a new vector object with given coordinates" + }, + { + "alias": "readfile", + "arguments": [ + { + "alias": "sPath", + "type": "string", + "optional": false, + "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + } + ], + "returns": [ + { + "type": "string", + "description": "contents of file" + } + ], + "description": "reads a file contents" + }, + { + "alias": "vtable_bind", + "arguments": [ + { + "alias": "sModuleFileName", + "type": "string", + "optional": false, + "description": "a module filename, e.g. `engine.dll`" + }, + { + "alias": "sInterfaceAlias", + "type": "string", + "optional": false, + "description": "a module's interface alias, e.g. `VEngineClient014`" + }, + { + "alias": "nVTFI", + "type": "number", + "optional": false, + "description": "a virtual table function index inside the interface, e.g. for GetNetChannelInfo it's `78`" + }, + { + "alias": "sTypeOf", + "type": "string", + "optional": false, + "description": "a function typeof to which the result pointer is casted, e.g. for GetNetChannelInfo it's `void*(__thiscall*)(void*)`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a function pointer)" + } + ], + "description": "binds virtual function table method from module's interface to a callable cdata object (call it like the lua function). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + }, + { + "alias": "vtable_thunk", + "arguments": [ + { + "alias": "nVTFI", + "type": "number", + "optional": false, + "description": "a virtual table function index inside the interface, e.g. for GetLatency it's `9`" + }, + { + "alias": "sTypeOf", + "type": "string", + "optional": false, + "description": "a function typeof to which the result pointer is casted, e.g. for GetLatency it's `float(__thiscall*)(void*, int)`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a function pointer)" + } + ], + "description": "thunks virtual function table method from interface to a callable cdata object (call it like the lua function, but the first argument must be a pointer to the interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + }, + { + "alias": "writefile", + "arguments": [ + { + "alias": "sPath", + "type": "string", + "optional": false, + "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + }, + { + "alias": "sData", + "type": "string", + "optional": false, + "description": "contents to write" + } + ], + "returns": [], + "description": "writes contents to file" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/bit.json b/docs/for_developers/api/bit.json new file mode 100644 index 0000000..f725542 --- /dev/null +++ b/docs/for_developers/api/bit.json @@ -0,0 +1,298 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "bit", + "functions": [ + { + "alias": "arshift", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to shift" + }, + { + "alias": "nPositions", + "type": "number", + "optional": false, + "description": "number of positions to shift" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "arithmetic right-shift by bits of value" + }, + { + "alias": "band", + "arguments": [ + { + "alias": "nValue1", + "type": "number", + "optional": false, + "description": "value for bitwise and" + }, + { + "alias": "nValue2", + "type": "number", + "optional": true, + "description": "value for bitwise and" + }, + { + "alias": "...", + "type": "variadic number", + "optional": true, + "description": "values for bitwise and" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "bitwise and of values" + }, + { + "alias": "bnot", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value for bitwise not" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "bitwise not of value" + }, + { + "alias": "bor", + "arguments": [ + { + "alias": "nValue1", + "type": "number", + "optional": false, + "description": "value for bitwise or" + }, + { + "alias": "nValue2", + "type": "number", + "optional": true, + "description": "value for bitwise or" + }, + { + "alias": "...", + "type": "variadic number", + "optional": true, + "description": "values for bitwise or" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "bitwise or of values" + }, + { + "alias": "bswap", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value for byte swap" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "byte-swap of value (little-endian <-> big-endian)" + }, + { + "alias": "bxor", + "arguments": [ + { + "alias": "nValue1", + "type": "number", + "optional": false, + "description": "value for bitwise xor" + }, + { + "alias": "nValue2", + "type": "number", + "optional": true, + "description": "value for bitwise xor" + }, + { + "alias": "...", + "type": "variadic number", + "optional": true, + "description": "value sfor bitwise xor" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "bitwise xor of values" + }, + { + "alias": "lshift", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to shift" + }, + { + "alias": "nPositions", + "type": "number", + "optional": false, + "description": "number of positions to shift" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "logical left-shift by bits of value" + }, + { + "alias": "rol", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to rotate" + }, + { + "alias": "nPositions", + "type": "number", + "optional": false, + "description": "number of positions to rotate" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "left-rotate by bits of value" + }, + { + "alias": "ror", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to rotate" + }, + { + "alias": "nPositions", + "type": "number", + "optional": false, + "description": "number of positions to rotate" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "right-rotate by bits of value" + }, + { + "alias": "rshift", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to shift" + }, + { + "alias": "nPositions", + "type": "number", + "optional": false, + "description": "number of positions to shift" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "logical left-shift by bits of value" + }, + { + "alias": "tobit", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to normalize" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)" + }, + { + "alias": "tohex", + "arguments": [ + { + "alias": "nValue", + "type": "number", + "optional": false, + "description": "value to format" + }, + { + "alias": "n", + "type": "number", + "optional": true, + "description": "amount of hex digits (default is 8)" + } + ], + "returns": [ + { + "type": "string", + "description": "result" + } + ], + "description": "format value as hex with digit limit" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json new file mode 100644 index 0000000..3e3a21a --- /dev/null +++ b/docs/for_developers/api/client.json @@ -0,0 +1,261 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "client", + "functions": [ + { + "alias": "camera_angles", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "camera_position", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "color_log", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "create_interface", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "delay_call", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_circle", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_circle_outline", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_debug_text", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_gradient", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_hitboxes", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_indicator", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_line", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_rectangle", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "draw_text", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "error_log", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "exec", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "eye_position", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "find_signature", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_cvar", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_model_name", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "key_state", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "latency", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "log", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "random_float", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "random_int", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "register_esp_flag", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "reload_active_scripts", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "scale_damage", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "screen_size", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_clan_tag", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_cvar", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_event_callback", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "system_time", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "timestamp", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "trace_bullet", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "trace_line", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "unix_time", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "unset_event_callback", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "update_player_list", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "userid_to_entindex", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "visible", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "world_to_screen", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/config.json b/docs/for_developers/api/config.json new file mode 100644 index 0000000..b913ad1 --- /dev/null +++ b/docs/for_developers/api/config.json @@ -0,0 +1,27 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "config", + "functions": [ + { + "alias": "export", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "import", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "load", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/cvar{}.json b/docs/for_developers/api/cvar{}.json new file mode 100644 index 0000000..61e6042 --- /dev/null +++ b/docs/for_developers/api/cvar{}.json @@ -0,0 +1,64 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "cvar{}", + "functions": [ + { + "alias": "get_float", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_int", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_string", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "invoke_callback", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_float", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_int", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_raw_float", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_raw_int", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_string", + "arguments": [], + "returns": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/database.json b/docs/for_developers/api/database.json new file mode 100644 index 0000000..81ef2bf --- /dev/null +++ b/docs/for_developers/api/database.json @@ -0,0 +1,27 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "database", + "functions": [ + { + "alias": "flush", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "read", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "write", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/entity.json b/docs/for_developers/api/entity.json new file mode 100644 index 0000000..eeb6080 --- /dev/null +++ b/docs/for_developers/api/entity.json @@ -0,0 +1,117 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "entity", + "functions": [ + { + "alias": "get_all", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_bounding_box", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_classname", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_esp_data", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_game_rules", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_local_player", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_origin", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_player_name", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_player_resource", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_player_weapon", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_players", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_prop", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_steam64", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "hitbox_position", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "is_alive", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "is_dormant", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "is_enemy", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_prop", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/ffi.json b/docs/for_developers/api/ffi.json new file mode 100644 index 0000000..4c36a2f --- /dev/null +++ b/docs/for_developers/api/ffi.json @@ -0,0 +1,105 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "ffi", + "functions": [ + { + "alias": "abi", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "alignof", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "cast", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "cdef", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "copy", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "errno", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "fill", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "gc", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "istype", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "metatype", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "new", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "offsetof", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "sizeof", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "string", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "typeinfo", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "typeof", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/globals.json b/docs/for_developers/api/globals.json new file mode 100644 index 0000000..2a33ac1 --- /dev/null +++ b/docs/for_developers/api/globals.json @@ -0,0 +1,87 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "globals", + "functions": [ + { + "alias": "absoluteframetime", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "chokedcommands", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "commandack", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "curtime", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "framecount", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "frametime", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "lastoutgoingcommand", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "mapname", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "maxplayers", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "oldcommandack", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "realtime", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "tickcount", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "tickinterval", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/json.json b/docs/for_developers/api/json.json new file mode 100644 index 0000000..5861100 --- /dev/null +++ b/docs/for_developers/api/json.json @@ -0,0 +1,57 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "json", + "functions": [ + { + "alias": "decode_invalid_numbers", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "decode_max_depth", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "encode_invalid_numbers", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "encode_max_depth", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "encode_number_precision", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "encode_sparse_array", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "parse", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "stringify", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/materialsystem.json b/docs/for_developers/api/materialsystem.json new file mode 100644 index 0000000..0589cfe --- /dev/null +++ b/docs/for_developers/api/materialsystem.json @@ -0,0 +1,51 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "materialsystem", + "functions": [ + { + "alias": "arms_material", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "chams_material", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "find_material", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "find_materials", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "find_texture", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_model_materials", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "override_material", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/materialsystem{}.json b/docs/for_developers/api/materialsystem{}.json new file mode 100644 index 0000000..9f3fb2c --- /dev/null +++ b/docs/for_developers/api/materialsystem{}.json @@ -0,0 +1,51 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "materialsystem{}", + "functions": [ + { + "alias": "alpha_modulate", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "color_modulate", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_material_var_flag", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "get_shader_param", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "reload", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_material_var_flag", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "set_shader_param", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/panorama.json b/docs/for_developers/api/panorama.json new file mode 100644 index 0000000..f9cd76c --- /dev/null +++ b/docs/for_developers/api/panorama.json @@ -0,0 +1,21 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "panorama", + "functions": [ + { + "alias": "loadstring", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "open", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/plist.json b/docs/for_developers/api/plist.json new file mode 100644 index 0000000..30784f9 --- /dev/null +++ b/docs/for_developers/api/plist.json @@ -0,0 +1,58 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "plist", + "functions": [ + { + "alias": "get", + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index of the player" + }, + { + "alias": "sUiFieldName", + "type": "string", + "optional": false, + "description": "Name of the field inside player list, e.g. `Correction Active`" + } + ], + "returns": [ + { + "type": "any", + "description": "value of ui element (ui element specific type)" + } + ], + "description": "Gets the value of corresponding ui element for specific player in playerlist tab" + }, + { + "alias": "set", + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index of the player" + }, + { + "alias": "sUiFieldName", + "type": "string", + "optional": false, + "description": "Name of the field inside player list, e.g. `Correction Active`" + }, + { + "alias": "value", + "type": "any", + "optional": false, + "description": "value to set (ui element specific type)" + } + ], + "description": "Sets the value to corresponding ui element for specific player in playerlist tab" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/renderer.json b/docs/for_developers/api/renderer.json new file mode 100644 index 0000000..7dff98f --- /dev/null +++ b/docs/for_developers/api/renderer.json @@ -0,0 +1,99 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "renderer", + "functions": [ + { + "alias": "circle", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "circle_outline", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "gradient", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "indicator", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "line", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "load_jpg", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "load_png", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "load_rgba", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "load_svg", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "measure_text", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "rectangle", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "text", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "texture", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "triangle", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "world_to_screen", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json new file mode 100644 index 0000000..c33ba77 --- /dev/null +++ b/docs/for_developers/api/ui.json @@ -0,0 +1,626 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "ui", + "functions": [ + { + "alias": "get", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + } + ], + "returns": [ + { + "type": "any", + "description": "value of ui element (ui element specific type)" + } + ], + "description": "Gets the value of referenced ui element" + }, + { + "alias": "is_menu_open", + "returns": [ + { + "type": "boolean", + "description": "-" + } + ], + "description": "returns whether cheat menu is open" + }, + { + "alias": "menu_position", + "returns": [ + { + "type": "number", + "description": "x axis coordinate of menu" + }, + { + "type": "number", + "description": "y axis coordinate of menu" + } + ], + "description": "returns position of the menu as 2 values" + }, + { + "alias": "menu_size", + "returns": [ + { + "type": "number", + "description": "width of menu" + }, + { + "type": "number", + "description": "height of menu" + } + ], + "description": "returns dimensions of the menu as 2 values" + }, + { + "alias": "mouse_position", + "returns": [ + { + "type": "number", + "description": "x axis coordinate of menu" + }, + { + "type": "number", + "description": "y axis coordinate of menu" + } + ], + "description": "returns position of the menu as 2 values" + }, + { + "alias": "name", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + } + ], + "returns": [ + { + "type": "string", + "description": "alias of ui element" + } + ], + "description": "Gets the alias of referenced ui element" + }, + { + "alias": "new_button", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_checkbox", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_color_picker", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "nR", + "type": "number", + "optional": true, + "description": "value of red channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": true, + "description": "value of green channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": true, + "description": "value of blue channel (0 - 255)" + }, + { + "alias": "nA", + "type": "number", + "optional": true, + "description": "value of alpha channel (0 - 255)" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_combobox", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "...", + "type": "variadic string / table{string, ...}", + "optional": false, + "description": "values that will be added to combobox" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_hotkey", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "bInline", + "type": "boolean", + "optional": true, + "description": "whether on not, the newly created ui element will be placed to the right of preceding ui element" + }, + { + "alias": "nInitVK", + "type": "number", + "optional": true, + "description": "initial virtual key value" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_label", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that reference of that ui element can be used only in `ui.set` and `ui.name`**" + }, + { + "alias": "new_listbox", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "tItems", + "type": "table{string, ...}", + "optional": false, + "description": "values that will be added to listbox" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_multiselect", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "...", + "type": "variadic string / table{string, ...}", + "optional": false, + "description": "values that will be added to multiselect" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_slider", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "nMin", + "type": "number", + "optional": false, + "description": "minimum value of slider (must be an integer)" + }, + { + "alias": "nMax", + "type": "number", + "optional": false, + "description": "maximum value of slider (must be an integer)" + }, + { + "alias": "nInit", + "type": "number", + "optional": true, + "description": "initial value of slider (must be an integer)" + }, + { + "alias": "bShowTooltip", + "type": "boolean", + "optional": true, + "description": "whether or not to show current value of the slider" + }, + { + "alias": "sUnit", + "type": "string", + "optional": true, + "description": "string to append to tooltip (max 3 symbols)" + }, + { + "alias": "nScale", + "type": "number", + "optional": true, + "description": "multiplier for displayed value, e.g. slider with range of `0-10` and scale set to `0.1` would result in tooltip to display values within `0.0-1.0` range" + }, + { + "alias": "tTooltops", + "type": "table{[nValue] = string, ...}", + "optional": true, + "description": "override tooltip for specified value" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure" + }, + { + "alias": "new_string", + "arguments": [ + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + }, + { + "alias": "sValue", + "type": "string", + "optional": false, + "description": "initial value of element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element. **This doesn't populate any ui elements visually**" + }, + { + "alias": "new_textbox", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element" + } + ], + "returns": [ + { + "type": "number", + "description": "a ui element reference" + } + ], + "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that this element doesn't store it's value in configuration**" + }, + { + "alias": "reference", + "arguments": [ + { + "alias": "sTabAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab, e.g. `Visuals`" + }, + { + "alias": "sContainerAlias", + "type": "number", + "optional": false, + "description": "alias of the cheat menu tab container, e.g. `Effects`" + }, + { + "alias": "sUiElementAlias", + "type": "number", + "optional": false, + "description": "alias of the new element, e.g. `Force third person (alive)`" + } + ], + "returns": [ + { + "type": "number, ...", + "description": "a ui element reference (multiple references if corresponding ui element contains inlined following ui elements)" + } + ], + "description": "returns a reference of a built-in ui element at specified location in menu structure. **Keep in mind that it's better not to call this more than once per enviroment**" + }, + { + "alias": "set", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "value", + "type": "any", + "optional": false, + "description": "value to set (ui element specific type)" + }, + { + "alias": "...", + "type": "variadic any", + "optional": true, + "description": "values to set (ui element specific type)" + } + ], + "description": "Sets the value of referenced ui element" + }, + { + "alias": "set_callback", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function that will be called on ui element action. **Reference to that ui element is passed to callback function as first argument**" + } + ], + "description": "Binds function that will be called on ui element action" + }, + { + "alias": "set_visible", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "bVisible", + "type": "boolean", + "optional": false, + "description": "whether on not the referenced ui element is visible in ui" + } + ], + "description": "Changes visibility of referenced ui element" + }, + { + "alias": "update", + "arguments": [ + { + "alias": "nUiElementReference", + "type": "number", + "optional": false, + "description": "a ui element reference to get value of" + }, + { + "alias": "...", + "type": "any", + "optional": false, + "description": "values that will be overriden (ui element specific type)" + } + ], + "description": "Updates values of referenced ui element" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/api/vector{}.json b/docs/for_developers/api/vector{}.json new file mode 100644 index 0000000..1de4787 --- /dev/null +++ b/docs/for_developers/api/vector{}.json @@ -0,0 +1,117 @@ +{ + "type": "LuaFunctionsTableArray", + "MyArray": [ + { + "alias": "vector{}", + "functions": [ + { + "alias": "init", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "init_from_angles", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "scale", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "scaled", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "normalize", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "normalized", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "length2d", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "length2dsqr", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "length", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "lengthsqr", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "lerp", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "dot", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "dist", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "dist2d", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "cross", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "angles", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "vectors", + "arguments": [], + "returns": [], + "description": "" + }, + { + "alias": "to", + "arguments": [], + "description": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 0977ae7..d372f4e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,21 +4,39 @@ nav: - For users: - Getting Started: ./for_users/getting_started.md - Features: - - Legitbot: ./for_users/features/legitbot.md # Must be autogenerated - - Ragebot: ./for_users/features/ragebot.md # Must be autogenerated - - Antiaim: ./for_users/features/antiaim.md # Must be autogenerated - - Visuals: ./for_users/features/visuals.md # Must be autogenerated - - Misc: ./for_users/features/misc.md # Must be autogenerated - - Settings: ./for_users/features/settings.md # Must be autogenerated - - Skinchanger: ./for_users/features/skinchanger.md # Must be autogenerated - - Playerlist: ./for_users/features/playerlist.md # Must be autogenerated + - Legitbot: ./for_users/features/legitbot.md + - Ragebot: ./for_users/features/ragebot.md + - Antiaim: ./for_users/features/antiaim.md + - Visuals: ./for_users/features/visuals.md + - Misc: ./for_users/features/misc.md + - Settings: ./for_users/features/settings.md + - Skinchanger: ./for_users/features/skinchanger.md + - Playerlist: ./for_users/features/playerlist.md - Common issues & Troubleshooting: ./for_users/common_issues_and_troubleshooting.md - For developers: - Getting Started: ./for_developers/getting_started.md - - API: ./for_developers/api.md # Must be autogenerated - - Events: ./for_developers/events.md # Must be autogenerated - - Netprops: ./for_developers/netprops.md # Must be autogenerated - - Tips & Tricks: ./for_developers/tips_and_tricks.md + - API: + - "*": ./for_developers/api.md + - _G: ./for_developers/api/_G.md + - bit: ./for_developers/api/bit.md + - client: ./for_developers/api/client.md + - config: ./for_developers/api/config.md + - cvar{}: ./for_developers/api/cvar{}.md + - database: ./for_developers/api/database.md + - entity: ./for_developers/api/entity.md + - globals: ./for_developers/api/globals.md + - json: ./for_developers/api/json.md + - materialsystem: ./for_developers/api/materialsystem.md + - materialsystem{}: ./for_developers/api/materialsystem{}.md + - ffi: ./for_developers/api/ffi.md + - vector{}: ./for_developers/api/vector{}.md + - panorama: ./for_developers/api/panorama.md + - plist: ./for_developers/api/plist.md + - renderer: ./for_developers/api/renderer.md + - ui: ./for_developers/api/ui.md + - Events: ./for_developers/events.md + - Netprops: ./for_developers/netprops.md + - Tips & Tricks: ./for_developers/tips_and_tricks.md theme: name: material palette: From cdee98f7f6197fa35d4afc58f91eb005635f7cc8 Mon Sep 17 00:00:00 2001 From: "W7RUS-LAPTOP\\w7rus" Date: Fri, 30 Oct 2020 22:08:05 +0700 Subject: [PATCH 09/23] Update docs/for_developers/api.json (Fix descriptions) Update docs/for_developers/api/client.json Update docs/for_developers/api/ui.json (Fix descriptions) --- docs/for_developers/api.json | 16 +- docs/for_developers/api/client.json | 270 ++++++++++++++++++++++++---- docs/for_developers/api/ui.json | 16 +- 3 files changed, 254 insertions(+), 48 deletions(-) diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json index d55c73a..961e1d3 100644 --- a/docs/for_developers/api.json +++ b/docs/for_developers/api.json @@ -1540,11 +1540,11 @@ "returns": [ { "type": "number", - "description": "x axis coordinate of menu" + "description": "x asix coordinate of menu" }, { "type": "number", - "description": "y axis coordinate of menu" + "description": "y asix coordinate of menu" } ], "description": "returns position of the menu as 2 values" @@ -1568,11 +1568,11 @@ "returns": [ { "type": "number", - "description": "x axis coordinate of menu" + "description": "x asix coordinate of menu" }, { "type": "number", - "description": "y axis coordinate of menu" + "description": "y asix coordinate of menu" } ], "description": "returns position of the menu as 2 values" @@ -1680,25 +1680,25 @@ "alias": "nR", "type": "number", "optional": true, - "description": "value of red channel (0 - 255)" + "description": "red color channel (0 - 255)" }, { "alias": "nG", "type": "number", "optional": true, - "description": "value of green channel (0 - 255)" + "description": "green color channel (0 - 255)" }, { "alias": "nB", "type": "number", "optional": true, - "description": "value of blue channel (0 - 255)" + "description": "blue color channel (0 - 255)" }, { "alias": "nA", "type": "number", "optional": true, - "description": "value of alpha channel (0 - 255)" + "description": "alpha channel value (0 - 255)" } ], "returns": [ diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json index 3e3a21a..e8df31e 100644 --- a/docs/for_developers/api/client.json +++ b/docs/for_developers/api/client.json @@ -6,87 +6,293 @@ "functions": [ { "alias": "camera_angles", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "pitch in degrees" + }, + { + "type": "number", + "description": "yaw in degrees" + } + ], + "description": "Gets camera world angles" + }, + { + "alias": "camera_angles", + "arguments": [ + { + "alias": "nPitch", + "type": "number", + "optional": false, + "description": "pitch in degrees" + }, + { + "alias": "nYaw", + "type": "number", + "optional": false, + "description": "yaw in degrees" + } + ], + "description": "Sets camera world angles to values provided" }, { "alias": "camera_position", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "x asix coordinate" + }, + { + "type": "number", + "description": "y asix coordinate" + }, + { + "type": "number", + "description": "z asix coordinate" + } + ], + "description": "Gets camera world position coordinates" }, { "alias": "color_log", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nR", + "type": "number", + "optional": false, + "description": "red color channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": false, + "description": "green color channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": false, + "description": "blue color channel (0 - 255)" + }, + { + "alias": "sMessage", + "type": "string", + "optional": false, + "description": "message to log" + }, + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "messages to log" + } + ], + "description": "Logs message(s) with provided color into game console" }, { "alias": "create_interface", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sModuleFileName", + "type": "string", + "optional": false, + "description": "a module filename, e.g. `engine.dll`" + }, + { + "alias": "sInterfaceAlias", + "type": "string", + "optional": false, + "description": "a module's interface alias, e.g. `VEngineClient014`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a void pointer)" + } + ], + "description": "returns pointer of the module's interface" }, { "alias": "delay_call", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nDelay", + "type": "number", + "optional": false, + "description": "delay in seconds" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function that will be called" + } + ], + "description": "Binds function that will be called after specified delay" }, { "alias": "draw_circle", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.circle`" }, { "alias": "draw_circle_outline", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.circle_outline`" }, { "alias": "draw_debug_text", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nX", + "type": "number", + "optional": false, + "description": "x asix coordinate" + }, + { + "alias": "nY", + "type": "number", + "optional": false, + "description": "y asix coordinate" + }, + { + "alias": "nZ", + "type": "number", + "optional": false, + "description": "z asix coordinate" + }, + { + "alias": "nLineOffset", + "type": "number", + "optional": false, + "description": "line offset (0 for first line)" + }, + { + "alias": "nDuration", + "type": "number", + "optional": false, + "description": "time in seconds to keep rendering of the text" + }, + { + "alias": "nR", + "type": "number", + "optional": false, + "description": "red color channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": true, + "description": "green color channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": true, + "description": "blue color channel (0 - 255)" + }, + { + "alias": "nA", + "type": "number", + "optional": true, + "description": "alpha channel (0 - 255)" + }, + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "text to draw" + } + ], + "description": "Draws text with provided color for required amount of time. **Keep in mind that it's better not to call this frequently**" }, { "alias": "draw_gradient", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.gradient`" }, { "alias": "draw_hitboxes", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index" + }, + { + "alias": "nDuration", + "type": "number", + "optional": false, + "description": "Time in seconds to keep rendering" + }, + { + "alias": "hitboxes", + "type": "number / {number, ...}", + "optional": false, + "description": "hitbox index or table of hitbox indices, or 19 for all hitboxes" + }, + { + "alias": "nR", + "type": "number", + "optional": false, + "description": "red color channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": false, + "description": "green color channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": false, + "description": "blue color channel (0 - 255)" + }, + { + "alias": "nA", + "type": "number", + "optional": false, + "description": "alpha channel (0 - 255)" + }, + { + "alias": "nTick", + "type": "number", + "optional": true, + "description": "server tick" + } + ], + "description": "Draws hitbox capsule(s) with provided color for required amount of time and selected tick. **Keep in mind that it's better not to call this frequently**" }, { "alias": "draw_indicator", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.indicator`" }, { "alias": "draw_line", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.line`" }, { "alias": "draw_rectangle", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.rectangle`" }, { "alias": "draw_text", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `renderer.text`" }, { "alias": "error_log", @@ -116,7 +322,7 @@ "alias": "get_cvar", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `cvar{}:get<_raw/>_`" }, { "alias": "get_model_name", @@ -188,7 +394,7 @@ "alias": "set_cvar", "arguments": [], "returns": [], - "description": "" + "description": "(obsolete) use `cvar{}:set<_raw/>_`" }, { "alias": "set_event_callback", @@ -248,12 +454,12 @@ "alias": "visible", "arguments": [], "returns": [], - "description": "" + "description": "(buggy)" }, { "alias": "world_to_screen", "arguments": [], - "description": "" + "description": "(obsolete) use `renderer.world_to_screen`" } ] } diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json index c33ba77..fb44afe 100644 --- a/docs/for_developers/api/ui.json +++ b/docs/for_developers/api/ui.json @@ -37,11 +37,11 @@ "returns": [ { "type": "number", - "description": "x axis coordinate of menu" + "description": "x asix coordinate of menu" }, { "type": "number", - "description": "y axis coordinate of menu" + "description": "y asix coordinate of menu" } ], "description": "returns position of the menu as 2 values" @@ -65,11 +65,11 @@ "returns": [ { "type": "number", - "description": "x axis coordinate of menu" + "description": "x asix coordinate of menu" }, { "type": "number", - "description": "y axis coordinate of menu" + "description": "y asix coordinate of menu" } ], "description": "returns position of the menu as 2 values" @@ -177,25 +177,25 @@ "alias": "nR", "type": "number", "optional": true, - "description": "value of red channel (0 - 255)" + "description": "red color channel (0 - 255)" }, { "alias": "nG", "type": "number", "optional": true, - "description": "value of green channel (0 - 255)" + "description": "green color channel (0 - 255)" }, { "alias": "nB", "type": "number", "optional": true, - "description": "value of blue channel (0 - 255)" + "description": "blue color channel (0 - 255)" }, { "alias": "nA", "type": "number", "optional": true, - "description": "value of alpha channel (0 - 255)" + "description": "alpha channel value (0 - 255)" } ], "returns": [ From 0d43efdbb5710f406cb3d658349e4540a5801895 Mon Sep 17 00:00:00 2001 From: "W7RUS-LAPTOP\\w7rus" Date: Sat, 31 Oct 2020 13:20:24 +0700 Subject: [PATCH 10/23] Update docs/for_developers/api/client.json Update docs/for_developers/api/ui.json (Fix descriptions) Drop docs/for_developers/api.json --- docs/for_developers/api.json | 2129 --------------------------- docs/for_developers/api/client.json | 502 ++++++- docs/for_developers/api/ui.json | 2 +- 3 files changed, 428 insertions(+), 2205 deletions(-) delete mode 100644 docs/for_developers/api.json diff --git a/docs/for_developers/api.json b/docs/for_developers/api.json deleted file mode 100644 index 961e1d3..0000000 --- a/docs/for_developers/api.json +++ /dev/null @@ -1,2129 +0,0 @@ -{ - "type": "LuaFunctionsTableArray", - "MyArray": [ - { - "alias": "_G", - "functions": [ - { - "alias": "defer", - "arguments": [], - "returns": [], - "description": "`shutdown` event (obsolete)" - }, - { - "alias": "vector", - "arguments": [ - { - "alias": "nX", - "type": "number", - "optional": false, - "description": "x asix coordinate" - }, - { - "alias": "nY", - "type": "number", - "optional": false, - "description": "y asix coordinate" - }, - { - "alias": "nZ", - "type": "number", - "optional": false, - "description": "z asix coordinate" - } - ], - "returns": [ - { - "type": "vector{}", - "description": "instance of vector object" - } - ], - "description": "creates a new vector object with given coordinates" - }, - { - "alias": "readfile", - "arguments": [ - { - "alias": "sPath", - "type": "string", - "optional": false, - "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" - } - ], - "returns": [ - { - "type": "string", - "description": "contents of file" - } - ], - "description": "reads a file contents" - }, - { - "alias": "vtable_bind", - "arguments": [ - { - "alias": "sModuleFileName", - "type": "string", - "optional": false, - "description": "a module filename, e.g. `engine.dll`" - }, - { - "alias": "sInterfaceAlias", - "type": "string", - "optional": false, - "description": "a module's interface alias, e.g. `VEngineClient014`" - }, - { - "alias": "nVTFI", - "type": "number", - "optional": false, - "description": "a virtual table function index inside the interface, e.g. for GetNetChannelInfo it's `78`" - }, - { - "alias": "sTypeOf", - "type": "string", - "optional": false, - "description": "a function typeof to which the result pointer is casted, e.g. for GetNetChannelInfo it's `void*(__thiscall*)(void*)`" - } - ], - "returns": [ - { - "type": "cdata", - "description": "a C data object (a function pointer)" - } - ], - "description": "binds virtual function table method from module's interface to a callable cdata object (call it like the lua function). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" - }, - { - "alias": "vtable_thunk", - "arguments": [ - { - "alias": "nVTFI", - "type": "number", - "optional": false, - "description": "a virtual table function index inside the interface, e.g. for GetLatency it's `9`" - }, - { - "alias": "sTypeOf", - "type": "string", - "optional": false, - "description": "a function typeof to which the result pointer is casted, e.g. for GetLatency it's `float(__thiscall*)(void*, int)`" - } - ], - "returns": [ - { - "type": "cdata", - "description": "a C data object (a function pointer)" - } - ], - "description": "thunks virtual function table method from interface to a callable cdata object (call it like the lua function, but the first argument must be a pointer to the interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" - }, - { - "alias": "writefile", - "arguments": [ - { - "alias": "sPath", - "type": "string", - "optional": false, - "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" - }, - { - "alias": "sData", - "type": "string", - "optional": false, - "description": "contents to write" - } - ], - "returns": [], - "description": "writes contents to file" - } - ] - }, - { - "alias": "bit", - "functions": [ - { - "alias": "arshift", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to shift" - }, - { - "alias": "nPositions", - "type": "number", - "optional": false, - "description": "number of positions to shift" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "arithmetic right-shift by bits of value" - }, - { - "alias": "band", - "arguments": [ - { - "alias": "nValue1", - "type": "number", - "optional": false, - "description": "value for bitwise and" - }, - { - "alias": "nValue2", - "type": "number", - "optional": true, - "description": "value for bitwise and" - }, - { - "alias": "...", - "type": "variadic number", - "optional": true, - "description": "values for bitwise and" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "bitwise and of values" - }, - { - "alias": "bnot", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value for bitwise not" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "bitwise not of value" - }, - { - "alias": "bor", - "arguments": [ - { - "alias": "nValue1", - "type": "number", - "optional": false, - "description": "value for bitwise or" - }, - { - "alias": "nValue2", - "type": "number", - "optional": true, - "description": "value for bitwise or" - }, - { - "alias": "...", - "type": "variadic number", - "optional": true, - "description": "values for bitwise or" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "bitwise or of values" - }, - { - "alias": "bswap", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value for byte swap" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "byte-swap of value (little-endian <-> big-endian)" - }, - { - "alias": "bxor", - "arguments": [ - { - "alias": "nValue1", - "type": "number", - "optional": false, - "description": "value for bitwise xor" - }, - { - "alias": "nValue2", - "type": "number", - "optional": true, - "description": "value for bitwise xor" - }, - { - "alias": "...", - "type": "variadic number", - "optional": true, - "description": "value sfor bitwise xor" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "bitwise xor of values" - }, - { - "alias": "lshift", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to shift" - }, - { - "alias": "nPositions", - "type": "number", - "optional": false, - "description": "number of positions to shift" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "logical left-shift by bits of value" - }, - { - "alias": "rol", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to rotate" - }, - { - "alias": "nPositions", - "type": "number", - "optional": false, - "description": "number of positions to rotate" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "left-rotate by bits of value" - }, - { - "alias": "ror", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to rotate" - }, - { - "alias": "nPositions", - "type": "number", - "optional": false, - "description": "number of positions to rotate" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "right-rotate by bits of value" - }, - { - "alias": "rshift", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to shift" - }, - { - "alias": "nPositions", - "type": "number", - "optional": false, - "description": "number of positions to shift" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "logical left-shift by bits of value" - }, - { - "alias": "tobit", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to normalize" - } - ], - "returns": [ - { - "type": "number", - "description": "-" - } - ], - "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)" - }, - { - "alias": "tohex", - "arguments": [ - { - "alias": "nValue", - "type": "number", - "optional": false, - "description": "value to format" - }, - { - "alias": "n", - "type": "number", - "optional": true, - "description": "amount of hex digits (default is 8)" - } - ], - "returns": [ - { - "type": "string", - "description": "result" - } - ], - "description": "format value as hex with digit limit" - } - ] - }, - { - "alias": "client", - "functions": [ - { - "alias": "camera_angles", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "camera_position", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "color_log", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "create_interface", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "delay_call", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_circle", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_circle_outline", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_debug_text", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_gradient", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_hitboxes", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_indicator", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_line", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_rectangle", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "draw_text", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "error_log", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "exec", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "eye_position", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "find_signature", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_cvar", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_model_name", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "key_state", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "latency", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "log", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "random_float", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "random_int", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "register_esp_flag", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "reload_active_scripts", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "scale_damage", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "screen_size", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_clan_tag", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_cvar", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_event_callback", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "system_time", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "timestamp", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "trace_bullet", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "trace_line", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "unix_time", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "unset_event_callback", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "update_player_list", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "userid_to_entindex", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "visible", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "world_to_screen", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "config", - "functions": [ - { - "alias": "export", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "import", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "load", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "cvar{}", - "functions": [ - { - "alias": "get_float", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_int", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_string", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "invoke_callback", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_float", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_int", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_raw_float", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_raw_int", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_string", - "arguments": [], - "returns": [], - "description": "" - } - ] - }, - { - "alias": "database", - "functions": [ - { - "alias": "flush", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "read", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "write", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "entity", - "functions": [ - { - "alias": "get_all", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_bounding_box", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_classname", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_esp_data", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_game_rules", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_local_player", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_origin", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_player_name", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_player_resource", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_player_weapon", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_players", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_prop", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_steam64", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "hitbox_position", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "is_alive", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "is_dormant", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "is_enemy", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_prop", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "globals", - "functions": [ - { - "alias": "absoluteframetime", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "chokedcommands", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "commandack", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "curtime", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "framecount", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "frametime", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "lastoutgoingcommand", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "mapname", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "maxplayers", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "oldcommandack", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "realtime", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "tickcount", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "tickinterval", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "json", - "functions": [ - { - "alias": "decode_invalid_numbers", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "decode_max_depth", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "encode_invalid_numbers", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "encode_max_depth", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "encode_number_precision", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "encode_sparse_array", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "parse", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "stringify", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "materialsystem", - "functions": [ - { - "alias": "arms_material", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "chams_material", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "find_material", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "find_materials", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "find_texture", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_model_materials", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "override_material", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "materialsystem{}", - "functions": [ - { - "alias": "alpha_modulate", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "color_modulate", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_material_var_flag", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "get_shader_param", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "reload", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_material_var_flag", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "set_shader_param", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "ffi", - "functions": [ - { - "alias": "abi", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "alignof", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "cast", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "cdef", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "copy", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "errno", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "fill", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "gc", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "istype", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "metatype", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "new", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "offsetof", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "sizeof", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "string", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "typeinfo", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "typeof", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "vector{}", - "functions": [ - { - "alias": "init", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "init_from_angles", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "scale", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "scaled", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "normalize", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "normalized", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "length2d", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "length2dsqr", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "length", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "lengthsqr", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "lerp", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "dot", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "dist", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "dist2d", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "cross", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "angles", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "vectors", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "to", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "panorama", - "functions": [ - { - "alias": "loadstring", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "open", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "plist", - "functions": [ - { - "alias": "get", - "arguments": [ - { - "alias": "nEntityIndex", - "type": "number", - "optional": false, - "description": "entity index of the player" - }, - { - "alias": "sUiFieldName", - "type": "string", - "optional": false, - "description": "Name of the field inside player list, e.g. `Correction Active`" - } - ], - "returns": [ - { - "type": "any", - "description": "value of ui element (ui element specific type)" - } - ], - "description": "Gets the value of corresponding ui element for specific player in playerlist tab" - }, - { - "alias": "set", - "arguments": [ - { - "alias": "nEntityIndex", - "type": "number", - "optional": false, - "description": "entity index of the player" - }, - { - "alias": "sUiFieldName", - "type": "string", - "optional": false, - "description": "Name of the field inside player list, e.g. `Correction Active`" - }, - { - "alias": "value", - "type": "any", - "optional": false, - "description": "value to set (ui element specific type)" - } - ], - "description": "Sets the value to corresponding ui element for specific player in playerlist tab" - } - ] - }, - { - "alias": "renderer", - "functions": [ - { - "alias": "circle", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "circle_outline", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "gradient", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "indicator", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "line", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "load_jpg", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "load_png", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "load_rgba", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "load_svg", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "measure_text", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "rectangle", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "text", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "texture", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "triangle", - "arguments": [], - "returns": [], - "description": "" - }, - { - "alias": "world_to_screen", - "arguments": [], - "description": "" - } - ] - }, - { - "alias": "ui", - "functions": [ - { - "alias": "get", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - } - ], - "returns": [ - { - "type": "any", - "description": "value of ui element (ui element specific type)" - } - ], - "description": "Gets the value of referenced ui element" - }, - { - "alias": "is_menu_open", - "returns": [ - { - "type": "boolean", - "description": "-" - } - ], - "description": "returns whether cheat menu is open" - }, - { - "alias": "menu_position", - "returns": [ - { - "type": "number", - "description": "x asix coordinate of menu" - }, - { - "type": "number", - "description": "y asix coordinate of menu" - } - ], - "description": "returns position of the menu as 2 values" - }, - { - "alias": "menu_size", - "returns": [ - { - "type": "number", - "description": "width of menu" - }, - { - "type": "number", - "description": "height of menu" - } - ], - "description": "returns dimensions of the menu as 2 values" - }, - { - "alias": "mouse_position", - "returns": [ - { - "type": "number", - "description": "x asix coordinate of menu" - }, - { - "type": "number", - "description": "y asix coordinate of menu" - } - ], - "description": "returns position of the menu as 2 values" - }, - { - "alias": "name", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - } - ], - "returns": [ - { - "type": "string", - "description": "alias of ui element" - } - ], - "description": "Gets the alias of referenced ui element" - }, - { - "alias": "new_button", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_checkbox", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_color_picker", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "nR", - "type": "number", - "optional": true, - "description": "red color channel (0 - 255)" - }, - { - "alias": "nG", - "type": "number", - "optional": true, - "description": "green color channel (0 - 255)" - }, - { - "alias": "nB", - "type": "number", - "optional": true, - "description": "blue color channel (0 - 255)" - }, - { - "alias": "nA", - "type": "number", - "optional": true, - "description": "alpha channel value (0 - 255)" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_combobox", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "...", - "type": "variadic string / table{string, ...}", - "optional": false, - "description": "values that will be added to combobox" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_hotkey", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "bInline", - "type": "boolean", - "optional": true, - "description": "whether on not, the newly created ui element will be placed to the right of preceding ui element" - }, - { - "alias": "nInitVK", - "type": "number", - "optional": true, - "description": "initial virtual key value" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_label", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that reference of that ui element can be used only in `ui.set` and `ui.name`**" - }, - { - "alias": "new_listbox", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "tItems", - "type": "table{string, ...}", - "optional": false, - "description": "values that will be added to listbox" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_multiselect", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "...", - "type": "variadic string / table{string, ...}", - "optional": false, - "description": "values that will be added to multiselect" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_slider", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "nMin", - "type": "number", - "optional": false, - "description": "minimum value of slider (must be an integer)" - }, - { - "alias": "nMax", - "type": "number", - "optional": false, - "description": "maximum value of slider (must be an integer)" - }, - { - "alias": "nInit", - "type": "number", - "optional": true, - "description": "initial value of slider (must be an integer)" - }, - { - "alias": "bShowTooltip", - "type": "boolean", - "optional": true, - "description": "whether or not to show current value of the slider" - }, - { - "alias": "sUnit", - "type": "string", - "optional": true, - "description": "string to append to tooltip (max 3 symbols)" - }, - { - "alias": "nScale", - "type": "number", - "optional": true, - "description": "multiplier for displayed value, e.g. slider with range of `0-10` and scale set to `0.1` would result in tooltip to display values within `0.0-1.0` range" - }, - { - "alias": "tTooltops", - "type": "table{[nValue] = string, ...}", - "optional": true, - "description": "override tooltip for specified value" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure" - }, - { - "alias": "new_string", - "arguments": [ - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - }, - { - "alias": "sValue", - "type": "string", - "optional": false, - "description": "initial value of element" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element. **This doesn't populate any ui elements visually**" - }, - { - "alias": "new_textbox", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element" - } - ], - "returns": [ - { - "type": "number", - "description": "a ui element reference" - } - ], - "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that this element doesn't store it's value in configuration**" - }, - { - "alias": "reference", - "arguments": [ - { - "alias": "sTabAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab, e.g. `Visuals`" - }, - { - "alias": "sContainerAlias", - "type": "number", - "optional": false, - "description": "alias of the cheat menu tab container, e.g. `Effects`" - }, - { - "alias": "sUiElementAlias", - "type": "number", - "optional": false, - "description": "alias of the new element, e.g. `Force third person (alive)`" - } - ], - "returns": [ - { - "type": "number, ...", - "description": "a ui element reference (multiple references if corresponding ui element contains inlined following ui elements)" - } - ], - "description": "returns a reference of a built-in ui element at specified location in menu structure. **Keep in mind that it's better not to call this more than once per enviroment**" - }, - { - "alias": "set", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - }, - { - "alias": "value", - "type": "any", - "optional": false, - "description": "value to set (ui element specific type)" - }, - { - "alias": "...", - "type": "variadic any", - "optional": true, - "description": "values to set (ui element specific type)" - } - ], - "description": "Sets the value of referenced ui element" - }, - { - "alias": "set_callback", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - }, - { - "alias": "fnCallback", - "type": "function", - "optional": false, - "description": "a function that will be called on ui element action. **Reference to that ui element is passed to callback function as first argument**" - } - ], - "description": "Binds function that will be called on ui element action" - }, - { - "alias": "set_visible", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - }, - { - "alias": "bVisible", - "type": "boolean", - "optional": false, - "description": "whether on not the referenced ui element is visible in ui" - } - ], - "description": "Changes visibility of referenced ui element" - }, - { - "alias": "update", - "arguments": [ - { - "alias": "nUiElementReference", - "type": "number", - "optional": false, - "description": "a ui element reference to get value of" - }, - { - "alias": "...", - "type": "any", - "optional": false, - "description": "values that will be overriden (ui element specific type)" - } - ], - "description": "Updates values of referenced ui element" - } - ] - } - ] -} \ No newline at end of file diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json index e8df31e..82b4125 100644 --- a/docs/for_developers/api/client.json +++ b/docs/for_developers/api/client.json @@ -9,11 +9,11 @@ "returns": [ { "type": "number", - "description": "pitch in degrees" + "description": "pitch [degrees]" }, { "type": "number", - "description": "yaw in degrees" + "description": "yaw [degrees]" } ], "description": "Gets camera world angles" @@ -25,13 +25,13 @@ "alias": "nPitch", "type": "number", "optional": false, - "description": "pitch in degrees" + "description": "pitch [degrees]" }, { "alias": "nYaw", "type": "number", "optional": false, - "description": "yaw in degrees" + "description": "yaw [degrees]" } ], "description": "Sets camera world angles to values provided" @@ -88,7 +88,7 @@ "description": "messages to log" } ], - "description": "Logs message(s) with provided color into game console" + "description": "logs message(s) with provided color into game console" }, { "alias": "create_interface", @@ -296,27 +296,81 @@ }, { "alias": "error_log", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sMessage", + "type": "string", + "optional": false, + "description": "message to log" + }, + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "messages to log" + } + ], + "description": "logs message(s) as error into game console" }, { "alias": "exec", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sCommand", + "type": "string", + "optional": false, + "description": "command to execute (append `;` if passing more than one command)" + }, + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "commands to execute (`;` separated)" + } + ], + "description": "executes game console command(s)" }, { "alias": "eye_position", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "x asix coordinate" + }, + { + "type": "number", + "description": "y asix coordinate" + }, + { + "type": "number", + "description": "z asix coordinate" + } + ], + "description": "Gets eye position of a local player entity" }, { "alias": "find_signature", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sModuleFileName", + "type": "string", + "optional": false, + "description": "a module filename, e.g. `engine.dll`" + }, + { + "alias": "sSignature", + "type": "string", + "optional": false, + "description": "a signature (as byte escape sequence, wildcard is `\\xCC`), e.g. `\\xB9\\xCC\\xCC\\xCC\\xCC\\x88\\x46\\x09`" + } + ], + "returns": [ + { + "type": "cdata", + "description": "a C data object (a void pointer)" + } + ], + "description": "returns pointer at signature match start inside specified module" }, { "alias": "get_cvar", @@ -326,69 +380,187 @@ }, { "alias": "get_model_name", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nModelIndex", + "type": "number", + "optional": false, + "description": "a model index" + } + ], + "returns": [ + { + "type": "string", + "description": "a model name" + } + ], + "description": "Gets model name by provided model index" }, { "alias": "key_state", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nVK", + "type": "number", + "optional": false, + "description": "virtual key code" + } + ], + "returns": [ + { + "type": "boolean", + "description": "result of virtual key being pressed" + } + ], + "description": "returns whether the key is pressed" }, { "alias": "latency", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "latency [seconds]" + } + ], + "description": "returns your latency in seconds" }, { "alias": "log", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sMessage", + "type": "string", + "optional": false, + "description": "message to log" + }, + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "messages to log" + } + ], + "description": "logs message(s) into game console" }, { "alias": "random_float", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nMin", + "type": "number", + "optional": false, + "description": "minimum value" + }, + { + "alias": "nMax", + "type": "number", + "optional": false, + "description": "maximum value" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "returns random float in range specified" }, { "alias": "random_int", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nMin", + "type": "number", + "optional": false, + "description": "minimum value" + }, + { + "alias": "nMax", + "type": "number", + "optional": false, + "description": "maximum value" + } + ], + "returns": [ + { + "type": "number", + "description": "-" + } + ], + "description": "returns random integer in range specified" }, { "alias": "register_esp_flag", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sFlag", + "type": "string", + "optional": false, + "description": "a flag" + }, + { + "alias": "nR", + "type": "number", + "optional": false, + "description": "red color channel (0 - 255)" + }, + { + "alias": "nG", + "type": "number", + "optional": false, + "description": "green color channel (0 - 255)" + }, + { + "alias": "nB", + "type": "number", + "optional": false, + "description": "blue color channel (0 - 255)" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function that will be called on ui element action. **Entity index is passed to callback function as first argument**" + } + ], + "description": "Sets function that is called for each player entity while drawing the ESP. **Keep in mind that this function requires `Visuals > Player > Flags` feature being active**" }, { "alias": "reload_active_scripts", - "arguments": [], - "returns": [], - "description": "" + "description": "forces reload of all loaded scripts" }, { "alias": "scale_damage", "arguments": [], "returns": [], - "description": "" + "description": "(buggy)" }, { "alias": "screen_size", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "width value" + }, + { + "type": "number", + "description": "height value" + } + ], + "description": "returns dimensions of the game's viewport" }, { "alias": "set_clan_tag", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "...", + "type": "variadic string", + "optional": true, + "description": "text(s) to set as clantag (leave empty to remove clantag)" + } + ], + "description": "Sets clantag to the text(s) provided" }, { "alias": "set_cvar", @@ -398,57 +570,237 @@ }, { "alias": "set_event_callback", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sEventAlias", + "type": "string", + "optional": false, + "description": "an event alias, e.g. `paint` or `player_connect_full` (game events and built-in cheat events, for more info check `For Developers > Events`)" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function that will be called when provided event is fired. **Event data is passed to callback function as first argument**" + } + ], + "description": "Sets function that is called when specified even is fired" }, { "alias": "system_time", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "hours value" + }, + { + "type": "number", + "description": "minutes value" + }, + { + "type": "number", + "description": "seconds value" + }, + { + "type": "number", + "description": "milliseconds value" + } + ], + "description": "returns your local system time" }, { "alias": "timestamp", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "milliseconds value" + } + ], + "description": "returns high precision timestamp in milliseconds" }, { "alias": "trace_bullet", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index to trace from" + }, + { + "alias": "nFromX", + "type": "number", + "optional": false, + "description": "x asix coordinate to trace from" + }, + { + "alias": "nFromY", + "type": "number", + "optional": false, + "description": "y asix coordinate to trace from" + }, + { + "alias": "nFromZ", + "type": "number", + "optional": false, + "description": "z asix coordinate to trace from" + }, + { + "alias": "nToX", + "type": "number", + "optional": false, + "description": "x asix coordinate to trace to" + }, + { + "alias": "nToY", + "type": "number", + "optional": false, + "description": "y asix coordinate to trace to" + }, + { + "alias": "nToZ", + "type": "number", + "optional": false, + "description": "z asix coordinate to trace to" + }, + { + "alias": "bSkipHitboxes", + "type": "boolean", + "optional": true, + "description": "whether to skip expensive entity hitbox checks" + } + ], + "returns": [ + { + "type": "number", + "description": "entity index of entity that intersects trace (can deal damage to)" + }, + { + "type": "number", + "description": "damage that can be done with local player active weapon at traced world position" + } + ], + "description": "Traces damage from world position as selected entity's active weapon to another world position" }, { "alias": "trace_line", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nEntityIndex", + "type": "number", + "optional": false, + "description": "entity index to trace from" + }, + { + "alias": "nFromX", + "type": "number", + "optional": false, + "description": "x asix coordinate to trace from" + }, + { + "alias": "nFromY", + "type": "number", + "optional": false, + "description": "y asix coordinate to trace from" + }, + { + "alias": "nFromZ", + "type": "number", + "optional": false, + "description": "z asix coordinate to trace from" + }, + { + "alias": "nToX", + "type": "number", + "optional": false, + "description": "x asix coordinate to trace to" + }, + { + "alias": "nToY", + "type": "number", + "optional": false, + "description": "y asix coordinate to trace to" + }, + { + "alias": "nToZ", + "type": "number", + "optional": false, + "description": "z asix coordinate to trace to" + } + ], + "returns": [ + { + "type": "number", + "description": "fraction that shows how far the trace went relative to distance between world positions (0.0 - 1.0)" + }, + { + "type": "number", + "description": "entity index of entity that intersects trace" + } + ], + "description": "Traces visibility from world position to another world position" }, { "alias": "unix_time", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "hours value" + }, + { + "type": "number", + "description": "minutes value" + }, + { + "type": "number", + "description": "seconds value" + }, + { + "type": "number", + "description": "milliseconds value" + } + ], + "description": "returns time since 00:00:00 01/01/1970" }, { "alias": "unset_event_callback", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sEventAlias", + "type": "string", + "optional": false, + "description": "an event alias, e.g. `paint` or `player_connect_full` (game events and built-in cheat events, for more info check `For Developers > Events`)" + }, + { + "alias": "fnCallback", + "type": "function", + "optional": false, + "description": "a function for which to unset the provided event" + } + ], + "description": "Unsets function that have been called when specified even were fired" }, { "alias": "update_player_list", - "arguments": [], - "returns": [], - "description": "" + "description": "Updates player list tab without having to open it" }, { "alias": "userid_to_entindex", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "nUserId", + "type": "number", + "optional": false, + "description": "a userId that is given by some game events" + } + ], + "returns": [ + { + "type": "number", + "description": "entity index" + } + ], + "description": "returns entity index that is linked to provided userId" }, { "alias": "visible", diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json index fb44afe..70fe655 100644 --- a/docs/for_developers/api/ui.json +++ b/docs/for_developers/api/ui.json @@ -273,7 +273,7 @@ "alias": "nInitVK", "type": "number", "optional": true, - "description": "initial virtual key value" + "description": "initial virtual key code" } ], "returns": [ From fe1ede76e035cf98b8dc125f9632e65d62ce7ed4 Mon Sep 17 00:00:00 2001 From: w7rus Date: Sat, 31 Oct 2020 15:08:44 +0700 Subject: [PATCH 11/23] Update docs/for_developers/api/_G.json (Fix descriptions) Update docs/for_developers/api/bit.json (Fix descriptions) Update docs/for_developers/api/client.json (Fix descriptions) Update docs/for_developers/api/plist.json (Fix descriptions) Update docs/for_developers/api/ui.json (Fix descriptions) Update GenDoc (Fix not prinint of ')' when no arguments provided) --- GenDoc/GenDoc/Program.cs | 14 +++- docs/for_developers/api/_G.json | 11 ++- docs/for_developers/api/bit.json | 24 +++--- docs/for_developers/api/client.json | 116 ++++++++++++++-------------- docs/for_developers/api/plist.json | 16 ++-- docs/for_developers/api/ui.json | 34 ++++---- mkdocs.yml | 1 - 7 files changed, 111 insertions(+), 105 deletions(-) diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index dbdae4e..decad69 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -143,10 +143,10 @@ internal static class GenDoc { stringBuilder.Append(']'); } - - stringBuilder.Append(')'); } + stringBuilder.Append(')'); + /* * Write returns */ @@ -193,8 +193,16 @@ internal static class GenDoc foreach (var (value, i) in luaFunction.Returns.Select((value, i) => (value, i))) { + var positionalIndex = (i + 1) switch + { + 1 => "1st", + 2 => "2nd", + 3 => "3rd", + _ => $"{i + 1}th" + }; + stringBuilder.AppendLine( - $"|{i + 1}|{value.Type}|{value.Description}|"); + $"|{positionalIndex}|{value.Type}|{value.Description}|"); } stringBuilder.Append("\n"); diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/_G.json index 31c76e7..03160d5 100644 --- a/docs/for_developers/api/_G.json +++ b/docs/for_developers/api/_G.json @@ -8,7 +8,7 @@ "alias": "defer", "arguments": [], "returns": [], - "description": "`shutdown` event (obsolete)" + "description": "(obsolete) `shutdown` event" }, { "alias": "vector", @@ -38,7 +38,7 @@ "description": "instance of vector object" } ], - "description": "creates a new vector object with given coordinates" + "description": "returns a new vector object with given coordinates" }, { "alias": "readfile", @@ -56,7 +56,7 @@ "description": "contents of file" } ], - "description": "reads a file contents" + "description": "returns contents of provided file by path" }, { "alias": "vtable_bind", @@ -92,7 +92,7 @@ "description": "a C data object (a function pointer)" } ], - "description": "binds virtual function table method from module's interface to a callable cdata object (call it like the lua function). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + "description": "returns function (callable cdata object) bound to virtual function table method from module's interface. **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" }, { "alias": "vtable_thunk", @@ -116,7 +116,7 @@ "description": "a C data object (a function pointer)" } ], - "description": "thunks virtual function table method from interface to a callable cdata object (call it like the lua function, but the first argument must be a pointer to the interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + "description": "returns function (callable cdata object) thunked to virtual function table method from interface (the first argument must be a pointer to that interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" }, { "alias": "writefile", @@ -134,7 +134,6 @@ "description": "contents to write" } ], - "returns": [], "description": "writes contents to file" } ] diff --git a/docs/for_developers/api/bit.json b/docs/for_developers/api/bit.json index f725542..80f552a 100644 --- a/docs/for_developers/api/bit.json +++ b/docs/for_developers/api/bit.json @@ -26,7 +26,7 @@ "description": "-" } ], - "description": "arithmetic right-shift by bits of value" + "description": "returns arithmetic right-shift by bits of value" }, { "alias": "band", @@ -56,7 +56,7 @@ "description": "-" } ], - "description": "bitwise and of values" + "description": "returns bitwise and of values" }, { "alias": "bnot", @@ -74,7 +74,7 @@ "description": "-" } ], - "description": "bitwise not of value" + "description": "returns bitwise not of value" }, { "alias": "bor", @@ -104,7 +104,7 @@ "description": "-" } ], - "description": "bitwise or of values" + "description": "returns bitwise or of values" }, { "alias": "bswap", @@ -122,7 +122,7 @@ "description": "-" } ], - "description": "byte-swap of value (little-endian <-> big-endian)" + "description": "returns byte-swap of value (little-endian <-> big-endian)" }, { "alias": "bxor", @@ -152,7 +152,7 @@ "description": "-" } ], - "description": "bitwise xor of values" + "description": "returns bitwise xor of values" }, { "alias": "lshift", @@ -176,7 +176,7 @@ "description": "-" } ], - "description": "logical left-shift by bits of value" + "description": "returns logical left-shift by bits of value" }, { "alias": "rol", @@ -200,7 +200,7 @@ "description": "-" } ], - "description": "left-rotate by bits of value" + "description": "returns left-rotate by bits of value" }, { "alias": "ror", @@ -224,7 +224,7 @@ "description": "-" } ], - "description": "right-rotate by bits of value" + "description": "returns right-rotate by bits of value" }, { "alias": "rshift", @@ -248,7 +248,7 @@ "description": "-" } ], - "description": "logical left-shift by bits of value" + "description": "returns logical left-shift by bits of value" }, { "alias": "tobit", @@ -266,7 +266,7 @@ "description": "-" } ], - "description": "normalize number to the numeric range of bit operations (all bit ops use this implicitly)" + "description": "returns normalized number to the numeric range of bit operations (all bit ops use this implicitly)" }, { "alias": "tohex", @@ -290,7 +290,7 @@ "description": "result" } ], - "description": "format value as hex with digit limit" + "description": "returns format of value as hex with digit limit" } ] } diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json index 82b4125..62ca0f5 100644 --- a/docs/for_developers/api/client.json +++ b/docs/for_developers/api/client.json @@ -9,14 +9,14 @@ "returns": [ { "type": "number", - "description": "pitch [degrees]" + "description": "pitch (degrees)" }, { "type": "number", - "description": "yaw [degrees]" + "description": "yaw (degrees)" } ], - "description": "Gets camera world angles" + "description": "returns camera world angles" }, { "alias": "camera_angles", @@ -25,16 +25,16 @@ "alias": "nPitch", "type": "number", "optional": false, - "description": "pitch [degrees]" + "description": "pitch (degrees)" }, { "alias": "nYaw", "type": "number", "optional": false, - "description": "yaw [degrees]" + "description": "yaw (degrees)" } ], - "description": "Sets camera world angles to values provided" + "description": "sets camera world angles to values provided" }, { "alias": "camera_position", @@ -52,7 +52,7 @@ "description": "z asix coordinate" } ], - "description": "Gets camera world position coordinates" + "description": "returns camera world position coordinates" }, { "alias": "color_log", @@ -61,19 +61,19 @@ "alias": "nR", "type": "number", "optional": false, - "description": "red color channel (0 - 255)" + "description": "red color channel [0-255]" }, { "alias": "nG", "type": "number", "optional": false, - "description": "green color channel (0 - 255)" + "description": "green color channel [0-255]" }, { "alias": "nB", "type": "number", "optional": false, - "description": "blue color channel (0 - 255)" + "description": "blue color channel [0-255]" }, { "alias": "sMessage", @@ -121,7 +121,7 @@ "alias": "nDelay", "type": "number", "optional": false, - "description": "delay in seconds" + "description": "delay (seconds)" }, { "alias": "fnCallback", @@ -130,7 +130,7 @@ "description": "a function that will be called" } ], - "description": "Binds function that will be called after specified delay" + "description": "binds function that will be called after specified delay" }, { "alias": "draw_circle", @@ -175,31 +175,31 @@ "alias": "nDuration", "type": "number", "optional": false, - "description": "time in seconds to keep rendering of the text" + "description": "time to keep rendering of the text (seconds)" }, { "alias": "nR", "type": "number", "optional": false, - "description": "red color channel (0 - 255)" + "description": "red color channel [0-255]" }, { "alias": "nG", "type": "number", "optional": true, - "description": "green color channel (0 - 255)" + "description": "green color channel [0-255]" }, { "alias": "nB", "type": "number", "optional": true, - "description": "blue color channel (0 - 255)" + "description": "blue color channel [0-255]" }, { "alias": "nA", "type": "number", "optional": true, - "description": "alpha channel (0 - 255)" + "description": "alpha channel [0-255]" }, { "alias": "...", @@ -208,7 +208,7 @@ "description": "text to draw" } ], - "description": "Draws text with provided color for required amount of time. **Keep in mind that it's better not to call this frequently**" + "description": "draws text with provided color for required amount of time. **Keep in mind that it's better not to call this frequently**" }, { "alias": "draw_gradient", @@ -229,7 +229,7 @@ "alias": "nDuration", "type": "number", "optional": false, - "description": "Time in seconds to keep rendering" + "description": "time to keep rendering (seconds)" }, { "alias": "hitboxes", @@ -241,25 +241,25 @@ "alias": "nR", "type": "number", "optional": false, - "description": "red color channel (0 - 255)" + "description": "red color channel [0-255]" }, { "alias": "nG", "type": "number", "optional": false, - "description": "green color channel (0 - 255)" + "description": "green color channel [0-255]" }, { "alias": "nB", "type": "number", "optional": false, - "description": "blue color channel (0 - 255)" + "description": "blue color channel [0-255]" }, { "alias": "nA", "type": "number", "optional": false, - "description": "alpha channel (0 - 255)" + "description": "alpha channel [0-255]" }, { "alias": "nTick", @@ -268,7 +268,7 @@ "description": "server tick" } ], - "description": "Draws hitbox capsule(s) with provided color for required amount of time and selected tick. **Keep in mind that it's better not to call this frequently**" + "description": "draws hitbox capsule(s) with provided color for required amount of time and selected tick. **Keep in mind that it's better not to call this frequently**" }, { "alias": "draw_indicator", @@ -346,7 +346,7 @@ "description": "z asix coordinate" } ], - "description": "Gets eye position of a local player entity" + "description": "returns eye position of a local player entity" }, { "alias": "find_signature", @@ -394,7 +394,7 @@ "description": "a model name" } ], - "description": "Gets model name by provided model index" + "description": "returns model name by provided model index" }, { "alias": "key_state", @@ -409,7 +409,7 @@ "returns": [ { "type": "boolean", - "description": "result of virtual key being pressed" + "description": "-" } ], "description": "returns whether the key is pressed" @@ -419,7 +419,7 @@ "returns": [ { "type": "number", - "description": "latency [seconds]" + "description": "latency (seconds)" } ], "description": "returns your latency in seconds" @@ -461,7 +461,7 @@ "returns": [ { "type": "number", - "description": "-" + "description": "random float" } ], "description": "returns random float in range specified" @@ -485,7 +485,7 @@ "returns": [ { "type": "number", - "description": "-" + "description": "random integer" } ], "description": "returns random integer in range specified" @@ -503,19 +503,19 @@ "alias": "nR", "type": "number", "optional": false, - "description": "red color channel (0 - 255)" + "description": "red color channel [0-255]" }, { "alias": "nG", "type": "number", "optional": false, - "description": "green color channel (0 - 255)" + "description": "green color channel [0-255]" }, { "alias": "nB", "type": "number", "optional": false, - "description": "blue color channel (0 - 255)" + "description": "blue color channel [0-255]" }, { "alias": "fnCallback", @@ -524,7 +524,7 @@ "description": "a function that will be called on ui element action. **Entity index is passed to callback function as first argument**" } ], - "description": "Sets function that is called for each player entity while drawing the ESP. **Keep in mind that this function requires `Visuals > Player > Flags` feature being active**" + "description": "sets function that is called for each player entity while drawing the ESP. **Keep in mind that this function requires `Visuals > Player > Flags` feature being active**" }, { "alias": "reload_active_scripts", @@ -534,18 +534,18 @@ "alias": "scale_damage", "arguments": [], "returns": [], - "description": "(buggy)" + "description": "(buggy) `client.trace_bullet` takes that into account" }, { "alias": "screen_size", "returns": [ { "type": "number", - "description": "width value" + "description": "width [px]" }, { "type": "number", - "description": "height value" + "description": "height [px]" } ], "description": "returns dimensions of the game's viewport" @@ -560,7 +560,7 @@ "description": "text(s) to set as clantag (leave empty to remove clantag)" } ], - "description": "Sets clantag to the text(s) provided" + "description": "sets clantag to the text(s) provided" }, { "alias": "set_cvar", @@ -584,26 +584,26 @@ "description": "a function that will be called when provided event is fired. **Event data is passed to callback function as first argument**" } ], - "description": "Sets function that is called when specified even is fired" + "description": "sets function that is called when specified even is fired" }, { "alias": "system_time", "returns": [ { "type": "number", - "description": "hours value" + "description": "hours [0-24]" }, { "type": "number", - "description": "minutes value" + "description": "minutes [0-59]" }, { "type": "number", - "description": "seconds value" + "description": "seconds [0-59]" }, { "type": "number", - "description": "milliseconds value" + "description": "milliseconds [0-999]" } ], "description": "returns your local system time" @@ -613,7 +613,7 @@ "returns": [ { "type": "number", - "description": "milliseconds value" + "description": "milliseconds" } ], "description": "returns high precision timestamp in milliseconds" @@ -680,16 +680,16 @@ "description": "damage that can be done with local player active weapon at traced world position" } ], - "description": "Traces damage from world position as selected entity's active weapon to another world position" + "description": "traces damage from world position via selected entity's active weapon to another world position" }, { "alias": "trace_line", "arguments": [ { - "alias": "nEntityIndex", + "alias": "nSkipEntityIndex", "type": "number", "optional": false, - "description": "entity index to trace from" + "description": "entity index to skip" }, { "alias": "nFromX", @@ -731,36 +731,36 @@ "returns": [ { "type": "number", - "description": "fraction that shows how far the trace went relative to distance between world positions (0.0 - 1.0)" + "description": "fraction that shows how far the trace went relative to distance between world positions [0.0-1.0]" }, { "type": "number", "description": "entity index of entity that intersects trace" } ], - "description": "Traces visibility from world position to another world position" + "description": "traces visibility from world position to another world position" }, { "alias": "unix_time", "returns": [ { "type": "number", - "description": "hours value" + "description": "hours [0-24]" }, { "type": "number", - "description": "minutes value" + "description": "minutes [0-59]" }, { "type": "number", - "description": "seconds value" + "description": "seconds [0-59]" }, { "type": "number", - "description": "milliseconds value" + "description": "milliseconds [0-999]" } ], - "description": "returns time since 00:00:00 01/01/1970" + "description": "returns time since `00:00:00 01/01/1970`" }, { "alias": "unset_event_callback", @@ -778,11 +778,11 @@ "description": "a function for which to unset the provided event" } ], - "description": "Unsets function that have been called when specified even were fired" + "description": "unsets function that have been bound to provided event" }, { "alias": "update_player_list", - "description": "Updates player list tab without having to open it" + "description": "updates player list tab without having to open it" }, { "alias": "userid_to_entindex", @@ -791,7 +791,7 @@ "alias": "nUserId", "type": "number", "optional": false, - "description": "a userId that is given by some game events" + "description": "a userId that is given by some game events, e.g. `player_connect_full` (for more info check `For Developers > Events`)" } ], "returns": [ @@ -800,7 +800,7 @@ "description": "entity index" } ], - "description": "returns entity index that is linked to provided userId" + "description": "returns entity index by provided userId" }, { "alias": "visible", diff --git a/docs/for_developers/api/plist.json b/docs/for_developers/api/plist.json index 30784f9..6060549 100644 --- a/docs/for_developers/api/plist.json +++ b/docs/for_developers/api/plist.json @@ -11,13 +11,13 @@ "alias": "nEntityIndex", "type": "number", "optional": false, - "description": "entity index of the player" + "description": "entity index (players only)" }, { - "alias": "sUiFieldName", + "alias": "sUiAlias", "type": "string", "optional": false, - "description": "Name of the field inside player list, e.g. `Correction Active`" + "description": "alias of the ui element inside player list, e.g. `Correction Active`" } ], "returns": [ @@ -26,7 +26,7 @@ "description": "value of ui element (ui element specific type)" } ], - "description": "Gets the value of corresponding ui element for specific player in playerlist tab" + "description": "returns the value of corresponding ui element for specific player in playerlist tab" }, { "alias": "set", @@ -35,13 +35,13 @@ "alias": "nEntityIndex", "type": "number", "optional": false, - "description": "entity index of the player" + "description": "entity index (players only)" }, { - "alias": "sUiFieldName", + "alias": "sUiAlias", "type": "string", "optional": false, - "description": "Name of the field inside player list, e.g. `Correction Active`" + "description": "alias of the ui element inside player list, e.g. `Correction Active`" }, { "alias": "value", @@ -50,7 +50,7 @@ "description": "value to set (ui element specific type)" } ], - "description": "Sets the value to corresponding ui element for specific player in playerlist tab" + "description": "sets the value to corresponding ui element for specific player in playerlist tab" } ] } diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json index 70fe655..770af23 100644 --- a/docs/for_developers/api/ui.json +++ b/docs/for_developers/api/ui.json @@ -20,7 +20,7 @@ "description": "value of ui element (ui element specific type)" } ], - "description": "Gets the value of referenced ui element" + "description": "returns the value of referenced ui element" }, { "alias": "is_menu_open", @@ -37,25 +37,25 @@ "returns": [ { "type": "number", - "description": "x asix coordinate of menu" + "description": "x asix coordinate [px]" }, { "type": "number", - "description": "y asix coordinate of menu" + "description": "y asix coordinate [px]" } ], - "description": "returns position of the menu as 2 values" + "description": "returns position of the menu as 2 values from top left of game's viewport" }, { "alias": "menu_size", "returns": [ { "type": "number", - "description": "width of menu" + "description": "width [px]" }, { "type": "number", - "description": "height of menu" + "description": "height [px]" } ], "description": "returns dimensions of the menu as 2 values" @@ -65,11 +65,11 @@ "returns": [ { "type": "number", - "description": "x asix coordinate of menu" + "description": "x asix coordinate [px]" }, { "type": "number", - "description": "y asix coordinate of menu" + "description": "y asix coordinate [px]" } ], "description": "returns position of the menu as 2 values" @@ -90,7 +90,7 @@ "description": "alias of ui element" } ], - "description": "Gets the alias of referenced ui element" + "description": "returns the alias of referenced ui element" }, { "alias": "new_button", @@ -177,25 +177,25 @@ "alias": "nR", "type": "number", "optional": true, - "description": "red color channel (0 - 255)" + "description": "red color channel [0-255]" }, { "alias": "nG", "type": "number", "optional": true, - "description": "green color channel (0 - 255)" + "description": "green color channel [0-255]" }, { "alias": "nB", "type": "number", "optional": true, - "description": "blue color channel (0 - 255)" + "description": "blue color channel [0-255]" }, { "alias": "nA", "type": "number", "optional": true, - "description": "alpha channel value (0 - 255)" + "description": "alpha channel value [0-255]" } ], "returns": [ @@ -564,7 +564,7 @@ "description": "values to set (ui element specific type)" } ], - "description": "Sets the value of referenced ui element" + "description": "sets the value of referenced ui element" }, { "alias": "set_callback", @@ -582,7 +582,7 @@ "description": "a function that will be called on ui element action. **Reference to that ui element is passed to callback function as first argument**" } ], - "description": "Binds function that will be called on ui element action" + "description": "binds function that will be called on ui element action" }, { "alias": "set_visible", @@ -600,7 +600,7 @@ "description": "whether on not the referenced ui element is visible in ui" } ], - "description": "Changes visibility of referenced ui element" + "description": "sets visibility of referenced ui element" }, { "alias": "update", @@ -618,7 +618,7 @@ "description": "values that will be overriden (ui element specific type)" } ], - "description": "Updates values of referenced ui element" + "description": "updates values of referenced ui element" } ] } diff --git a/mkdocs.yml b/mkdocs.yml index d372f4e..29b3152 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,7 +16,6 @@ nav: - For developers: - Getting Started: ./for_developers/getting_started.md - API: - - "*": ./for_developers/api.md - _G: ./for_developers/api/_G.md - bit: ./for_developers/api/bit.md - client: ./for_developers/api/client.md From 349a0c2b1c2cd21740910eed6cac8704d68ed63f Mon Sep 17 00:00:00 2001 From: w7rus Date: Sat, 31 Oct 2020 18:46:48 +0700 Subject: [PATCH 12/23] Update docs/for_developers/api/_G.json (Add admonitions) Update docs/for_developers/api/bit.json (Add admonitions) Update docs/for_developers/api/client.json (Add admonitions) Update docs/for_developers/api/ui.json (Add admonitions) Update GenDoc (Add support for admonitions) --- GenDoc/GenDoc/Program.cs | 61 ++++++- docs/for_developers/api/_G.json | 59 ++++++- docs/for_developers/api/client.json | 236 +++++++++++++++++++++++++--- docs/for_developers/api/ui.json | 53 +++++-- mkdocs.yml | 4 +- 5 files changed, 366 insertions(+), 47 deletions(-) diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index decad69..ab8136a 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -15,6 +16,18 @@ internal enum GenDocType LuaNetPropsTableArray, } + public class Admonition + { + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("title")] + public string Title { get; set; } + + [JsonProperty("data")] + public string Data { get; set; } + } + public class LuaFunctionArgument { [JsonProperty("alias")] @@ -52,6 +65,9 @@ public class LuaFunction [JsonProperty("returns")] public List Returns { get; set; } + + [JsonProperty("admonitions")] + public List Admonitions { get; set; } } public class LuaFunctionsTable @@ -78,6 +94,27 @@ public static string GetFullPathWithoutExtension(string path) { return Path.Combine(Path.GetDirectoryName(path) ?? string.Empty, Path.GetFileNameWithoutExtension(path)); } + + public static List GetFilesDeep(string root, string regex, int depth) + { + var files = new List(); + + foreach (var directory in Directory.EnumerateDirectories(root)) + { + if (depth > 0) + files.AddRange(GetFilesDeep(directory, regex, depth - 1)); + } + + var filesFound = Directory.EnumerateFiles(root); + + foreach (var fileFound in filesFound) + { + if (Regex.Match(fileFound, regex).Success) + files.Add(fileFound); + } + + return files; + } } internal static class GenDoc @@ -104,6 +141,9 @@ internal static class GenDoc { stringBuilder.AppendLine($"### {luaFunction.Alias}\n"); + if (!string.IsNullOrEmpty(luaFunction.Description)) + stringBuilder.AppendLine($"{luaFunction.Description}\n"); + stringBuilder.Append( $"`{luaFunctionsTable.Alias}{(luaFunctionsTable.Alias.Contains("{}") ? ":" : ".")}{luaFunction.Alias}("); @@ -208,8 +248,21 @@ internal static class GenDoc stringBuilder.Append("\n"); } - if (!string.IsNullOrEmpty(luaFunction.Description)) - stringBuilder.AppendLine($"{luaFunction.Description}\n"); + /* + * Write admonitions + */ + + if (luaFunction.Admonitions != null && luaFunction.Admonitions.Count > 0) + { + foreach (var luaFunctionAdmonition in luaFunction.Admonitions) + { + stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\""); + + stringBuilder.AppendLine($" {luaFunctionAdmonition.Data}"); + + stringBuilder.Append("\n"); + } + } } } } @@ -249,9 +302,9 @@ internal class Program { private static void Main(string[] args) { - foreach (var s in args) + foreach (var filepath in Helper.GetFilesDeep(Path.Combine(Directory.GetCurrentDirectory(), args[0]), ".*\\.json$", 10)) { - GenDoc.ForFile(s); + GenDoc.ForFile(filepath); } } } diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/_G.json index 03160d5..96de99f 100644 --- a/docs/for_developers/api/_G.json +++ b/docs/for_developers/api/_G.json @@ -8,7 +8,19 @@ "alias": "defer", "arguments": [], "returns": [], - "description": "(obsolete) `shutdown` event" + "description": "(obsolete) `shutdown` event", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `client.set_event_callback` with `shutdown` as event parameter" + } + ] }, { "alias": "vector", @@ -47,7 +59,7 @@ "alias": "sPath", "type": "string", "optional": false, - "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + "description": "path to file" } ], "returns": [ @@ -56,7 +68,14 @@ "description": "contents of file" } ], - "description": "returns contents of provided file by path" + "description": "returns contents of file by provided path", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Argument `sPath` is relative to a `MOD` directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + } + ] }, { "alias": "vtable_bind", @@ -92,7 +111,14 @@ "description": "a C data object (a function pointer)" } ], - "description": "returns function (callable cdata object) bound to virtual function table method from module's interface. **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + "description": "returns function (callable cdata object) bound to virtual function table method from module's interface", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "The first argument `sTypeOf` must be a `void*` (a pointer to the interface)" + } + ] }, { "alias": "vtable_thunk", @@ -116,7 +142,19 @@ "description": "a C data object (a function pointer)" } ], - "description": "returns function (callable cdata object) thunked to virtual function table method from interface (the first argument must be a pointer to that interface). **Keep in mind that the first argument of `sTypeOf` must be a `void*` (a pointer to the interface)**" + "description": "returns function (callable cdata object) thunked to virtual function table method from interface.", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "The first argument passed to a function call must be a pointer to the interface" + }, + { + "type": "warning", + "title": "", + "data": "The first argument of ctype definition `sTypeOf` must be a `void*` (a pointer to the interface)" + } + ] }, { "alias": "writefile", @@ -125,7 +163,7 @@ "alias": "sPath", "type": "string", "optional": false, - "description": "path to file relative to MOD directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + "description": "path to file" }, { "alias": "sData", @@ -134,7 +172,14 @@ "description": "contents to write" } ], - "description": "writes contents to file" + "description": "writes contents to file by provided path", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Argument `sPath` is relative to a `MOD` directory, e.g. `...\\steamapps\\common\\Counter-Strike Global Offensive\\csgo`" + } + ] } ] } diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json index 62ca0f5..a0e7ad2 100644 --- a/docs/for_developers/api/client.json +++ b/docs/for_developers/api/client.json @@ -136,13 +136,35 @@ "alias": "draw_circle", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.circle`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.circle` instead" + } + ] }, { "alias": "draw_circle_outline", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.circle_outline`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.circle_outline` instead" + } + ] }, { "alias": "draw_debug_text", @@ -208,13 +230,31 @@ "description": "text to draw" } ], - "description": "draws text with provided color for required amount of time. **Keep in mind that it's better not to call this frequently**" + "description": "draws text with provided color for required amount of time", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "Avoid calling this function frequently" + } + ] }, { "alias": "draw_gradient", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.gradient`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.gradient` instead" + } + ] }, { "alias": "draw_hitboxes", @@ -268,31 +308,82 @@ "description": "server tick" } ], - "description": "draws hitbox capsule(s) with provided color for required amount of time and selected tick. **Keep in mind that it's better not to call this frequently**" + "description": "draws hitbox capsule(s) with provided color for required amount of time and selected tick", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "Avoid calling this function frequently" + } + ] }, { "alias": "draw_indicator", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.indicator`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.indicator` instead" + } + ] }, { "alias": "draw_line", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.line`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.line` instead" + } + ] }, { "alias": "draw_rectangle", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.rectangle`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.rectangle` instead" + } + ] }, { "alias": "draw_text", "arguments": [], "returns": [], - "description": "(obsolete) use `renderer.text`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.text` instead" + } + ] }, { "alias": "error_log", @@ -319,16 +410,23 @@ "alias": "sCommand", "type": "string", "optional": false, - "description": "command to execute (append `;` if passing more than one command)" + "description": "command to execute" }, { "alias": "...", "type": "variadic string", "optional": true, - "description": "commands to execute (`;` separated)" + "description": "commands to execute" } ], - "description": "executes game console command(s)" + "description": "executes game console command(s)", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "If passing multiple console commands, append `;` to each, e.g. `client.exec(\"disconnect;\", \"quit\")`" + } + ] }, { "alias": "eye_position", @@ -361,7 +459,7 @@ "alias": "sSignature", "type": "string", "optional": false, - "description": "a signature (as byte escape sequence, wildcard is `\\xCC`), e.g. `\\xB9\\xCC\\xCC\\xCC\\xCC\\x88\\x46\\x09`" + "description": "a signature, e.g. `\\xB9\\xCC\\xCC\\xCC\\xCC\\x88\\x46\\x09` (as byte escape sequence)" } ], "returns": [ @@ -370,13 +468,31 @@ "description": "a C data object (a void pointer)" } ], - "description": "returns pointer at signature match start inside specified module" + "description": "returns pointer at signature match start inside specified module", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Wildcard `? (IDA type)` for signatures is `\\xCC`" + } + ] }, { "alias": "get_cvar", "arguments": [], "returns": [], - "description": "(obsolete) use `cvar{}:get<_raw/>_`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `cvar{}:get<_raw/>_` instead" + } + ] }, { "alias": "get_model_name", @@ -412,7 +528,14 @@ "description": "-" } ], - "description": "returns whether the key is pressed" + "description": "returns whether the key is pressed", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "For more info about virtual key codes check [this article](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes)" + } + ] }, { "alias": "latency", @@ -524,7 +647,14 @@ "description": "a function that will be called on ui element action. **Entity index is passed to callback function as first argument**" } ], - "description": "sets function that is called for each player entity while drawing the ESP. **Keep in mind that this function requires `Visuals > Player > Flags` feature being active**" + "description": "sets function that is called for each player entity while drawing the ESP", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "This function requires `Visuals > Player > Flags` feature being active" + } + ] }, { "alias": "reload_active_scripts", @@ -566,7 +696,18 @@ "alias": "set_cvar", "arguments": [], "returns": [], - "description": "(obsolete) use `cvar{}:set<_raw/>_`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `cvar{}:set<_raw/>_` instead" + } + ] }, { "alias": "set_event_callback", @@ -575,7 +716,7 @@ "alias": "sEventAlias", "type": "string", "optional": false, - "description": "an event alias, e.g. `paint` or `player_connect_full` (game events and built-in cheat events, for more info check `For Developers > Events`)" + "description": "an event alias, e.g. `paint`, `player_connect_full` (game events and built-in cheat events)" }, { "alias": "fnCallback", @@ -584,7 +725,14 @@ "description": "a function that will be called when provided event is fired. **Event data is passed to callback function as first argument**" } ], - "description": "sets function that is called when specified even is fired" + "description": "sets function that is called when specified even is fired", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "For more info about events check `For Developers > Events`" + } + ] }, { "alias": "system_time", @@ -769,7 +917,7 @@ "alias": "sEventAlias", "type": "string", "optional": false, - "description": "an event alias, e.g. `paint` or `player_connect_full` (game events and built-in cheat events, for more info check `For Developers > Events`)" + "description": "an event alias, e.g. `paint`, `player_connect_full` (game events and built-in cheat events)" }, { "alias": "fnCallback", @@ -778,7 +926,14 @@ "description": "a function for which to unset the provided event" } ], - "description": "unsets function that have been bound to provided event" + "description": "unsets function that have been bound to provided event", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "For more info about events check `For Developers > Events`" + } + ] }, { "alias": "update_player_list", @@ -791,7 +946,7 @@ "alias": "nUserId", "type": "number", "optional": false, - "description": "a userId that is given by some game events, e.g. `player_connect_full` (for more info check `For Developers > Events`)" + "description": "a userId that is given by some game events, e.g. `player_connect_full`" } ], "returns": [ @@ -800,18 +955,47 @@ "description": "entity index" } ], - "description": "returns entity index by provided userId" + "description": "returns entity index by provided userId", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "For more info about events check `For Developers > Events`" + } + ] }, { "alias": "visible", "arguments": [], "returns": [], - "description": "(buggy)" + "admonitions": [ + { + "type": "bug", + "title": "", + "data": "This function is buggy, and returns unreliable results" + }, + { + "type": "tip", + "title": "", + "data": "Use `client.trace_line` instead" + } + ] }, { "alias": "world_to_screen", "arguments": [], - "description": "(obsolete) use `renderer.world_to_screen`" + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "This function is deprecated, and it's only available for compatibility reasons" + }, + { + "type": "tip", + "title": "", + "data": "Use `renderer.world_to_screen` instead" + } + ] } ] } diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json index 770af23..3489c82 100644 --- a/docs/for_developers/api/ui.json +++ b/docs/for_developers/api/ui.json @@ -44,7 +44,7 @@ "description": "y asix coordinate [px]" } ], - "description": "returns position of the menu as 2 values from top left of game's viewport" + "description": "returns position of the menu from top left of game's viewport" }, { "alias": "menu_size", @@ -58,7 +58,7 @@ "description": "height [px]" } ], - "description": "returns dimensions of the menu as 2 values" + "description": "returns dimensions of the menu" }, { "alias": "mouse_position", @@ -72,7 +72,7 @@ "description": "y asix coordinate [px]" } ], - "description": "returns position of the menu as 2 values" + "description": "returns position of the menu" }, { "alias": "name", @@ -312,7 +312,14 @@ "description": "a ui element reference" } ], - "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that reference of that ui element can be used only in `ui.set` and `ui.name`**" + "description": "returns reference of a newly created ui element at specified location in menu structure", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Reference of that ui element can only be used in `ui.set` and `ui.name`" + } + ] }, { "alias": "new_listbox", @@ -480,7 +487,14 @@ "description": "a ui element reference" } ], - "description": "returns reference of a newly created ui element. **This doesn't populate any ui elements visually**" + "description": "returns reference of a newly created ui element", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "No ui element is being populated visually" + } + ] }, { "alias": "new_textbox", @@ -510,7 +524,14 @@ "description": "a ui element reference" } ], - "description": "returns reference of a newly created ui element at specified location in menu structure. **Keep in mind that this element doesn't store it's value in configuration**" + "description": "returns reference of a newly created ui element at specified location in menu structure", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "This ui element doesn't store it's value into configuration" + } + ] }, { "alias": "reference", @@ -540,7 +561,14 @@ "description": "a ui element reference (multiple references if corresponding ui element contains inlined following ui elements)" } ], - "description": "returns a reference of a built-in ui element at specified location in menu structure. **Keep in mind that it's better not to call this more than once per enviroment**" + "description": "returns a reference of a built-in ui element at specified location in menu structure", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "Avoid calling this function more than once per enviroment" + } + ] }, { "alias": "set", @@ -579,10 +607,17 @@ "alias": "fnCallback", "type": "function", "optional": false, - "description": "a function that will be called on ui element action. **Reference to that ui element is passed to callback function as first argument**" + "description": "a function that will be called on ui element action" } ], - "description": "binds function that will be called on ui element action" + "description": "binds function that will be called on ui element action", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Reference of bound ui element is passed to callback function as first argument" + } + ] }, { "alias": "set_visible", diff --git a/mkdocs.yml b/mkdocs.yml index 29b3152..6ed4f84 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -44,4 +44,6 @@ theme: - navigation.instant - navigation.tabs extra_css: - - stylesheets/extra.css \ No newline at end of file + - stylesheets/extra.css +markdown_extensions: + - admonition \ No newline at end of file From 36b14eea7b8cb3216ea52cb67295273b40d145ac Mon Sep 17 00:00:00 2001 From: w7rus Date: Sat, 31 Oct 2020 20:37:01 +0700 Subject: [PATCH 13/23] Update docs/for_developers/api/config.json Update docs/for_developers/api/database.json Update docs/for_developers/api/globals.json Update docs/for_developers/api/json.json --- docs/for_developers/api/config.json | 47 ++++++++-- docs/for_developers/api/database.json | 35 ++++++- docs/for_developers/api/globals.json | 129 ++++++++++++++++++-------- docs/for_developers/api/json.json | 35 ++++++- 4 files changed, 190 insertions(+), 56 deletions(-) diff --git a/docs/for_developers/api/config.json b/docs/for_developers/api/config.json index b913ad1..8cbc00b 100644 --- a/docs/for_developers/api/config.json +++ b/docs/for_developers/api/config.json @@ -6,20 +6,51 @@ "functions": [ { "alias": "export", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sConfigAlias", + "type": "string", + "optional": false, + "description": "alias of the config" + } + ], + "returns": [ + { + "type": "string", + "description": "encrypted base64 config data" + } + ], + "description": "returns config data by provided alias as encrypted base64" }, { "alias": "import", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sConfigAlias", + "type": "string", + "optional": false, + "description": "alias of the config" + }, + { + "alias": "sConfigData", + "type": "string", + "optional": false, + "description": "encrypted base64 config data" + } + ], + "description": "writes config data by provided alias to config" }, { "alias": "load", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "sConfigAlias", + "type": "string", + "optional": false, + "description": "alias of the config" + } + ], + "description": "loads config by provided alias" } ] } diff --git a/docs/for_developers/api/database.json b/docs/for_developers/api/database.json index 81ef2bf..687089a 100644 --- a/docs/for_developers/api/database.json +++ b/docs/for_developers/api/database.json @@ -12,14 +12,39 @@ }, { "alias": "read", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sKey", + "type": "string", + "optional": false, + "description": "a key" + } + ], + "returns": [ + { + "type": "any", + "description": "a value" + } + ], + "description": "returns value stored in database by provided key" }, { "alias": "write", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "sKey", + "type": "string", + "optional": false, + "description": "a key" + }, + { + "alias": "value", + "type": "any", + "optional": false, + "description": "a value" + } + ], + "description": "writes value by provided key in database" } ] } diff --git a/docs/for_developers/api/globals.json b/docs/for_developers/api/globals.json index 2a33ac1..aaf8ac7 100644 --- a/docs/for_developers/api/globals.json +++ b/docs/for_developers/api/globals.json @@ -6,80 +6,133 @@ "functions": [ { "alias": "absoluteframetime", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "time (seconds)" + } + ], + "description": "returns time elapsed during last game frame" }, { "alias": "chokedcommands", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "amount of commands" + } + ], + "description": "returns amount of commands that are being held back" }, { "alias": "commandack", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "command number" + } + ], + "description": "returns last command number that the server acknowledged" }, { "alias": "curtime", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "time (seconds)" + } + ], + "description": "returns server's game time" }, { "alias": "framecount", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "amount of frames" + } + ], + "description": "returns total amount of frames drawn" }, { "alias": "frametime", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "time (seconds)" + } + ], + "description": "returns time that took frame to render" }, { "alias": "lastoutgoingcommand", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "command number" + } + ], + "description": "returns last command number that the client sent to server" }, { "alias": "mapname", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "string", + "description": "current map name" + } + ], + "description": "returns current map name that the server has" }, { "alias": "maxplayers", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "max amount of players" + } + ], + "description": "returns max amount of players that the server allows" }, { "alias": "oldcommandack", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "command number" + } + ], + "description": "returns previous command number that the server acknowledged" }, { "alias": "realtime", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "time (seconds)" + } + ], + "description": "returns local game time" }, { "alias": "tickcount", - "arguments": [], - "returns": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "amount of ticks" + } + ], + "description": "returns server's tickcount" }, { "alias": "tickinterval", - "arguments": [], - "description": "" + "returns": [ + { + "type": "number", + "description": "time (seconds)" + } + ], + "description": "returns time elapsed in one tick" } ] } diff --git a/docs/for_developers/api/json.json b/docs/for_developers/api/json.json index 5861100..b404388 100644 --- a/docs/for_developers/api/json.json +++ b/docs/for_developers/api/json.json @@ -42,14 +42,39 @@ }, { "alias": "parse", - "arguments": [], - "returns": [], - "description": "" + "arguments": [ + { + "alias": "sData", + "type": "string", + "optional": false, + "description": "inlined JSON to transform" + } + ], + "returns": [ + { + "type": "table", + "description": "table representation of a JSON" + } + ], + "description": "returns table representation of a JSON" }, { "alias": "stringify", - "arguments": [], - "description": "" + "arguments": [ + { + "alias": "tData", + "type": "table", + "optional": false, + "description": "table to transform" + } + ], + "returns": [ + { + "type": "string", + "description": "inlined JSON" + } + ], + "description": "returns JSON representation of a table" } ] } From 7f4649a7f80e7258df93b8387709fc194f57d498 Mon Sep 17 00:00:00 2001 From: "W7RUS-LAPTOP\\w7rus" Date: Sun, 1 Nov 2020 12:41:53 +0700 Subject: [PATCH 14/23] Update docs/for_developers/api/config.json --- docs/for_developers/api/config.json | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/docs/for_developers/api/config.json b/docs/for_developers/api/config.json index 8cbc00b..7e8d1b5 100644 --- a/docs/for_developers/api/config.json +++ b/docs/for_developers/api/config.json @@ -6,31 +6,17 @@ "functions": [ { "alias": "export", - "arguments": [ - { - "alias": "sConfigAlias", - "type": "string", - "optional": false, - "description": "alias of the config" - } - ], "returns": [ { "type": "string", "description": "encrypted base64 config data" } ], - "description": "returns config data by provided alias as encrypted base64" + "description": "returns current config data as encrypted base64" }, { "alias": "import", "arguments": [ - { - "alias": "sConfigAlias", - "type": "string", - "optional": false, - "description": "alias of the config" - }, { "alias": "sConfigData", "type": "string", @@ -38,7 +24,7 @@ "description": "encrypted base64 config data" } ], - "description": "writes config data by provided alias to config" + "description": "writes config data to current config" }, { "alias": "load", From 64e1b6f2316f5f4de0b52789a1ff247b8f7dddd1 Mon Sep 17 00:00:00 2001 From: w7rus Date: Sun, 1 Nov 2020 14:52:06 +0700 Subject: [PATCH 15/23] Update docs/stylesheets/extra.css (Add gamesense line. Update colors for code blocks) Add docs/for_developers/api/examples/* (Add example lua snippets) Updage GenDoc (Add examples support) --- GenDoc/GenDoc/Program.cs | 43 ++++++++++- docs/for_developers/api/_G.json | 12 +++ .../api/examples/vtable_bind.lua | 7 ++ .../api/examples/vtable_thunk.lua | 9 +++ docs/stylesheets/extra.css | 75 ++++++++++++++++++- mkdocs.yml | 7 +- 6 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 docs/for_developers/api/examples/vtable_bind.lua create mode 100644 docs/for_developers/api/examples/vtable_thunk.lua diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index ab8136a..f6e29b9 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -28,6 +28,18 @@ public class Admonition public string Data { get; set; } } + public class Example + { + [JsonProperty("title")] + public string Title { get; set; } + + [JsonProperty("language")] + public string Language { get; set; } + + [JsonProperty("data")] + public string Data { get; set; } + } + public class LuaFunctionArgument { [JsonProperty("alias")] @@ -77,6 +89,9 @@ public class LuaFunctionsTable [JsonProperty("functions")] public List Functions { get; set; } + + [JsonProperty("examples")] + public List Examples { get; set; } } public class Root @@ -137,6 +152,9 @@ internal static class GenDoc if (luaFunctionsTable.Functions == null) continue; + /* + * Write functions data + */ foreach (var luaFunction in luaFunctionsTable.Functions) { stringBuilder.AppendLine($"### {luaFunction.Alias}\n"); @@ -251,7 +269,6 @@ internal static class GenDoc /* * Write admonitions */ - if (luaFunction.Admonitions != null && luaFunction.Admonitions.Count > 0) { foreach (var luaFunctionAdmonition in luaFunction.Admonitions) @@ -264,6 +281,30 @@ internal static class GenDoc } } } + + /* + * Write examples data + */ + if (luaFunctionsTable.Examples != null && luaFunctionsTable.Examples.Count > 0) + { + stringBuilder.AppendLine("## Examples\n"); + + stringBuilder.AppendLine("??? example \"Examples\""); + + foreach (var example in luaFunctionsTable.Examples) + { + stringBuilder.AppendLine($"\n === \"{example.Title}\"\n"); + + stringBuilder.AppendLine($" ``` {example.Language} linenums=\"1\""); + + foreach (var exampleDataLine in example.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {exampleDataLine}"); + } + + stringBuilder.AppendLine(" ```"); + } + } } } }, diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/_G.json index 96de99f..cf404c0 100644 --- a/docs/for_developers/api/_G.json +++ b/docs/for_developers/api/_G.json @@ -181,6 +181,18 @@ } ] } + ], + "examples": [ + { + "title": "vtable_bind.lua", + "language": "lua", + "data": "--8<-- \"docs/for_developers/api/examples/vtable_bind.lua\"" + }, + { + "title": "vtable_thunk.lua", + "language": "lua", + "data": "--8<-- \"docs/for_developers/api/examples/vtable_thunk.lua\"" + } ] } ] diff --git a/docs/for_developers/api/examples/vtable_bind.lua b/docs/for_developers/api/examples/vtable_bind.lua new file mode 100644 index 0000000..a7433ae --- /dev/null +++ b/docs/for_developers/api/examples/vtable_bind.lua @@ -0,0 +1,7 @@ +local ffi = require("ffi") + +local fnGetConsoleVisible = vtable_bind("engine.dll", "VEngineClient014", 11, "bool(__thiscall*)(void*)") + +client.set_event_callback("paint_ui", function() + print(tostring(fnGetConsoleVisible())) +end) \ No newline at end of file diff --git a/docs/for_developers/api/examples/vtable_thunk.lua b/docs/for_developers/api/examples/vtable_thunk.lua new file mode 100644 index 0000000..a8a36c0 --- /dev/null +++ b/docs/for_developers/api/examples/vtable_thunk.lua @@ -0,0 +1,9 @@ +local ffi = require("ffi") + +local pEngineClient = client.create_interface("engine.dll", "VEngineClient014") or error("invalid interface", 2) + +local fnGetConsoleVisible = vtable_thunk(11, "bool(__thiscall*)(void*)") + +client.set_event_callback("paint_ui", function() + print(tostring(fnGetConsoleVisible(pEngineClient))) +end) \ No newline at end of file diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 6f99e75..be89255 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -30,12 +30,20 @@ /* Code highlighting color shades */ --md-code-hl-color: hsla(60, 100%, 50%, 0.5); - --md-code-hl-number-color: hsla(0, 67%, 50%, 1); + /* --md-code-hl-number-color: hsla(0, 67%, 50%, 1); --md-code-hl-special-color: hsla(340, 83%, 47%, 1); --md-code-hl-function-color: hsla(291, 45%, 50%, 1); --md-code-hl-constant-color: hsla(250, 63%, 60%, 1); --md-code-hl-keyword-color: hsla(219, 54%, 51%, 1); - --md-code-hl-string-color: hsla(150, 63%, 30%, 1); + --md-code-hl-string-color: hsla(150, 63%, 30%, 1); */ + + --md-code-hl-number-color: hsla(6, 74%, 63%, 1); + --md-code-hl-special-color: hsla(340, 83%, 66%, 1); + --md-code-hl-function-color: hsla(291, 57%, 65%, 1); + --md-code-hl-constant-color: hsla(250, 62%, 70%, 1); + --md-code-hl-keyword-color: hsla(219, 66%, 64%, 1); + --md-code-hl-string-color: hsla(150, 58%, 44%, 1); + --md-code-hl-name-color: var(--md-code-fg-color); --md-code-hl-operator-color: var(--md-default-fg-color--light); --md-code-hl-punctuation-color: var(--md-default-fg-color--light); @@ -69,9 +77,72 @@ --md-footer-fg-color--lighter: hsla(0, 0%, 100%, 0.3); --md-footer-bg-color: hsla(0, 0%, 0%, 0.87); --md-footer-bg-color--dark: hsla(0, 0%, 0%, 0.32); + + --md-footer-meta-fg-color: hsla(0, 0%, 0%, 1); + --md-footer-meta-fg-color--light: hsla(0, 0%, 0%, 0.7); + --md-footer-meta-fg-color--lighter: hsla(0, 0%, 0%, 0.3); } [data-md-color-scheme="gamesense"] .md-typeset table:not([class]) th { color: var(--md-default-fg-color) !important; background-color: var(--md-default-bg-color--light) !important; +} + +[data-md-color-scheme="gamesense"] .md-header, [data-md-color-scheme="gamesense"] .md-tabs { + color: var(--md-primary-fg-color) !important; + background-color: var(--md-primary-bg-color) !important; +} + +[data-md-color-scheme="gamesense"] .md-tabs { + color: var(--md-primary-fg-color) !important; + background-color: var(--md-primary-bg-color) !important; +} + +@-webkit-keyframes AnimationName { + 0%{background-position:0% 50%} + 50%{background-position:100% 50%} + 100%{background-position:0% 50%} +} +@-moz-keyframes AnimationName { + 0%{background-position:0% 50%} + 50%{background-position:100% 50%} + 100%{background-position:0% 50%} +} +@-o-keyframes AnimationName { + 0%{background-position:0% 50%} + 50%{background-position:100% 50%} + 100%{background-position:0% 50%} +} +@keyframes AnimationName { + 0%{background-position:0% 50%} + 50%{background-position:100% 50%} + 100%{background-position:0% 50%} +} + +[data-md-color-scheme="gamesense"] .md-header::after { + position: absolute; + display: block; + width: 100%; + height: 2px; + background: linear-gradient(to right, #1e5799 0%,#f300ff 50%,#e0ff00 100%); + content: ''; +} + +[data-md-color-scheme="gamesense"] .md-footer-meta { + background: linear-gradient(to right, #1e5799 0%,#f300ff 50%,#e0ff00 100%); + background-size: 600% 600%; + -webkit-animation: AnimationName 30s ease infinite; + -moz-animation: AnimationName 30s ease infinite; + -o-animation: AnimationName 30s ease infinite; + animation: AnimationName 30s ease infinite; + + color: var(--md-footer-meta-fg-color) !important; +} + +[data-md-color-scheme="gamesense"] .md-footer-copyright { + color: var(--md-footer-meta-fg-color--lighter) !important; +} + +[data-md-color-scheme="gamesense"] .md-footer-copyright a { + color: var(--md-footer-meta-fg-color--light) !important; } \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 6ed4f84..ec99e95 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -46,4 +46,9 @@ theme: extra_css: - stylesheets/extra.css markdown_extensions: - - admonition \ No newline at end of file + - admonition + - pymdownx.snippets + - pymdownx.highlight + - pymdownx.superfences + - pymdownx.tabbed + - pymdownx.details \ No newline at end of file From a95dd8aacc859ca30b03a8e50f07a8d5457b7096 Mon Sep 17 00:00:00 2001 From: w7rus Date: Sun, 1 Nov 2020 18:40:34 +0700 Subject: [PATCH 16/23] Update docs (Add events data) Update GenDoc (Add formatter for luaEventsTable) --- GenDoc/GenDoc/Program.cs | 135 +++- docs/for_developers/api/_G.json | 6 +- docs/for_developers/api/client.json | 46 +- docs/for_developers/api/ui.json | 12 +- docs/for_developers/events/events.json | 597 ++++++++++++++++++ .../events/examples/hitgroups.lua | 13 + .../events/examples/reasons.lua | 7 + .../events/examples/snaplines.lua | 58 ++ mkdocs.yml | 2 +- 9 files changed, 837 insertions(+), 39 deletions(-) create mode 100644 docs/for_developers/events/events.json create mode 100644 docs/for_developers/events/examples/hitgroups.lua create mode 100644 docs/for_developers/events/examples/reasons.lua create mode 100644 docs/for_developers/events/examples/snaplines.lua diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index f6e29b9..f603e8b 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -27,7 +27,6 @@ public class Admonition [JsonProperty("data")] public string Data { get; set; } } - public class Example { [JsonProperty("title")] @@ -40,6 +39,43 @@ public class Example public string Data { get; set; } } + public class LuaEventParameter + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + } + public class LuaEvent + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("parameters")] + public List Parameters { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + + [JsonProperty("admonitions")] + public List Admonitions { get; set; } + } + public class LuaEventsTable + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("events")] + public List Events { get; set; } + + [JsonProperty("examples")] + public List Examples { get; set; } + } + public class LuaFunctionArgument { [JsonProperty("alias")] @@ -54,7 +90,6 @@ public class LuaFunctionArgument [JsonProperty("description")] public string Description { get; set; } } - public class LuaFunctionReturn { [JsonProperty("type")] @@ -63,7 +98,6 @@ public class LuaFunctionReturn [JsonProperty("description")] public string Description { get; set; } } - public class LuaFunction { [JsonProperty("alias")] @@ -81,7 +115,6 @@ public class LuaFunction [JsonProperty("admonitions")] public List Admonitions { get; set; } } - public class LuaFunctionsTable { [JsonProperty("alias")] @@ -273,9 +306,12 @@ internal static class GenDoc { foreach (var luaFunctionAdmonition in luaFunction.Admonitions) { - stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\""); + stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\"\n"); - stringBuilder.AppendLine($" {luaFunctionAdmonition.Data}"); + foreach (var admonitionDataLine in luaFunctionAdmonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {admonitionDataLine}"); + } stringBuilder.Append("\n"); } @@ -302,6 +338,93 @@ internal static class GenDoc stringBuilder.AppendLine($" {exampleDataLine}"); } + stringBuilder.AppendLine(" ```"); + } + } + } + } + }, + { + GenDocType.LuaEventsArray, + (stringBuilder, jsonMapRoot) => + { + var jsonMapRootCastMyArray = jsonMapRoot.MyArray.ToObject>(); + + if (jsonMapRootCastMyArray == null) + return; + + foreach (var luaEventsTable in jsonMapRootCastMyArray) + { + stringBuilder.AppendLine($"## {luaEventsTable.Alias}\n\n---\n"); + + if (luaEventsTable.Events == null) continue; + + /* + * Write events data + */ + foreach (var luaEvent in luaEventsTable.Events) + { + stringBuilder.AppendLine($"### {luaEvent.Alias}\n"); + + if (!string.IsNullOrEmpty(luaEvent.Description)) + stringBuilder.AppendLine($"{luaEvent.Description}\n"); + + /* + * Write table of parameters + */ + if (luaEvent.Parameters != null && luaEvent.Parameters.Count > 0) + { + stringBuilder.AppendLine("|Parameter|Type|Description|"); + stringBuilder.AppendLine("|-|-|-|"); + + foreach (var luaEventParameter in luaEvent.Parameters) + { + stringBuilder.AppendLine( + $"|e{luaEventParameter.Alias}|{luaEventParameter.Type}|{luaEventParameter.Description}|"); + } + + stringBuilder.Append("\n"); + } + + /* + * Write admonitions + */ + if (luaEvent.Admonitions != null && luaEvent.Admonitions.Count > 0) + { + foreach (var luaFunctionAdmonition in luaEvent.Admonitions) + { + stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\"\n"); + + foreach (var admonitionDataLine in luaFunctionAdmonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {admonitionDataLine}"); + } + + stringBuilder.Append("\n"); + } + } + } + + /* + * Write examples data + */ + if (luaEventsTable.Examples != null && luaEventsTable.Examples.Count > 0) + { + stringBuilder.AppendLine("## Examples\n"); + + stringBuilder.AppendLine("??? example \"Examples\""); + + foreach (var example in luaEventsTable.Examples) + { + stringBuilder.AppendLine($"\n === \"{example.Title}\"\n"); + + stringBuilder.AppendLine($" ``` {example.Language} linenums=\"1\""); + + foreach (var exampleDataLine in example.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {exampleDataLine}"); + } + stringBuilder.AppendLine(" ```"); } } diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/_G.json index cf404c0..1c856bb 100644 --- a/docs/for_developers/api/_G.json +++ b/docs/for_developers/api/_G.json @@ -29,19 +29,19 @@ "alias": "nX", "type": "number", "optional": false, - "description": "x asix coordinate" + "description": "x asix coordinate (units)" }, { "alias": "nY", "type": "number", "optional": false, - "description": "y asix coordinate" + "description": "y asix coordinate (units)" }, { "alias": "nZ", "type": "number", "optional": false, - "description": "z asix coordinate" + "description": "z asix coordinate (units)" } ], "returns": [ diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/client.json index a0e7ad2..6f38cff 100644 --- a/docs/for_developers/api/client.json +++ b/docs/for_developers/api/client.json @@ -41,15 +41,15 @@ "returns": [ { "type": "number", - "description": "x asix coordinate" + "description": "x asix coordinate (units)" }, { "type": "number", - "description": "y asix coordinate" + "description": "y asix coordinate (units)" }, { "type": "number", - "description": "z asix coordinate" + "description": "z asix coordinate (units)" } ], "description": "returns camera world position coordinates" @@ -173,19 +173,19 @@ "alias": "nX", "type": "number", "optional": false, - "description": "x asix coordinate" + "description": "x asix coordinate (units)" }, { "alias": "nY", "type": "number", "optional": false, - "description": "y asix coordinate" + "description": "y asix coordinate (units)" }, { "alias": "nZ", "type": "number", "optional": false, - "description": "z asix coordinate" + "description": "z asix coordinate (units)" }, { "alias": "nLineOffset", @@ -433,15 +433,15 @@ "returns": [ { "type": "number", - "description": "x asix coordinate" + "description": "x asix coordinate (units)" }, { "type": "number", - "description": "y asix coordinate" + "description": "y asix coordinate (units)" }, { "type": "number", - "description": "z asix coordinate" + "description": "z asix coordinate (units)" } ], "description": "returns eye position of a local player entity" @@ -644,7 +644,7 @@ "alias": "fnCallback", "type": "function", "optional": false, - "description": "a function that will be called on ui element action. **Entity index is passed to callback function as first argument**" + "description": "a function that will be called on ui element action. **Entity index is passed to callback function as first parameter**" } ], "description": "sets function that is called for each player entity while drawing the ESP", @@ -722,7 +722,7 @@ "alias": "fnCallback", "type": "function", "optional": false, - "description": "a function that will be called when provided event is fired. **Event data is passed to callback function as first argument**" + "description": "a function that will be called when provided event is fired. **Event data is passed to callback function as first parameter**" } ], "description": "sets function that is called when specified even is fired", @@ -779,37 +779,37 @@ "alias": "nFromX", "type": "number", "optional": false, - "description": "x asix coordinate to trace from" + "description": "x asix coordinate (units) to trace from" }, { "alias": "nFromY", "type": "number", "optional": false, - "description": "y asix coordinate to trace from" + "description": "y asix coordinate (units) to trace from" }, { "alias": "nFromZ", "type": "number", "optional": false, - "description": "z asix coordinate to trace from" + "description": "z asix coordinate (units) to trace from" }, { "alias": "nToX", "type": "number", "optional": false, - "description": "x asix coordinate to trace to" + "description": "x asix coordinate (units) to trace to" }, { "alias": "nToY", "type": "number", "optional": false, - "description": "y asix coordinate to trace to" + "description": "y asix coordinate (units) to trace to" }, { "alias": "nToZ", "type": "number", "optional": false, - "description": "z asix coordinate to trace to" + "description": "z asix coordinate (units) to trace to" }, { "alias": "bSkipHitboxes", @@ -843,37 +843,37 @@ "alias": "nFromX", "type": "number", "optional": false, - "description": "x asix coordinate to trace from" + "description": "x asix coordinate (units) to trace from" }, { "alias": "nFromY", "type": "number", "optional": false, - "description": "y asix coordinate to trace from" + "description": "y asix coordinate (units) to trace from" }, { "alias": "nFromZ", "type": "number", "optional": false, - "description": "z asix coordinate to trace from" + "description": "z asix coordinate (units) to trace from" }, { "alias": "nToX", "type": "number", "optional": false, - "description": "x asix coordinate to trace to" + "description": "x asix coordinate (units) to trace to" }, { "alias": "nToY", "type": "number", "optional": false, - "description": "y asix coordinate to trace to" + "description": "y asix coordinate (units) to trace to" }, { "alias": "nToZ", "type": "number", "optional": false, - "description": "z asix coordinate to trace to" + "description": "z asix coordinate (units) to trace to" } ], "returns": [ diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/ui.json index 3489c82..593b1be 100644 --- a/docs/for_developers/api/ui.json +++ b/docs/for_developers/api/ui.json @@ -37,11 +37,11 @@ "returns": [ { "type": "number", - "description": "x asix coordinate [px]" + "description": "x asix coordinate (units) [px]" }, { "type": "number", - "description": "y asix coordinate [px]" + "description": "y asix coordinate (units) [px]" } ], "description": "returns position of the menu from top left of game's viewport" @@ -65,11 +65,11 @@ "returns": [ { "type": "number", - "description": "x asix coordinate [px]" + "description": "x asix coordinate (units) [px]" }, { "type": "number", - "description": "y asix coordinate [px]" + "description": "y asix coordinate (units) [px]" } ], "description": "returns position of the menu" @@ -436,7 +436,7 @@ "alias": "bShowTooltip", "type": "boolean", "optional": true, - "description": "whether or not to show current value of the slider" + "description": "whether to show current value of the slider" }, { "alias": "sUnit", @@ -615,7 +615,7 @@ { "type": "info", "title": "", - "data": "Reference of bound ui element is passed to callback function as first argument" + "data": "Reference of bound ui element is passed to callback function as first parameter" } ] }, diff --git a/docs/for_developers/events/events.json b/docs/for_developers/events/events.json new file mode 100644 index 0000000..2de6883 --- /dev/null +++ b/docs/for_developers/events/events.json @@ -0,0 +1,597 @@ +{ + "type": "LuaEventsArray", + "MyArray": [ + { + "alias": "events", + "events": [ + { + "alias": "paint", + "parameters": [ + { + "alias": "", + "type": "number", + "description": "a paint context `(obsolete) only available for compatibility reasons`" + } + ], + "description": "Fired every time the game renders a frame while being connected to the server, used to utilize `renderer.*` and `client.draw_*` functions", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "Prefer using this event only for visualization of data" + } + ] + }, + { + "alias": "paint_ui", + "description": "Fired every time the game renders a frame, used to utilize `renderer.*` functions", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "Prefer using this event only for visualization of data" + } + ] + }, + { + "alias": "run_command", + "parameters": [ + { + "alias": ".chokedcommands", + "type": "number", + "description": "amount of commands that are being held back" + }, + { + "alias": ".command_number", + "type": "number", + "description": "current command number" + } + ], + "description": "Fired every time the game runs a command (equally to server's tickrate) while local player is alive", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "This is the best event for processing data that changes when the game receives an update from the server and local player is alive" + } + ] + }, + { + "alias": "setup_command", + "parameters": [ + { + "alias": ".chokedcommands", + "type": "number", + "description": "amount of commands that are being held back" + }, + { + "alias": ".command_number", + "type": "number", + "description": "current command number" + }, + { + "alias": ".pitch", + "type": "number", + "description": "view pitch (degrees)" + }, + { + "alias": ".yaw", + "type": "number", + "description": "view yaw (degrees)" + }, + { + "alias": ".forwardmove", + "type": "number", + "description": "forward speed (units) [-450-450]" + }, + { + "alias": ".sidemove", + "type": "number", + "description": "right speed (units) [-450-450]" + }, + { + "alias": ".move_yaw", + "type": "number", + "description": "move yaw (degrees) (defaults to view yaw)" + }, + { + "alias": ".allow_send_packet", + "type": "boolean", + "description": "whether to hold back current packet" + }, + { + "alias": ".in_attack", + "type": "boolean", + "description": "whether IN_ATTACK button is pressed" + }, + { + "alias": ".in_jump", + "type": "boolean", + "description": "whether IN_JUMP button is pressed" + }, + { + "alias": ".in_duck", + "type": "boolean", + "description": "whether IN_DUCK button is pressed" + }, + { + "alias": ".in_forward", + "type": "boolean", + "description": "whether IN_FORWARD button is pressed" + }, + { + "alias": ".in_back", + "type": "boolean", + "description": "whether IN_BACK button is pressed" + }, + { + "alias": ".in_use", + "type": "boolean", + "description": "whether IN_USE button is pressed" + }, + { + "alias": ".in_cancel", + "type": "boolean", + "description": "whether IN_CANCEL button is pressed" + }, + { + "alias": ".in_left", + "type": "boolean", + "description": "whether IN_LEFT button is pressed" + }, + { + "alias": ".in_right", + "type": "boolean", + "description": "whether IN_RIGHT button is pressed" + }, + { + "alias": ".in_moveleft", + "type": "boolean", + "description": "whether IN_MOVELEFT button is pressed" + }, + { + "alias": ".in_moveright", + "type": "boolean", + "description": "whether IN_MOVERIGHT button is pressed" + }, + { + "alias": ".in_attack2", + "type": "boolean", + "description": "whether IN_ATTACK2 button is pressed" + }, + { + "alias": ".in_run", + "type": "boolean", + "description": "whether IN_RUN button is pressed" + }, + { + "alias": ".in_reload", + "type": "boolean", + "description": "whether IN_RELOAD button is pressed" + }, + { + "alias": ".in_alt1", + "type": "boolean", + "description": "whether IN_ALT1 button is pressed" + }, + { + "alias": ".in_alt2", + "type": "boolean", + "description": "whether IN_ALT2 button is pressed" + }, + { + "alias": ".in_score", + "type": "boolean", + "description": "whether IN_SCORE button is pressed" + }, + { + "alias": ".in_speed", + "type": "boolean", + "description": "whether IN_SPEED button is pressed" + }, + { + "alias": ".in_walk", + "type": "boolean", + "description": "whether IN_WALK button is pressed" + }, + { + "alias": ".in_zoom", + "type": "boolean", + "description": "whether IN_ZOOM button is pressed" + }, + { + "alias": ".in_weapon1", + "type": "boolean", + "description": "whether IN_WEAPON1 button is pressed" + }, + { + "alias": ".in_weapon2", + "type": "boolean", + "description": "whether IN_WEAPON2 button is pressed" + }, + { + "alias": ".in_bullrush", + "type": "boolean", + "description": "whether IN_BULLRUSH button is pressed" + }, + { + "alias": ".in_grenade1", + "type": "boolean", + "description": "whether IN_GRENADE1 button is pressed" + }, + { + "alias": ".in_grenade2", + "type": "boolean", + "description": "whether IN_GRENADE2 button is pressed" + }, + { + "alias": ".in_attack3", + "type": "boolean", + "description": "whether IN_ATTACK3 button is pressed" + }, + { + "alias": ".weaponselect", + "type": "number", + "description": "" + }, + { + "alias": ".weaponsubtype", + "type": "number", + "description": "" + } + ], + "description": "Fired every time the game prepares a move command that's sent to the server (equally to server's tickrate)", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "This is the best event for setting user input and should be used instead of `client.exec` whenever possible" + }, + { + "type": "info", + "title": "", + "data": "This is ran before cheat features like antiaim and can be used to modify user input (view angles, pressed keys, movement) how it's seen by the cheat" + } + ] + }, + { + "alias": "override_view", + "parameters": [ + { + "alias": ".x", + "type": "number", + "description": "x asix coordinate (units)" + }, + { + "alias": ".y", + "type": "number", + "description": "y asix coordinate (units)" + }, + { + "alias": ".z", + "type": "number", + "description": "z asix coordinate (units)" + }, + { + "alias": ".pitch", + "type": "number", + "description": "pitch (degrees)" + }, + { + "alias": ".yaw", + "type": "number", + "description": "yaw (degrees)" + }, + { + "alias": ".fov", + "type": "number", + "description": "vertical field of view (degrees)" + } + ], + "description": "Fired every time the game renders a frame, let's you override camera position and angles (limited)", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "Avoid using this event for anything else but view override" + } + ] + }, + { + "alias": "console_input", + "parameters": [ + { + "alias": "", + "type": "string", + "description": "console input" + } + ], + "description": "Fired every time user sumbmits console input, let's you handle the input", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "Return `true` to block processing of the input" + } + ] + }, + { + "alias": "player_chat", + "parameters": [ + { + "alias": ".teamonly", + "type": "boolean", + "description": "whether team chat was used" + }, + { + "alias": ".entity", + "type": "number", + "description": "entity index who sent the message" + }, + { + "alias": ".name", + "type": "string", + "description": "name of the player who sent the message" + }, + { + "alias": ".text", + "type": "string", + "description": "text that was in the message sent" + } + ], + "description": "Fired every time player sends a message to in-game chat" + }, + { + "alias": "string_cmd", + "parameters": [ + { + "alias": "", + "type": "string", + "description": "console command" + } + ], + "description": "Fired every time user sumbmits console command" + }, + { + "alias": "net_update_start", + "description": "Fired every time game starts to process entity updates from the server", + "admonitions": [ + { + "type": "warning", + "title": "", + "data": "Avoid using this event for modifying entity data" + } + ] + }, + { + "alias": "net_update_end", + "description": "Fired every time game starts to process entity updates from the server", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "This is the best event for processing entity data that changes when the game processed entity updates from the server" + } + ] + }, + { + "alias": "predict_command", + "parameters": [ + { + "alias": ".command_number", + "type": "number", + "description": "predicted command number" + } + ], + "description": "Fired every time game prediction is ran", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "This is the best event for processing entity data that changes when the game processed entity updates from the server" + } + ] + }, + { + "alias": "pre_render", + "description": "Fired every time the game prepares to render a frame while being connected to the server" + }, + { + "alias": "post_render", + "description": "Fired every time the game completed rendering a frame while being connected to the server" + }, + { + "alias": "aim_fire", + "parameters": [ + { + "alias": ".id", + "type": "number", + "description": "id of the shot, can be used to find corresponding `aim_him` / `aim_miss` event" + }, + { + "alias": ".target", + "type": "number", + "description": "entity index of the target" + }, + { + "alias": ".hit_chance", + "type": "number", + "description": "chance the shot will hit" + }, + { + "alias": ".hitgroup", + "type": "number", + "description": "target's entity hitgroup the shot was fired at" + }, + { + "alias": ".damage", + "type": "number", + "description": "predicted damage the shot will do to the target" + }, + { + "alias": ".backtrack", + "type": "number", + "description": "`(obsolete) only available for compatibility reasons`" + }, + { + "alias": ".boosted", + "type": "boolean", + "description": "whether accuracy boost feature was used to increase accuracy of the shot" + }, + { + "alias": ".high_priority", + "type": "boolean", + "description": "whether shot was fired at high priority record, e.g. `on-shot backtrack`" + }, + { + "alias": ".interpolated", + "type": "boolean", + "description": "whether entity state was interpolated" + }, + { + "alias": ".extrapolated", + "type": "boolean", + "description": "whether entity state was extrapolated (predicted)" + }, + { + "alias": ".teleported", + "type": "boolean", + "description": "whether entity was breaking lag compensation (teleporting)" + }, + { + "alias": ".tick", + "type": "number", + "description": "tickcount at which the show was fired, can be used in `client.draw_hitboxes`" + }, + { + "alias": ".x", + "type": "number", + "description": "x asix coordinate (units) of client-side shot position" + }, + { + "alias": ".y", + "type": "number", + "description": "y asix coordinate (units) of client-side shot position" + }, + { + "alias": ".z", + "type": "number", + "description": "z asix coordinate (units) of client-side shot position" + } + ], + "description": "Fired every time the ragebot aimbot fires at the target", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "This event requires `Rage > Other > Anti-aim correction` being active" + }, + { + "type": "note", + "title": "Hitgroups", + "data": "``` lua\n--8<-- \"docs/for_developers/events/examples/hitgroups.lua\"\n```" + } + ] + }, + { + "alias": "aim_hit", + "parameters": [ + { + "alias": ".id", + "type": "number", + "description": "id of the shot, can be used to find corresponding `aim_him` / `aim_miss` event" + }, + { + "alias": ".target", + "type": "number", + "description": "entity index of the target" + }, + { + "alias": ".hit_chance", + "type": "number", + "description": "(duplicate) same value as in `aim_fire` event" + }, + { + "alias": ".hitgroup", + "type": "number", + "description": "target's entity hitgroup the shot landed at" + }, + { + "alias": ".damage", + "type": "number", + "description": "actual damage the shot did to the target" + } + ], + "description": "Fired every time the ragebot aimbot hits the target", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "This event requires `Rage > Other > Anti-aim correction` being active" + }, + { + "type": "note", + "title": "Hitgroups", + "data": "``` lua\n--8<-- \"docs/for_developers/events/examples/hitgroups.lua\"\n```" + } + ] + }, + { + "alias": "aim_miss", + "parameters": [ + { + "alias": ".id", + "type": "number", + "description": "id of the shot, can be used to find corresponding `aim_him` / `aim_miss` event" + }, + { + "alias": ".target", + "type": "number", + "description": "entity index of the target" + }, + { + "alias": ".hit_chance", + "type": "number", + "description": "(duplicate) same value as in `aim_fire` event" + }, + { + "alias": ".hitgroup", + "type": "number", + "description": "(duplicate) same value as in `aim_fire` event" + }, + { + "alias": ".reason", + "type": "string", + "description": "reason due to which the a shot missed the target" + } + ], + "description": "Fired every time the ragebot aimbot misses the target", + "admonitions": [ + { + "type": "info", + "title": "", + "data": "This event requires `Rage > Other > Anti-aim correction` being active" + }, + { + "type": "note", + "title": "Hitgroups", + "data": "``` lua\n--8<-- \"docs/for_developers/events/examples/hitgroups.lua\"\n```" + }, + { + "type": "note", + "title": "Reasons", + "data": "``` lua\n--8<-- \"docs/for_developers/events/examples/reasons.lua\"\n```" + } + ] + } + ], + "examples": [ + { + "title": "snaplines.lua", + "language": "lua", + "data": "--8<-- \"docs/for_developers/events/examples/snaplines.lua\"" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/events/examples/hitgroups.lua b/docs/for_developers/events/examples/hitgroups.lua new file mode 100644 index 0000000..58aeb0b --- /dev/null +++ b/docs/for_developers/events/examples/hitgroups.lua @@ -0,0 +1,13 @@ +local tAimbotHitgroups = { + "Generic", + "Head", + "Chest", + "Stomach", + "Left Arm", + "Right Arm", + "Left Leg", + "Right Leg", + "Neck", + "?", + "Gear" +} \ No newline at end of file diff --git a/docs/for_developers/events/examples/reasons.lua b/docs/for_developers/events/examples/reasons.lua new file mode 100644 index 0000000..238fca3 --- /dev/null +++ b/docs/for_developers/events/examples/reasons.lua @@ -0,0 +1,7 @@ +local tAimbotMissReason = { + ["spread"] = "Spread" --and/or Tickbase desynced + ["prediction error"] = "Prediction Error" --and/or any of [Aimpunch, Game Mechanics] + ["death"] = "Death" --and/or any of [Ping, Loss] + ["unregistered shot"] = "Unregistered Shot" --and/or any of [Server state, Exploits] + ["?"] = "?" --and/or any of [Resolver, LC Breaker Prediction, Desynced Map Data, Damage rejection, Event Timeout] +} diff --git a/docs/for_developers/events/examples/snaplines.lua b/docs/for_developers/events/examples/snaplines.lua new file mode 100644 index 0000000..e70b04d --- /dev/null +++ b/docs/for_developers/events/examples/snaplines.lua @@ -0,0 +1,58 @@ +local nLocalPlayer = nil +local nPlayerResource = nil +local tPlayers = {} +local nPlayersCount = 0 + +client.set_event_callback("player_connect_full", function(e) + if entity.get_local_player() == client.userid_to_entindex(e.userid) then + nLocalPlayer = entity.get_local_player() + nPlayerResource = entity.get_player_resource() + end +end) + +client.set_event_callback("level_init", function() + nLocalPlayer = nil + nPlayerResource = nil +end) + +client.set_event_callback("net_update_end", function() + if not(nLocalPlayer and nPlayerResource) then + nLocalPlayer = entity.get_local_player() + nPlayerResource = entity.get_player_resource() + + return + end + + tEntities = entity.get_all() + + tPlayers = {} + nPlayersCount = 0 + + for nIter1 = 1, #tEntities do + local nEntityIndex = tEntities[nIter1] + if entity.get_classname(nEntityIndex) == "CCSPlayer" then + nPlayersCount = nPlayersCount + 1 + tPlayers[nPlayersCount] = nEntityIndex + end + end +end) + +client.set_event_callback("paint", function() + tViewportDimensions = {client.screen_size()} + + if not(nLocalPlayer and nPlayerResource) then + return + end + + for nIter1 = 1, nPlayersCount do + nEntityIndex = tPlayers[nIter1] + + tEntityWorldOrigin = {entity.get_prop(nEntityIndex, "m_vecOrigin")} + + tEntityScreenOrigin = {renderer.world_to_screen(unpack(tEntityWorldOrigin))} + + if tEntityScreenOrigin[1] and tEntityScreenOrigin[2] then + renderer.line(tViewportDimensions[1] / 2, tViewportDimensions[2] / 2, tEntityScreenOrigin[1], tEntityScreenOrigin[2], 255, 255, 255, 255) + end + end +end) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ec99e95..6464783 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,7 +33,7 @@ nav: - plist: ./for_developers/api/plist.md - renderer: ./for_developers/api/renderer.md - ui: ./for_developers/api/ui.md - - Events: ./for_developers/events.md + - Events: ./for_developers/events/events.md - Netprops: ./for_developers/netprops.md - Tips & Tricks: ./for_developers/tips_and_tricks.md theme: From aa77a735755df36930949945d866143108a8e2bd Mon Sep 17 00:00:00 2001 From: w7rus Date: Mon, 2 Nov 2020 13:57:24 +0700 Subject: [PATCH 17/23] Update directory structure of docs Add sample json models for netprops, features Update GenDoc (Skip empty json files. Skip unknown types) --- GenDoc/GenDoc/Program.cs | 13 +- docs/for_developers/api/{ => data}/_G.json | 0 docs/for_developers/api/{ => data}/bit.json | 0 .../for_developers/api/{ => data}/client.json | 0 .../for_developers/api/{ => data}/config.json | 0 .../for_developers/api/{ => data}/cvar{}.json | 0 .../api/{ => data}/database.json | 0 .../for_developers/api/{ => data}/entity.json | 0 docs/for_developers/api/{ => data}/ffi.json | 0 .../api/{ => data}/globals.json | 0 docs/for_developers/api/{ => data}/json.json | 0 .../api/{ => data}/materialsystem.json | 0 .../api/{ => data}/materialsystem{}.json | 0 .../api/{ => data}/panorama.json | 0 docs/for_developers/api/{ => data}/plist.json | 0 .../api/{ => data}/renderer.json | 0 docs/for_developers/api/{ => data}/ui.json | 0 .../api/{ => data}/vector{}.json | 0 .../{events.json => data/cheat_events.json} | 0 .../netprops/data/DT_AnimTimeMustBeFirst.json | 14 ++ .../netprops/data/DT_BaseEntity.json | 182 ++++++++++++++++++ docs/for_users/features/data/legitbot.json | 46 +++++ docs/index.md | 2 + mkdocs.yml | 65 ++++--- 24 files changed, 291 insertions(+), 31 deletions(-) rename docs/for_developers/api/{ => data}/_G.json (100%) rename docs/for_developers/api/{ => data}/bit.json (100%) rename docs/for_developers/api/{ => data}/client.json (100%) rename docs/for_developers/api/{ => data}/config.json (100%) rename docs/for_developers/api/{ => data}/cvar{}.json (100%) rename docs/for_developers/api/{ => data}/database.json (100%) rename docs/for_developers/api/{ => data}/entity.json (100%) rename docs/for_developers/api/{ => data}/ffi.json (100%) rename docs/for_developers/api/{ => data}/globals.json (100%) rename docs/for_developers/api/{ => data}/json.json (100%) rename docs/for_developers/api/{ => data}/materialsystem.json (100%) rename docs/for_developers/api/{ => data}/materialsystem{}.json (100%) rename docs/for_developers/api/{ => data}/panorama.json (100%) rename docs/for_developers/api/{ => data}/plist.json (100%) rename docs/for_developers/api/{ => data}/renderer.json (100%) rename docs/for_developers/api/{ => data}/ui.json (100%) rename docs/for_developers/api/{ => data}/vector{}.json (100%) rename docs/for_developers/events/{events.json => data/cheat_events.json} (100%) create mode 100644 docs/for_developers/netprops/data/DT_AnimTimeMustBeFirst.json create mode 100644 docs/for_developers/netprops/data/DT_BaseEntity.json create mode 100644 docs/for_users/features/data/legitbot.json diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index f603e8b..f934b6f 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -13,7 +13,7 @@ internal enum GenDocType { LuaFunctionsTableArray, LuaEventsArray, - LuaNetPropsTableArray, + LuaNetpropsDTArray, } public class Admonition @@ -435,7 +435,8 @@ internal static class GenDoc private static void ForType(GenDocType type, StringBuilder stringBuilder, Root jsonMapRoot) { - TypeToAction[type](stringBuilder, jsonMapRoot); + if (TypeToAction.ContainsKey(type)) + TypeToAction[type](stringBuilder, jsonMapRoot); } public static void ForFile(string path) @@ -454,9 +455,13 @@ public static void ForFile(string path) var jsonMapRoot = JsonConvert.DeserializeObject(streamReader.ReadToEndAsync().Result); - var docType = (GenDocType)Enum.Parse(typeof(GenDocType), jsonMapRoot.Type); + if (jsonMapRoot == null) return; - ForType(docType, stringBuilder, jsonMapRoot); + Enum.TryParse(typeof(GenDocType), jsonMapRoot.Type, out var docType); + + if (docType == null) return; + + ForType((GenDocType)docType, stringBuilder, jsonMapRoot); streamWriter.Write(stringBuilder); } diff --git a/docs/for_developers/api/_G.json b/docs/for_developers/api/data/_G.json similarity index 100% rename from docs/for_developers/api/_G.json rename to docs/for_developers/api/data/_G.json diff --git a/docs/for_developers/api/bit.json b/docs/for_developers/api/data/bit.json similarity index 100% rename from docs/for_developers/api/bit.json rename to docs/for_developers/api/data/bit.json diff --git a/docs/for_developers/api/client.json b/docs/for_developers/api/data/client.json similarity index 100% rename from docs/for_developers/api/client.json rename to docs/for_developers/api/data/client.json diff --git a/docs/for_developers/api/config.json b/docs/for_developers/api/data/config.json similarity index 100% rename from docs/for_developers/api/config.json rename to docs/for_developers/api/data/config.json diff --git a/docs/for_developers/api/cvar{}.json b/docs/for_developers/api/data/cvar{}.json similarity index 100% rename from docs/for_developers/api/cvar{}.json rename to docs/for_developers/api/data/cvar{}.json diff --git a/docs/for_developers/api/database.json b/docs/for_developers/api/data/database.json similarity index 100% rename from docs/for_developers/api/database.json rename to docs/for_developers/api/data/database.json diff --git a/docs/for_developers/api/entity.json b/docs/for_developers/api/data/entity.json similarity index 100% rename from docs/for_developers/api/entity.json rename to docs/for_developers/api/data/entity.json diff --git a/docs/for_developers/api/ffi.json b/docs/for_developers/api/data/ffi.json similarity index 100% rename from docs/for_developers/api/ffi.json rename to docs/for_developers/api/data/ffi.json diff --git a/docs/for_developers/api/globals.json b/docs/for_developers/api/data/globals.json similarity index 100% rename from docs/for_developers/api/globals.json rename to docs/for_developers/api/data/globals.json diff --git a/docs/for_developers/api/json.json b/docs/for_developers/api/data/json.json similarity index 100% rename from docs/for_developers/api/json.json rename to docs/for_developers/api/data/json.json diff --git a/docs/for_developers/api/materialsystem.json b/docs/for_developers/api/data/materialsystem.json similarity index 100% rename from docs/for_developers/api/materialsystem.json rename to docs/for_developers/api/data/materialsystem.json diff --git a/docs/for_developers/api/materialsystem{}.json b/docs/for_developers/api/data/materialsystem{}.json similarity index 100% rename from docs/for_developers/api/materialsystem{}.json rename to docs/for_developers/api/data/materialsystem{}.json diff --git a/docs/for_developers/api/panorama.json b/docs/for_developers/api/data/panorama.json similarity index 100% rename from docs/for_developers/api/panorama.json rename to docs/for_developers/api/data/panorama.json diff --git a/docs/for_developers/api/plist.json b/docs/for_developers/api/data/plist.json similarity index 100% rename from docs/for_developers/api/plist.json rename to docs/for_developers/api/data/plist.json diff --git a/docs/for_developers/api/renderer.json b/docs/for_developers/api/data/renderer.json similarity index 100% rename from docs/for_developers/api/renderer.json rename to docs/for_developers/api/data/renderer.json diff --git a/docs/for_developers/api/ui.json b/docs/for_developers/api/data/ui.json similarity index 100% rename from docs/for_developers/api/ui.json rename to docs/for_developers/api/data/ui.json diff --git a/docs/for_developers/api/vector{}.json b/docs/for_developers/api/data/vector{}.json similarity index 100% rename from docs/for_developers/api/vector{}.json rename to docs/for_developers/api/data/vector{}.json diff --git a/docs/for_developers/events/events.json b/docs/for_developers/events/data/cheat_events.json similarity index 100% rename from docs/for_developers/events/events.json rename to docs/for_developers/events/data/cheat_events.json diff --git a/docs/for_developers/netprops/data/DT_AnimTimeMustBeFirst.json b/docs/for_developers/netprops/data/DT_AnimTimeMustBeFirst.json new file mode 100644 index 0000000..fd60b81 --- /dev/null +++ b/docs/for_developers/netprops/data/DT_AnimTimeMustBeFirst.json @@ -0,0 +1,14 @@ +{ + "type": "LuaNetpropsDTArray", + "MyArray": [ + { + "alias": "DT_AnimTimeMustBeFirst", + "netprops": [ + { + "alias": "m_flAnimTime", + "type": "float" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_developers/netprops/data/DT_BaseEntity.json b/docs/for_developers/netprops/data/DT_BaseEntity.json new file mode 100644 index 0000000..8666470 --- /dev/null +++ b/docs/for_developers/netprops/data/DT_BaseEntity.json @@ -0,0 +1,182 @@ +{ + "type": "LuaNetpropsDTArray", + "MyArray": [ + { + "alias": "DT_BaseEntity", + "inherits": [ + "DT_AnimTimeMustBeFirst", + "DT_CollisionProperty" + ], + "netprops": [ + { + "alias": "m_flSimulationTime", + "type": "integer" + }, + { + "alias": "m_cellbits", + "type": "integer" + }, + { + "alias": "m_cellX", + "type": "integer" + }, + { + "alias": "m_cellY", + "type": "integer" + }, + { + "alias": "m_cellZ", + "type": "integer" + }, + { + "alias": "m_vecOrigin", + "type": "vector" + }, + { + "alias": "m_nModelIndex", + "type": "integer" + }, + { + "alias": "m_nRenderFX", + "type": "integer" + }, + { + "alias": "m_nRenderMode", + "type": "integer" + }, + { + "alias": "m_fEffects", + "type": "integer" + }, + { + "alias": "m_clrRender", + "type": "integer" + }, + { + "alias": "m_iTeamNum", + "type": "integer" + }, + { + "alias": "m_iPendingTeamNum", + "type": "integer" + }, + { + "alias": "m_CollisionGroup", + "type": "integer" + }, + { + "alias": "m_flElasticity", + "type": "float" + }, + { + "alias": "m_flShadowCastDistance", + "type": "float" + }, + { + "alias": "m_hOwnerEntity", + "type": "integer" + }, + { + "alias": "m_hEffectEntity", + "type": "integer" + }, + { + "alias": "moveparent", + "type": "integer" + }, + { + "alias": "m_iParentAttachment", + "type": "integer" + }, + { + "alias": "m_iName", + "type": "string" + }, + { + "alias": "movetype", + "type": "integer" + }, + { + "alias": "movecollide", + "type": "integer" + }, + { + "alias": "m_angRotation", + "type": "vector" + }, + { + "alias": "m_iTextureFrameIndex", + "type": "integer" + }, + { + "alias": "m_bSimulatedEveryTick", + "type": "integer" + }, + { + "alias": "m_bAnimatedEveryTick", + "type": "integer" + }, + { + "alias": "m_bAlternateSorting", + "type": "integer" + }, + { + "alias": "m_bSpotted", + "type": "integer" + }, + { + "alias": "m_bSpottedByMask", + "type": "array[0-1]" + }, + { + "alias": "m_bIsAutoaimTarget", + "type": "integer" + }, + { + "alias": "m_fadeMinDist", + "type": "float" + }, + { + "alias": "m_fadeMaxDist", + "type": "float" + }, + { + "alias": "m_flFadeScale", + "type": "float" + }, + { + "alias": "m_nMinCPULevel", + "type": "integer" + }, + { + "alias": "m_nMaxCPULevel", + "type": "integer" + }, + { + "alias": "m_nMinGPULevel", + "type": "integer" + }, + { + "alias": "m_nMaxGPULevel", + "type": "integer" + }, + { + "alias": "m_flUseLookAtAngle", + "type": "float" + }, + { + "alias": "m_flLastMadeNoiseTime", + "type": "float" + }, + { + "alias": "m_flMaxFallVelocity", + "type": "float" + }, + { + "alias": "m_bEligibleForScreenHighlight", + "type": "integer" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/for_users/features/data/legitbot.json b/docs/for_users/features/data/legitbot.json new file mode 100644 index 0000000..296f742 --- /dev/null +++ b/docs/for_users/features/data/legitbot.json @@ -0,0 +1,46 @@ +{ + "type": "CheatFeaturesArray", + "MyArray": [ + { + "alias": "Legitbot", + "refalias": "LEGIT", + "description": "", + "containers": [ + { + "alias": "Weapon Type", + "refalias": "Weapon Type", + "description": "", + "elements": [ + { + "alias": "Weapon Type", + "refalias": "Weapon Type", + "type": "string", + "description": "", + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "Sample admonition for element" + } + ] + } + ], + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "Sample admonition for container" + } + ] + } + ], + "admonitions": [ + { + "type": "tip", + "title": "", + "data": "Sample admonition for tab" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index eb36c2b..3d38e40 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,3 +3,5 @@ This website documents the usage of gamesense.pub features for users and developers. All content is split by categories. Use navigation bar and/or search to find what you interested in. + +(Search does not work in `serve` mode) diff --git a/mkdocs.yml b/mkdocs.yml index 6464783..31f3572 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,37 +4,48 @@ nav: - For users: - Getting Started: ./for_users/getting_started.md - Features: - - Legitbot: ./for_users/features/legitbot.md - - Ragebot: ./for_users/features/ragebot.md - - Antiaim: ./for_users/features/antiaim.md - - Visuals: ./for_users/features/visuals.md - - Misc: ./for_users/features/misc.md - - Settings: ./for_users/features/settings.md - - Skinchanger: ./for_users/features/skinchanger.md - - Playerlist: ./for_users/features/playerlist.md + - Legitbot: ./for_users/features/legitbot.md # Autogenerated + - Ragebot: ./for_users/features/ragebot.md # Autogenerated + - Antiaim: ./for_users/features/antiaim.md # Autogenerated + - Visuals: ./for_users/features/visuals.md # Autogenerated + - Misc: ./for_users/features/misc.md # Autogenerated + - Settings: ./for_users/features/settings.md # Autogenerated + - Skinchanger: ./for_users/features/skinchanger.md # Autogenerated + - Playerlist: ./for_users/features/playerlist.md # Autogenerated - Common issues & Troubleshooting: ./for_users/common_issues_and_troubleshooting.md - For developers: - Getting Started: ./for_developers/getting_started.md - API: - - _G: ./for_developers/api/_G.md - - bit: ./for_developers/api/bit.md - - client: ./for_developers/api/client.md - - config: ./for_developers/api/config.md - - cvar{}: ./for_developers/api/cvar{}.md - - database: ./for_developers/api/database.md - - entity: ./for_developers/api/entity.md - - globals: ./for_developers/api/globals.md - - json: ./for_developers/api/json.md - - materialsystem: ./for_developers/api/materialsystem.md - - materialsystem{}: ./for_developers/api/materialsystem{}.md - - ffi: ./for_developers/api/ffi.md - - vector{}: ./for_developers/api/vector{}.md - - panorama: ./for_developers/api/panorama.md - - plist: ./for_developers/api/plist.md - - renderer: ./for_developers/api/renderer.md - - ui: ./for_developers/api/ui.md - - Events: ./for_developers/events/events.md - - Netprops: ./for_developers/netprops.md + - About: ./for_developers/api/about.md #Some basic info about api + - List: + - _G: ./for_developers/api/data/_G.md # Autogenerated + - bit: ./for_developers/api/data/bit.md # Autogenerated + - client: ./for_developers/api/data/client.md # Autogenerated + - config: ./for_developers/api/data/config.md # Autogenerated + - cvar{}: ./for_developers/api/data/cvar{}.md # Autogenerated + - database: ./for_developers/api/data/database.md # Autogenerated + - entity: ./for_developers/api/data/entity.md # Autogenerated + - globals: ./for_developers/api/data/globals.md # Autogenerated + - json: ./for_developers/api/data/json.md # Autogenerated + - materialsystem: ./for_developers/api/data/materialsystem.md # Autogenerated + - materialsystem{}: ./for_developers/api/data/materialsystem{}.md # Autogenerated + - ffi: ./for_developers/api/data/ffi.md # Autogenerated + - vector{}: ./for_developers/api/data/vector{}.md # Autogenerated + - panorama: ./for_developers/api/data/panorama.md # Autogenerated + - plist: ./for_developers/api/data/plist.md # Autogenerated + - renderer: ./for_developers/api/data/renderer.md # Autogenerated + - ui: ./for_developers/api/data/ui.md # Autogenerated + - Events: + - About: ./for_developers/events/about.md #Some basic info about events + - List: + - Cheat Events: ./for_developers/events/data/cheat_events.md # Autogenerated + - Source Events: ./for_developers/events/data/source_events.md # Autogenerated + - "Counter-Strike: Global Offensive Events": ./for_developers/events/data/csgo_events.md # Autogenerated + - Netprops: + - About: ./for_developers/netprops/about.md + - List: + - DT_AnimTimeMustBeFirst: ./for_developers/netprops/data/DT_AnimTimeMustBeFirst.md # Autogenerated + - DT_BaseEntity: ./for_developers/netprops/data/DT_BaseEntity.md # Autogenerated - Tips & Tricks: ./for_developers/tips_and_tricks.md theme: name: material From 6e3dbd95e2533a6e6bdd43234acbc4697a8dbd75 Mon Sep 17 00:00:00 2001 From: w7rus Date: Mon, 2 Nov 2020 14:01:37 +0700 Subject: [PATCH 18/23] Add LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fc060ab --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2019] [gamesensical] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 249f814f9874849b36ffff5378ad622905e99556 Mon Sep 17 00:00:00 2001 From: w7rus Date: Mon, 2 Nov 2020 17:55:57 +0700 Subject: [PATCH 19/23] Update GenDoc (Add formatter for luaNetpropsDT) --- GenDoc/GenDoc/Program.cs | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index f934b6f..5837dd5 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -39,6 +39,26 @@ public class Example public string Data { get; set; } } + public class LuaNetprop + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + } + public class LuaNetpropDT + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("inherits")] + public List Inherits { get; set; } + + [JsonProperty("netprops")] + public List Netprops { get; set; } + } + public class LuaEventParameter { [JsonProperty("alias")] @@ -431,6 +451,55 @@ internal static class GenDoc } } }, + { + GenDocType.LuaNetpropsDTArray, + (stringBuilder, jsonMapRoot) => + { + var jsonMapRootCastMyArray = jsonMapRoot.MyArray.ToObject>(); + + if (jsonMapRootCastMyArray == null) + return; + + foreach (var luaNetpropDt in jsonMapRootCastMyArray) + { + stringBuilder.AppendLine($"## {luaNetpropDt.Alias}\n\n---\n"); + + /* + * Write inherits + */ + if (luaNetpropDt.Inherits != null && luaNetpropDt.Inherits.Count > 0) + { + stringBuilder.AppendLine("### Inherits\n"); + + stringBuilder.AppendLine("!!! info \"\""); + + foreach (var inherit in luaNetpropDt.Inherits) + { + stringBuilder.AppendLine($" [{inherit}](./{inherit}.md)\n"); + } + } + + /* + * Write table of parameters + */ + if (luaNetpropDt.Netprops != null && luaNetpropDt.Netprops.Count > 0) + { + stringBuilder.AppendLine("### Members\n"); + + stringBuilder.AppendLine("|Member|Type|"); + stringBuilder.AppendLine("|-|-|"); + + foreach (var netprop in luaNetpropDt.Netprops) + { + stringBuilder.AppendLine( + $"|{netprop.Alias}|{netprop.Type}|"); + } + + stringBuilder.Append("\n"); + } + } + } + }, }; private static void ForType(GenDocType type, StringBuilder stringBuilder, Root jsonMapRoot) From d936d04b66e50e1cda1d1677b1f5beb1b095ee77 Mon Sep 17 00:00:00 2001 From: w7rus Date: Mon, 2 Nov 2020 19:45:03 +0700 Subject: [PATCH 20/23] Update GenDocs (Add formatter for CheatFeatures) --- GenDoc/GenDoc/Program.cs | 178 +++++++++++++++++- .../netprops/data/DT_BaseEntity.json | 62 +++--- docs/for_users/features/data/legitbot.json | 18 +- mkdocs.yml | 16 +- 4 files changed, 217 insertions(+), 57 deletions(-) diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index 5837dd5..33d7a99 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -14,6 +14,7 @@ internal enum GenDocType LuaFunctionsTableArray, LuaEventsArray, LuaNetpropsDTArray, + CheatFeaturesArray } public class Admonition @@ -39,6 +40,58 @@ public class Example public string Data { get; set; } } + public class CheatFeatureContainerElement + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("refalias")] + public string RefAlias { get; set; } + + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + + [JsonProperty("admonitions")] + public List Admonitions { get; set; } + } + public class CheatFeatureContainer + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("refalias")] + public string RefAlias { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + + [JsonProperty("elements")] + public List Elements { get; set; } + + [JsonProperty("admonitions")] + public List Admonitions { get; set; } + } + public class CheatFeature + { + [JsonProperty("alias")] + public string Alias { get; set; } + + [JsonProperty("refalias")] + public string RefAlias { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + + [JsonProperty("containers")] + public List Containers { get; set; } + + [JsonProperty("admonitions")] + public List Admonitions { get; set; } + } + public class LuaNetprop { [JsonProperty("alias")] @@ -324,11 +377,11 @@ internal static class GenDoc */ if (luaFunction.Admonitions != null && luaFunction.Admonitions.Count > 0) { - foreach (var luaFunctionAdmonition in luaFunction.Admonitions) + foreach (var admonition in luaFunction.Admonitions) { - stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\"\n"); + stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); - foreach (var admonitionDataLine in luaFunctionAdmonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) { stringBuilder.AppendLine($" {admonitionDataLine}"); } @@ -411,11 +464,11 @@ internal static class GenDoc */ if (luaEvent.Admonitions != null && luaEvent.Admonitions.Count > 0) { - foreach (var luaFunctionAdmonition in luaEvent.Admonitions) + foreach (var admonition in luaEvent.Admonitions) { - stringBuilder.AppendLine($"!!! {luaFunctionAdmonition.Type} \"{luaFunctionAdmonition.Title}\"\n"); + stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); - foreach (var admonitionDataLine in luaFunctionAdmonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) { stringBuilder.AppendLine($" {admonitionDataLine}"); } @@ -500,6 +553,119 @@ internal static class GenDoc } } }, + { + GenDocType.CheatFeaturesArray, + (stringBuilder, jsonMapRoot) => + { + var jsonMapRootCastMyArray = jsonMapRoot.MyArray.ToObject>(); + + if (jsonMapRootCastMyArray == null) + return; + + foreach (var cheatFeature in jsonMapRootCastMyArray) + { + stringBuilder.AppendLine($"## {cheatFeature.Alias}\n\n---\n"); + + if (!string.IsNullOrEmpty(cheatFeature.RefAlias)) + stringBuilder.AppendLine($"Reference by: `{cheatFeature.RefAlias}`\n"); + + if (!string.IsNullOrEmpty(cheatFeature.Description)) + stringBuilder.AppendLine($"{cheatFeature.Description}\n"); + + /* + * Write admonitions + */ + if (cheatFeature.Admonitions != null && cheatFeature.Admonitions.Count > 0) + { + foreach (var admonition in cheatFeature.Admonitions) + { + stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); + + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {admonitionDataLine}"); + } + + stringBuilder.Append("\n"); + } + } + + /* + * Write containers + */ + if (cheatFeature.Containers != null && cheatFeature.Containers.Count > 0) + { + stringBuilder.AppendLine($"??? abstract \"Containers\"\n"); + + foreach (var container in cheatFeature.Containers) + { + stringBuilder.AppendLine($" ### {container.Alias}\n\n ---\n"); + + if (!string.IsNullOrEmpty(container.RefAlias)) + stringBuilder.AppendLine($" Reference by: `{container.RefAlias}`\n"); + + if (!string.IsNullOrEmpty(container.Description)) + stringBuilder.AppendLine($" {container.Description}\n"); + + /* + * Write admonitions + */ + if (container.Admonitions != null && container.Admonitions.Count > 0) + { + foreach (var admonition in container.Admonitions) + { + stringBuilder.AppendLine($" !!! {admonition.Type} \"{admonition.Title}\"\n"); + + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {admonitionDataLine}"); + } + + stringBuilder.Append("\n"); + } + } + + /* + * Write elements + */ + if (container.Elements != null && container.Elements.Count > 0) + { + stringBuilder.AppendLine($" ??? abstract \"Elements\"\n"); + + foreach (var element in container.Elements) + { + stringBuilder.AppendLine($" #### {element.Alias}\n\n ---\n"); + + if (!string.IsNullOrEmpty(element.RefAlias)) + stringBuilder.AppendLine($" Reference by: `{element.RefAlias}`, Value type: `({element.Type})`\n"); + + if (!string.IsNullOrEmpty(element.Description)) + stringBuilder.AppendLine($" {element.Description}\n"); + + /* + * Write admonitions + */ + if (element.Admonitions != null && element.Admonitions.Count > 0) + { + foreach (var admonition in element.Admonitions) + { + stringBuilder.AppendLine($" !!! {admonition.Type} \"{admonition.Title}\"\n"); + + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($" {admonitionDataLine}"); + } + + stringBuilder.Append("\n"); + } + } + } + } + } + } + } + } + }, }; private static void ForType(GenDocType type, StringBuilder stringBuilder, Root jsonMapRoot) diff --git a/docs/for_developers/netprops/data/DT_BaseEntity.json b/docs/for_developers/netprops/data/DT_BaseEntity.json index 8666470..20eec25 100644 --- a/docs/for_developers/netprops/data/DT_BaseEntity.json +++ b/docs/for_developers/netprops/data/DT_BaseEntity.json @@ -10,23 +10,23 @@ "netprops": [ { "alias": "m_flSimulationTime", - "type": "integer" + "type": "int" }, { "alias": "m_cellbits", - "type": "integer" + "type": "int" }, { "alias": "m_cellX", - "type": "integer" + "type": "int" }, { "alias": "m_cellY", - "type": "integer" + "type": "int" }, { "alias": "m_cellZ", - "type": "integer" + "type": "int" }, { "alias": "m_vecOrigin", @@ -34,35 +34,35 @@ }, { "alias": "m_nModelIndex", - "type": "integer" + "type": "int" }, { "alias": "m_nRenderFX", - "type": "integer" + "type": "int" }, { "alias": "m_nRenderMode", - "type": "integer" + "type": "int" }, { "alias": "m_fEffects", - "type": "integer" + "type": "int" }, { "alias": "m_clrRender", - "type": "integer" + "type": "int" }, { "alias": "m_iTeamNum", - "type": "integer" + "type": "int" }, { "alias": "m_iPendingTeamNum", - "type": "integer" + "type": "int" }, { "alias": "m_CollisionGroup", - "type": "integer" + "type": "int" }, { "alias": "m_flElasticity", @@ -74,19 +74,19 @@ }, { "alias": "m_hOwnerEntity", - "type": "integer" + "type": "int" }, { "alias": "m_hEffectEntity", - "type": "integer" + "type": "int" }, { "alias": "moveparent", - "type": "integer" + "type": "int" }, { "alias": "m_iParentAttachment", - "type": "integer" + "type": "int" }, { "alias": "m_iName", @@ -94,11 +94,11 @@ }, { "alias": "movetype", - "type": "integer" + "type": "int" }, { "alias": "movecollide", - "type": "integer" + "type": "int" }, { "alias": "m_angRotation", @@ -106,31 +106,31 @@ }, { "alias": "m_iTextureFrameIndex", - "type": "integer" + "type": "int" }, { "alias": "m_bSimulatedEveryTick", - "type": "integer" + "type": "int" }, { "alias": "m_bAnimatedEveryTick", - "type": "integer" + "type": "int" }, { "alias": "m_bAlternateSorting", - "type": "integer" + "type": "int" }, { "alias": "m_bSpotted", - "type": "integer" + "type": "int" }, { "alias": "m_bSpottedByMask", - "type": "array[0-1]" + "type": "(int)array[0-1]" }, { "alias": "m_bIsAutoaimTarget", - "type": "integer" + "type": "int" }, { "alias": "m_fadeMinDist", @@ -146,19 +146,19 @@ }, { "alias": "m_nMinCPULevel", - "type": "integer" + "type": "int" }, { "alias": "m_nMaxCPULevel", - "type": "integer" + "type": "int" }, { "alias": "m_nMinGPULevel", - "type": "integer" + "type": "int" }, { "alias": "m_nMaxGPULevel", - "type": "integer" + "type": "int" }, { "alias": "m_flUseLookAtAngle", @@ -174,7 +174,7 @@ }, { "alias": "m_bEligibleForScreenHighlight", - "type": "integer" + "type": "int" } ] } diff --git a/docs/for_users/features/data/legitbot.json b/docs/for_users/features/data/legitbot.json index 296f742..878daa1 100644 --- a/docs/for_users/features/data/legitbot.json +++ b/docs/for_users/features/data/legitbot.json @@ -4,41 +4,35 @@ { "alias": "Legitbot", "refalias": "LEGIT", - "description": "", + "description": "A legitbot tab", "containers": [ { "alias": "Weapon Type", "refalias": "Weapon Type", - "description": "", + "description": "A container", "elements": [ { "alias": "Weapon Type", "refalias": "Weapon Type", "type": "string", - "description": "", + "description": "Element for switching legitbot weapon type configuration", "admonitions": [ { "type": "tip", "title": "", - "data": "Sample admonition for element" + "data": "Automatically changes to active local player weapon" } ] } ], - "admonitions": [ - { - "type": "tip", - "title": "", - "data": "Sample admonition for container" - } - ] + "admonitions": [] } ], "admonitions": [ { "type": "tip", "title": "", - "data": "Sample admonition for tab" + "data": "Features in this tab are inactive, when Ragebot is active" } ] } diff --git a/mkdocs.yml b/mkdocs.yml index 31f3572..fee8794 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,14 +4,14 @@ nav: - For users: - Getting Started: ./for_users/getting_started.md - Features: - - Legitbot: ./for_users/features/legitbot.md # Autogenerated - - Ragebot: ./for_users/features/ragebot.md # Autogenerated - - Antiaim: ./for_users/features/antiaim.md # Autogenerated - - Visuals: ./for_users/features/visuals.md # Autogenerated - - Misc: ./for_users/features/misc.md # Autogenerated - - Settings: ./for_users/features/settings.md # Autogenerated - - Skinchanger: ./for_users/features/skinchanger.md # Autogenerated - - Playerlist: ./for_users/features/playerlist.md # Autogenerated + - Legitbot: ./for_users/features/data/legitbot.md # Autogenerated + - Ragebot: ./for_users/features/data/ragebot.md # Autogenerated + - Antiaim: ./for_users/features/data/antiaim.md # Autogenerated + - Visuals: ./for_users/features/data/visuals.md # Autogenerated + - Misc: ./for_users/features/data/misc.md # Autogenerated + - Settings: ./for_users/features/data/settings.md # Autogenerated + - Skinchanger: ./for_users/features/data/skinchanger.md # Autogenerated + - Playerlist: ./for_users/features/data/playerlist.md # Autogenerated - Common issues & Troubleshooting: ./for_users/common_issues_and_troubleshooting.md - For developers: - Getting Started: ./for_developers/getting_started.md From ff8df8eb3fb3d5e2783cfbdb1e5df35e8b594747 Mon Sep 17 00:00:00 2001 From: w7rus Date: Wed, 4 Nov 2020 18:20:57 +0700 Subject: [PATCH 21/23] Update GenDoc (Move repeated code into local functions) --- GenDoc/GenDoc/Program.cs | 246 ++++++------------ .../GenDoc.csproj.FileListAbsolute.txt | 6 +- 2 files changed, 85 insertions(+), 167 deletions(-) diff --git a/GenDoc/GenDoc/Program.cs b/GenDoc/GenDoc/Program.cs index 33d7a99..0abd844 100644 --- a/GenDoc/GenDoc/Program.cs +++ b/GenDoc/GenDoc/Program.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; @@ -240,6 +241,51 @@ public static List GetFilesDeep(string root, string regex, int depth) internal static class GenDoc { + private static void WriteAdmonitions(StringBuilder stringBuilder, IReadOnlyCollection admonitions, int padLevel = 0) + { + if (admonitions == null || admonitions.Count <= 0) return; + + var padding = new string(' ', padLevel * 4); + + foreach (var admonition in admonitions) + { + stringBuilder.AppendLine($"{padding}!!! {admonition.Type} \"{admonition.Title}\"\n"); + + foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($"{padding} {admonitionDataLine}"); + } + + stringBuilder.Append("\n"); + } + } + + private static void WriteExamples(StringBuilder stringBuilder, IReadOnlyCollection examples, + int padLevel = 0) + { + if (examples == null || examples.Count <= 0) return; + + var padding = new string(' ', padLevel * 4); + + stringBuilder.AppendLine($"{padding}## Examples\n"); + + stringBuilder.AppendLine($"{padding}??? example \"Examples\""); + + foreach (var example in examples) + { + stringBuilder.AppendLine($"\n{padding} === \"{example.Title}\"\n"); + + stringBuilder.AppendLine($"{padding} ``` {example.Language} linenums=\"1\""); + + foreach (var exampleDataLine in example.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) + { + stringBuilder.AppendLine($"{padding} {exampleDataLine}"); + } + + stringBuilder.AppendLine($"{padding} ```"); + } + } + private static readonly Dictionary> TypeToAction = new Dictionary> { @@ -372,48 +418,10 @@ internal static class GenDoc stringBuilder.Append("\n"); } - /* - * Write admonitions - */ - if (luaFunction.Admonitions != null && luaFunction.Admonitions.Count > 0) - { - foreach (var admonition in luaFunction.Admonitions) - { - stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); - - foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {admonitionDataLine}"); - } - - stringBuilder.Append("\n"); - } - } + WriteAdmonitions(stringBuilder, luaFunction.Admonitions); } - /* - * Write examples data - */ - if (luaFunctionsTable.Examples != null && luaFunctionsTable.Examples.Count > 0) - { - stringBuilder.AppendLine("## Examples\n"); - - stringBuilder.AppendLine("??? example \"Examples\""); - - foreach (var example in luaFunctionsTable.Examples) - { - stringBuilder.AppendLine($"\n === \"{example.Title}\"\n"); - - stringBuilder.AppendLine($" ``` {example.Language} linenums=\"1\""); - - foreach (var exampleDataLine in example.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {exampleDataLine}"); - } - - stringBuilder.AppendLine(" ```"); - } - } + WriteExamples(stringBuilder, luaFunctionsTable.Examples); } } }, @@ -459,48 +467,10 @@ internal static class GenDoc stringBuilder.Append("\n"); } - /* - * Write admonitions - */ - if (luaEvent.Admonitions != null && luaEvent.Admonitions.Count > 0) - { - foreach (var admonition in luaEvent.Admonitions) - { - stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); - - foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {admonitionDataLine}"); - } - - stringBuilder.Append("\n"); - } - } + WriteAdmonitions(stringBuilder, luaEvent.Admonitions); } - /* - * Write examples data - */ - if (luaEventsTable.Examples != null && luaEventsTable.Examples.Count > 0) - { - stringBuilder.AppendLine("## Examples\n"); - - stringBuilder.AppendLine("??? example \"Examples\""); - - foreach (var example in luaEventsTable.Examples) - { - stringBuilder.AppendLine($"\n === \"{example.Title}\"\n"); - - stringBuilder.AppendLine($" ``` {example.Language} linenums=\"1\""); - - foreach (var exampleDataLine in example.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {exampleDataLine}"); - } - - stringBuilder.AppendLine(" ```"); - } - } + WriteExamples(stringBuilder, luaEventsTable.Examples); } } }, @@ -562,105 +532,53 @@ internal static class GenDoc if (jsonMapRootCastMyArray == null) return; - foreach (var cheatFeature in jsonMapRootCastMyArray) + static void PrintDetails(StringBuilder stringBuilder, object objectData, int padLevel) { - stringBuilder.AppendLine($"## {cheatFeature.Alias}\n\n---\n"); + var padding = new string(' ', padLevel * 4); - if (!string.IsNullOrEmpty(cheatFeature.RefAlias)) - stringBuilder.AppendLine($"Reference by: `{cheatFeature.RefAlias}`\n"); + dynamic objectDataCast = objectData switch + { + CheatFeature data => data, + CheatFeatureContainer data => data, + CheatFeatureContainerElement data => data, + _ => null + }; - if (!string.IsNullOrEmpty(cheatFeature.Description)) - stringBuilder.AppendLine($"{cheatFeature.Description}\n"); + if (objectDataCast == null) return; - /* - * Write admonitions - */ - if (cheatFeature.Admonitions != null && cheatFeature.Admonitions.Count > 0) - { - foreach (var admonition in cheatFeature.Admonitions) - { - stringBuilder.AppendLine($"!!! {admonition.Type} \"{admonition.Title}\"\n"); + stringBuilder.AppendLine($"{padding}## {objectDataCast.Alias}\n\n{padding}---\n"); - foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {admonitionDataLine}"); - } + if (!string.IsNullOrEmpty(objectDataCast.RefAlias)) stringBuilder.AppendLine($"{padding}Reference by: `{objectDataCast.RefAlias}`\n"); - stringBuilder.Append("\n"); - } - } + if (!string.IsNullOrEmpty(objectDataCast.Description)) stringBuilder.AppendLine($"{padding}{objectDataCast.Description}\n"); + } + + foreach (var cheatFeature in jsonMapRootCastMyArray) + { + PrintDetails(stringBuilder, cheatFeature, 0); + WriteAdmonitions(stringBuilder, cheatFeature.Admonitions); /* * Write containers */ - if (cheatFeature.Containers != null && cheatFeature.Containers.Count > 0) - { - stringBuilder.AppendLine($"??? abstract \"Containers\"\n"); - - foreach (var container in cheatFeature.Containers) - { - stringBuilder.AppendLine($" ### {container.Alias}\n\n ---\n"); - - if (!string.IsNullOrEmpty(container.RefAlias)) - stringBuilder.AppendLine($" Reference by: `{container.RefAlias}`\n"); - - if (!string.IsNullOrEmpty(container.Description)) - stringBuilder.AppendLine($" {container.Description}\n"); - - /* - * Write admonitions - */ - if (container.Admonitions != null && container.Admonitions.Count > 0) - { - foreach (var admonition in container.Admonitions) - { - stringBuilder.AppendLine($" !!! {admonition.Type} \"{admonition.Title}\"\n"); + if (cheatFeature.Containers == null || cheatFeature.Containers.Count <= 0) continue; + stringBuilder.AppendLine("??? abstract \"Containers\"\n"); - foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {admonitionDataLine}"); - } - - stringBuilder.Append("\n"); - } - } + foreach (var container in cheatFeature.Containers) + { + PrintDetails(stringBuilder, container, 1); + WriteAdmonitions(stringBuilder, container.Admonitions, 1); - /* + /* * Write elements */ - if (container.Elements != null && container.Elements.Count > 0) - { - stringBuilder.AppendLine($" ??? abstract \"Elements\"\n"); - - foreach (var element in container.Elements) - { - stringBuilder.AppendLine($" #### {element.Alias}\n\n ---\n"); - - if (!string.IsNullOrEmpty(element.RefAlias)) - stringBuilder.AppendLine($" Reference by: `{element.RefAlias}`, Value type: `({element.Type})`\n"); - - if (!string.IsNullOrEmpty(element.Description)) - stringBuilder.AppendLine($" {element.Description}\n"); + if (container.Elements == null || container.Elements.Count <= 0) continue; + stringBuilder.AppendLine(" ??? abstract \"Elements\"\n"); - /* - * Write admonitions - */ - if (element.Admonitions != null && element.Admonitions.Count > 0) - { - foreach (var admonition in element.Admonitions) - { - stringBuilder.AppendLine($" !!! {admonition.Type} \"{admonition.Title}\"\n"); - - foreach (var admonitionDataLine in admonition.Data.Split(new[] { "\n", Environment.NewLine }, StringSplitOptions.None)) - { - stringBuilder.AppendLine($" {admonitionDataLine}"); - } - - stringBuilder.Append("\n"); - } - } - } - } + foreach (var element in container.Elements) + { + PrintDetails(stringBuilder, element, 2); + WriteAdmonitions(stringBuilder, element.Admonitions, 2); } } } diff --git a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt index a2f503e..69323d5 100644 --- a/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt +++ b/GenDoc/GenDoc/obj/Debug/netcoreapp3.1/GenDoc.csproj.FileListAbsolute.txt @@ -1,13 +1,13 @@ D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.exe -D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csprojAssemblyReference.cache -D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfoInputs.cache -D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfo.cs D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.deps.json D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.runtimeconfig.json D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.runtimeconfig.dev.json D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.dll D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\GenDoc.pdb D:\Git\gamesense_docs\GenDoc\GenDoc\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csprojAssemblyReference.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfoInputs.cache +D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.AssemblyInfo.cs D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csproj.CoreCompileInputs.cache D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.csproj.CopyComplete D:\Git\gamesense_docs\GenDoc\GenDoc\obj\Debug\netcoreapp3.1\GenDoc.dll From 832246d3ae757adb6c5d85df9dbfae0343befafd Mon Sep 17 00:00:00 2001 From: "h4xr0x.cc#1337" <65768277+h4xrOx@users.noreply.github.com> Date: Fri, 2 Sep 2022 13:04:34 -0500 Subject: [PATCH 22/23] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..81b6958 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# gamesense_docs +Documentation usage of gamesense.pub features for users and developers. (WIP) From 1a40508b0886d8319e0eb56d94574391efb36265 Mon Sep 17 00:00:00 2001 From: h4xr0x#1337 <65768277+h4xrOx@users.noreply.github.com> Date: Thu, 15 Sep 2022 01:05:20 -0500 Subject: [PATCH 23/23] Create dotnet-desktop.yml Signed-off-by: h4xr0x#1337 <65768277+h4xrOx@users.noreply.github.com> --- .github/workflows/dotnet-desktop.yml | 115 +++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..ae601d0 --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,115 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow will build, test, sign and package a WPF or Windows Forms desktop application +# built on .NET Core. +# To learn how to migrate your existing application to .NET Core, +# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework +# +# To configure this workflow: +# +# 1. Configure environment variables +# GitHub sets default environment variables for every workflow run. +# Replace the variables relative to your project in the "env" section below. +# +# 2. Signing +# Generate a signing certificate in the Windows Application +# Packaging Project or add an existing signing certificate to the project. +# Next, use PowerShell to encode the .pfx file using Base64 encoding +# by running the following Powershell script to generate the output string: +# +# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte +# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' +# +# Open the output file, SigningCertificate_Encoded.txt, and copy the +# string inside. Then, add the string to the repo as a GitHub secret +# and name it "Base64_Encoded_Pfx." +# For more information on how to configure your signing certificate for +# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing +# +# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". +# See "Build the Windows Application Packaging project" below to see how the secret is used. +# +# For more information on GitHub Actions, refer to https://github.com/features/actions +# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, +# refer to https://github.com/microsoft/github-actions-for-desktop-apps + +name: .NET Core Desktop + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + strategy: + matrix: + configuration: [Debug, Release] + + runs-on: windows-latest # For a list of available runner types, refer to + # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + + env: + Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. + Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} + + # Decode the base 64 encoded pfx and save the Signing_Certificate + - name: Decode the pfx + run: | + $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") + $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx + [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) + + # Create the app package by building and packaging the Windows Application Packaging project + - name: Create the app package + run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Bundle_Platforms: x86|x64 + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Remove the pfx + - name: Remove the pfx + run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx + + # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: MSIX Package + path: ${{ env.Wap_Project_Directory }}\AppPackages