Ejemplo n.º 1
0
    def prepare_class_name(self,
                           oop: FunctionOOP):
        """
        Prepares OOP class name
        """
        if '|' in oop.class_name:
            oop.class_name = re.match(self.CLASS_NAME_SELECTOR,
                                      oop.class_name).group(2)

        oop.class_name = oop.class_name.lower()
        oop.class_name = TypeConverter(oop.class_name).convert()
Ejemplo n.º 2
0
    def prepare_constructor(self,
                            oop: FunctionOOP,
                            function_base: FunctionData):
        """
        Prepares OOP constructor method
        """
        if oop.field is None and oop.is_static and oop.method is None:
            method = deepcopy(function_base)
            method.signature.name = 'constructor'

            oop.method = method
            oop.is_static = False
Ejemplo n.º 3
0
    def prepare_resolve_multiple_signatures(self, data: FunctionOOP) -> \
            List[FunctionOOP]:
        if not data.method:
            return []

        out_list = [data.method]
        FilterDumpProcessFunctions.resolve_multiple_signatures(out_list, 0)
        if len(out_list) > 1:
            return list(
                map(
                    lambda list_data: FunctionOOP(
                        description=data.description,
                        class_name=data.class_name,
                        base_function_name=data.base_function_name,
                        method=list_data,
                        field=data.field,
                        is_static=data.is_static,
                    ),
                    out_list[1:]
                )
            )

        return []
     FunctionOOP(
         description=None,
         base_function_name="engineApplyShaderToWorldTexture",
         class_name='shader',
         method=FunctionData(
     signature=FunctionSignature(
         name='applyToWorldTexture',
         return_types=FunctionReturnTypes(
             return_types=[
                 FunctionType(
                             names=['bool'],
                             is_optional=False,
                         )
             ],
             variable_length=False,
         ),
         arguments=FunctionArgumentValues(
             arguments=[
                 [
                     FunctionArgument(
                         name='shader',
                         argument_type=FunctionType(
                             names=['element'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ],
                 [
                     FunctionArgument(
                         name='textureName',
                         argument_type=FunctionType(
                             names=['string'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ],
                 [
                     FunctionArgument(
                         name='targetElement',
                         argument_type=FunctionType(
                             names=['element'],
                             is_optional=True,
                         ),
                         default_value='nil',
                     )
                 ],
                 [
                     FunctionArgument(
                         name='appendLayers',
                         argument_type=FunctionType(
                             names=['bool'],
                             is_optional=True,
                         ),
                         default_value='true',
                     )
                 ]
             ],
             variable_length=False,
         ),
         generic_types=[
             
         ],
     ),
     docs=FunctionDoc(
         description='This function applies a shader to one or more world textures.\n* The resource Shader_examples#Texture_names|shader_tex_names can help in finding the names of world textures.\n* When replacing the texture for a ped using the CJ skin, set textureName to CJ\n* The shader inherits the render states of the original when it is drawn, so texture stage 0 will already be set to the original texture.\n* When using with a ped, ensure you have set ped or all in the elementTypes when calling dxCreateShader\n* CJ body parts textures can be replaced by using: cj_ped_head, cj_ped_hat, cj_ped_torso, cj_ped_legs, cj_ped_feet, cj_ped_glasses, cj_ped_necklace, cj_ped_watch and cj_ped_extra1. Latest version of http://wiki.multitheftauto.com/wiki/Shader_examples#Texture_names shader_tex_names will show what is being used.' ,
         arguments={
             "shader": """The shader which is to be applied """,
             "textureName": """The name of the world texture to apply the shader to. Wildcard matching e.g. ro?ds* can be used to apply to more than one texture at a time. """,
             "targetElement": """The element to restrict applying the shader to. If this is not set the shader will be applied to everything using the texture name. Valid element types for targetElement are vehicle|vehicles, Object|objects and Ped|peds. """,
             "appendLayers": """allows two or more layered shaders to be applied in the same texture. You may want to modify the DepthBias in the technique pass to avoid Z-fighting artifacts when using this. """
         },
         result='returns true if the shader was successfully applied, false otherwise.' ,
     ),
     url='engineApplyShaderToWorldTexture',
 ),
         field=None,
         is_static=False,
     )
Ejemplo n.º 5
0
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createProjectile",
                class_name='Projectile',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
    CompoundOOPData(
        server=[],
        client=[],
    ),
    CompoundOOPData(
        server=[],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="getProjectileCounter",
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            
        ],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createSearchLight",
                class_name='Element/Searchlight|SearchLight',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
    CompoundOOPData(
        server=[
            
        ],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="getSearchLightEndPosition",
                class_name='Element/Searchlight|searchLight',
                method=FunctionData(
            FunctionOOP(
                description=
                """This OOP syntax is for [[Element/Weapon|custom weapons]] only.""",
                base_function_name="getWeaponProperty",
                class_name='Element/Weapon|weapon',
                method=FunctionData(
                    signature=FunctionSignature(
                        name='getProperty',
                        return_types=FunctionReturnTypes(
                            return_types=[
                                FunctionType(
                                    names=['int'],
                                    is_optional=False,
                                )
                            ],
                            variable_length=False,
                        ),
                        arguments=FunctionArgumentValues(
                            arguments=[[
                                FunctionArgument(
                                    name='weaponID',
                                    argument_type=FunctionType(
                                        names=['int'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                ),
                                FunctionArgument(
                                    name='weaponName',
                                    argument_type=FunctionType(
                                        names=['string'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                                       [
                                           FunctionArgument(
                                               name='weaponSkill',
                                               argument_type=FunctionType(
                                                   names=['string'],
                                                   is_optional=False,
                                               ),
                                               default_value=None,
                                           )
                                       ],
                                       [
                                           FunctionArgument(
                                               name='property',
                                               argument_type=FunctionType(
                                                   names=['string'],
                                                   is_optional=False,
                                               ),
                                               default_value=None,
                                           )
                                       ]],
                            variable_length=False,
                        ),
                        generic_types=[],
                    ),
                    docs=FunctionDoc(
                        description=
                        'This function gets a weapon property of the specified Element/Weapon|custom weapon (clientside only) or specified Weapons|player-held weapon (both client and server).',
                        arguments={
                            "weaponID or weaponName":
                            """The ID or name of the weapon you want to get info of. Names can be: """,
                            "weaponSkill":
                            """Either: pro, std or poor """,
                            "property":
                            """The property you want to get the value of:
The following properties are get only: """
                        },
                        result=
                        'on success:\nint: the weapon property\non failure:\nbool: false if the passed arguments were invalid',
                    ),
                    url='getWeaponProperty',
                ),
                field=None,
                is_static=False,
            )
Ejemplo n.º 8
0
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createLight",
                class_name='Light',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
    CompoundOOPData(
        server=[],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="getLightColor",
                class_name='light',
                method=FunctionData(
                    signature=FunctionSignature(
                        name='getColor',
 FunctionOOP(
     description=None,
     base_function_name="getTimerDetails",
     class_name='timer',
     method=FunctionData(
         signature=FunctionSignature(
             name='getDetails',
             return_types=FunctionReturnTypes(
                 return_types=[
                     FunctionType(
                         names=['int'],
                         is_optional=False,
                     ),
                     FunctionType(
                         names=['int'],
                         is_optional=False,
                     ),
                     FunctionType(
                         names=['int'],
                         is_optional=False,
                     )
                 ],
                 variable_length=False,
             ),
             arguments=FunctionArgumentValues(
                 arguments=[[
                     FunctionArgument(
                         name='theTimer',
                         argument_type=FunctionType(
                             names=['timer'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ]],
                 variable_length=False,
             ),
             generic_types=[],
         ),
         docs=FunctionDoc(
             description=
             'This function is for getting the details of a running timer.',
             arguments={"theTimer": """A timer element. """},
             result=
             '* integer one represents the time left in miliseconds (1000th of a second) of the current time left in the loop.\n* integer two represents the amount of times the timer has left to execute.\n* integer three represents the time interval of timer.\n* returns false if the timer doesnt exist or stopped running. also, debugscript will say bad argument @ gettimerdetails. to prevent this, you can check if the timer exists with istimer().',
         ),
         url='getTimerDetails',
     ),
     field=None,
     is_static=False,
 )
            FunctionOOP(
                description=None,
                base_function_name="outputChatBox",
                class_name='player',
                method=FunctionData(
                    signature=FunctionSignature(
                        name='outputChat',
                        return_types=FunctionReturnTypes(
                            return_types=[
                                FunctionType(
                                    names=['bool'],
                                    is_optional=False,
                                )
                            ],
                            variable_length=False,
                        ),
                        arguments=FunctionArgumentValues(
                            arguments=[[
                                FunctionArgument(
                                    name='text',
                                    argument_type=FunctionType(
                                        names=['string'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                                       [
                                           FunctionArgument(
                                               name='visibleTo',
                                               argument_type=FunctionType(
                                                   names=['table', 'element'],
                                                   is_optional=True,
                                               ),
                                               default_value='root',
                                           )
                                       ],
                                       [
                                           FunctionArgument(
                                               name='r',
                                               argument_type=FunctionType(
                                                   names=['int'],
                                                   is_optional=True,
                                               ),
                                               default_value='231',
                                           )
                                       ],
                                       [
                                           FunctionArgument(
                                               name='g',
                                               argument_type=FunctionType(
                                                   names=['int'],
                                                   is_optional=True,
                                               ),
                                               default_value='217',
                                           )
                                       ],
                                       [
                                           FunctionArgument(
                                               name='b',
                                               argument_type=FunctionType(
                                                   names=['int'],
                                                   is_optional=True,
                                               ),
                                               default_value='176',
                                           )
                                       ],
                                       [
                                           FunctionArgument(
                                               name='colorCoded',
                                               argument_type=FunctionType(
                                                   names=['bool'],
                                                   is_optional=True,
                                               ),
                                               default_value='false',
                                           )
                                       ]],
                            variable_length=False,
                        ),
                        generic_types=[],
                    ),
                    docs=FunctionDoc(
                        description=
                        'This outputs the specified text string to the chatbox. It can be specified as a message to certain player(s) or all players.\nIt can optionally allow you to embed color changes into the string by setting the colorCoded boolean to true. This allows:\n<syntaxhighlight lang=lua>\noutputChatBox ( #FF0000Hello #00FF00World, root, 255, 255, 255, true )\n</syntaxhighlight>\nThis will display as: <span style=color:red;>Hello</span> <span style=color:green>World</span>',
                        arguments={
                            "text":
                            """The text string that you wish to send to the chat window. If more than 256 characters it will not be showed in chat. """,
                            "visibleTo":
                            """Can also be a table of players or team.}} """,
                            "r":
                            """The amount of red in the color of the text. Default value is 231. """,
                            "g":
                            """The amount of green in the color of the text. Default value is 217. """,
                            "b":
                            """The amount of blue in the color of the text. Default value is 176. """,
                            "colorCoded":
                            """A boolean value determining whether or not #RRGGBB tags should be used.
Note: The #RRGGBB format must contain capital letters a-f is not acceptable but A-F is. Default RGB values in this format are: '#E7D9B0'. """
                        },
                        result='',
                    ),
                    url='outputChatBox',
                ),
                field=None,
                is_static=False,
            )
 FunctionOOP(
     description=None,
     base_function_name="triggerClientEvent",
     class_name='player',
     method=FunctionData(
         signature=FunctionSignature(
             name='triggerEvent',
             return_types=FunctionReturnTypes(
                 return_types=[
                     FunctionType(
                         names=['bool'],
                         is_optional=False,
                     )
                 ],
                 variable_length=False,
             ),
             arguments=FunctionArgumentValues(
                 arguments=[[
                     FunctionArgument(
                         name='sendTo',
                         argument_type=FunctionType(
                             names=['table', 'element'],
                             is_optional=True,
                         ),
                         default_value='getRootElement()',
                     )
                 ],
                            [
                                FunctionArgument(
                                    name='name',
                                    argument_type=FunctionType(
                                        names=['string'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                            [
                                FunctionArgument(
                                    name='sourceElement',
                                    argument_type=FunctionType(
                                        names=['element'],
                                        is_optional=False,
                                    ),
                                    default_value=None,
                                )
                            ],
                            [
                                FunctionArgument(
                                    name='arguments',
                                    argument_type=None,
                                    default_value=None,
                                )
                            ]],
                 variable_length=True,
             ),
             generic_types=[],
         ),
         docs=FunctionDoc(
             description=
             'This function triggers an event previously registered on a client. This is the primary means of passing information between the server and the client. Clients have a similar triggerServerEvent function that can do the reverse. You can treat this function as if it was an asynchronous function call, using triggerServerEvent to pass back any returned information if necessary.\nAlmost any data types can be passed as expected, including elements and complex nested tables. Non-element MTA data types like xmlNodes or resource pointers will not be able to be passed as they do not necessarily have a valid representation on the client.\nEvents are sent reliably, so clients will receive them, but there may be (but shouldnt be) a significant delay before they are received. You should take this into account when using them.\nKeep in mind the bandwidth issues when using events - dont pass a large list of arguments unless you really need to. It is marginally more efficient to pass one large event than two smaller ones.',
             arguments={
                 "name":
                 """The name of the event to trigger client side. You should register this event with addEvent and add at least one event handler using addEventHandler. """,
                 "sourceElement":
                 """The element that is the Event system#Event handlers|source of the event. """,
                 "sendTo":
                 """The event will be sent to all players that are children of the specified element. By default this is the root element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements. """,
                 "arguments...":
                 """A list of arguments to trigger with the event. You can pass any lua data type (except functions). You can also pass elements. """
             },
             result=
             'returns true if the event trigger has been sent, false if invalid arguments were specified.',
         ),
         url='triggerClientEvent',
     ),
     field=None,
     is_static=False,
 )
Ejemplo n.º 12
0
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="createWater",
                class_name='Water',
                method=None,
                field=None,
                is_static=True,
            )
        ],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createWater",
                class_name='Water',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="createPickup",
                class_name='Pickup',
                method=None,
                field=None,
                is_static=True,
            )
        ],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createPickup",
                class_name='Pickup',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="createRadarArea",
                class_name='radararea|RadarArea',
                method=None,
                field=None,
                is_static=True,
            )
        ],
        client=[
            FunctionOOP(
                description=None,
                base_function_name="createRadarArea",
                class_name='radararea|RadarArea',
                method=None,
                field=None,
                is_static=True,
            )
        ],
    ),
Ejemplo n.º 15
0
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="addBan",
                class_name='Ban',
                method=None,
                field=None,
                is_static=True,
            )
        ],
        client=[],
    ),
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="banPlayer",
                class_name='player',
                method=FunctionData(
                    signature=FunctionSignature(
                        name='ban',
    FunctionReturnTypes, \
    FunctionSignature, \
    FunctionDoc, \
    FunctionOOP, \
    FunctionOOPField, \
    CompoundOOPData, \
    FunctionData, \
    CompoundFunctionData

DUMP_PARTIAL = [
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="dbConnect",
                class_name='Connection',
                method=None,
                field=None,
                is_static=True,
            )
        ],
        client=[
            
        ],
    ),
    CompoundOOPData(
        server=[
            FunctionOOP(
                description=None,
                base_function_name="dbExec",
                class_name='connection',
                method=FunctionData(
 FunctionOOP(
     description=None,
     base_function_name="countPlayersInTeam",
     class_name='team',
     method=FunctionData(
         signature=FunctionSignature(
             name='countPlayers',
             return_types=FunctionReturnTypes(
                 return_types=[
                     FunctionType(
                         names=['int'],
                         is_optional=False,
                     )
                 ],
                 variable_length=False,
             ),
             arguments=FunctionArgumentValues(
                 arguments=[[
                     FunctionArgument(
                         name='theTeam',
                         argument_type=FunctionType(
                             names=['team'],
                             is_optional=False,
                         ),
                         default_value=None,
                     )
                 ]],
                 variable_length=False,
             ),
             generic_types=[],
         ),
         docs=FunctionDoc(
             description=
             'This function is for returning the number of players in the specified team.',
             arguments={
                 "theTeam":
                 """The team you wish to retrieve the player count of. """
             },
             result=
             'returns an integer containing the number of players in the team, false if it could not be retrieved.',
         ),
         url='countPlayersInTeam',
     ),
     field=FunctionOOPField(
         name='playerCount',
         types=[FunctionType(
             names=['int'],
             is_optional=False,
         )],
     ),
     is_static=False,
 )
     server=[
         
     ],
     client=[
         
     ],
 ),
 CompoundOOPData(
     server=[
         
     ],
     client=[
         FunctionOOP(
             description=None,
             base_function_name="isWorldSpecialPropertyEnabled",
             class_name='None',
             method=None,
             field=None,
             is_static=None,
         )
     ],
 ),
 CompoundOOPData(
     server=[
         
     ],
     client=[
         
     ],
 ),
 CompoundOOPData(
     server=[